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-04-14 21:10:50 +0200
commitb9e692af05df98d3efc43996dda0983d31dfa7b4 (patch)
tree0e43271567377cb53f217653ff0c3ea2036d60d3 /js/src/vm/NativeObject.cpp
parent871e57fdd6d7e7aabf00f47f1b30e2ed084eed69 (diff)
downloadUXP-b9e692af05df98d3efc43996dda0983d31dfa7b4.tar
UXP-b9e692af05df98d3efc43996dda0983d31dfa7b4.tar.gz
UXP-b9e692af05df98d3efc43996dda0983d31dfa7b4.tar.lz
UXP-b9e692af05df98d3efc43996dda0983d31dfa7b4.tar.xz
UXP-b9e692af05df98d3efc43996dda0983d31dfa7b4.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 bd7484e07..8b7543d12 100644
--- a/js/src/vm/NativeObject.cpp
+++ b/js/src/vm/NativeObject.cpp
@@ -1021,22 +1021,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>