Mauro Bringolf 92fc26d399 Remove check-constants plugin (#6987)
* Rebased onto new version

* Moved constants check into a separate method
2018-01-26 10:43:09 -05:00

13 lines
247 B
JavaScript

function f(arr) {
const MULTIPLIER = 5;
for (MULTIPLIER in arr);
return 'survived';
}
assert.throws(function() {
f([1,2,3]);
}, '"MULTIPLIER" is read-only');
assert.equal(f([]), 'survived', 'For-in over empty array should not throw.');