summaryrefslogtreecommitdiff
path: root/iseq.c
diff options
context:
space:
mode:
Diffstat (limited to 'iseq.c')
-rw-r--r--iseq.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/iseq.c b/iseq.c
index 99361156f1..22a250d312 100644
--- a/iseq.c
+++ b/iseq.c
@@ -310,6 +310,15 @@ rb_iseq_new_top(NODE *node, VALUE name, VALUE filename, VALUE parent)
&COMPILE_OPTION_DEFAULT);
}
+VALUE
+rb_iseq_new_main(NODE *node, VALUE filename)
+{
+ rb_thread_t *th = GET_THREAD();
+ VALUE parent = th->base_block->iseq->self;
+ return rb_iseq_new_with_opt(node, rb_str_new2("<main>"), filename,
+ parent, ISEQ_TYPE_EVAL, &COMPILE_OPTION_DEFAULT);
+}
+
static VALUE
rb_iseq_new_with_bopt_and_opt(NODE *node, VALUE name, VALUE filename,
VALUE parent, VALUE type, VALUE bopt,