Bug 1921963 part 1 - Use JS::ReportUncatchableException more outside the JS engine...
[gecko.git] / js / src / tests / non262 / global / bug-320887.js
blob5e8d3445abd86575620329c7b33d08e3fde4f1b5
1 // `var x` should not call the getter of an existing global property.
3 var hit = 0;
4 Object.defineProperty(this, "x", {
5     get: function () { return ++hit; },
6     configurable: true
7 });
8 eval("var x;");
9 assertEq(hit, 0);
11 // The declaration should not have redefined the global x, either.
12 assertEq(x, 1);
13 assertEq(x, 2);
15 reportCompare(0, 0);