summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaming4JC <g4jc@hyperbola.info>2019-06-08 19:30:53 -0400
committerGaming4JC <g4jc@hyperbola.info>2019-07-18 22:38:24 -0400
commitfe20cd26491f8db4e7304d509a2639cfccf26c7e (patch)
tree09500529d6663a92424b6b55016fe49577273ddd
parent549bab83d1d7fa7bb0a15f7852ccffc708d70ab0 (diff)
downloaduxp-fe20cd26491f8db4e7304d509a2639cfccf26c7e.tar.gz
1320408 - Part 8: Change JSObject::reportNotConfigurable and JSObject::reportNotExtensible to static method.
-rw-r--r--js/src/jsobj.cpp10
-rw-r--r--js/src/jsobj.h5
-rw-r--r--js/src/vm/Shape.cpp6
3 files changed, 11 insertions, 10 deletions
diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp
index f4a524d44c..b08e8a6193 100644
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -2451,7 +2451,7 @@ js::HasOwnDataPropertyPure(JSContext* cx, JSObject* obj, jsid id, bool* result)
return true;
}
-bool
+/* static */ bool
JSObject::reportReadOnly(JSContext* cx, jsid id, unsigned report)
{
RootedValue val(cx, IdToValue(id));
@@ -2460,7 +2460,7 @@ JSObject::reportReadOnly(JSContext* cx, jsid id, unsigned report)
nullptr, nullptr);
}
-bool
+/* static */ bool
JSObject::reportNotConfigurable(JSContext* cx, jsid id, unsigned report)
{
RootedValue val(cx, IdToValue(id));
@@ -2469,10 +2469,10 @@ JSObject::reportNotConfigurable(JSContext* cx, jsid id, unsigned report)
nullptr, nullptr);
}
-bool
-JSObject::reportNotExtensible(JSContext* cx, unsigned report)
+/* static */ bool
+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,
JSDVG_IGNORE_STACK, val, nullptr,
nullptr, nullptr);
diff --git a/js/src/jsobj.h b/js/src/jsobj.h
index bdd08cf966..3eabf448a7 100644
--- a/js/src/jsobj.h
+++ b/js/src/jsobj.h
@@ -520,8 +520,9 @@ class JSObject : public js::gc::Cell
public:
static bool reportReadOnly(JSContext* cx, jsid id, unsigned report = JSREPORT_ERROR);
- bool reportNotConfigurable(JSContext* cx, jsid id, unsigned report = JSREPORT_ERROR);
- bool reportNotExtensible(JSContext* cx, unsigned report = JSREPORT_ERROR);
+ static bool reportNotConfigurable(JSContext* cx, jsid id, 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,
js::HandleValue v, js::HandleValue receiver,
diff --git a/js/src/vm/Shape.cpp b/js/src/vm/Shape.cpp
index 306a2c5400..15fb713437 100644
--- a/js/src/vm/Shape.cpp
+++ b/js/src/vm/Shape.cpp
@@ -534,7 +534,7 @@ NativeObject::addProperty(ExclusiveContext* cx, HandleNativeObject obj, HandleId
return nullptr;
if (!extensible) {
if (cx->isJSContext())
- obj->reportNotExtensible(cx->asJSContext());
+ JSObject::reportNotExtensible(cx->asJSContext(), obj);
return nullptr;
}
@@ -727,7 +727,7 @@ CheckCanChangeAttrs(ExclusiveContext* cx, JSObject* obj, Shape* shape, unsigned*
(*attrsp & (JSPROP_GETTER | JSPROP_SETTER | JSPROP_SHARED)))
{
if (cx->isJSContext())
- obj->reportNotConfigurable(cx->asJSContext(), shape->propid());
+ JSObject::reportNotConfigurable(cx->asJSContext(), shape->propid());
return false;
}
@@ -785,7 +785,7 @@ NativeObject::putProperty(ExclusiveContext* cx, HandleNativeObject obj, HandleId
if (!extensible) {
if (cx->isJSContext())
- obj->reportNotExtensible(cx->asJSContext());
+ JSObject::reportNotExtensible(cx->asJSContext(), obj);
return nullptr;
}