mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 09:15:35 +00:00
Bug 1285710 - Add testcase for error message for redeclaration error. r=shu
This commit is contained in:
parent
7f263d232a
commit
6db3eda41a
10
js/src/jit-test/tests/parser/redeclaration-message.js
Normal file
10
js/src/jit-test/tests/parser/redeclaration-message.js
Normal file
@ -0,0 +1,10 @@
|
||||
var aVar = 56;
|
||||
try {
|
||||
console.log(aLet);
|
||||
let aLet = 56;
|
||||
// We cannot add `caught` variable on the toplevel for this testcase.
|
||||
// We use assertEq here to catch non-throwing case.
|
||||
assertEq(true, false);
|
||||
} catch (e) {
|
||||
assertEq(e.message, "can't access lexical declaration `aLet' before initialization");
|
||||
}
|
Loading…
Reference in New Issue
Block a user