mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 00:01:50 +00:00
Bug 916949 - Change __noSuchMethod__ so that it only gets invoked on undefined bindings. r=jorendorff
This commit is contained in:
parent
a9d5d30b02
commit
faaab77a79
@ -6015,7 +6015,7 @@ DoGetPropFallback(JSContext *cx, BaselineFrame *frame, ICGetProp_Fallback *stub,
|
||||
|
||||
#if JS_HAS_NO_SUCH_METHOD
|
||||
// Handle objects with __noSuchMethod__.
|
||||
if (op == JSOP_CALLPROP && JS_UNLIKELY(res.isPrimitive()) && val.isObject()) {
|
||||
if (op == JSOP_CALLPROP && JS_UNLIKELY(res.isUndefined()) && val.isObject()) {
|
||||
if (!OnUnknownMethod(cx, obj, IdToValue(id), res))
|
||||
return false;
|
||||
}
|
||||
|
@ -1781,7 +1781,7 @@ GetPropertyIC::update(JSContext *cx, size_t cacheIndex,
|
||||
|
||||
#if JS_HAS_NO_SUCH_METHOD
|
||||
// Handle objects with __noSuchMethod__.
|
||||
if (JSOp(*pc) == JSOP_CALLPROP && JS_UNLIKELY(vp.isPrimitive())) {
|
||||
if (JSOp(*pc) == JSOP_CALLPROP && JS_UNLIKELY(vp.isUndefined())) {
|
||||
if (!OnUnknownMethod(cx, obj, IdToValue(id), vp))
|
||||
return false;
|
||||
}
|
||||
|
@ -391,7 +391,7 @@ GetObjectElementOperation(JSContext *cx, JSOp op, JSObject *objArg, bool wasObje
|
||||
} while (0);
|
||||
|
||||
#if JS_HAS_NO_SUCH_METHOD
|
||||
if (op == JSOP_CALLELEM && JS_UNLIKELY(res.isPrimitive()) && wasObject) {
|
||||
if (op == JSOP_CALLELEM && JS_UNLIKELY(res.isUndefined()) && wasObject) {
|
||||
RootedObject obj(cx, objArg);
|
||||
if (!OnUnknownMethod(cx, obj, rref, res))
|
||||
return false;
|
||||
|
@ -266,7 +266,7 @@ GetPropertyOperation(JSContext *cx, StackFrame *fp, HandleScript script, jsbytec
|
||||
|
||||
#if JS_HAS_NO_SUCH_METHOD
|
||||
if (op == JSOP_CALLPROP &&
|
||||
JS_UNLIKELY(vp.isPrimitive()) &&
|
||||
JS_UNLIKELY(vp.isUndefined()) &&
|
||||
wasObject)
|
||||
{
|
||||
if (!OnUnknownMethod(cx, obj, IdToValue(id), vp))
|
||||
@ -3453,7 +3453,7 @@ js::CallProperty(JSContext *cx, HandleValue v, HandlePropertyName name, MutableH
|
||||
return false;
|
||||
|
||||
#if JS_HAS_NO_SUCH_METHOD
|
||||
if (JS_UNLIKELY(vp.isPrimitive()) && v.isObject())
|
||||
if (JS_UNLIKELY(vp.isUndefined()) && v.isObject())
|
||||
{
|
||||
RootedObject obj(cx, &v.toObject());
|
||||
if (!OnUnknownMethod(cx, obj, StringValue(name), vp))
|
||||
|
Loading…
Reference in New Issue
Block a user