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

Side by Side Diff: test/mjsunit/es6/debug-promises/throw-with-undefined-reject.js

Issue 1491923003: Improve rendering of callsite with non-function target. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix tests Created 5 years 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
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | test/mjsunit/es6/debug-stepnext-for.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --expose-debug-as debug --allow-natives-syntax --promise-extra 5 // Flags: --expose-debug-as debug --allow-natives-syntax --promise-extra
6 6
7 // Test debug events when an exception is thrown inside a Promise, which is 7 // Test debug events when an exception is thrown inside a Promise, which is
8 // caught by a custom promise, which has no reject handler. 8 // caught by a custom promise, which has no reject handler.
9 // We expect two Exception debug events: 9 // We expect two Exception debug events:
10 // 1) when the exception is thrown in the promise q. 10 // 1) when the exception is thrown in the promise q.
(...skipping 30 matching lines...) Expand all
41 if (event == Debug.DebugEvent.Exception) { 41 if (event == Debug.DebugEvent.Exception) {
42 expected_events--; 42 expected_events--;
43 assertTrue(expected_events >= 0); 43 assertTrue(expected_events >= 0);
44 if (expected_events == 1) { 44 if (expected_events == 1) {
45 assertTrue( 45 assertTrue(
46 exec_state.frame(0).sourceLineText().indexOf('// event') > 0); 46 exec_state.frame(0).sourceLineText().indexOf('// event') > 0);
47 assertEquals("caught", event_data.exception().message); 47 assertEquals("caught", event_data.exception().message);
48 } else if (expected_events == 0) { 48 } else if (expected_events == 0) {
49 // All of the frames on the stack are from native Javascript. 49 // All of the frames on the stack are from native Javascript.
50 assertEquals(0, exec_state.frameCount()); 50 assertEquals(0, exec_state.frameCount());
51 assertEquals("undefined is not a function", 51 assertEquals("(var).reject is not a function",
52 event_data.exception().message); 52 event_data.exception().message);
53 } else { 53 } else {
54 assertUnreachable(); 54 assertUnreachable();
55 } 55 }
56 assertSame(q, event_data.promise()); 56 assertSame(q, event_data.promise());
57 } 57 }
58 } catch (e) { 58 } catch (e) {
59 %AbortJS(e + "\n" + e.stack); 59 %AbortJS(e + "\n" + e.stack);
60 } 60 }
61 } 61 }
(...skipping 14 matching lines...) Expand all
76 } 76 }
77 } catch (e) { 77 } catch (e) {
78 %AbortJS(e + "\n" + e.stack); 78 %AbortJS(e + "\n" + e.stack);
79 } 79 }
80 } 80 }
81 81
82 %EnqueueMicrotask(checkResult); 82 %EnqueueMicrotask(checkResult);
83 } 83 }
84 84
85 testDone(0); 85 testDone(0);
OLDNEW
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | test/mjsunit/es6/debug-stepnext-for.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698