2020-01-20 11:14:11 +00:00
|
|
|
Tests that Runtime.evaluate with REPL mode correctly detects side-effects.
|
|
|
|
Test "let" declaration is side-effecting
|
2020-01-22 13:26:10 +00:00
|
|
|
{
|
|
|
|
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
|
2020-01-20 11:14:11 +00:00
|
|
|
{
|
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-27 09:29:59 +00:00
|
|
|
Test "const" with side-effects works afterwards
|
|
|
|
{
|
|
|
|
id : <messageId>
|
|
|
|
result : {
|
|
|
|
result : {
|
|
|
|
type : undefined
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-01-20 11:14:11 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|