Bug 1285710 - Add testcase for error message for redeclaration error. r=shu
authorTooru Fujisawa <arai_a@mac.com>
Tue, 15 Nov 2016 13:00:50 +0900
changeset 350568 e725cf00b32e304c50e4df8614cf01dfb49c095d
parent 350567 5af892c2f0a1f78fe5cb02c90b61f6fb094b832f
child 350569 be0a409b178acc10fc89b0d528c78a03755d89e4
push id10621
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 16:02:43 +0000
treeherdermozilla-aurora@dca7b42e6c67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersshu
bugs1285710
milestone52.0a1
Bug 1285710 - Add testcase for error message for redeclaration error. r=shu
js/src/jit-test/tests/parser/redeclaration-message.js
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/parser/redeclaration-message.js
@@ -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");
+}