Loading js/src/vm/ErrorObject.cpp +18 −24 Original line number Diff line number Diff line Loading @@ -647,19 +647,24 @@ static bool FindErrorInstanceOrPrototype(JSContext* cx, HandleObject obj, // (new NYI).stack // to continue returning stacks that are useless, but at least don't throw. RootedObject target(cx, CheckedUnwrapStatic(obj)); RootedObject curr(cx, obj); RootedObject target(cx); do { target = CheckedUnwrapStatic(curr); if (!target) { ReportAccessDenied(cx); return false; } if (IsErrorProtoKey(StandardProtoKeyOrNull(target))) { result.set(target); return true; } RootedObject proto(cx); while (!IsErrorProtoKey(StandardProtoKeyOrNull(target))) { if (!GetPrototype(cx, target, &proto)) { if (!GetPrototype(cx, curr, &curr)) { return false; } } while (curr); if (!proto) { // We walked the whole prototype chain and did not find an Error // object. JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, Loading @@ -668,17 +673,6 @@ static bool FindErrorInstanceOrPrototype(JSContext* cx, HandleObject obj, return false; } target = CheckedUnwrapStatic(proto); if (!target) { ReportAccessDenied(cx); return false; } } result.set(target); return true; } static MOZ_ALWAYS_INLINE bool IsObject(HandleValue v) { return v.isObject(); } /* static */ Loading Loading
js/src/vm/ErrorObject.cpp +18 −24 Original line number Diff line number Diff line Loading @@ -647,19 +647,24 @@ static bool FindErrorInstanceOrPrototype(JSContext* cx, HandleObject obj, // (new NYI).stack // to continue returning stacks that are useless, but at least don't throw. RootedObject target(cx, CheckedUnwrapStatic(obj)); RootedObject curr(cx, obj); RootedObject target(cx); do { target = CheckedUnwrapStatic(curr); if (!target) { ReportAccessDenied(cx); return false; } if (IsErrorProtoKey(StandardProtoKeyOrNull(target))) { result.set(target); return true; } RootedObject proto(cx); while (!IsErrorProtoKey(StandardProtoKeyOrNull(target))) { if (!GetPrototype(cx, target, &proto)) { if (!GetPrototype(cx, curr, &curr)) { return false; } } while (curr); if (!proto) { // We walked the whole prototype chain and did not find an Error // object. JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, Loading @@ -668,17 +673,6 @@ static bool FindErrorInstanceOrPrototype(JSContext* cx, HandleObject obj, return false; } target = CheckedUnwrapStatic(proto); if (!target) { ReportAccessDenied(cx); return false; } } result.set(target); return true; } static MOZ_ALWAYS_INLINE bool IsObject(HandleValue v) { return v.isObject(); } /* static */ Loading