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 <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Joyee Cheung <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Benjamin Gruenbaum <[email protected]>
Reviewed-By: Tobias Nießen <[email protected]>
  • 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.