summaryrefslogtreecommitdiffstats
path: root/js/src/vm/NativeObject.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2020-02-22 21:07:48 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2020-02-22 21:07:48 +0100
commitb1cd96989bb5107f83895c2320e0046d84b448ab (patch)
tree468d90d65d7cb753f0e99fada6bc6798a3ff0e31 /js/src/vm/NativeObject.cpp
parenta7888b8cf20691a4090715ab9b055ec3cb75f5e8 (diff)
downloadUXP-b1cd96989bb5107f83895c2320e0046d84b448ab.tar
UXP-b1cd96989bb5107f83895c2320e0046d84b448ab.tar.gz
UXP-b1cd96989bb5107f83895c2320e0046d84b448ab.tar.lz
UXP-b1cd96989bb5107f83895c2320e0046d84b448ab.tar.xz
UXP-b1cd96989bb5107f83895c2320e0046d84b448ab.zip
Revert 1320408 part 15: Make addDataProperty static
Diffstat (limited to 'js/src/vm/NativeObject.cpp')
-rw-r--r--js/src/vm/NativeObject.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/js/src/vm/NativeObject.cpp b/js/src/vm/NativeObject.cpp
index d801fad06..e7de36f13 100644
--- a/js/src/vm/NativeObject.cpp
+++ b/js/src/vm/NativeObject.cpp
@@ -994,22 +994,23 @@ NativeObject::freeSlot(ExclusiveContext* cx, uint32_t slot)
setSlot(slot, UndefinedValue());
}
-/* static */ Shape*
-NativeObject::addDataProperty(ExclusiveContext* cx, HandleNativeObject obj,
- jsid idArg, uint32_t slot, unsigned attrs)
+Shape*
+NativeObject::addDataProperty(ExclusiveContext* cx, jsid idArg, uint32_t slot, unsigned attrs)
{
MOZ_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
+ RootedNativeObject self(cx, this);
RootedId id(cx, idArg);
- return addProperty(cx, obj, id, nullptr, nullptr, slot, attrs, 0);
+ return addProperty(cx, self, id, nullptr, nullptr, slot, attrs, 0);
}
-/* static */ Shape*
-NativeObject::addDataProperty(ExclusiveContext* cx, HandleNativeObject obj,
- HandlePropertyName name, uint32_t slot, unsigned attrs)
+Shape*
+NativeObject::addDataProperty(ExclusiveContext* cx, HandlePropertyName name,
+ uint32_t slot, unsigned attrs)
{
MOZ_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
+ RootedNativeObject self(cx, this);
RootedId id(cx, NameToId(name));
- return addProperty(cx, obj, id, nullptr, nullptr, slot, attrs, 0);
+ return addProperty(cx, self, id, nullptr, nullptr, slot, attrs, 0);
}
template <AllowGC allowGC>