| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 1a9ca52 commit 791a85b
5 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -36,7 +36,7 @@ | |||
| 36 | 36 | ||
| 37 | 37 | # Reset this number to 0 on major V8 upgrades. | |
| 38 | 38 | # Increment by one for each non-official patch applied to deps/v8. | |
| 39 | - 'v8_embedder_string': '-node.15', | ||
| 39 | + 'v8_embedder_string': '-node.16', | ||
| 40 | 40 | ||
| 41 | 41 | ##### V8 defaults for Node.js ##### | |
| 42 | 42 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -473,6 +473,7 @@ bool BytecodeHasNoSideEffect(interpreter::Bytecode bytecode) { | |||
| 473 | 473 | case Bytecode::kToNumeric: | |
| 474 | 474 | case Bytecode::kToString: | |
| 475 | 475 | // Misc. | |
| 476 | + case Bytecode::kIncBlockCounter: // Coverage counters. | ||
| 476 | 477 | case Bytecode::kForInEnumerate: | |
| 477 | 478 | case Bytecode::kForInPrepare: | |
| 478 | 479 | case Bytecode::kForInContinue: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,3 @@ | |||
| 1 | + Tests side-effect-free evaluation with coverage enabled | ||
| 2 | + Paused on 'debugger;' | ||
| 3 | + f() returns 1 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,43 @@ | |||
| 1 | + // Copyright 2020 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 | + let {session, contextGroup, Protocol} = InspectorTest.start('Tests side-effect-free evaluation with coverage enabled'); | ||
| 6 | + | ||
| 7 | + contextGroup.addScript(` | ||
| 8 | + function testFunction() | ||
| 9 | + { | ||
| 10 | + var o = 0; | ||
| 11 | + function f() { return 1; } | ||
| 12 | + function g() { o = 2; return o; } | ||
| 13 | + f,g; | ||
| 14 | + debugger; | ||
| 15 | + } | ||
| 16 | + //# sourceURL=foo.js`); | ||
| 17 | + | ||
| 18 | + // Side effect free call should not result in EvalError when coverage | ||
| 19 | + // is enabled: | ||
| 20 | + Protocol.Profiler.enable() | ||
| 21 | + Protocol.Profiler.startPreciseCoverage({callCount: true, detailed: true}) | ||
| 22 | + | ||
| 23 | + Protocol.Debugger.enable(); | ||
| 24 | + | ||
| 25 | + Protocol.Debugger.oncePaused().then(debuggerPaused); | ||
| 26 | + | ||
| 27 | + Protocol.Runtime.evaluate({ "expression": "setTimeout(testFunction, 0)" }); | ||
| 28 | + | ||
| 29 | + var topFrameId; | ||
| 30 | + | ||
| 31 | + function debuggerPaused(messageObject) | ||
| 32 | + { | ||
| 33 | + InspectorTest.log("Paused on 'debugger;'"); | ||
| 34 | + | ||
| 35 | + topFrameId = messageObject.params.callFrames[0].callFrameId; | ||
| 36 | + Protocol.Debugger.evaluateOnCallFrame({ callFrameId: topFrameId, expression: "f()", throwOnSideEffect: true}).then(evaluatedFirst); | ||
| 37 | + } | ||
| 38 | + | ||
| 39 | + function evaluatedFirst(response) | ||
| 40 | + { | ||
| 41 | + InspectorTest.log("f() returns " + response.result.result.value); | ||
| 42 | + InspectorTest.completeTest(); | ||
| 43 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,6 +33,7 @@ | |||
| 33 | 33 | 'debugger/eval-scopes': [PASS, FAIL], | |
| 34 | 34 | 'debugger/scope-skip-variables-with-empty-name': [PASS, FAIL], | |
| 35 | 35 | 'debugger/update-call-frame-scopes': [PASS, FAIL], | |
| 36 | + 'debugger/side-effect-free-coverage-enabled': [PASS, FAIL], | ||
| 36 | 37 | 'debugger/side-effect-free-debug-evaluate': [PASS, FAIL], | |
| 37 | 38 | 'debugger/evaluate-on-call-frame-in-module': [PASS, FAIL], | |
| 38 | 39 | }], # variant != default | |
| Back | FazBrowse Home | New Git URL |
0 commit comments