mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-16 22:04:36 +00:00
Bug 973566, part 1 - Fix "Assertion failure: offsetsv.isUndefined()" with elements on Object.prototype. r=jimb.
This commit is contained in:
parent
c4600431ae
commit
55256bef4f
7
js/src/jit-test/tests/debug/bug973566.js
Normal file
7
js/src/jit-test/tests/debug/bug973566.js
Normal file
@ -0,0 +1,7 @@
|
||||
Object.prototype[1] = 'peek';
|
||||
var g = newGlobal();
|
||||
var dbg = Debugger(g);
|
||||
dbg.onEnterFrame = function (frame) {
|
||||
var lines = frame.script.getAllOffsets();
|
||||
};
|
||||
g.eval("1;");
|
@ -4275,6 +4275,18 @@ js::HasOwnProperty<NoGC>(JSContext *cx, LookupGenericOp lookup,
|
||||
JSObject *obj, jsid id,
|
||||
FakeMutableHandle<JSObject*> objp, FakeMutableHandle<Shape*> propp);
|
||||
|
||||
bool
|
||||
js::HasOwnProperty(JSContext *cx, HandleObject obj, HandleId id, bool *resultp)
|
||||
{
|
||||
RootedObject pobj(cx);
|
||||
RootedShape shape(cx);
|
||||
if (!HasOwnProperty<CanGC>(cx, obj->getOps()->lookupGeneric, obj, id, &pobj, &shape))
|
||||
return false;
|
||||
*resultp = (shape != nullptr);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
template <AllowGC allowGC>
|
||||
static MOZ_ALWAYS_INLINE bool
|
||||
NativeGetInline(JSContext *cx,
|
||||
|
@ -1286,6 +1286,9 @@ DenseRangeRef::mark(JSTracer *trc)
|
||||
}
|
||||
#endif
|
||||
|
||||
bool
|
||||
HasOwnProperty(JSContext *cx, HandleObject obj, HandleId id, bool *resultp);
|
||||
|
||||
template <AllowGC allowGC>
|
||||
extern bool
|
||||
HasOwnProperty(JSContext *cx, LookupGenericOp lookup,
|
||||
|
@ -3370,7 +3370,7 @@ DebuggerScript_getAllOffsets(JSContext *cx, unsigned argc, Value *vp)
|
||||
RootedId id(cx, INT_TO_JSID(lineno));
|
||||
|
||||
bool found;
|
||||
if (!JSObject::hasProperty(cx, result, id, &found))
|
||||
if (!js::HasOwnProperty(cx, result, id, &found))
|
||||
return false;
|
||||
if (found && !JSObject::getGeneric(cx, result, result, id, &offsetsv))
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user