Closed
Bug 380959
Opened 17 years ago
Closed 15 years ago
uneval(window) gives me something I can't pass to eval
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: jruderman, Assigned: jruderman)
Details
(Keywords: testcase)
Attachments
(1 file)
904 bytes,
patch
|
mrbkap
:
review+
mrbkap
:
superreview+
|
Details | Diff | Splinter Review |
javascript:a = 3; alert(uneval(window)); result: "{}" expected: at least something I can pass to eval, such as "({})", but "({a:3})" would be nice.
Assignee | ||
Comment 1•15 years ago
|
||
Updated•15 years ago
|
Attachment #382206 -
Flags: superreview+
Attachment #382206 -
Flags: review?(jst)
Attachment #382206 -
Flags: review+
Comment 2•15 years ago
|
||
Comment on attachment 382206 [details] [diff] [review] patch changing {} to ({}) >diff --git a/js/src/xpconnect/src/xpcwrappednativejsops.cpp b/js/src/xpconnect/src/xpcwrappednativejsops.cpp >+ static const char empty[] = "({})"; This is fine. It'll end up with extra parens in, e.g. uneval({a:window}) => ({a: ({})}) but that's better than too few parentheses stopping compilation altogether! > *vp = STRING_TO_JSVAL(JS_NewStringCopyN(cx, empty, sizeof(empty)-1)); Please make this: JSString *str = JS_NewStringCopyN(cx, empty, sizeof(empty)-1); if(!str) return JS_FALSE; *vp = STRING_TO_JSVAL(str); > return JS_TRUE; > }
Assignee | ||
Comment 3•15 years ago
|
||
Fixed: http://hg.mozilla.org/mozilla-central/rev/efc54e3f494c
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 4•15 years ago
|
||
Was this individually landed on TM branch? (whatever the case, it eventually will be once m-c gets synchronized onto TM branch)
Assignee | ||
Comment 5•15 years ago
|
||
No, I only landed this on mozilla-central. It's in DOM/XPConnect code, not JavaScript Engine code.
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•