Skip to content

Commit

Permalink
test: make test-repl-syntax-error-stack agnostic
Browse files Browse the repository at this point in the history
Revise test so that it does not depend on behavior specific to V8.

PR-URL: #16272
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
  • Loading branch information
Trott authored and evanlucas committed Nov 13, 2017
1 parent c81b086 commit f8337ce
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/parallel/test-repl-syntax-error-stack.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ process.on('exit', () => {
});

common.ArrayStream.prototype.write = function(output) {
if (/var foo bar;/.test(output))
// Matching only on a minimal piece of the stack because the string will vary
// greatly depending on the JavaScript engine. V8 includes `;` because it
// displays the line of code (`var foo bar;`) that is causing a problem.
// ChakraCore does not display the line of code but includes `;` in the phrase
// `Expected ';' `.
if (/;/.test(output))
found = true;
};

Expand Down

0 comments on commit f8337ce

Please sign in to comment.