Hello,
I get back to neko and I would like to know how prototypes export system
works.
For example, I createed a file called proto.neko with the following
contents:
-------------------------------------------------------------------------
var proto = $new(null);
proto.foo = function() { $print(this.msg) }
-------------------------------------------------------------------------
then a file called lod.neko with the following contents:
-------------------------------------------------------------------------
var proto = $loader.loadmodule("proto",$loader);
var o = $new(null);
o.msg = "hello";
$objsetproto(o,proto);
o.foo(); // print "hello"
-------------------------------------------------------------------------
But when I do:
nekoc proto.neko
nekoc lod.neko
neko lod.n
I have the following message:
Called from lod.neko line 6
Uncaught exception - Invalid call
Line 6 corresponds to the "o.foo()" so it seems that the prototype isn't
fully imported.
What happens?
Thank you in advance.
--
Neko : One VM to run them all
(http://nekovm.org)