Enable async Opal startup and REPL, use correct REPL runner
Taken from my platform work. Use case: Conditional dynamic import() of platform specific modules directly after runtime.js and before corelib ruby parts. Lets see what specs say ...
All good, nice.
No, not all good, it causes issues when using eval(), eval_js()
Actually not, the issues i hit are caused by a pending promise, a error somewhere else, so still all good.
No, not all good, because the unresolved promise is caused by this change.
For the moment, not queuing code for IRB solves the problem. But this needs further work to enable async code for REPL/IRB.
Alright, all good
My test case:
>> puts 123; p [1,2,3,4,5].each_await { |i| p i }.__await__; puts 456
123
1
2
=> #<PromiseV2:0x31e>
>>
3
=> nil
>>
4
=> nil
>>
5
=> nil
>>
=> nil
>>
[1, 2, 3, 4, 5]
456
=> nil
Somehow it returned too early...
@hmdne sure, i removed that await again, because if you do:
>> a = Promise.new
it will wait forever