convert Javascript to Haxe using refactor

461 views Asked by At

I want to convert a javascript class to Haxe. (Which is Nakama Backend JS Client, nakama-js.umd.js) in order to do that, I've tried to use refactor tool. which is a haxelib tool after installing refactor, I've executed the following command:

haxelib run refactor js_to_haxe nakama-js.umd.js

but i get the following error:

Called from ? line 1
Called from Main.hx line 72
Called from hant/Process.hx line 196
Called from hant/Process.hx line 99
Called from a C function
Called from hant/Process.hx line 174
Called from hant/Process.hx line 173
Called from a C function
Called from C:\MyProg\_tools\motion-twin\haxe\std/neko/Lib.hx line 42
Uncaught exception - load.c(237) : Failed to load library : hant.ndll
Stack trace:
        Called from a C function
        Called from hant/Process.hx line 10
        Called from a C function
        Called from hant/Process.hx line 10
        Called from hant/Process.hx line 174
        Called from a C function
        Called from hant/Process.hx line 99
        Called from hant/Process.hx line 196
        Called from Main.hx line 72
        Called from ? line 1

I also tried installing hant lib. nothing changed.

1

There are 1 answers

0
coderofsalvation On
$ haxelib run refactor convertFile input.js Output.hx js_to_haxe.rules

This seems to execute in haxe 4 (the invocation described in the docs was for 3.x).
The output doesn't really seem to transpile in Haxe though.