e99d4e77be
This CL fixes a parser crash in REPL mode. Some SyntaxErrors can cause the AST to contain NULL nodes, resulting in a crash when we want to rewrite the AST after parsing. Instead of re-writing a broken AST we bail early. R=leszeks@chromium.org Bug: chromium:1040034, chromium:1045758 Change-Id: I9c559f6de5969c8db17833ccbdb1608627b46311 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2023547 Reviewed-by: Leszek Swirski <leszeks@chromium.org> Commit-Queue: Simon Zünd <szuend@chromium.org> Cr-Commit-Position: refs/heads/master@{#66008}
66 lines
1.3 KiB
Plaintext
66 lines
1.3 KiB
Plaintext
Tests that Runtime.evaluate works with REPL mode.
|
|
Test 'let' re-declaration
|
|
SyntaxError in REPL mode does not crash the parser
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
type : undefined
|
|
}
|
|
}
|
|
}
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
description : 21
|
|
type : number
|
|
value : 21
|
|
}
|
|
}
|
|
}
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
type : undefined
|
|
}
|
|
}
|
|
}
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
description : 42
|
|
type : number
|
|
value : 42
|
|
}
|
|
}
|
|
}
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
exceptionDetails : {
|
|
columnNumber : 10
|
|
exception : {
|
|
className : SyntaxError
|
|
description : SyntaxError: Unexpected token 'const'
|
|
objectId : <objectId>
|
|
subtype : error
|
|
type : object
|
|
}
|
|
exceptionId : <exceptionId>
|
|
lineNumber : 0
|
|
scriptId : <scriptId>
|
|
text : Uncaught
|
|
}
|
|
result : {
|
|
className : SyntaxError
|
|
description : SyntaxError: Unexpected token 'const'
|
|
objectId : <objectId>
|
|
subtype : error
|
|
type : object
|
|
}
|
|
}
|
|
}
|