954829b037
Added tests that I forgot to commit with big debug.js removal. TBR=dgozman@chromium.org Bug: none Change-Id: I518dd254af116d391a2af96a6f6c11da457129a1 Reviewed-on: https://chromium-review.googlesource.com/1086375 Reviewed-by: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Cr-Commit-Position: refs/heads/master@{#53507}
53 lines
1.8 KiB
JavaScript
53 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);
|
|
}
|
|
]);
|