From d627042fa6ea69d2676ea1549f99eacaa6756408 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 30 Nov 2016 23:19:34 -0800 Subject: [PATCH] Fix javascript error test A single line with two function declarations now parses successfully, so to create the desired error recovery scenario, wrap the two functions in an assignment --- spec/fixtures/error_corpus/javascript_errors.txt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/spec/fixtures/error_corpus/javascript_errors.txt b/spec/fixtures/error_corpus/javascript_errors.txt index c308e443..87ae22a8 100644 --- a/spec/fixtures/error_corpus/javascript_errors.txt +++ b/spec/fixtures/error_corpus/javascript_errors.txt @@ -43,7 +43,7 @@ one invalid subtree right after the viable prefix =================================================== if ({a: 'b'} {c: 'd'}) { - function(a) { b; } function(c) { d; } + x = function(a) { b; } function(c) { d; } } --- @@ -53,13 +53,14 @@ if ({a: 'b'} {c: 'd'}) { (object (pair (identifier) (string))) (ERROR (object (pair (identifier) (string)))) (statement_block - (ERROR (function - (formal_parameters (identifier)) - (statement_block (expression_statement (identifier))))) - (expression_statement + (expression_statement (assignment + (identifier) + (ERROR (function + (formal_parameters (identifier)) + (statement_block (expression_statement (identifier))))) (function (formal_parameters (identifier)) - (statement_block (expression_statement (identifier)))))))) + (statement_block (expression_statement (identifier))))))))) =================================================== one invalid token at the end of the file