Commit 1d4292bb authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[inspector] Add test that const declaration is side-effecting

Add a test that const declarations are recognized as having side-
effects in REPL mode.

Bug: chromium:1043151
Change-Id: I6f8038ab4a5ee446d23904ed46637223157db5c7
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2013114Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#65916}
parent 78176faf
......@@ -26,6 +26,33 @@ Test "let" declaration is side-effecting
}
}
}
Test "const" declaration is side-effecting
{
id : <messageId>
result : {
exceptionDetails : {
columnNumber : -1
exception : {
className : EvalError
description : EvalError: Possible side-effect in debug-evaluate
objectId : <objectId>
subtype : error
type : object
}
exceptionId : <exceptionId>
lineNumber : -1
scriptId : <scriptId>
text : Uncaught
}
result : {
className : EvalError
description : EvalError: Possible side-effect in debug-evaluate
objectId : <objectId>
subtype : error
type : object
}
}
}
Test side-effect free expressions can be eagerly evaluated
{
id : <messageId>
......
......@@ -10,6 +10,9 @@ Protocol.Runtime.enable();
InspectorTest.log('Test "let" declaration is side-effecting');
await evaluateRepl('let x = 21;');
InspectorTest.log('Test "const" declaration is side-effecting');
await evaluateRepl('const y = 42;');
InspectorTest.log('Test side-effect free expressions can be eagerly evaluated');
await evaluateRepl('1 + 2');
await evaluateRepl('"hello " + "REPL"');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment