import change from rmottola/Arctic-Fox:

- Bug 1133085 - PropDesc::initFromPropertyDescriptor should understand JSPROP_GETTER without JSPROP_SETTER and vice versa. (d83f16200)
This commit is contained in:
2019-03-30 07:48:34 +08:00
parent c1ae338aef
commit d86d78c8b6
3 changed files with 42 additions and 8 deletions
+2 -2
View File
@@ -912,7 +912,7 @@ ScriptedDirectProxyHandler::get(JSContext* cx, HandleObject proxy, HandleObject
}
}
if (IsAccessorDescriptor(desc) && desc.isPermanent() && !desc.hasGetterObject()) {
if (IsAccessorDescriptor(desc) && desc.isPermanent() && desc.getterObject() == nullptr) {
if (!trapResult.isUndefined()) {
JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_MUST_REPORT_UNDEFINED);
return false;
@@ -982,7 +982,7 @@ ScriptedDirectProxyHandler::set(JSContext* cx, HandleObject proxy, HandleObject
}
}
if (IsAccessorDescriptor(desc) && desc.isPermanent() && !desc.hasSetterObject()) {
if (IsAccessorDescriptor(desc) && desc.isPermanent() && desc.setterObject() == nullptr) {
JS_ReportErrorNumber(cx, GetErrorMessage, nullptr, JSMSG_CANT_SET_WO_SETTER);
return false;
}