| OLD | NEW |
| 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 | 5 // Flags: --expose-debug-as debug --allow-natives-syntax |
| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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("undefined 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 assertEquals(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 } |
| 62 | 62 |
| 63 Debug.setBreakOnUncaughtException(); | 63 Debug.setBreakOnUncaughtException(); |
| 64 Debug.setListener(listener); | 64 Debug.setListener(listener); |
| 65 | 65 |
| 66 log.push("end main"); | 66 log.push("end main"); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 79 } | 79 } |
| 80 } | 80 } |
| 81 | 81 |
| 82 // Run testDone through the Object.observe processing loop. | 82 // Run testDone through the Object.observe processing loop. |
| 83 var dummy = {}; | 83 var dummy = {}; |
| 84 Object.observe(dummy, checkResult); | 84 Object.observe(dummy, checkResult); |
| 85 dummy.dummy = dummy; | 85 dummy.dummy = dummy; |
| 86 } | 86 } |
| 87 | 87 |
| 88 testDone(0); | 88 testDone(0); |
| OLD | NEW |