jsval_t x = mkprop(js, js->scope, js_mkstr(js, class_name, class_name_len), constructor, false);
if (is_err(x)) return x;
}
(void) class_body_start;
return js_mkundef();
}
static jsval_t js_stmt(struct js *js) {
jsval_t res;
if (js->brk > js->gct) js_gc(js);
switch (next(js)) {
case TOK_CASE: case TOK_CATCH:
case TOK_DEFAULT: case TOK_FINALLY:
case TOK_SWITCH:
case TOK_TRY:
case TOK_WITH: case TOK_YIELD:
res = js_mkerr(js, "'%.*s' not implemented", (int) js->tlen, js->code + js->toff);
break;
case TOK_THROW: {
js->consumed = 1;
jsval_t throw_val = js_expr(js);
if (js->flags & F_NOEXEC) {
res = js_mkundef();
} else {
throw_val = resolveprop(js, throw_val);
if (is_err(throw_val)) {
res = throw_val;
} else {
res = js_throw(js, throw_val);
}
}
break;
}
case TOK_VAR:
if (!js->var_warning_shown) {
fprintf(stderr, "Warning: 'var' is deprecated, use 'let' or 'const' instead\n");
js->var_warning_shown = true;
}
res = js_let(js);
break;
case TOK_WHILE: res = js_while(js); break;
case TOK_DO: res = js_do_while(js); break;
case TOK_CONTINUE: res = js_continue(js); break;
case TOK_BREAK: res = js_break(js); break;
case TOK_LET: res = js_let(js); break;
case TOK_CONST: res = js_const(js); break;
case TOK_FUNC: res = js_func_decl(js); break;
case TOK_ASYNC: js->consumed = 1; if (next(js) == TOK_FUNC) res = js_func_decl_async(js); else return js_mkerr(js, "async must be followed by function"); break;
case TOK_CLASS: res = js_class_decl(js); break;
case TOK_IF: res = js_if(js); break;
case TOK_LBRACE: res = js_block(js, !(js->flags & F_NOEXEC)); break;
case TOK_FOR: res = js_for(js); break;
case TOK_RETURN: res = js_return(js); break;
default: res = resolveprop(js, js_expr(js)); break;