Skip to content

Commit

Permalink
issue #35 always create _ENV upvalue in the Lua chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
dibyendumajumdar committed Oct 24, 2020
1 parent 8ccef98 commit 8edb43b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -1639,6 +1639,7 @@ static void parse_lua_chunk(struct parser_state *parser)
raviX_next(parser->ls); /* read first token */
parser->container->main_function = new_function(parser); /* vararg function wrapper */
parser->container->main_function->function_expr.is_vararg = true;
add_upvalue_for_ENV(parser);
parse_statement_list(parser, &parser->container->main_function->function_expr.function_statement_list);
end_function(parser);
assert(parser->current_function == NULL);
Expand Down

0 comments on commit 8edb43b

Please sign in to comment.