-
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
Document the meaning of the "names" array #6
Comments
It's tough to know what all the "names" field is used for. Variable names, function names, fields. Some of this will improve when we add the function and variable names to the official spec this should be able to be deprecated. It would be great if anyone has interesting current uses for this if they would respond in this ticket. Otherwise it seems like the best way forward might be to leave this vague, work on adding the new features and then deprecate this? |
|
Ideally we want to say something like "Ideally function names and variables names are put in this array. " and mention that it's deprecated. |
Chrome DevTools utilizes the "names" array for the following features (if available):
*A previous version of this comment claimed that it's the opening brace ( |
That's ... unexpected. How is anyone emitting source map supposed to know they have to target the |
Apologies, I read the code comment too fast this moment. We consider the opening paren ( Implementation-wise DevTools relies on V8 here and we just take V8's word where the scope is starting (in this case). For |
Fixed bad links
Some generators have declined to use names because they are under-specified. We should better define what is the expected value when they are referenced from a mapping field. Also, under which circumstances there should be such a reference. These can be used for unminified identifier name, they can also be the full property expression unminified Note: When we come up with our Scopes Expression proposal, it should support code like this: import f from "f";
export function fn() {
let obj = { x : 1 };
return f(obj.x, obj.x);
} Being compiled to import r from"f";export function fn(){let t=1;return r(t,t)} And allow you to debug that |
All that the spec says about "names" is:
It's never explained what one might use these for.
The text was updated successfully, but these errors were encountered: