-
Notifications
You must be signed in to change notification settings - Fork 860
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
ImportBatchSpecifier vs ImportNamespaceSpecifier #157
Comments
@sebmck Yes, I also figured we have got this problem after ariya/esprima#287 (and tried to discuss there, no luck with results so far). Our node types were implemented few months earlier, discussed with guys from Mozilla and submitted to Parser API as tasks, but few months after esprima decided to invent own types instead of using existing implementations. That doesn't feel good, especially given that there exist only three of those (Reflect.parse, acorn and esprima) so it wouldn't be hard to check existing solutions and use them or discuss with their authors in corresponding trackers. |
@RReverser Ah okay. This issue was more to see whose behaviour is correct and fix it if possible. Closing this since esprima is the one deviating from the spec, at least a proposed one. |
@RReverser just copying a couple of notes from ast-types PR here:
the second one is the most concerning one. |
|
@RReverser I hate to go in circles about this, but the reality is that in the loader specs -- which we are still working on -- the |
@caridy That feels like passing same instance or batch-loop is more implementation details than semantic difference. In both cases user 1) gets access to all the exports of module and 2) either can access them in own code through local var or can re-export to outer consumer. But |
Ok, agree to disagree then. Ultimately, it is your call to produce a different AST. |
Um, it's not. There were types for this syntax feature much earlier than Esprima's PR appeared and I believe such a constructive conversation on features and names should be done before implementing them differently in another library. I believe that even now it's not too late to discuss and fix things up so everybody would be happy. |
It does come across as inconsistent for ImportBatchSpecifier to use "name" instead of "id" like the rest of the ImportSpecifiers, which are used for both default and single namespace imports. Side note, and I know I'm probably not helping the bikeshedding here by saying this, but why can't we do anything like this? This is very similar to how the ECMAScript specification handles it. (1, 2, see the second table at each anchor for examples) I've got a more complete spec in this repo, complete with an issue tracker/etc. |
Currently there's a discrepancy between Acorn and Esprima where Acorn has a
ImportBatchSpecifier
node which has anname
property while Esprima usesImportNamespaceSpecifier
with anid
property. How are node types standardised (if at all) and which is correct?The text was updated successfully, but these errors were encountered: