Closed
Bug 632030
Opened 13 years ago
Closed 13 years ago
Reflect.parse doesn't handle doubly-declared variables correctly
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jorendorff, Assigned: dherman)
Details
(Whiteboard: reflect-parse fixed-in-tracemonkey)
Attachments
(1 file, 1 obsolete file)
10.05 KB,
patch
|
jorendorff
:
review+
|
Details | Diff | Splinter Review |
Given this program: function g(x) { var x; } Reflect.parse sees this: function g(x) { var x = x; } This is a little strange, but I don't think the difference is observable. But Reflect.parse also gives the same output for f.p = 1; var f; f.p; function f(){} and f.p = 1; var f = function f(){}; f.p; function f(){} and these are definitely two different programs. The first evals to 1; the second evals to undefined.
Assignee | ||
Updated•13 years ago
|
Whiteboard: reflect-parse
Assignee | ||
Comment 1•13 years ago
|
||
Another undocumented case in jsparse.h. :) When a var declaration is a duplicate of a funarg or function declaration, its TOK_NAME declarator node has pn_used set, and the pn_lexdef variant of the union is supposed to be used, not the pn_expr variant. This patch fixes the missing case in jsreflect, adds the information to the jsparse.h documentation comment, and adds test cases for this bug. Dave
Assignee: general → dherman
Attachment #537795 -
Flags: review?(jorendorff)
Assignee | ||
Comment 2•13 years ago
|
||
Oops, there was a busted test case. Dave
Attachment #537795 -
Attachment is obsolete: true
Attachment #541284 -
Flags: review?(jorendorff)
Attachment #537795 -
Flags: review?(jorendorff)
Reporter | ||
Updated•13 years ago
|
Attachment #541284 -
Flags: review?(jorendorff) → review+
Assignee | ||
Comment 3•13 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/56ea7c0ebe16
Whiteboard: reflect-parse → reflect-parse fixed-in-tracemonkey
Comment 4•13 years ago
|
||
cdleary-bot mozilla-central merge info: http://hg.mozilla.org/mozilla-central/rev/56ea7c0ebe16
Updated•13 years ago
|
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•