mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Address review comments from bhackett (bug 672829 comment 82).
This commit is contained in:
parent
65e5022233
commit
d36ff061fa
16
js/src/jit-test/tests/debug/Object-preventExtensions-01.js
Normal file
16
js/src/jit-test/tests/debug/Object-preventExtensions-01.js
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// Basic preventExtensions test.
|
||||||
|
|
||||||
|
var g = newGlobal('new-compartment');
|
||||||
|
var obj = g.eval("({x: 1})");
|
||||||
|
assertEq(g.Object.isExtensible(obj), true);
|
||||||
|
|
||||||
|
var dbg = new Debugger;
|
||||||
|
var objw = dbg.addDebuggee(obj);
|
||||||
|
assertEq(objw.isExtensible(), true);
|
||||||
|
|
||||||
|
assertEq(objw.preventExtensions(), undefined);
|
||||||
|
assertEq(g.Object.isExtensible(obj), false);
|
||||||
|
assertEq(objw.isExtensible(), false);
|
||||||
|
|
||||||
|
// Calling preventExtensions again has no effect.
|
||||||
|
assertEq(objw.preventExtensions(), undefined);
|
@ -3102,7 +3102,7 @@ UnwrapPropDesc(JSContext *cx, Debugger *dbg, JSObject *obj, PropDesc *desc)
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Rewrap *idp and the fields of *desc for the current compartment. Also:
|
* Rewrap *idp and the fields of *desc for the current compartment. Also:
|
||||||
* defining a property on a proxy requiers the pd field to contain a descriptor
|
* defining a property on a proxy requires the pd field to contain a descriptor
|
||||||
* object, so reconstitute desc->pd if needed.
|
* object, so reconstitute desc->pd if needed.
|
||||||
*/
|
*/
|
||||||
static bool
|
static bool
|
||||||
@ -3232,8 +3232,10 @@ DebuggerObject_sealHelper(JSContext *cx, uintN argc, Value *vp, SealHelperOp op,
|
|||||||
ok = obj->freeze(cx);
|
ok = obj->freeze(cx);
|
||||||
} else {
|
} else {
|
||||||
JS_ASSERT(op == PreventExtensions);
|
JS_ASSERT(op == PreventExtensions);
|
||||||
if (!obj->isExtensible())
|
if (!obj->isExtensible()) {
|
||||||
|
args.rval().setUndefined();
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
AutoIdVector props(cx);
|
AutoIdVector props(cx);
|
||||||
ok = obj->preventExtensions(cx, &props);
|
ok = obj->preventExtensions(cx, &props);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user