Support catch statement without argument. (#3956)

JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
Zoltan Herczeg
2020-06-30 18:00:40 +02:00
committed by GitHub
parent 9d2b7334bc
commit 37049c4968
4 changed files with 92 additions and 41 deletions
+34
View File
@@ -128,3 +128,37 @@ function f7()
assert(e === 6)
}
f7()
function f8()
{
var cnt = 0;
try {
throw "A"
asert(false)
} catch {
cnt++
}
let i = 0
const j = 0
try {
throw {}
asert(false)
} catch {
const i = 1.5
let j = 2
cnt += i * j
}
assert(i === 0)
assert(j === 0)
return cnt
}
try {
assert(f8() === 4)
} catch {
assert(false)
}