| Index: test.js
|
| diff --git a/test.js b/test.js
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..53b1b3a468e6ed9de0a812a8f2eae47ad2bf34d9
|
| --- /dev/null
|
| +++ b/test.js
|
| @@ -0,0 +1,26 @@
|
| +// Copyright 2017 the V8 project authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +// Run this test with
|
| +// d8 test/mjsunit/mjsunit.js test/debugger/test-api.js --allow-natives-syntax --enable-inspector test.js
|
| +
|
| +let exception = null;
|
| +let named_object = new NamedObject();
|
| +
|
| +function listener(event, exec_state, event_data, data) {
|
| + if (event != Debug.DebugEvent.Break) return;
|
| + try {
|
| + print(JSON.stringify(exec_state.frame().evaluate("named_object").value()));
|
| + } catch (e) {
|
| + exception = e;
|
| + }
|
| +}
|
| +
|
| +let Debug = debug.Debug;
|
| +Debug.setListener(listener);
|
| +
|
| +debugger;
|
| +
|
| +Debug.setListener(null);
|
| +assertNull(exception);
|
|
|