Bug 677593 - [jsdbg2] Assertion failure: (ptrBits & 0x7) == 0, at ../jsval.h:705. r=jimb.

This commit is contained in:
Jason Orendorff 2011-08-09 15:46:41 -05:00
parent 6666d9cd42
commit 2b428cbaf2
2 changed files with 11 additions and 2 deletions

View File

@ -0,0 +1,8 @@
// Debugger.Object.prototype.defineProperty with too few arguments throws.
load(libdir + "asserts.js");
var g = newGlobal('new-compartment');
var dbg = new Debugger;
var gw = dbg.addDebuggee(g);
assertThrowsInstanceOf(function () { gw.defineProperty("x"); }, TypeError);

View File

@ -3083,12 +3083,13 @@ static JSBool
DebuggerObject_defineProperty(JSContext *cx, uintN argc, Value *vp) DebuggerObject_defineProperty(JSContext *cx, uintN argc, Value *vp)
{ {
THIS_DEBUGOBJECT_OWNER_REFERENT(cx, vp, "defineProperty", dbg, obj); THIS_DEBUGOBJECT_OWNER_REFERENT(cx, vp, "defineProperty", dbg, obj);
REQUIRE_ARGC("Debugger.Object.defineProperty", 2);
jsid id; jsid id;
if (!ValueToId(cx, argc >= 1 ? vp[2] : UndefinedValue(), &id)) if (!ValueToId(cx, vp[2], &id))
return JS_FALSE; return JS_FALSE;
const Value &descval = argc >= 1 ? vp[3] : UndefinedValue(); const Value &descval = vp[3];
AutoPropDescArrayRooter descs(cx); AutoPropDescArrayRooter descs(cx);
PropDesc *desc = descs.append(); PropDesc *desc = descs.append();
if (!desc || !desc->initialize(cx, descval, false)) if (!desc || !desc->initialize(cx, descval, false))