Confirmed users
497
edits
m (Reorder sections.) |
|||
| Line 216: | Line 216: | ||
When called via a <code>new</code> expression, the <code>Debug.Object</code> constructor takes one argument, an object in the debugger's compartment, and applies the HTML5 "structured cloning" algorithm to copy the object into the debuggee's compartment. It then returns a <code>Debug.Object</code> instance referring to the copy. It is an error to apply <code>Debug.Object</code> to a primitive value via a <code>new</code> expression. | When called via a <code>new</code> expression, the <code>Debug.Object</code> constructor takes one argument, an object in the debugger's compartment, and applies the HTML5 "structured cloning" algorithm to copy the object into the debuggee's compartment. It then returns a <code>Debug.Object</code> instance referring to the copy. It is an error to apply <code>Debug.Object</code> to a primitive value via a <code>new</code> expression. | ||
When applied as a function, <code>Debug.Object</code> behaves as above, except that primitive values are returned unchanged (although possibly wrapped, in an ordinary cross-compartment wrapper). | When applied as a function, <code>Debug.Object</code> behaves as above, except that primitive values are returned unchanged (although possibly wrapped, in an ordinary cross-compartment wrapper). This allows the debugger to use <code>Debug.Object</code> as a generic "debugger value to debuggee value" conversion function. | ||
=== Properties of the <code>Debug.Object</code> constructor === | === Properties of the <code>Debug.Object</code> constructor === | ||