summaryrefslogtreecommitdiffstats
path: root/js/src/tests/ecma_6/LexicalEnvironment/unscopables-const.js
blob: 7e1d0e07c6f10288ae2dad5e4d7cf17d3c68da7c (plain)
1
2
3
4
5
6
7
8
// @@unscopables prevents a property from having any effect on assigning to a
// const binding (which is an error).

const x = 1;
with ({x: 1, [Symbol.unscopables]: {x: true}})
    assertThrowsInstanceOf(() => {x = 2;}, TypeError);

reportCompare(0, 0);