size_t spare_size, chunk_size;
njs_native_frame_t *frame;
+ /*
+ * The size value must be aligned to njs_value_t because vm->top_frame
+ * may point to frame->free and vm->top_frame is used as a base pointer
+ * in njs_vm_continuation() which is expected to return pointers aligned
+ * to njs_value_t.
+ */
+ size = nxt_align_size(size, sizeof(njs_value_t));
+
spare_size = vm->top_frame->free_size;
if (nxt_fast_path(size <= spare_size)) {
"a.forEach(function(v, i, a) { a[i+3] = a.length }); a"),
nxt_string("1,2,3,3,4,5") },
+ { nxt_string("function f() { var c; [1].forEach(function(v) { c })}; f()"),
+ nxt_string("undefined") },
+
{ nxt_string("var a = [1,2,3]; var s = { sum: 0 };"
"[].forEach.call(a, function(v, i, a) { this.sum += v }, s);"
"s.sum"),