Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / js / script-tests / dfg-custom-getter-throw-inlined.js
blob8cbdc7fc6d5ea68d83f3c380d7619859fc1dc5ec
1 description(
2 "Tests that DFG custom getter caching does not break the world if the getter throws an exception from inlined code."
3 );
5 function foo(x) {
6 return x.responseText;
9 function baz(x) {
10 return foo(x);
13 function bar(binary) {
14 var x = new XMLHttpRequest();
15 x.open("GET", "http://foo.bar.com/");
16 if (binary)
17 x.responseType = "arraybuffer";
18 try {
19 return "Returned result: " + baz(x);
20 } catch (e) {
21 return "Threw exception: " + e;
25 for (var i = 0; i < 200; ++i) {
26 shouldBe("bar(i >= 100)", i >= 100 ? "\"Threw exception: InvalidStateError: Failed to read the 'responseText' property from 'XMLHttpRequest': The value is only accessible if the object's 'responseType' is '' or 'text' (was 'arraybuffer').\"" : "\"Returned result: \"");