if rest argument value is captured, copy it to capture area. close #78.
This commit is contained in:
parent
46ac5faa97
commit
4cd217937f
|
@ -915,7 +915,7 @@ create_activation(codegen_context *cxt)
|
|||
|
||||
for (i = 0; i < cxt->captures.size; ++i) {
|
||||
var = xv_get(&cxt->captures, i);
|
||||
if ((n = xh_val(xh_get(®s, *var), size_t)) <= cxt->args.size) {
|
||||
if ((n = xh_val(xh_get(®s, *var), size_t)) <= cxt->args.size || (cxt->varg && n == cxt->args.size + 1)) {
|
||||
/* copy arguments to capture variable area */
|
||||
cxt->code[cxt->clen].insn = OP_LREF;
|
||||
cxt->code[cxt->clen].u.i = n;
|
||||
|
|
Loading…
Reference in New Issue