Closed
Bug 1150771
Opened 11 years ago
Closed 11 years ago
cloneInto is not able to clone Xrays object property with ArrayBuffer value
Categories
(Core :: XPConnect, defect)
Tracking
()
RESOLVED
FIXED
mozilla40
| Tracking | Status | |
|---|---|---|
| firefox40 | --- | fixed |
People
(Reporter: yury, Assigned: bholley)
References
Details
Attachments
(1 file)
|
4.21 KB,
patch
|
gkrizsanits
:
review+
|
Details | Diff | Splinter Review |
Currently an object's Xrays vision needs to be unwaived before calling cloneInto if a property contains ArrayBuffer:
let Cu = Components.utils;
let sandbox1 = new Cu.Sandbox('resource://r1/');
let sandbox2 = new Cu.Sandbox('resource://r2/');
let arg = Cu.evalInSandbox('({buf: ArrayBuffer(2)})', sandbox1);
let clonedArg = Cu.cloneInto(arg, sandbox2);
print(Cu.waiveXrays(clonedArg).buf); // undefined
let clonedArg = Cu.cloneInto(Cu.waiveXrays(arg), sandbox2);
print(Cu.waiveXrays(clonedArg).buf); // ArrayBuffer
It's expected that cloneInto(arg, sandbox2) call shall work as Cu.cloneInto(Cu.waiveXrays(arg), sandbox2) one.
| Assignee | ||
Comment 1•11 years ago
|
||
Attachment #8588237 -
Flags: review?(gkrizsanits)
| Assignee | ||
Comment 2•11 years ago
|
||
Thanks for the great bug report, yury.
https://treeherder.mozilla.org/#/jobs?repo=try&revision=406ca2f6354d
Comment 3•11 years ago
|
||
Comment on attachment 8588237 [details] [diff] [review]
Let ArrayBuffer through object Xrays. v1
Review of attachment 8588237 [details] [diff] [review]:
-----------------------------------------------------------------
Thanks for the detailed description!
::: js/xpconnect/tests/unit/test_bug1150771.js
@@ +1,5 @@
> +function run_test() {
> +let Cu = Components.utils;
> +let sandbox1 = new Cu.Sandbox(null);
> +let sandbox2 = new Cu.Sandbox(null);
> +let arg = Cu.evalInSandbox('({buf: ArrayBuffer(2)})', sandbox1);
nit: ({ buf: ArrayBuffer(2) })
Attachment #8588237 -
Flags: review?(gkrizsanits) → review+
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bobbyholley
| Assignee | ||
Comment 4•11 years ago
|
||
Comment 5•11 years ago
|
||
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
You need to log in
before you can comment on or make changes to this bug.
Description
•