| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f8337ce commit 835ca63
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -72,7 +72,7 @@ function clean_up() { | |||
| 72 | 72 | function strict_mode_error_test() { | |
| 73 | 73 | send_expect([ | |
| 74 | 74 | { client: client_unix, send: 'ref = 1', | |
| 75 | - expect: /^ReferenceError:\sref\sis\snot\sdefined\nnode via Unix socket> $/ }, | ||
| 75 | + expect: /^ReferenceError:\s/ }, | ||
| 76 | 76 | ]); | |
| 77 | 77 | } | |
| 78 | 78 | ||
@@ -143,7 +143,7 @@ function error_test() { | |||
| 143 | 143 | expect: prompt_unix }, | |
| 144 | 144 | // But passing the same string to eval() should throw | |
| 145 | 145 | { client: client_unix, send: 'eval("function test_func() {")', | |
| 146 | - expect: /^SyntaxError: Unexpected end of input/ }, | ||
| 146 | + expect: /^SyntaxError: / }, | ||
| 147 | 147 | // Can handle multiline template literals | |
| 148 | 148 | { client: client_unix, send: '`io.js', | |
| 149 | 149 | expect: prompt_multiline }, | |
@@ -172,51 +172,48 @@ function error_test() { | |||
| 172 | 172 | // invalid input to JSON.parse error is special case of syntax error, | |
| 173 | 173 | // should throw | |
| 174 | 174 | { client: client_unix, send: 'JSON.parse(\'{invalid: \\\'json\\\'}\');', | |
| 175 | - expect: /^SyntaxError: Unexpected token i/ }, | ||
| 175 | + expect: /^SyntaxError: / }, | ||
| 176 | 176 | // end of input to JSON.parse error is special case of syntax error, | |
| 177 | 177 | // should throw | |
| 178 | 178 | { client: client_unix, send: 'JSON.parse(\'066\');', | |
| 179 | - expect: /^SyntaxError: Unexpected number/ }, | ||
| 179 | + expect: /^SyntaxError: / }, | ||
| 180 | 180 | // should throw | |
| 181 | 181 | { client: client_unix, send: 'JSON.parse(\'{\');', | |
| 182 | - expect: /^SyntaxError: Unexpected end of JSON input/ }, | ||
| 182 | + expect: /^SyntaxError: / }, | ||
| 183 | 183 | // invalid RegExps are a special case of syntax error, | |
| 184 | 184 | // should throw | |
| 185 | 185 | { client: client_unix, send: '/(/;', | |
| 186 | - expect: /^SyntaxError: Invalid regular expression:/ }, | ||
| 186 | + expect: /^SyntaxError: / }, | ||
| 187 | 187 | // invalid RegExp modifiers are a special case of syntax error, | |
| 188 | 188 | // should throw (GH-4012) | |
| 189 | 189 | { client: client_unix, send: 'new RegExp("foo", "wrong modifier");', | |
| 190 | - expect: /^SyntaxError: Invalid flags supplied to RegExp constructor/ }, | ||
| 190 | + expect: /^SyntaxError: / }, | ||
| 191 | 191 | // strict mode syntax errors should be caught (GH-5178) | |
| 192 | 192 | { client: client_unix, | |
| 193 | 193 | send: '(function() { "use strict"; return 0755; })()', | |
| 194 | - expect: /\bSyntaxError: Octal literals are not allowed in strict mode/ }, | ||
| 194 | + expect: /\bSyntaxError: / }, | ||
| 195 | 195 | { | |
| 196 | 196 | client: client_unix, | |
| 197 | 197 | send: '(function(a, a, b) { "use strict"; return a + b + c; })()', | |
| 198 | - expect: | ||
| 199 | - /\bSyntaxError: Duplicate parameter name not allowed in this context/ | ||
| 198 | + expect: /\bSyntaxError: / | ||
| 200 | 199 | }, | |
| 201 | 200 | { | |
| 202 | 201 | client: client_unix, | |
| 203 | 202 | send: '(function() { "use strict"; with (this) {} })()', | |
| 204 | - expect: /\bSyntaxError: Strict mode code may not include a with statement/ | ||
| 203 | + expect: /\bSyntaxError: / | ||
| 205 | 204 | }, | |
| 206 | 205 | { | |
| 207 | 206 | client: client_unix, | |
| 208 | 207 | send: '(function() { "use strict"; var x; delete x; })()', | |
| 209 | - expect: | ||
| 210 | - /\bSyntaxError: Delete of an unqualified identifier in strict mode/ | ||
| 208 | + expect: /\bSyntaxError: / | ||
| 211 | 209 | }, | |
| 212 | 210 | { client: client_unix, | |
| 213 | 211 | send: '(function() { "use strict"; eval = 17; })()', | |
| 214 | - expect: /\bSyntaxError: Unexpected eval or arguments in strict mode/ }, | ||
| 212 | + expect: /\bSyntaxError: / }, | ||
| 215 | 213 | { | |
| 216 | 214 | client: client_unix, | |
| 217 | 215 | send: '(function() { "use strict"; if (true) function f() { } })()', | |
| 218 | - expect: | ||
| 219 | - /\bSyntaxError: In strict mode code, functions can only be declared at top level or inside a block\./ | ||
| 216 | + expect: /\bSyntaxError: / | ||
| 220 | 217 | }, | |
| 221 | 218 | // Named functions can be used: | |
| 222 | 219 | { client: client_unix, send: 'function blah() { return 1; }', | |
@@ -268,7 +265,7 @@ function error_test() { | |||
| 268 | 265 | expect: `Invalid REPL keyword\n${prompt_unix}` }, | |
| 269 | 266 | // fail when we are not inside a String and a line continuation is used | |
| 270 | 267 | { client: client_unix, send: '[] \\', | |
| 271 | - expect: /\bSyntaxError: Invalid or unexpected token/ }, | ||
| 268 | + expect: /\bSyntaxError: / }, | ||
| 272 | 269 | // do not fail when a String is created with line continuation | |
| 273 | 270 | { client: client_unix, send: '\'the\\\nfourth\\\neye\'', | |
| 274 | 271 | expect: `${prompt_multiline}${prompt_multiline}'thefourtheye'\n${ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments