mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-30 19:17:31 +09:00
1320408 - Part 8: Change JSObject::reportNotConfigurable and JSObject::reportNotExtensible to static method.
This commit is contained in:
parent
f32edc66ae
commit
7e0b20a7bf
3 changed files with 11 additions and 10 deletions
|
|
@ -2451,7 +2451,7 @@ js::HasOwnDataPropertyPure(JSContext* cx, JSObject* obj, jsid id, bool* result)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
/* static */ bool
|
||||||
JSObject::reportReadOnly(JSContext* cx, jsid id, unsigned report)
|
JSObject::reportReadOnly(JSContext* cx, jsid id, unsigned report)
|
||||||
{
|
{
|
||||||
RootedValue val(cx, IdToValue(id));
|
RootedValue val(cx, IdToValue(id));
|
||||||
|
|
@ -2460,7 +2460,7 @@ JSObject::reportReadOnly(JSContext* cx, jsid id, unsigned report)
|
||||||
nullptr, nullptr);
|
nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
/* static */ bool
|
||||||
JSObject::reportNotConfigurable(JSContext* cx, jsid id, unsigned report)
|
JSObject::reportNotConfigurable(JSContext* cx, jsid id, unsigned report)
|
||||||
{
|
{
|
||||||
RootedValue val(cx, IdToValue(id));
|
RootedValue val(cx, IdToValue(id));
|
||||||
|
|
@ -2469,10 +2469,10 @@ JSObject::reportNotConfigurable(JSContext* cx, jsid id, unsigned report)
|
||||||
nullptr, nullptr);
|
nullptr, nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool
|
/* static */ bool
|
||||||
JSObject::reportNotExtensible(JSContext* cx, unsigned report)
|
JSObject::reportNotExtensible(JSContext* cx, HandleObject obj, unsigned report)
|
||||||
{
|
{
|
||||||
RootedValue val(cx, ObjectValue(*this));
|
RootedValue val(cx, ObjectValue(*obj));
|
||||||
return ReportValueErrorFlags(cx, report, JSMSG_OBJECT_NOT_EXTENSIBLE,
|
return ReportValueErrorFlags(cx, report, JSMSG_OBJECT_NOT_EXTENSIBLE,
|
||||||
JSDVG_IGNORE_STACK, val, nullptr,
|
JSDVG_IGNORE_STACK, val, nullptr,
|
||||||
nullptr, nullptr);
|
nullptr, nullptr);
|
||||||
|
|
|
||||||
|
|
@ -520,8 +520,9 @@ class JSObject : public js::gc::Cell
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static bool reportReadOnly(JSContext* cx, jsid id, unsigned report = JSREPORT_ERROR);
|
static bool reportReadOnly(JSContext* cx, jsid id, unsigned report = JSREPORT_ERROR);
|
||||||
bool reportNotConfigurable(JSContext* cx, jsid id, unsigned report = JSREPORT_ERROR);
|
static bool reportNotConfigurable(JSContext* cx, jsid id, unsigned report = JSREPORT_ERROR);
|
||||||
bool reportNotExtensible(JSContext* cx, unsigned report = JSREPORT_ERROR);
|
static bool reportNotExtensible(JSContext* cx, js::HandleObject obj,
|
||||||
|
unsigned report = JSREPORT_ERROR);
|
||||||
|
|
||||||
static bool nonNativeSetProperty(JSContext* cx, js::HandleObject obj, js::HandleId id,
|
static bool nonNativeSetProperty(JSContext* cx, js::HandleObject obj, js::HandleId id,
|
||||||
js::HandleValue v, js::HandleValue receiver,
|
js::HandleValue v, js::HandleValue receiver,
|
||||||
|
|
|
||||||
|
|
@ -534,7 +534,7 @@ NativeObject::addProperty(ExclusiveContext* cx, HandleNativeObject obj, HandleId
|
||||||
return nullptr;
|
return nullptr;
|
||||||
if (!extensible) {
|
if (!extensible) {
|
||||||
if (cx->isJSContext())
|
if (cx->isJSContext())
|
||||||
obj->reportNotExtensible(cx->asJSContext());
|
JSObject::reportNotExtensible(cx->asJSContext(), obj);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -727,7 +727,7 @@ CheckCanChangeAttrs(ExclusiveContext* cx, JSObject* obj, Shape* shape, unsigned*
|
||||||
(*attrsp & (JSPROP_GETTER | JSPROP_SETTER | JSPROP_SHARED)))
|
(*attrsp & (JSPROP_GETTER | JSPROP_SETTER | JSPROP_SHARED)))
|
||||||
{
|
{
|
||||||
if (cx->isJSContext())
|
if (cx->isJSContext())
|
||||||
obj->reportNotConfigurable(cx->asJSContext(), shape->propid());
|
JSObject::reportNotConfigurable(cx->asJSContext(), shape->propid());
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -785,7 +785,7 @@ NativeObject::putProperty(ExclusiveContext* cx, HandleNativeObject obj, HandleId
|
||||||
|
|
||||||
if (!extensible) {
|
if (!extensible) {
|
||||||
if (cx->isJSContext())
|
if (cx->isJSContext())
|
||||||
obj->reportNotExtensible(cx->asJSContext());
|
JSObject::reportNotExtensible(cx->asJSContext(), obj);
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue