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
3 // found in the LICENSE file.
5 // Flags: --expose-debug-as debug --allow-natives-syntax
7 // Test debug events when we only listen to uncaught exceptions and
8 // there is a catch handler for the exception thrown in a Promise.
9 // We expect no debug event to be triggered.
13 var p = new Promise(function(resolve, reject) {
19 throw new Error("caught throw");
24 assertEquals("caught throw", e.message);
27 function listener(event, exec_state, event_data, data) {
29 assertTrue(event != Debug.DebugEvent.Exception);
31 %AbortJS(e + "\n" + e.stack);
35 Debug.setBreakOnUncaughtException();
36 Debug.setListener(listener);