From 6a51c3e80c0901851c252ed4d1387e43939a452f Mon Sep 17 00:00:00 2001 From: Yusuke Endoh Date: Sun, 19 Dec 2021 04:00:51 +0900 Subject: Make AST.of possible even under eval when keep_script_lines is enabled Now the following code works without an exception. ``` RubyVM.keep_script_lines = true eval(<body->variable.script_lines; + if (NIL_P(lines) && rb_iseq_from_eval_p(iseq)) { rb_raise(rb_eArgError, "cannot get AST for method defined in eval"); } path = rb_iseq_path(iseq); - lines = iseq->body->variable.script_lines; if (!NIL_P(lines) || !NIL_P(lines = script_lines(path))) { node = rb_ast_parse_array(lines, keep_script_lines); -- cgit v1.2.3