mirror of
https://github.com/nodejs/node.git
synced 2025-08-18 15:18:46 +02:00

PR-URL: https://github.com/nodejs/node/pull/21983 Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Ujjwal Sharma <usharma1998@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
52 lines
1.8 KiB
JavaScript
52 lines
1.8 KiB
JavaScript
// 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);
|
|
}
|
|
]);
|