Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / script-tests / implicit-call-with-global-reentry.js
blob79f78e62c9a156cb9e7319fa3ea0971796d78848
1 description(
2 "This test checks that implicit reentry to global code through a getter does not clobber the calling register file."
3 );
5 var testVar = "FAIL";
6 function testGlobalCode(test) {
7 document.write("<script>"+test+"<"+"/script>");
9 var testObject = {
10 get getterTest(){ testGlobalCode("var a, b, c, d; testVar = 'PASS';"); },
11 set setterTest(_){ testGlobalCode("var e, f, g, h; testVar = 'PASS';"); },
12 toString: function() { testGlobalCode("var i, j, k, l; testVar = 'PASS';"); return ''; },
13 valueOf: function() { testGlobalCode("var m, n, o, p; testVar = 'PASS';"); return 0; },
14 toStringTest: function() { "" + this; },
15 valueOfTest: function() { 0 * this; }
18 shouldBe("testObject.getterTest; testVar;", '"PASS"');
19 var testVar = "FAIL";
20 shouldBe("testObject.setterTest = 1; testVar;", '"PASS"');
21 var testVar = "FAIL";
22 shouldBe("testObject.toStringTest(); testVar;", '"PASS"');
23 var testVar = "FAIL";
24 shouldBe("testObject.valueOfTest(); testVar;", '"PASS"');