Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(291)

Side by Side Diff: LayoutTests/fast/js/script-tests/dfg-custom-getter-throw-inlined.js

Issue 23041002: Improve 'XMLHttpRequest' exception messages. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ExceptionMessages. Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 description( 1 description(
2 "Tests that DFG custom getter caching does not break the world if the getter thr ows an exception from inlined code." 2 "Tests that DFG custom getter caching does not break the world if the getter thr ows an exception from inlined code."
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 baz(x) { 9 function baz(x) {
10 return foo(x); 10 return foo(x);
11 } 11 }
12 12
13 function bar(doOpen) { 13 function bar(doOpen) {
14 var x = new XMLHttpRequest(); 14 var x = new XMLHttpRequest();
15 if (doOpen) 15 if (doOpen)
16 x.open("GET", "http://foo.bar.com/"); 16 x.open("GET", "http://foo.bar.com/");
17 try { 17 try {
18 return "Returned result: " + baz(x); 18 return "Returned result: " + baz(x);
19 } catch (e) { 19 } catch (e) {
20 return "Threw exception: " + e; 20 return "Threw exception: " + e;
21 } 21 }
22 } 22 }
23 23
24 for (var i = 0; i < 200; ++i) { 24 for (var i = 0; i < 200; ++i) {
25 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\""); 25 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\"");
26 } 26 }
27 27
28 28
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698