{"comment":{"created_at":"2011-10-11T16:56:26Z","body":"Regarding the __rt.__func, this is feasible but it requires a bit more work on the transformation module.\r\n\r\nI thought that it would be more efficient to alias all these functions to local variables. As these functions will usually be called many times this should lead to smaller code overall. Also, it eliminates one indirection in every call. What's your feeling about this?\r\n\r\nI can do the second change (BASENAMEOFSOURCEFILE). I don't like the idea of having the file name as a string literal in every __func call. So it looks like I will need a local variable at file scope for it.\r\nAlso, I don't want to compute __srcName in every __func call (for obvious perf reasons), I want to have it pre-computed, or I can compute it from __filename and BASNAME... when formatting stack frames.\r\n","updated_at":"2011-10-11T16:56:26Z","url":"https://api.github.com/repos/Sage/streamlinejs/issues/comments/2368188","id":2368188,"user":{"avatar_url":"https://secure.gravatar.com/avatar/5fae4fe6a889a91041bc556d50ccb2e3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/bjouhier","id":415044,"login":"bjouhier"}},"action":"created","issue":{"number":52,"created_at":"2011-10-03T14:47:39Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"I don't know enough of the internals to even take a crack at this myself.\r\n\r\nBut ideally I think the common runtime stub added to every compiled file could be moved to its own shared module.\r\n\r\nsimilar to what I did with Traceur:\r\nhttp://github.com/aikar/traceur\r\n\r\nSome parts I understand  cant be shared, but imo the shared parts could be moved\r\n\r\nSome advantages:\r\n1) its easier to manage than a bunch of strings in transform.js\r\n2) shared so V8 can compile and optimize it better, so hopefully a performance benefit.\r\n3) reduced duplication of code, ie reduced memory.\r\n\r\nSo ideally, the top of each source file would be like so\r\n    var __streamline = require('streamline-runtime')('path.to.source');\r\n\r\nbut I'm really wondering do we need the filename stored in a variable though, cant it just report the active file?\r\n\r\nie require('streamline-runtime')(__filename);","comments":24,"title":"Change Request: Move common runtime stub to its own module.","updated_at":"2011-10-11T16:56:26Z","url":"https://api.github.com/repos/Sage/streamlinejs/issues/52","id":1803224,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/c6abf37c059c2eb548319c49bf5125ea?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/aikar","id":58008,"login":"aikar"},"html_url":"https://github.com/Sage/streamlinejs/issues/52","labels":[],"state":"open"},"legacy":{"issue_id":1803224,"comment_id":2368188}}