JSTokenType tt;
JS_FRIEND_API(JSBool)js_CompileTokenStream(JSContext *cx, JSObject *chain, JSTokenStream *ts,		      JSCodeGenerator *cg){    JSStackFrame *fp, frame;    JSTokenType tt;    JSBool ok;    JSParseNode *pn;    fp = cx->fp;    if (!fp || fp->scopeChain != chain) {	memset(&frame, 0, sizeof frame);	frame.scopeChain = chain;	frame.down = fp;	cx->fp = &frame;    }    /*     * Prevent GC activation on this context (possible if out of memory when     * atomizing, or from pre-ECMAv2 switch case expr eval in the unlikely     * case of a branch-callback -- unlikely because it means the switch case     * must have called a function).     */    JS_DISABLE_GC(cx->runtime);    ok = JS_TRUE;    do {	ts->flags |= TSF_REGEXP;	tt = js_GetToken(cx, ts);	ts->flags &= ~TSF_REGEXP;	if (tt <= TOK_EOF) {	    if (tt == TOK_ERROR)		ok = JS_FALSE;	    break;	}#if JS_HAS_GETTER_SETTER        if (tt == TOK_NAME) {            tt = CheckGetterOrSetter(cx, ts, TOK_FUNCTION);            if (tt == TOK_ERROR) {		ok = JS_FALSE;                break;            }        }#endif	if (tt == TOK_FUNCTION) {	    pn = FunctionStmt(cx, ts, &cg->treeContext);	    if (pn && pn->pn_pos.end.lineno == ts->lineno) {                ok = WellTerminated(cx, ts, TOK_FUNCTION);                if (!ok)                    break;	    }        } else {	    js_UngetToken(ts);	    pn = Statement(cx, ts, &cg->treeContext);	}	if (!pn) {	    ok = JS_FALSE;            break;	}        ok = js_FoldConstants(cx, pn);        if (!ok)            break;        ok = js_AllocTryNotes(cx, cg);        if (!ok)            break;        ok = js_EmitTree(cx, cg, pn);    } while (ok);    JS_ENABLE_GC(cx->runtime);    ts->flags &= ~TSF_ERROR;    cx->fp = fp;    return ok;}