Always use the target object, regardless of where a method property is found along the prototype chain.

This commit is contained in:
beard%netscape.com 2000-06-24 05:21:49 +00:00
parent 8558f071a4
commit c337fff76a
2 changed files with 6 additions and 4 deletions

View File

@ -493,12 +493,13 @@ JSValue Context::interpret(ICodeModule* iCode, const JSValues& args)
JSValue base;
JSValue prop;
if (op2(call).first == NotARegister) {
base = mGlobal->getReference(prop, *((*registers)[op3(call).first].string));
base = mGlobal;
prop = mGlobal->getProperty(*((*registers)[op3(call).first].string));
}
else {
base = (*registers)[op2(call).first];
ASSERT(base.tag == JSValue::object_tag); // XXX runtime error
base = base.object->getReference(prop, *((*registers)[op3(call).first].string));
prop = base.object->getProperty(*((*registers)[op3(call).first].string));
}
ASSERT(prop.isFunction()); // XXX runtime error
JSFunction *target = prop.function;

View File

@ -493,12 +493,13 @@ JSValue Context::interpret(ICodeModule* iCode, const JSValues& args)
JSValue base;
JSValue prop;
if (op2(call).first == NotARegister) {
base = mGlobal->getReference(prop, *((*registers)[op3(call).first].string));
base = mGlobal;
prop = mGlobal->getProperty(*((*registers)[op3(call).first].string));
}
else {
base = (*registers)[op2(call).first];
ASSERT(base.tag == JSValue::object_tag); // XXX runtime error
base = base.object->getReference(prop, *((*registers)[op3(call).first].string));
prop = base.object->getProperty(*((*registers)[op3(call).first].string));
}
ASSERT(prop.isFunction()); // XXX runtime error
JSFunction *target = prop.function;