Skip to content

Commit

Permalink
test: adapt test-repl to V8 9.5
Browse files Browse the repository at this point in the history
Syntax errors for RegExp literals now show hint to error location.

PR-URL: #40178
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
  • Loading branch information
targos committed Oct 12, 2021
1 parent d7b9b9f commit 842fd23
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/parallel/test-repl.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ async function runReplTests(socket, prompt, tests) {

console.error('in:', JSON.stringify(actualLine));

// Match a string directly, or a RegExp through .test().
// Match a string directly, or a RegExp.
if (typeof expectedLine === 'string') {
assert.strictEqual(actualLine, expectedLine);
} else {
Expand Down Expand Up @@ -226,7 +226,12 @@ const errorTests = [
// should throw
{
send: '/(/;',
expect: [/^Uncaught SyntaxError: /]
expect: [
kSource,
kArrow,
'',
/^Uncaught SyntaxError: /,
]
},
// invalid RegExp modifiers are a special case of syntax error,
// should throw (GH-4012)
Expand Down

0 comments on commit 842fd23

Please sign in to comment.