codegen: throw type error when encountering an unknown argument

This commit is contained in:
Gregory Terzian 2019-09-05 00:18:58 +08:00
parent 39bd45529d
commit 5149aefd85
2 changed files with 7 additions and 2 deletions

View file

@ -492,7 +492,7 @@ class CGMethodCall(CGThing):
else: else:
# Just throw; we have no idea what we're supposed to # Just throw; we have no idea what we're supposed to
# do with this. # do with this.
caseBody.append(CGGeneric("throw_internal_error(*cx, \"Could not convert JavaScript argument\");\n" caseBody.append(CGGeneric("throw_type_error(*cx, \"Could not convert JavaScript argument\");\n"
"return false;")) "return false;"))
argCountCases.append(CGCase(str(argCount), argCountCases.append(CGCase(str(argCount),

View file

@ -1,2 +1,7 @@
[iirfilter.html] [iirfilter.html]
expected: CRASH expected: ERROR
[X createIIRFilter with unnormalized coefficients incorrectly threw TypeError: \"context.createIIRFilter is not a function\".]
expected: FAIL
[X createIIRFilter with normalized coefficients incorrectly threw TypeError: \"context.createIIRFilter is not a function\".]
expected: FAIL