Fix AsyncGeneratorPrototype routines 'this' argument validation (#4811)
JerryScript-DCO-1.0-Signed-off-by: Robert Fancsik robert.fancsik@h-lab.eu
This commit is contained in:
@@ -39,6 +39,19 @@ function check_rejected(p, value)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
function check_type_error(p)
|
||||
{
|
||||
assert(p instanceof Promise)
|
||||
|
||||
p.then(function(v) {
|
||||
assert(false)
|
||||
}, function(v) {
|
||||
assert(v instanceof TypeError);
|
||||
successCount++
|
||||
})
|
||||
}
|
||||
|
||||
// Test 1
|
||||
|
||||
var gen, r, o
|
||||
@@ -65,6 +78,9 @@ check_fulfilled(gen.next("Test2"), 1.5, false)
|
||||
check_fulfilled(gen.next(2.5), o, true)
|
||||
check_fulfilled(gen.next(), undefined, true)
|
||||
check_fulfilled(gen.next(), undefined, true)
|
||||
check_type_error(gen.next.call(undefined))
|
||||
check_type_error(gen.throw.call(undefined))
|
||||
check_type_error(gen.return.call(undefined))
|
||||
|
||||
r(1)
|
||||
|
||||
@@ -220,7 +236,7 @@ check_fulfilled(gen.next(), undefined, true)
|
||||
// END
|
||||
|
||||
function __checkAsync() {
|
||||
assert(successCount === 29)
|
||||
assert(successCount === 32)
|
||||
assert(state === 4)
|
||||
assert(state2 === 4)
|
||||
}
|
||||
|
||||
@@ -3112,15 +3112,9 @@
|
||||
<test id="built-ins/AsyncGeneratorFunction/instance-yield-expr-in-param.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/next/request-queue-await-order.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/next/request-queue-promise-resolve-order.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/next/this-val-not-async-generator.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/next/this-val-not-object.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/return/return-state-completed.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/return/return-suspendedStart-promise.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/return/return-suspendedYield-promise.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/return/this-val-not-async-generator.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/return/this-val-not-object.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/throw/this-val-not-async-generator.js"><reason></reason></test>
|
||||
<test id="built-ins/AsyncGeneratorPrototype/throw/this-val-not-object.js"><reason></reason></test>
|
||||
<test id="built-ins/FinalizationRegistry/prototype/cleanupSome/return-undefined-with-gc.js"><reason></reason></test>
|
||||
<test id="built-ins/FinalizationRegistry/prototype/cleanupSome/return-undefined.js"><reason></reason></test>
|
||||
<test id="language/block-scope/syntax/redeclaration/async-function-name-redeclaration-attempt-with-async-generator.js"><reason></reason></test>
|
||||
|
||||
Reference in New Issue
Block a user