OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 print('Checks that Debugger.setScriptSource doesn\'t crash with modules'); |
| 6 |
| 7 var module1 = ` |
| 8 export function foo() { |
| 9 return 42; |
| 10 }`; |
| 11 |
| 12 var editedModule1 = ` |
| 13 export function foo() { |
| 14 return 239; |
| 15 }`; |
| 16 |
| 17 var module2 = ` |
| 18 import { foo } from 'module1'; |
| 19 console.log(foo()); |
| 20 `; |
| 21 |
| 22 var module1Id; |
| 23 Protocol.Debugger.onScriptParsed(message => { |
| 24 if (message.params.url === 'module1') |
| 25 module1Id = message.params.scriptId; |
| 26 }); |
| 27 Protocol.Debugger.enable() |
| 28 .then(() => InspectorTest.addModule(module1, 'module1')) |
| 29 .then(() => InspectorTest.addModule(module2, 'module2')) |
| 30 .then(() => InspectorTest.waitPendingTasks()) |
| 31 .then(() => Protocol.Debugger.setScriptSource({ scriptId: module1Id, scriptSou
rce: editedModule1 })) |
| 32 .then(InspectorTest.logMessage) |
| 33 .then(InspectorTest.completeTest); |
OLD | NEW |