diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/jit-test/tests/environments/replace-global-var-with-getter.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/jit-test/tests/environments/replace-global-var-with-getter.js b/js/src/jit-test/tests/environments/replace-global-var-with-getter.js new file mode 100644 index 0000000000..f79948933a --- /dev/null +++ b/js/src/jit-test/tests/environments/replace-global-var-with-getter.js @@ -0,0 +1,13 @@ +let assert = assertEq; + +this.x = "OK"; + +for (let i = 0; i < 50; i++) { + assert(x, "OK"); + if (i === 40) { + this.x = "FAIL"; + Object.defineProperty(this, "x", { + get() { return "OK"; } + }); + } +} |