Bug 1130576 - Rename JSPropertyOp -> JSGetterOp and JSStrictPropertyOp -> JSSetterOp. r=efaust.

This commit is contained in:
Jason Orendorff
2015-01-30 13:56:15 -06:00
parent d7bc852a09
commit c9cc21f96d
39 changed files with 203 additions and 202 deletions

View File

@@ -475,6 +475,7 @@ Reject(JSContext *cx, HandleId id, unsigned errorNumber, bool throwError, bool *
return true;
}
/*** Standard-compliant property definition (used by Object.defineProperty) **********************/
static bool
@@ -571,7 +572,7 @@ DefinePropertyOnObject(JSContext *cx, HandleNativeObject obj, HandleId id, const
v = obj->getDenseOrTypedArrayElement(JSID_TO_INT(id));
} else if (shape->isDataDescriptor()) {
/*
* We must rule out a non-configurable js::PropertyOp-guarded
* We must rule out a non-configurable js::SetterOp-guarded
* property becoming a writable unguarded data property, since
* such a property can have its value changed to one the getter
* and setter preclude.
@@ -602,14 +603,14 @@ DefinePropertyOnObject(JSContext *cx, HandleNativeObject obj, HandleId id, const
return false;
if (!same) {
/*
* Insist that a non-configurable js::PropertyOp data
* Insist that a non-configurable js::GetterOp data
* property is frozen at exactly the last-got value.
*
* Duplicate the first part of the big conjunction that
* we tested above, rather than add a local bool flag.
* Likewise, don't try to keep shape->writable() in a
* flag we veto from true to false for non-configurable
* PropertyOp-based data properties and test before the
* GetterOp-based data properties and test before the
* SameValue check later on in order to re-use that "if
* (!SameValue) Reject" logic.
*
@@ -701,8 +702,8 @@ DefinePropertyOnObject(JSContext *cx, HandleNativeObject obj, HandleId id, const
/* 8.12.9 step 12. */
unsigned attrs;
PropertyOp getter;
StrictPropertyOp setter;
GetterOp getter;
SetterOp setter;
if (desc.isGenericDescriptor()) {
unsigned changed = 0;
if (desc.hasConfigurable())
@@ -1712,7 +1713,7 @@ JS_CopyPropertyFrom(JSContext *cx, HandleId id, HandleObject target,
return false;
MOZ_ASSERT(desc.object());
// Silently skip JSPropertyOp-implemented accessors.
// Silently skip JSGetterOp/JSSetterOp-implemented accessors.
if (desc.getter() && !desc.hasGetterObject())
return true;
if (desc.setter() && !desc.hasSetterObject())
@@ -3251,7 +3252,7 @@ js::GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id,
desc.setSetterObject(shape->setterObject());
} else {
// This is either a straight-up data property or (rarely) a
// property with a JSPropertyOp getter/setter. The latter must be
// property with a JSGetterOp/JSSetterOp. The latter must be
// reported to the caller as a plain data property, so don't
// populate desc.getter/setter, and mask away the SHARED bit.
desc.attributesRef() &= ~JSPROP_SHARED;
@@ -3268,7 +3269,7 @@ js::GetOwnPropertyDescriptor(JSContext *cx, HandleObject obj, HandleId id,
bool
js::DefineProperty(ExclusiveContext *cx, HandleObject obj, HandleId id, HandleValue value,
JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs)
JSGetterOp getter, JSSetterOp setter, unsigned attrs)
{
MOZ_ASSERT(getter != JS_PropertyStub);
MOZ_ASSERT(setter != JS_StrictPropertyStub);
@@ -3286,7 +3287,7 @@ js::DefineProperty(ExclusiveContext *cx, HandleObject obj, HandleId id, HandleVa
bool
js::DefineProperty(ExclusiveContext *cx, HandleObject obj,
PropertyName *name, HandleValue value,
JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs)
JSGetterOp getter, JSSetterOp setter, unsigned attrs)
{
RootedId id(cx, NameToId(name));
return DefineProperty(cx, obj, id, value, getter, setter, attrs);
@@ -3294,7 +3295,7 @@ js::DefineProperty(ExclusiveContext *cx, HandleObject obj,
bool
js::DefineElement(ExclusiveContext *cx, HandleObject obj, uint32_t index, HandleValue value,
JSPropertyOp getter, JSStrictPropertyOp setter, unsigned attrs)
JSGetterOp getter, JSSetterOp setter, unsigned attrs)
{
MOZ_ASSERT(getter != JS_PropertyStub);
MOZ_ASSERT(setter != JS_StrictPropertyStub);