lexicals.js (808B)
1 // |reftest| skip-if(!xulRuntime.shell) 2 function test() { 3 4 // global let is var 5 assertGlobalDecl("let {x:y} = foo;", letDecl([{ id: objPatt([assignProp("x", ident("y"))]), 6 init: ident("foo") }])); 7 // function-global let is let 8 assertLocalDecl("let {x:y} = foo;", letDecl([{ id: objPatt([assignProp("x", ident("y"))]), 9 init: ident("foo") }])); 10 // block-local let is let 11 assertBlockDecl("let {x:y} = foo;", letDecl([{ id: objPatt([assignProp("x", ident("y"))]), 12 init: ident("foo") }])); 13 14 assertDecl("const {x:y} = foo;", constDecl([{ id: objPatt([assignProp("x", ident("y"))]), 15 init: ident("foo") }])); 16 17 } 18 19 runtest(test);