summaryrefslogtreecommitdiffstats
path: root/js/src/tests/js1_8_5/reflect-parse/lexicals.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/js1_8_5/reflect-parse/lexicals.js')
-rw-r--r--js/src/tests/js1_8_5/reflect-parse/lexicals.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/tests/js1_8_5/reflect-parse/lexicals.js b/js/src/tests/js1_8_5/reflect-parse/lexicals.js
new file mode 100644
index 000000000..c42c43c32
--- /dev/null
+++ b/js/src/tests/js1_8_5/reflect-parse/lexicals.js
@@ -0,0 +1,19 @@
+// |reftest| skip-if(!xulRuntime.shell)
+function test() {
+
+// global let is var
+assertGlobalDecl("let {x:y} = foo;", letDecl([{ id: objPatt([assignProp("x", ident("y"))]),
+ init: ident("foo") }]));
+// function-global let is let
+assertLocalDecl("let {x:y} = foo;", letDecl([{ id: objPatt([assignProp("x", ident("y"))]),
+ init: ident("foo") }]));
+// block-local let is let
+assertBlockDecl("let {x:y} = foo;", letDecl([{ id: objPatt([assignProp("x", ident("y"))]),
+ init: ident("foo") }]));
+
+assertDecl("const {x:y} = foo;", constDecl([{ id: objPatt([assignProp("x", ident("y"))]),
+ init: ident("foo") }]));
+
+}
+
+runtest(test);