2017-01-26 01:29:01 +00:00
|
|
|
// 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.
|
|
|
|
|
2018-06-20 17:31:04 +00:00
|
|
|
let {session, contextGroup, Protocol} = InspectorTest.start(
|
|
|
|
'Check that setScriptSource completes correctly when an exception is' +
|
|
|
|
' thrown.');
|
2017-01-26 01:29:01 +00:00
|
|
|
|
|
|
|
Protocol.Debugger.enable();
|
|
|
|
|
2018-06-20 17:31:04 +00:00
|
|
|
InspectorTest.runAsyncTestSuite([
|
|
|
|
async function testIncorrectScriptId() {
|
|
|
|
InspectorTest.logMessage(await Protocol.Debugger.setScriptSource(
|
|
|
|
{scriptId: '-1', scriptSource: '0'}));
|
2017-01-26 01:29:01 +00:00
|
|
|
},
|
|
|
|
|
2018-06-20 17:31:04 +00:00
|
|
|
async function testSourceWithSyntaxError() {
|
2017-05-19 00:35:45 +00:00
|
|
|
contextGroup.addScript('function foo() {}');
|
2018-06-20 17:31:04 +00:00
|
|
|
const {params} = await Protocol.Debugger.onceScriptParsed();
|
|
|
|
const msg = await Protocol.Debugger.setScriptSource({
|
|
|
|
scriptId: params.scriptId,
|
|
|
|
scriptSource: 'function foo() {\n return a # b;\n}'
|
|
|
|
});
|
|
|
|
InspectorTest.logMessage(msg);
|
2017-01-26 01:29:01 +00:00
|
|
|
}
|
|
|
|
]);
|