Put JSContext argument back at the end of SameValue (apparently that means something)

This commit is contained in:
Luke Wagner 2010-06-29 02:08:07 -07:00
parent ae0f7e12b6
commit b8a731853a
4 changed files with 9 additions and 9 deletions

View File

@ -513,7 +513,7 @@ JS_StrictlyEqual(JSContext *cx, jsval v1, jsval v2)
JS_PUBLIC_API(JSBool) JS_PUBLIC_API(JSBool)
JS_SameValue(JSContext *cx, jsval v1, jsval v2) JS_SameValue(JSContext *cx, jsval v1, jsval v2)
{ {
return SameValue(cx, Valueify(v1), Valueify(v2)); return SameValue(Valueify(v1), Valueify(v2), cx);
} }
/************************************************************************/ /************************************************************************/

View File

@ -1003,7 +1003,7 @@ IsNaN(const Value &v)
} }
bool bool
SameValue(JSContext *cx, const Value &v1, const Value &v2) SameValue(const Value &v1, const Value &v2, JSContext *cx)
{ {
if (IsNegativeZero(v1)) if (IsNegativeZero(v1))
return IsNegativeZero(v2); return IsNegativeZero(v2);

View File

@ -374,7 +374,7 @@ StrictlyEqual(JSContext *cx, const Value &lval, const Value &rval);
/* === except that NaN is the same as NaN and -0 is not the same as +0. */ /* === except that NaN is the same as NaN and -0 is not the same as +0. */
extern bool extern bool
SameValue(JSContext *cx, const Value &v1, const Value &v2); SameValue(const Value &v1, const Value &v2, JSContext *cx);
extern JSType extern JSType
TypeOfValue(JSContext *cx, const js::Value &v); TypeOfValue(JSContext *cx, const js::Value &v);

View File

@ -2148,12 +2148,12 @@ DefinePropertyOnObject(JSContext *cx, JSObject *obj, const PropDesc &desc,
break; break;
if (desc.hasGet && if (desc.hasGet &&
!SameValue(cx, desc.getterValue(), sprop->getterOrUndefined())) { !SameValue(desc.getterValue(), sprop->getterOrUndefined(), cx)) {
break; break;
} }
if (desc.hasSet && if (desc.hasSet &&
!SameValue(cx, desc.setterValue(), sprop->setterOrUndefined())) { !SameValue(desc.setterValue(), sprop->setterOrUndefined(), cx)) {
break; break;
} }
} else { } else {
@ -2204,7 +2204,7 @@ DefinePropertyOnObject(JSContext *cx, JSObject *obj, const PropDesc &desc,
if (!sprop->isDataDescriptor()) if (!sprop->isDataDescriptor())
break; break;
if (desc.hasValue && !SameValue(cx, desc.value, v)) if (desc.hasValue && !SameValue(desc.value, v, cx))
break; break;
if (desc.hasWritable && desc.writable() != sprop->writable()) if (desc.hasWritable && desc.writable() != sprop->writable())
break; break;
@ -2255,7 +2255,7 @@ DefinePropertyOnObject(JSContext *cx, JSObject *obj, const PropDesc &desc,
JS_ASSERT(sprop->isDataDescriptor()); JS_ASSERT(sprop->isDataDescriptor());
if (!sprop->configurable() && !sprop->writable()) { if (!sprop->configurable() && !sprop->writable()) {
if ((desc.hasWritable && desc.writable()) || if ((desc.hasWritable && desc.writable()) ||
(desc.hasValue && !SameValue(cx, desc.value, v))) { (desc.hasValue && !SameValue(desc.value, v, cx))) {
return Reject(cx, obj2, current, JSMSG_CANT_REDEFINE_UNCONFIGURABLE_PROP, return Reject(cx, obj2, current, JSMSG_CANT_REDEFINE_UNCONFIGURABLE_PROP,
throwError, desc.id, rval); throwError, desc.id, rval);
} }
@ -2265,9 +2265,9 @@ DefinePropertyOnObject(JSContext *cx, JSObject *obj, const PropDesc &desc,
JS_ASSERT(desc.isAccessorDescriptor() && sprop->isAccessorDescriptor()); JS_ASSERT(desc.isAccessorDescriptor() && sprop->isAccessorDescriptor());
if (!sprop->configurable()) { if (!sprop->configurable()) {
if ((desc.hasSet && if ((desc.hasSet &&
!SameValue(cx, desc.setterValue(), sprop->setterOrUndefined())) || !SameValue(desc.setterValue(), sprop->setterOrUndefined(), cx)) ||
(desc.hasGet && (desc.hasGet &&
!SameValue(cx, desc.getterValue(), sprop->getterOrUndefined()))) { !SameValue(desc.getterValue(), sprop->getterOrUndefined(), cx))) {
return Reject(cx, obj2, current, JSMSG_CANT_REDEFINE_UNCONFIGURABLE_PROP, return Reject(cx, obj2, current, JSMSG_CANT_REDEFINE_UNCONFIGURABLE_PROP,
throwError, desc.id, rval); throwError, desc.id, rval);
} }