These are chat archives for opal/opal

4th
Apr 2017
Mitch VanDuyn
@catmando
Apr 04 2017 21:09

@fkchang @elia @/all : how do i get eval to work in irb mode?

eval("x = 12")
eval("x")

results in undefined x for main

looks like there is a config setting or something that I might need?
Elia Schito
@elia
Apr 04 2017 21:13
@catmando I'm sure Opal::Compiler has a flag to enable irb mode, but am AFK right now and can't check
Mitch VanDuyn
@catmando
Apr 04 2017 21:17
yes the compiler does...
just wondering if there is a way to do it from eval? I guess I can compile, and then run the js like eval would?
Elia Schito
@elia
Apr 04 2017 21:40
Yes eval uses the compiler internally, check its source in stdlib/opal-parser.rb