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.

disable tail call optimization for array and object literals during parsing

+9
+9
src/ant.c
··· 8691 8691 } 8692 8692 8693 8693 static jsval_t js_arr_literal(struct js *js) { 8694 + bool saved_tail = js->tail_ctx; 8695 + js->tail_ctx = false; 8696 + 8694 8697 uint8_t exe = !(js->flags & F_NOEXEC); 8695 8698 jsval_t arr = exe ? mkarr(js) : js_mkundef(); 8696 8699 if (is_err(arr)) return arr; ··· 8757 8760 } 8758 8761 arr = mkval(T_ARR, vdata(arr)); 8759 8762 } 8763 + js->tail_ctx = saved_tail; 8760 8764 return arr; 8761 8765 } 8762 8766 ··· 8858 8862 } 8859 8863 8860 8864 static jsval_t js_obj_literal(struct js *js) { 8865 + bool saved_tail = js->tail_ctx; 8866 + js->tail_ctx = false; 8867 + 8861 8868 uint8_t exe = !(js->flags & F_NOEXEC); 8862 8869 jsval_t obj = exe ? mkobj(js, 0) : js_mkundef(); 8863 8870 if (is_err(obj)) return obj; ··· 9111 9118 } 9112 9119 9113 9120 EXPECT(TOK_RBRACE); 9121 + js->tail_ctx = saved_tail; 9122 + 9114 9123 return obj; 9115 9124 } 9116 9125