OLD | NEW |
1 description( | 1 description( |
2 "Tests that DFG custom getter caching does not break the world if the getter thr
ows an exception." | 2 "Tests that DFG custom getter caching does not break the world if the getter thr
ows an exception." |
3 ); | 3 ); |
4 | 4 |
5 function foo(x) { | 5 function foo(x) { |
6 return x.status; | 6 return x.status; |
7 } | 7 } |
8 | 8 |
9 function bar(doOpen) { | 9 function bar(doOpen) { |
10 var x = new XMLHttpRequest(); | 10 var x = new XMLHttpRequest(); |
11 if (doOpen) | 11 if (doOpen) |
12 x.open("GET", "http://foo.bar.com/"); | 12 x.open("GET", "http://foo.bar.com/"); |
13 try { | 13 try { |
14 return "Returned result: " + foo(x); | 14 return "Returned result: " + foo(x); |
15 } catch (e) { | 15 } catch (e) { |
16 return "Threw exception: " + e; | 16 return "Threw exception: " + e; |
17 } | 17 } |
18 } | 18 } |
19 | 19 |
20 for (var i = 0; i < 200; ++i) { | 20 for (var i = 0; i < 200; ++i) { |
21 shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: InvalidStateError:
An attempt was made to use an object that is not, or is no longer, usable.\"" :
"\"Returned result: 0\""); | 21 shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: InvalidStateError:
Failed to read the 'status' property from 'XMLHttpRequest': the object's state m
ust not be OPENED.\"" : "\"Returned result: 0\""); |
22 } | 22 } |
23 | 23 |
24 | 24 |
OLD | NEW |