Closed
Bug 536472
Opened 15 years ago
Closed 14 years ago
ES5: { get x(v) { } } and { set x(v, v2) { } } should be syntax errors
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: Waldo, Assigned: Waldo)
References
Details
(Keywords: dev-doc-complete, Whiteboard: fixed-in-tracemonkey)
Attachments
(5 files)
4.08 KB,
patch
|
cdleary
:
review+
|
Details | Diff | Splinter Review |
1.56 KB,
patch
|
cdleary
:
review+
|
Details | Diff | Splinter Review |
3.64 KB,
patch
|
cdleary
:
review+
|
Details | Diff | Splinter Review |
16.65 KB,
patch
|
cdleary
:
review+
|
Details | Diff | Splinter Review |
18.69 KB,
patch
|
cdleary
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Updated•14 years ago
|
Whiteboard: [good first bug]
Updated•14 years ago
|
Keywords: dev-doc-needed
Assignee | ||
Comment 2•14 years ago
|
||
Ugh, function parsing is a disaster right now, no way this should have been [good first bug]. Patches coming up to do this...
Status: NEW → ASSIGNED
Whiteboard: [good first bug]
Assignee | ||
Comment 3•14 years ago
|
||
It's hard to understand possible syntactic transformations when you have to worry about effects on half a dozen apparently-non-extraneous variables.
Attachment #462146 -
Flags: review?(cdleary)
Assignee | ||
Comment 4•14 years ago
|
||
...following up on bug 581744.
Attachment #462148 -
Flags: review?(cdleary)
Assignee | ||
Comment 5•14 years ago
|
||
Making one Swiss army knife function parse names doesn't make sense when different callers have different naming requirements -- better for them to compute the name themselves and pass it in.
Attachment #462149 -
Flags: review?(cdleary)
Assignee | ||
Comment 6•14 years ago
|
||
Parser::functionDef is monstrously huge, 400+ lines before any of these patches. Splitting it up a bit (here by moving argument parsing out of the main function), done with even a slight amount of discernment, can only help readability.
Attachment #462150 -
Flags: review?(cdleary)
Assignee | ||
Comment 7•14 years ago
|
||
I was hoping to make more cleanups here, and to eventually move argument parsing into the callers, but the number of enclosing-scope variables required to parse arguments is pretty large, and boxing up a struct of them is just ugly. There must be a better way to do this that doesn't involve everything intermingled like here, but I'm not sure it's an incremental step away, as the previous patches have been. I lack the energy and time to do anything more than an incremental step, so this is where the cleanup stops and the special-casing begins -- on to other bugs with this done, now.
I haven't run through tests other than js tests to see whether any others need updates for this change -- some probably do, but those changes aren't the interesting part of this patch, from the JS engine point of view.
Attachment #462180 -
Flags: review?(cdleary)
Comment 8•14 years ago
|
||
Nice work, Waldo!
Could maybe use the split-out functionArguments parser from jsfun.cpp:Function, but then we'd accept destructuring formals. An allowed extension? Language lawyer needed, ES5 Chapter 16, also Chapter 15 intro, has revisions to tighten rules.
/be
Updated•14 years ago
|
Attachment #462146 -
Flags: review?(cdleary) → review+
Updated•14 years ago
|
Attachment #462148 -
Flags: review?(cdleary) → review+
Comment 9•14 years ago
|
||
Comment on attachment 462149 [details] [diff] [review]
3: Move function name parsing to callers
Yup, pushing name parsing into the callers makes more sense.
Attachment #462149 -
Flags: review?(cdleary) → review+
Updated•14 years ago
|
Attachment #462150 -
Flags: review?(cdleary) → review+
Comment 10•14 years ago
|
||
Comment on attachment 462180 [details] [diff] [review]
5: Actually check the number of arguments to parse
Please add tests for functions with duplicate formals. Other than that, looks great.
Attachment #462180 -
Flags: review?(cdleary) → review+
Assignee | ||
Comment 11•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/e46a5e0d30b5
http://hg.mozilla.org/tracemonkey/rev/9ff3514bd267
http://hg.mozilla.org/tracemonkey/rev/474ceb938fb1
http://hg.mozilla.org/tracemonkey/rev/2dbf74b2525e
http://hg.mozilla.org/tracemonkey/rev/4571f2680302
Whiteboard: fixed-in-tracemonkey
Comment 12•14 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Comment 13•14 years ago
|
||
Appropriate notes have been added:
https://developer.mozilla.org/en/JavaScript/Reference/Operators/Special_Operators/set_Operator
https://developer.mozilla.org/en/JavaScript/Reference/Operators/Special_Operators/get_Operator
Keywords: dev-doc-needed → dev-doc-complete
You need to log in
before you can comment on or make changes to this bug.
Description
•