1d4292bb68
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/+/2013114 Reviewed-by: Simon Zünd <szuend@chromium.org> Commit-Queue: Peter Marshall <petermarshall@chromium.org> Cr-Commit-Position: refs/heads/master@{#65916}
88 lines
2.1 KiB
Plaintext
88 lines
2.1 KiB
Plaintext
Tests that Runtime.evaluate with REPL mode correctly detects side-effects.
|
|
Test "let" 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 "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>
|
|
result : {
|
|
result : {
|
|
description : 3
|
|
type : number
|
|
value : 3
|
|
}
|
|
}
|
|
}
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
type : string
|
|
value : hello REPL
|
|
}
|
|
}
|
|
}
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
className : Promise
|
|
description : Promise
|
|
objectId : <objectId>
|
|
subtype : promise
|
|
type : object
|
|
}
|
|
}
|
|
}
|