From 041d19551dea530e896bb5078924f85856d5d915 Mon Sep 17 00:00:00 2001 From: Jan de Mooij Date: Wed, 1 Nov 2017 11:39:52 +0100 Subject: [PATCH] Bug 1394831 part 8 - Remove flags argument from addAccessorProperty. r=bhackett --- js/src/jsarray.cpp | 2 +- js/src/vm/NativeObject.cpp | 2 +- js/src/vm/NativeObject.h | 6 +++--- js/src/vm/Shape-inl.h | 4 ++-- js/src/vm/Shape.cpp | 7 +++---- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp index 36385166a0ab..e91731a9e915 100644 --- a/js/src/jsarray.cpp +++ b/js/src/jsarray.cpp @@ -1025,7 +1025,7 @@ AddLengthProperty(JSContext* cx, HandleArrayObject obj) return NativeObject::addAccessorProperty(cx, obj, lengthId, array_length_getter, array_length_setter, JSPROP_PERMANENT | JSPROP_SHADOWABLE, - 0, /* allowDictionary = */ false); + /* allowDictionary = */ false); } static bool diff --git a/js/src/vm/NativeObject.cpp b/js/src/vm/NativeObject.cpp index ba53d0566288..f9f050b97a63 100644 --- a/js/src/vm/NativeObject.cpp +++ b/js/src/vm/NativeObject.cpp @@ -1426,7 +1426,7 @@ AddOrChangeProperty(JSContext* cx, HandleNativeObject obj, HandleId id, desc.attributes()); } else { shape = NativeObject::addAccessorProperty(cx, obj, id, desc.getter(), desc.setter(), - desc.attributes(), 0); + desc.attributes()); } } else { if (Shape::isDataProperty(desc.attributes(), desc.getter(), desc.setter())) { diff --git a/js/src/vm/NativeObject.h b/js/src/vm/NativeObject.h index f8ce2cec3c34..028a9c37760a 100644 --- a/js/src/vm/NativeObject.h +++ b/js/src/vm/NativeObject.h @@ -858,8 +858,8 @@ class NativeObject : public ShapedObject static MOZ_ALWAYS_INLINE Shape* addAccessorProperty(JSContext* cx, HandleNativeObject obj, HandleId id, JSGetterOp getter, JSSetterOp setter, - unsigned attrs, unsigned flags, - bool allowDictionary = true); + unsigned attrs, bool allowDictionary = true); + static Shape* addEnumerableDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id); /* Add a data property whose id is not yet in this scope. */ @@ -901,7 +901,7 @@ class NativeObject : public ShapedObject static Shape* addAccessorPropertyInternal(JSContext* cx, HandleNativeObject obj, HandleId id, JSGetterOp getter, JSSetterOp setter, unsigned attrs, - unsigned flags, ShapeTable::Entry* entry, bool allowDictionary, + ShapeTable::Entry* entry, bool allowDictionary, const AutoKeepShapeTables& keep); static MOZ_MUST_USE bool fillInAfterSwap(JSContext* cx, HandleNativeObject obj, diff --git a/js/src/vm/Shape-inl.h b/js/src/vm/Shape-inl.h index b533a4ca372b..80feaccda997 100644 --- a/js/src/vm/Shape-inl.h +++ b/js/src/vm/Shape-inl.h @@ -413,7 +413,7 @@ NativeObject::addDataProperty(JSContext* cx, HandleNativeObject obj, HandleId id /* static */ MOZ_ALWAYS_INLINE Shape* NativeObject::addAccessorProperty(JSContext* cx, HandleNativeObject obj, HandleId id, GetterOp getter, SetterOp setter, unsigned attrs, - unsigned flags, bool allowDictionary) + bool allowDictionary) { MOZ_ASSERT(!JSID_IS_VOID(id)); MOZ_ASSERT(obj->uninlinedNonProxyIsExtensible()); @@ -428,7 +428,7 @@ NativeObject::addAccessorProperty(JSContext* cx, HandleNativeObject obj, HandleI entry = &table->search(id, keep); } - return addAccessorPropertyInternal(cx, obj, id, getter, setter, attrs, flags, entry, + return addAccessorPropertyInternal(cx, obj, id, getter, setter, attrs, entry, allowDictionary, keep); } diff --git a/js/src/vm/Shape.cpp b/js/src/vm/Shape.cpp index 0249f7c3d6cb..cacc5c2dd71e 100644 --- a/js/src/vm/Shape.cpp +++ b/js/src/vm/Shape.cpp @@ -479,7 +479,7 @@ class MOZ_RAII AutoCheckShapeConsistency NativeObject::addAccessorPropertyInternal(JSContext* cx, HandleNativeObject obj, HandleId id, GetterOp getter, SetterOp setter, - unsigned attrs, unsigned flags, ShapeTable::Entry* entry, + unsigned attrs, ShapeTable::Entry* entry, bool allowDictionary, const AutoKeepShapeTables& keep) { MOZ_ASSERT_IF(!allowDictionary, !obj->inDictionaryMode()); @@ -521,7 +521,7 @@ NativeObject::addAccessorPropertyInternal(JSContext* cx, if (!nbase) return nullptr; - Rooted child(cx, StackShape(nbase, id, SHAPE_INVALID_SLOT, attrs, flags)); + Rooted child(cx, StackShape(nbase, id, SHAPE_INVALID_SLOT, attrs, 0)); child.updateGetterSetter(getter, setter); shape = getChildProperty(cx, obj, last, &child); if (!shape) @@ -953,8 +953,7 @@ NativeObject::putAccessorProperty(JSContext* cx, HandleNativeObject obj, HandleI */ MOZ_ASSERT(obj->nonProxyIsExtensible()); - return addAccessorPropertyInternal(cx, obj, id, getter, setter, attrs, 0, entry, true, - keep); + return addAccessorPropertyInternal(cx, obj, id, getter, setter, attrs, entry, true, keep); } /* Property exists: search must have returned a valid entry. */