opal / opal-browser

Browser support for Opal.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`Proc.new` works differently in Opal and Ruby

graywolf opened this issue · comments

commented

Compare

[wolf@saito ~]$ opal -e "def foo; Proc.new; end" -e "pp foo {}"

/tmp/opal-nodejs-runner-20180319-15650-ygcnqf:5022
	  throw exception;
	  ^
ArgumentError: tried to create a Proc object without a block
	at singleton_class_alloc.TMP_Proc_new_1 [as $new] (/tmp/opal-nodejs-runner-20180319-15650-ygcnqf:16893:14)
	at Object_alloc.$$foo [as $foo] (/tmp/opal-nodejs-runner-20180319-15650-ygcnqf:21632:54)
	at Opal.send (/tmp/opal-nodejs-runner-20180319-15650-ygcnqf:1605:19)
	at /tmp/opal-nodejs-runner-20180319-15650-ygcnqf:21634:19
	at Object.<anonymous> (/tmp/opal-nodejs-runner-20180319-15650-ygcnqf:21637:3)
	at Module._compile (module.js:662:30)
	at Object.Module._extensions..js (module.js:673:10)
	at Module.load (module.js:575:32)
	at tryModuleLoad (module.js:515:12)
	at Function.Module._load (module.js:507:3)

with

[wolf@saito ~]$ ruby -e "def foo; Proc.new; end" -e "pp foo {}"
#<Proc:0x000009206e9ab810@-e:2>
commented

sorry wrong repo