-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Include record of inlined functions #40
Comments
Related issue (more generically): #33 |
Thanks for filing the issue @shicks - happy to share more about our experience here if anyone has questions. |
The Dart sourcemap extension is a good starting point but our experience has shown that it has a small shortcoming. Consider this program: function call1(a) { return call2(a); }
function call2(a) { return a.method1(null); }
class Thing {
method1(b) { return this.method2(b); },
method2(b) { return b.foo(); },
}
function main() {
call1(new Thing());
call1(null);
} Inlining of function call1(a) { return a.method2(null); }
// ^ It is reasonable to inline When The single indicated location in the inlining version of Hopefully a new sourcemap format will address this problem and provide a way to map the error location independently to a deeper frame. I stress independently because in the case of Dart, the stack frame sequence that corresponds to an error location is not necessarily a prefix of the sequence for errors called from that location. |
Many optimizers inline functions, but this can cause confusion when looking at stack traces: function A might be called by B which is called by C, but if B is inlined, the developer might only see C calling A directly, which doesn't make sense from looking at the source.
Dart's source map extensions have a potential solution for this by recording the inlined functions in a way that allows the stack trace to be filled back in with the inlined functions. We should consider including this in any new version of source maps.
This probably fits into the scopes/naming workstream?
@sigmundch probably has more to say about this (or can point me to an earlier-filed issue if this is a dupe).
The text was updated successfully, but these errors were encountered: