diff options
Diffstat (limited to 'deps/v8/test/inspector/debugger/break-on-exception-compiler-errors.js')
-rw-r--r-- | deps/v8/test/inspector/debugger/break-on-exception-compiler-errors.js | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/deps/v8/test/inspector/debugger/break-on-exception-compiler-errors.js b/deps/v8/test/inspector/debugger/break-on-exception-compiler-errors.js new file mode 100644 index 0000000000..2501e58988 --- /dev/null +++ b/deps/v8/test/inspector/debugger/break-on-exception-compiler-errors.js @@ -0,0 +1,52 @@ +// Copyright 2018 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. + +let {session, contextGroup, Protocol} = InspectorTest.start( + 'Break on exceptions from compiler errors.'); + +Protocol.Debugger.enable(); +Protocol.Debugger.setPauseOnExceptions({state: 'all'}); +Protocol.Debugger.onPaused(({params:{data}}) => { + InspectorTest.log('paused on exception:'); + InspectorTest.logMessage(data); + Protocol.Debugger.resume(); +}); + +InspectorTest.runAsyncTestSuite([ + async function testUnexpectedEndOfInput() { + InspectorTest.log(`Runs '+++'`); + let {result:{exceptionDetails}} = await Protocol.Runtime.evaluate({ + expression: '+++' + }); + InspectorTest.log('Runtime.evaluate exceptionDetails:'); + InspectorTest.logMessage(exceptionDetails); + }, + + async function testUnexpectedIdentifier() { + InspectorTest.log(`Runs 'x x'`); + let {result:{exceptionDetails}} = await Protocol.Runtime.evaluate({ + expression: 'x x' + }); + InspectorTest.log('Runtime.evaluate exceptionDetails:'); + InspectorTest.logMessage(exceptionDetails); + }, + + async function testEvalUnexpectedEndOfInput() { + InspectorTest.log(`Runs eval('+++')`); + let {result:{exceptionDetails}} = await Protocol.Runtime.evaluate({ + expression: `eval('+++')` + }); + InspectorTest.log('Runtime.evaluate exceptionDetails:'); + InspectorTest.logMessage(exceptionDetails); + }, + + async function testEvalUnexpectedIdentifier() { + InspectorTest.log(`Runs eval('x x')`); + let {result:{exceptionDetails}} = await Protocol.Runtime.evaluate({ + expression: `eval('x x')` + }); + InspectorTest.log('Runtime.evaluate exceptionDetails:'); + InspectorTest.logMessage(exceptionDetails); + } +]); |