I tried to compile Fantom using bootstrap script (as described on http://fantom.org/doc/docTools/Bootstrap.html), but the result dev version of fantom was invalid. I've detected error with running fan examples/js/demo.fan and opening corresponding page in browser. So error was something like Uncaught TypeError: undefined is not a function in function fan.sys.Obj.$extend (really argument base was undefined).
Let me describe some investigation about this. Types are written to js file (e.g. to sys.js) in some order. I don't want to deep into details, but believe me, that this order depends on the order of file names returned by the java.io.File.list(). In my case for the source directory src/sys/fan/ this method returns the list of file names where file "Method.fan" is earlier than file "Func.fan". It leads to the TypeError error in JS (that was described above), because in the sys.js the line
The issue as @jessevdam noted in #1612 - the class order is correct - but we use support classes that the Fantom compiler does not know about. So we need to be sure to implement those externally so we can write to sys.js lower to make sure we get dependencies out first.
ikornienko Wed 6 Apr 2011
I tried to compile Fantom using bootstrap script (as described on http://fantom.org/doc/docTools/Bootstrap.html), but the result dev version of fantom was invalid. I've detected error with running
fan examples/js/demo.fan
and opening corresponding page in browser. So error was something likeUncaught TypeError: undefined is not a function
in functionfan.sys.Obj.$extend
(really argumentbase
was undefined).Let me describe some investigation about this. Types are written to js file (e.g. to sys.js) in some order. I don't want to deep into details, but believe me, that this order depends on the order of file names returned by the
java.io.File.list()
. In my case for the source directorysrc/sys/fan/
this method returns the list of file names where file "Method.fan" is earlier than file "Func.fan". It leads to theTypeError
error in JS (that was described above), because in the sys.js the lineis earlier than
andy Thu 7 Apr 2011
Promoted to ticket #1478 and assigned to andy
The order should be the same as the compiler uses - but someone had this issue as well - so will dig into.
andy Thu 7 Apr 2011
Renamed from Invalid system pods after compiling Fantom to js: Invalid type order for sys pod
andy Fri 2 Aug 2013
Ticket resolved in 1.0.66
I fixed two instances I found - there may be others - hard to find manually.
If you see another one - tack it on here (only for sys pod - lets use another ticket for other pods).
Changesets
andy Fri 2 Aug 2013
The issue as @jessevdam noted in #1612 - the class order is correct - but we use support classes that the Fantom compiler does not know about. So we need to be sure to implement those externally so we can write to sys.js lower to make sure we get dependencies out first.