parent
fa912c246c
commit
f1722a280c
@ -273,6 +273,7 @@ function REPLServer(prompt, stream, eval_, useGlobal, ignoreUndefined) {
|
||||
return e && e.match(/^SyntaxError/) &&
|
||||
// RegExp syntax error
|
||||
!e.match(/^SyntaxError: Invalid regular expression/) &&
|
||||
!e.match(/^SyntaxError: Invalid flags supplied to RegExp constructor/) &&
|
||||
// JSON.parse() error
|
||||
!(e.match(/^SyntaxError: Unexpected token .*\n/) &&
|
||||
e.match(/\n at Object.parse \(native\)\n/));
|
||||
|
@ -130,6 +130,10 @@ function error_test() {
|
||||
// should throw
|
||||
{ client: client_unix, send: '/(/;',
|
||||
expect: /^SyntaxError: Invalid regular expression\:/ },
|
||||
// invalid RegExp modifiers are a special case of syntax error,
|
||||
// should throw (GH-4012)
|
||||
{ client: client_unix, send: 'new RegExp("foo", "wrong modifier");',
|
||||
expect: /^SyntaxError: Invalid flags supplied to RegExp constructor/ },
|
||||
// Named functions can be used:
|
||||
{ client: client_unix, send: 'function blah() { return 1; }',
|
||||
expect: prompt_unix },
|
||||
|
Loading…
x
Reference in New Issue
Block a user