Skip to content

Commit f8337ce

Browse files
Trottevanlucas
authored andcommitted
test: make test-repl-syntax-error-stack agnostic
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]>
1 parent c81b086 commit f8337ce

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/parallel/test-repl-syntax-error-stack.js

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ process.on('exit', () => {
1111
});
1212

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

0 commit comments

Comments
 (0)