mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 1 | description( |
| 2 | "This test checks that implicit reentry to global code through a getter does not clobber the calling register file." |
| 3 | ); |
| 4 | |
| 5 | var testVar = "FAIL"; |
| 6 | function testGlobalCode(test) { |
| 7 | document.write("<script>"+test+"<"+"/script>"); |
| 8 | } |
| 9 | var testObject = { |
| 10 | get getterTest(){ testGlobalCode("var a, b, c, d; testVar = 'PASS';"); }, |
joepeck@webkit.org | 1912334 | 2015-03-25 04:20:30 +0000 | [diff] [blame] | 11 | set setterTest(x){ testGlobalCode("var e, f, g, h; testVar = 'PASS';"); }, |
mrowe@apple.com | 2f6dfdf | 2008-05-22 01:20:45 +0000 | [diff] [blame] | 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; } |
| 16 | }; |
| 17 | |
| 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"'); |