зеркало из https://github.com/mozilla/gecko-dev.git
Bug 988493 -- improve error message for missing self-hosted prop r=till
This commit is contained in:
Родитель
79af0023a0
Коммит
e4dc5a97c1
|
@ -436,3 +436,4 @@ MSG_DEF(JSMSG_TYPEDOBJECT_HANDLE_TO_UNSIZED, 381, 0, JSEXN_TYPEERR, "cannot crea
|
|||
MSG_DEF(JSMSG_SETPROTOTYPEOF_FAIL, 382, 1, JSEXN_TYPEERR, "[[SetPrototypeOf]] failed on {0}")
|
||||
MSG_DEF(JSMSG_INVALID_ARG_TYPE, 383, 3, JSEXN_TYPEERR, "Invalid type: {0} can't be a{1} {2}")
|
||||
MSG_DEF(JSMSG_TERMINATED, 384, 1, JSEXN_ERR, "Script terminated by timeout at:\n{0}")
|
||||
MSG_DEF(JSMSG_NO_SUCH_SELF_HOSTED_PROP, 385, 1, JSEXN_ERR, "No such property on self-hosted object: {0}")
|
||||
|
|
|
@ -1000,15 +1000,17 @@ GetUnclonedValue(JSContext *cx, JSObject *selfHostedObject, jsid id, Value *vp)
|
|||
if (JSID_IS_STRING(id) && !JSID_TO_STRING(id)->isPermanentAtom()) {
|
||||
JS_ASSERT(selfHostedObject->is<GlobalObject>());
|
||||
gc::AutoSuppressGC suppress(cx);
|
||||
JS_ReportError(cx, "No such property on self hosted object");
|
||||
return false;
|
||||
RootedValue value(cx, IdToValue(id));
|
||||
return js_ReportValueErrorFlags(cx, JSREPORT_ERROR, JSMSG_NO_SUCH_SELF_HOSTED_PROP,
|
||||
JSDVG_IGNORE_STACK, value, NullPtr(), nullptr, nullptr);
|
||||
}
|
||||
|
||||
Shape *shape = selfHostedObject->nativeLookupPure(id);
|
||||
if (!shape) {
|
||||
gc::AutoSuppressGC suppress(cx);
|
||||
JS_ReportError(cx, "No such property on self hosted object");
|
||||
return false;
|
||||
RootedValue value(cx, IdToValue(id));
|
||||
return js_ReportValueErrorFlags(cx, JSREPORT_ERROR, JSMSG_NO_SUCH_SELF_HOSTED_PROP,
|
||||
JSDVG_IGNORE_STACK, value, NullPtr(), nullptr, nullptr);
|
||||
}
|
||||
|
||||
JS_ASSERT(shape->hasSlot() && shape->hasDefaultGetter());
|
||||
|
|
Загрузка…
Ссылка в новой задаче