Closed Bug 913617 Opened 11 years ago Closed 9 years ago

Reflect.parse: rename ArrowExpression to ArrowFunctionExpression to align with esprima

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: jorendorff, Assigned: dherman)

Details

Attachments

(1 file, 1 obsolete file)

      No description provided.
Identifiers in Reflect.parse but not in esprima:
    ArrowExpression
    SpreadExpression
    GeneratorExpression
    LetExpression
    LetStatement
    Property

Identifiers in esprima but not Reflect.parse:
    ArrowFunctionExpression
    ClassBody
    ClassDeclaration
    ClassExpression
    ClassHeritage
    ExportDeclaration
    ExportBatchSpecifier
    ExportSpecifier
    ImportDeclaration
    ImportSpecifier
    MethodDefinition
    SpreadElement
    TaggedTemplateExpression
    TemplateElement
    TemplateLiteral

This is based on the following two files:
  https://hg.mozilla.org/integration/mozilla-inbound/file/77e2eaaf2fbb/js/src/jsast.tbl
  https://github.com/ariya/esprima/blob/6c8079ab261757590c40d3c82e9f775bb9935615/esprima.js

The above suggests renaming:
    ArrowExpression -> ArrowFunctionExpression
    SpreadExpression -> SpreadElement
and probably Property as well. I don't even know exactly what that is, honestly.

LetExpression and LetStatement are SpiderMonkey extensions that we don't expect to see in Esprima. GeneratorExpression currently reflects legacy SpiderMonkey-only non-ES6 syntax.

I'm not thrilled to see ClassHeritage as a separate node; that is some extra weight that doesn't seem necessary.
Assignee: general → nobody
I am extremely rusty at hacking on SpiderMonkey but this one seemed easy. Nick, I believe this shouldn't be a problem for the front-end but I'd appreciate your feedback.
Attachment #8574300 - Flags: feedback?(nfitzgerald)
Attachment #8574300 - Flags: feedback?(jorendorff)
Comment on attachment 8574300 [details] [diff] [review]
renames ArrowFunction to ArrowFunctionExpression

I don't see any references to either ArrowFunction or ArrowFunctionExpression in the devtools AST walker -- I suspect it just doesn't support ES6 arow functions at all yet.
Attachment #8574300 - Flags: feedback?(nfitzgerald) → feedback+
Hm, I just found this:

http://mxr.mozilla.org/mozilla-central/search?string=ArrowExpression

So it looks like ScratchPad is slightly affected.

Dave
(In reply to Dave Herman [:dherman] from comment #4)
> Hm, I just found this:
> 
> http://mxr.mozilla.org/mozilla-central/search?string=ArrowExpression
> 
> So it looks like ScratchPad is slightly affected.
> 
> Dave

Ah, the patch (but not the bug) is mis-labeled and I searched for "ArrowFunction" not "ArrowExpression".

I can rubber stamp a find/replace in the devtools code.
Waiting on try server. If it passes I'll request review.

Dave
Attachment #8574300 - Attachment is obsolete: true
Attachment #8574300 - Flags: feedback?(jorendorff)
Comment on attachment 8575416 [details] [diff] [review]
renames ArrowFunction to ArrowFunctionExpression

Asking for Jason's review and Nick's feedback.

Thanks,
Dave
Attachment #8575416 - Flags: review?(jorendorff)
Attachment #8575416 - Flags: feedback?(nfitzgerald)
Should mention I had a pretty clean test run at

https://treeherder.mozilla.org/#/jobs?repo=try&revision=4772e82829f4

Dave
Attachment #8575416 - Flags: feedback?(nfitzgerald) → feedback+
Also, for reference, here's the ESTree issue where it was decided to go with ArrowFunctionExpression:

https://github.com/estree/estree/issues/2

Dave
I re-ran the two oranges and they failed again. Jason, if/when you have a chance I'd love your help trying to figure out what's going wrong.

Thanks again,
Dave
Attachment #8575416 - Flags: review?(jorendorff) → review+
Turns out I mis-read the treeherder output and the oranges were green on second run, so we're good to land. Marking checkin-needed.

Dave
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/c2e29988051b
Status: NEW → RESOLVED
Closed: 9 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: