mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
If prototype is at end need to return false
Signed-off-by: liujia178 <liujia178@huawei.com>
This commit is contained in:
parent
b08fb1f83d
commit
79d37cf96f
@ -4662,27 +4662,25 @@ GateRef StubBuilder::OrdinaryHasInstance(GateRef glue, GateRef target, GateRef o
|
||||
BRANCH(TaggedIsNull(*object), &afterLoop, &loopHead);
|
||||
LoopBegin(&loopHead);
|
||||
{
|
||||
GateRef isEqual = SameValue(glue, *object, *constructorPrototype);
|
||||
|
||||
BRANCH(isEqual, &strictEqual1, ¬StrictEqual1);
|
||||
Bind(&strictEqual1);
|
||||
object = GetPrototype(glue, *object);
|
||||
Branch(HasPendingException(glue), &shouldReturn, &shouldContinue);
|
||||
Bind(&shouldReturn);
|
||||
{
|
||||
result = TaggedTrue();
|
||||
result = Exception();
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(¬StrictEqual1);
|
||||
Bind(&shouldContinue);
|
||||
{
|
||||
object = GetPrototype(glue, *object);
|
||||
|
||||
BRANCH(HasPendingException(glue), &shouldReturn, &shouldContinue);
|
||||
Bind(&shouldReturn);
|
||||
GateRef isEqual = SameValue(glue, *object, *constructorPrototype);
|
||||
Branch(isEqual, &strictEqual1, ¬StrictEqual1);
|
||||
Bind(&strictEqual1);
|
||||
{
|
||||
result = Exception();
|
||||
result = TaggedTrue();
|
||||
Jump(&exit);
|
||||
}
|
||||
Bind(¬StrictEqual1);
|
||||
Branch(TaggedIsNull(*object), &afterLoop, &loopEnd);
|
||||
}
|
||||
Bind(&shouldContinue);
|
||||
BRANCH(TaggedIsNull(*object), &afterLoop, &loopEnd);
|
||||
}
|
||||
Bind(&loopEnd);
|
||||
LoopEnd(&loopHead, env, glue);
|
||||
|
@ -346,11 +346,11 @@ bool JSFunction::OrdinaryHasInstance(JSThread *thread, const JSHandle<JSTaggedVa
|
||||
// d.If SameValue(P, O) is true, return true.
|
||||
JSMutableHandle<JSTaggedValue> object(thread, obj.GetTaggedValue());
|
||||
while (!object->IsNull()) {
|
||||
object.Update(JSTaggedValue::GetPrototype(thread, object));
|
||||
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||
if (JSTaggedValue::SameValue(object, constructorPrototype)) {
|
||||
return true;
|
||||
}
|
||||
object.Update(JSTaggedValue::GetPrototype(thread, object));
|
||||
RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
@ -17,3 +17,5 @@ test success
|
||||
test success
|
||||
CallbackFn is not callable
|
||||
TypeError
|
||||
false
|
||||
false
|
||||
|
@ -87,4 +87,13 @@ try {
|
||||
Array instanceof function_prototype_changed;
|
||||
} catch (e) {
|
||||
print(e.name)
|
||||
}
|
||||
}
|
||||
|
||||
var A = {};
|
||||
function Func() { }
|
||||
Func.prototype = A;
|
||||
print(A instanceof Func);
|
||||
|
||||
var proto_desc = Object.getOwnPropertyDescriptor(RegExp, "prototype");
|
||||
var proto = proto_desc.value;
|
||||
print(proto instanceof RegExp);
|
||||
|
@ -1992,7 +1992,6 @@
|
||||
"mjsunit/math-floor-part2.js",
|
||||
"mjsunit/typedarray-resizablearraybuffer-detach.js",
|
||||
"mjsunit/copy-on-write-assert.js",
|
||||
"mjsunit/instanceof.js",
|
||||
"mjsunit/whitespaces3.js",
|
||||
"mjsunit/string-case.js",
|
||||
"mjsunit/getter-in-value-prototype.js",
|
||||
@ -3073,7 +3072,6 @@
|
||||
"mjsunit/es6/string-iterator5.js",
|
||||
"mjsunit/es6/block-const-assign.js",
|
||||
"mjsunit/es6/throw-type-error-function-restrictions.js",
|
||||
"mjsunit/es6/regexp-prototype.js",
|
||||
"mjsunit/es6/set-iterator-5.js",
|
||||
"mjsunit/es6/classes-lazy-parsing.js",
|
||||
"mjsunit/es6/regexp-tostring.js",
|
||||
|
Loading…
Reference in New Issue
Block a user