MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add support for 'default' in import list

+6 -2
+6 -2
src/ant.c
··· 20442 20442 int count = 0; 20443 20443 20444 20444 while (next(js) != TOK_RBRACE && count < max_bindings) { 20445 - EXPECT(TOK_IDENTIFIER, (void)0); 20445 + if (next(js) != TOK_IDENTIFIER && next(js) != TOK_DEFAULT) { 20446 + return js_mkerr_typed(js, JS_ERR_SYNTAX, "expected identifier or 'default' in import list"); 20447 + } 20446 20448 const char *import_name = &js->code[js->toff]; 20447 20449 size_t import_len = js->tlen; 20448 20450 js->consumed = 1; ··· 20452 20454 20453 20455 if (next(js) == TOK_AS) { 20454 20456 js->consumed = 1; 20455 - EXPECT(TOK_IDENTIFIER, (void)0); 20457 + if (next(js) != TOK_IDENTIFIER && next(js) != TOK_DEFAULT) { 20458 + return js_mkerr_typed(js, JS_ERR_SYNTAX, "expected identifier or 'default' after 'as'"); 20459 + } 20456 20460 local_name = &js->code[js->toff]; 20457 20461 local_len = js->tlen; 20458 20462 js->consumed = 1;