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

Side by Side Diff: LayoutTests/fast/js/script-tests/dfg-custom-getter-throw.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." 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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698