Issue with JS Generation in HaXe v2.08

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Issue with JS Generation in HaXe v2.08

jamesbjackson
Hello Everyone,

I am using HaXe to compile to Node.JS and just did a update from v2.07 to v2.08 on working code and I get a Node.JS compiler reference errors now which could be one of many. So i am wondering if someone can post a custom JS compiler for the old way HaXe compiled JS as this works perfectly in Node.JS. Or how to fix it. This is the error it breaks on and this is a massive JS output as over 6,500 lines of code so can't hand tweak it :-(.

if(String.prototype.cca == null) String.prototype.cca = String.prototype.charCodeAt;
String.prototype.charCodeAt = function(i) {
        var x = cca(i);
        if(x != x) return null;
        return x;
};

Node.JS compiler error's saying ReferenceError:  "caa" is not defined. on the following line " var x = cca(i);".

So it be great to have backward compatibility with the old JS generator as was working perfectly. Any pointers would be really helpful how I can fix this.... would be most appreciated.

James
--
haXe - an open source web programming language
http://haxe.org
Reply | Threaded
Open this post in threaded view
|

Re: Issue with JS Generation in HaXe v2.08

sledorze
You my upgrade to the latest nodejs api; I've made some fixes here:
https://github.com/sledorze/hx-node

until richie pushes it on haxelib.

Here's the code you'r looking for.. with '__this__':

                        if( String.prototype.cca == null )
                                String.prototype.cca = String.prototype.charCodeAt;
                        String.prototype.charCodeAt = function(i) {
                                var x = __this__.cca(i);
                                if( x != x ) // fast isNaN
                                        return null;
                                return x;
                        };

Stephane
Reply | Threaded
Open this post in threaded view
|

Re: Issue with JS Generation in HaXe v2.08

jamesbjackson
Thanks Stephane,

Just had to update js.Node.Boot.

I drop ritchie a email and ask him to update on haXeLib :-)
No compiler errrors now, YAY!

The HaXe community is amazing!

Thanks a million ;-)

James