Closed
Bug 458959
Opened 16 years ago
Closed 16 years ago
this.JSON is enumerable
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
VERIFIED
FIXED
People
(Reporter: jruderman, Assigned: sayrer)
References
Details
(Keywords: regression, testcase)
Attachments
(1 file, 1 obsolete file)
11.41 KB,
patch
|
mrbkap
:
review+
mrbkap
:
superreview+
|
Details | Diff | Splinter Review |
js> uneval(this)
({JSON:JSON})
js> for (i in this) print(i)
JSON
Seems like a bug to me. Is there something special about the JSON object that it should be enumerable when everything else (Math, gc, toSource, etc) is not?
If this is a bug, I'd appreciate a quick fix, because this change frustrates the reproducibility of jsfunfuzz bugs like bug 458679 that involve "uneval(this)" or "for (i in this)".
Assignee | ||
Comment 1•16 years ago
|
||
It looks to me like the flag should be JSPROP_READONLY | JSPROP_PERMANENT.
The only snag with this is that it will cause the export of JSON.jsm to fail, because it tries to export a "JSON" symbol and its JS_SetProperty call won't work.
Comment 2•16 years ago
|
||
What do you mean by "fail" and "won't work?" Setting a readonly property silently does nothing, it doesn't throw.
Assignee | ||
Comment 3•16 years ago
|
||
Assignee: general → sayrer
Assignee | ||
Comment 4•16 years ago
|
||
(In reply to comment #2)
> What do you mean by "fail" and "won't work?" Setting a readonly property
> silently does nothing, it doesn't throw.
This turns out to be what was happening. It was GlobalForLocation failing to compile the script, because of
var JSON = { ...
Assignee | ||
Updated•16 years ago
|
Attachment #342332 -
Flags: superreview?(mrbkap)
Attachment #342332 -
Flags: review?(mrbkap)
Assignee | ||
Comment 5•16 years ago
|
||
Attachment #342332 -
Attachment is obsolete: true
Attachment #342344 -
Flags: superreview?(mrbkap)
Attachment #342344 -
Flags: review?(mrbkap)
Attachment #342332 -
Flags: superreview?(mrbkap)
Attachment #342332 -
Flags: review?(mrbkap)
Comment 6•16 years ago
|
||
Comment on attachment 342344 [details] [diff] [review]
Switch to JSON native where possible, rename JSON module symbol, fix JSPROPs
Looks good. Are there bugs filed on making the other JSON consumer switch to the native API?
Attachment #342344 -
Flags: superreview?(mrbkap)
Attachment #342344 -
Flags: superreview+
Attachment #342344 -
Flags: review?(mrbkap)
Attachment #342344 -
Flags: review+
Comment 7•16 years ago
|
||
(In reply to comment #6)
> Are there bugs filed on making the other JSON consumer switch to the native API?
I'm waiting for review in bug 407110 (BTW: fixing bug 442059 would make that significantly simpler). Shall I completely remove JSON.jsm once we're done?
Assignee | ||
Updated•16 years ago
|
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Does this causes the regression bug 459293 "Sites not loading - redeclaration const JSON error on console"?
Comment 9•16 years ago
|
||
fixed by http://hg.mozilla.org/mozilla-central/rev/e18564ab198d
not on tracemonkey
Comment 10•16 years ago
|
||
/cvsroot/mozilla/js/tests/js1_8_1/JSON/regress-458959.js,v <-- regress-458959.js
initial revision: 1.1
http://hg.mozilla.org/mozilla-central/rev/b04c04268a94
Flags: in-testsuite+
Flags: in-litmus-
You need to log in
before you can comment on or make changes to this bug.
Description
•