Closed
Bug 604430
Opened 13 years ago
Closed 13 years ago
wantsXrays argument in Constructor doesn't work as expected
Categories
(DevTools :: General, defect)
DevTools
General
Tracking
(blocking2.0 beta7+)
VERIFIED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | beta7+ |
People
(Reporter: rcampbell, Assigned: mrbkap)
References
Details
Attachments
(2 files, 1 obsolete file)
414 bytes,
text/plain
|
Details | |
9.71 KB,
patch
|
peterv
:
review+
|
Details | Diff | Splinter Review |
Evaluating an object in the JSTerm now returns objects in the format: [Object XrayWrapper [[Object someobject]] Should be: [Object someobject]
Reporter | ||
Comment 1•13 years ago
|
||
today's build: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b8pre) Gecko/20101014 Firefox/4.0b8pre built from: http://hg.mozilla.org/mozilla-central/rev/ad0a0be8be74
Updated•13 years ago
|
Blocks: devtools4b8
Comment 2•13 years ago
|
||
you also get: Error: uncaught exception: [Exception... "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: resource://gre/modules/PropertyPanel.jsm :: namesAndValuesOf :: line 130" data: no] when trying to inspect these objects:(
Comment 3•13 years ago
|
||
Just talked to mrbkap about this. he says we can ditch the __proto__ trick and add another window as an argument to evalInSandbox as well as another argument of false (or true, he is not sure which)
Comment 4•13 years ago
|
||
__proto__ trick is here: http://mxr.mozilla.org/mozilla-central/source/toolkit/components/console/hudservice/HUDService.jsm?force=1#4149 eval call is here: http://mxr.mozilla.org/mozilla-central/source/toolkit/components/console/hudservice/HUDService.jsm?force=1#4168
Updated•13 years ago
|
blocking2.0: --- → ?
Updated•13 years ago
|
Assignee: nobody → rcampbell
Reporter | ||
Comment 5•13 years ago
|
||
I'm not sure those comments apply here or in bug 599940, David. In any case, I'd already started experimenting with elimination of __proto__ and adding the helper methods directly to the sandbox. I think this is just going to be a straight string replacement.
Reporter | ||
Comment 6•13 years ago
|
||
ok, disregard that last comment. I thought we were detecting and removing occurrences of [Object XPCWrappedJSObject [blah]] and replacing them. That appears to not be the case. I expect fixing this and removing the withs as I'd started in bug 59940 will fix both bugs.
Reporter | ||
Comment 7•13 years ago
|
||
I've tried both true and false as arguments to the "wantXrays" parameter and neither works. // create a JS Sandbox out of this.context this.sandbox = new Cu.Sandbox(this._window, { sandboxPrototype: this._window, wantXrays: false }); Either I'm calling this incorrectly or it's broken. CCing mrbkap for some consultation.
Reporter | ||
Comment 8•13 years ago
|
||
pinging mrbkap! Does the above code snippet make sense to you?
Reporter | ||
Comment 9•13 years ago
|
||
Dear mrbkap, minimal wrapper test. Instructions: 1. Open the Error Console on this page. 2. Copy and paste the contents of this file (appended below for easy copy'n'paste) into the Code: line in the Error Console. 3. Evaluate. Check the value of the output for an "[object XrayWrapper" prefix. Changing the value of wantXrays to true or false makes no difference. code: var Cu = Components.utils; var jsm = { }; Cu.import("resource://gre/modules/Services.jsm", jsm); var Svcs = jsm.Services; var gBrowser = Svcs.wm.getMostRecentWindow("navigator:browser").gBrowser; var w = gBrowser.selectedBrowser.contentWindow; var sb = Components.utils.Sandbox(w, { sandboxPrototype: w, wantXrays: false }); sb.$ = w.document.getElementById; Cu.evalInSandbox("$('header');", sb, "1.8", "TEST", 1) sincerely, Rob M. Campbell, esq. PS, beer me.
Reporter | ||
Comment 10•13 years ago
|
||
ps, only reference to "wantXrays" I could find was here: http://mxr.mozilla.org/mozilla-central/source/js/src/xpconnect/tests/chrome/test_evalInSandbox.xul
Assignee | ||
Comment 11•13 years ago
|
||
So this should fix it. It makes the sandbox object itself respect the wantXrays flag.
Assignee: rcampbell → mrbkap
Status: NEW → ASSIGNED
Assignee | ||
Updated•13 years ago
|
Attachment #485898 -
Flags: review?(peterv)
Assignee | ||
Comment 12•13 years ago
|
||
This does s/preferXrays/wantXrays/g and also fixes a couple of strings in the mochitest.
Attachment #485898 -
Attachment is obsolete: true
Attachment #485901 -
Flags: review?(peterv)
Attachment #485898 -
Flags: review?(peterv)
Updated•13 years ago
|
Attachment #485901 -
Flags: review?(peterv) → review+
You people kill me
blocking2.0: ? → beta7+
Assignee | ||
Comment 14•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/1b0dcd032479
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 15•13 years ago
|
||
that fix is all the beer I require. Yummy!
Reporter | ||
Comment 16•13 years ago
|
||
for the record, this fix doesn't fix the bug of the XrayWrapper prefix in the Web Console, just going to morph the title so we don't lose it.
Reporter | ||
Updated•13 years ago
|
Summary: Object XrayWrapper prefix on returned objects in Web Console → wantsXrays argument in Constructor doesn't work as expected
Reporter | ||
Comment 17•13 years ago
|
||
verified fixed in today's nightly build using the above test case in the error console. Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:2.0b8pre) Gecko/20101026 Firefox/4.0b8pre
Status: RESOLVED → VERIFIED
Updated•6 years ago
|
Product: Firefox → DevTools
You need to log in
before you can comment on or make changes to this bug.
Description
•