@@ -142,7 +142,7 @@ function error_test() {
142
142
expect : prompt_unix } ,
143
143
// But passing the same string to eval() should throw
144
144
{ client : client_unix , send : 'eval("function test_func() {")' ,
145
- expect : / \b S y n t a x E r r o r : U n e x p e c t e d e n d o f i n p u t / } ,
145
+ expect : / ^ S y n t a x E r r o r : U n e x p e c t e d e n d o f i n p u t / } ,
146
146
// Can handle multiline template literals
147
147
{ client : client_unix , send : '`io.js' ,
148
148
expect : prompt_multiline } ,
@@ -171,30 +171,31 @@ function error_test() {
171
171
// invalid input to JSON.parse error is special case of syntax error,
172
172
// should throw
173
173
{ client : client_unix , send : 'JSON.parse(\'{invalid: \\\'json\\\'}\');' ,
174
- expect : / \b S y n t a x E r r o r : U n e x p e c t e d t o k e n i / } ,
174
+ expect : / ^ S y n t a x E r r o r : U n e x p e c t e d t o k e n i / } ,
175
175
// end of input to JSON.parse error is special case of syntax error,
176
176
// should throw
177
177
{ client : client_unix , send : 'JSON.parse(\'066\');' ,
178
- expect : / \b S y n t a x E r r o r : U n e x p e c t e d n u m b e r / } ,
178
+ expect : / ^ S y n t a x E r r o r : U n e x p e c t e d n u m b e r / } ,
179
179
// should throw
180
180
{ client : client_unix , send : 'JSON.parse(\'{\');' ,
181
- expect : / \b S y n t a x E r r o r : U n e x p e c t e d e n d o f J S O N i n p u t / } ,
181
+ expect : / ^ S y n t a x E r r o r : U n e x p e c t e d e n d o f J S O N i n p u t / } ,
182
182
// invalid RegExps are a special case of syntax error,
183
183
// should throw
184
184
{ client : client_unix , send : '/(/;' ,
185
- expect : / \b S y n t a x E r r o r : I n v a l i d r e g u l a r e x p r e s s i o n : / } ,
185
+ expect : / ^ S y n t a x E r r o r : I n v a l i d r e g u l a r e x p r e s s i o n : / } ,
186
186
// invalid RegExp modifiers are a special case of syntax error,
187
187
// should throw (GH-4012)
188
188
{ client : client_unix , send : 'new RegExp("foo", "wrong modifier");' ,
189
- expect : / \b S y n t a x E r r o r : I n v a l i d f l a g s s u p p l i e d t o R e g E x p c o n s t r u c t o r / } ,
189
+ expect : / ^ S y n t a x E r r o r : I n v a l i d f l a g s s u p p l i e d t o R e g E x p c o n s t r u c t o r / } ,
190
190
// strict mode syntax errors should be caught (GH-5178)
191
191
{ client : client_unix ,
192
192
send : '(function() { "use strict"; return 0755; })()' ,
193
193
expect : / \b S y n t a x E r r o r : O c t a l l i t e r a l s a r e n o t a l l o w e d i n s t r i c t m o d e / } ,
194
194
{
195
195
client : client_unix ,
196
196
send : '(function(a, a, b) { "use strict"; return a + b + c; })()' ,
197
- expect : / \b S y n t a x E r r o r : D u p l i c a t e p a r a m e t e r n a m e n o t a l l o w e d i n t h i s c o n t e x t /
197
+ expect :
198
+ / \b S y n t a x E r r o r : D u p l i c a t e p a r a m e t e r n a m e n o t a l l o w e d i n t h i s c o n t e x t /
198
199
} ,
199
200
{
200
201
client : client_unix ,
@@ -204,15 +205,17 @@ function error_test() {
204
205
{
205
206
client : client_unix ,
206
207
send : '(function() { "use strict"; var x; delete x; })()' ,
207
- expect : / \b S y n t a x E r r o r : D e l e t e o f a n u n q u a l i f i e d i d e n t i f i e r i n s t r i c t m o d e /
208
+ expect :
209
+ / \b S y n t a x E r r o r : D e l e t e o f a n u n q u a l i f i e d i d e n t i f i e r i n s t r i c t m o d e /
208
210
} ,
209
211
{ client : client_unix ,
210
212
send : '(function() { "use strict"; eval = 17; })()' ,
211
213
expect : / \b S y n t a x E r r o r : U n e x p e c t e d e v a l o r a r g u m e n t s i n s t r i c t m o d e / } ,
212
214
{
213
215
client : client_unix ,
214
216
send : '(function() { "use strict"; if (true) function f() { } })()' ,
215
- expect : / \b S y n t a x E r r o r : I n s t r i c t m o d e c o d e , f u n c t i o n s c a n o n l y b e d e c l a r e d a t t o p l e v e l o r i n s i d e a b l o c k \. /
217
+ expect :
218
+ / \b S y n t a x E r r o r : I n s t r i c t m o d e c o d e , f u n c t i o n s c a n o n l y b e d e c l a r e d a t t o p l e v e l o r i n s i d e a b l o c k \. /
216
219
} ,
217
220
// Named functions can be used:
218
221
{ client : client_unix , send : 'function blah() { return 1; }' ,
0 commit comments