blob: c42c43c32f31488de42872f6e642dfa2f48dae50 [file] [log] [blame]
// |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);