forked from v8/v8
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
inspector: allow es6 module liveedit
After total liveedit rewrite, liveedit works with module, we can remove the guard. [email protected] Bug: chromium:806261 Cq-Include-Trybots: luci.chromium.try:linux_chromium_headless_rel;master.tryserver.blink:linux_trusty_blink_rel Change-Id: Ide15eca2ab6d8ba7df4e7fae541c4a65794eeea8 Reviewed-on: https://chromium-review.googlesource.com/1238914 Reviewed-by: Dmitry Gozman <[email protected]> Commit-Queue: Aleksey Kozyatinskiy <[email protected]> Cr-Commit-Position: refs/heads/master@{#56151}
- Loading branch information
Showing
6 changed files
with
67 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Checks liveedit with ES6 modules. | ||
console.log message from function before patching: | ||
{ | ||
type : string | ||
value : module1 | ||
} | ||
Debugger.setScriptSource result: | ||
{ | ||
callFrames : [ | ||
] | ||
stackChanged : false | ||
} | ||
console.log message from function after patching: | ||
{ | ||
type : string | ||
value : patched module1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
// 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. | ||
|
||
const {session, contextGroup, Protocol} = | ||
InspectorTest.start('Checks liveedit with ES6 modules.'); | ||
|
||
const moduleSource = ` | ||
export function foo() { | ||
console.log('module1'); | ||
return 42; | ||
} | ||
foo()`; | ||
|
||
const newModuleSource = ` | ||
export function foo() { | ||
console.log('patched module1'); | ||
return 42; | ||
} | ||
foo()`; | ||
|
||
const callFooSource = ` | ||
import { foo } from 'module'; | ||
foo();`; | ||
|
||
(async function test() { | ||
await Protocol.Runtime.enable(); | ||
await Protocol.Debugger.enable(); | ||
contextGroup.addModule(moduleSource, 'module'); | ||
const [{ params: { scriptId } }, { params: { args }}] = [ | ||
await Protocol.Debugger.onceScriptParsed(), | ||
await Protocol.Runtime.onceConsoleAPICalled() | ||
]; | ||
InspectorTest.log('console.log message from function before patching:') | ||
InspectorTest.logMessage(args[0]); | ||
|
||
const {result} = await Protocol.Debugger.setScriptSource({ | ||
scriptId, | ||
scriptSource: newModuleSource | ||
}); | ||
InspectorTest.log('Debugger.setScriptSource result:'); | ||
InspectorTest.logMessage(result); | ||
|
||
contextGroup.addModule(callFooSource, 'callFoo'); | ||
const { params: {args: patchedArgs } } = | ||
await Protocol.Runtime.onceConsoleAPICalled(); | ||
InspectorTest.log('console.log message from function after patching:') | ||
InspectorTest.logMessage(patchedArgs[0]); | ||
InspectorTest.completeTest(); | ||
})() |
8 changes: 0 additions & 8 deletions
8
test/inspector/debugger/es6-module-set-script-source-expected.txt
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.