v8/test/inspector/runtime/evaluate-repl-mode-code-cache.js
Simon Zünd e281dc303e Don't use the isolate compilation cache for REPL mode scripts
The compilation cache doesn't know about REPL mode. This means that
non-REPL mode compiled scripts are successfully found for their
REPL mode equivalent and vice versa.

This CL disables the compilation cache for REPL mode scripts.
Performance is not really a concern as DevTools console inputs
are usually very small.

R=leszeks@chromium.org

Bug: chromium:1108021
Change-Id: If396c7aa004188730762e4f6bd01dae2fc141181
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2434333
Commit-Queue: Simon Zünd <szuend@chromium.org>
Reviewed-by: Leszek Swirski <leszeks@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70160}
2020-09-28 13:25:56 +00:00

24 lines
908 B
JavaScript

// Copyright 2020 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 {Protocol} = InspectorTest.start(
"Tests that Runtime.evaluate's REPL mode correctly interacts with the compliation cache (crbug.com/1108021)");
(async function() {
InspectorTest.log('Prefill the cache with non-REPL mode script');
InspectorTest.logMessage(await Protocol.Runtime.evaluate({
expression: '5 + 3',
replMode: false,
}));
InspectorTest.log('REPL mode scripts always return a Promise.')
InspectorTest.log('The first script only returns "8" instead. When the inspector doesn\'t find a promise (due to a cache hit), it would respond with "undefined".');
InspectorTest.logMessage(await Protocol.Runtime.evaluate({
expression: '5 + 3',
replMode: true,
}));
InspectorTest.completeTest();
})();