kevinresol / hxgenjs

Extensible JS generator for Haxe
57 stars 16 forks source link

jquery is generated to ::$:: #22

Closed varadig closed 5 years ago

varadig commented 5 years ago

haxe source

import js.jquery.JQuery;
....
 new JQuery(function() {
            new Admin();
        });

js output

::$::(function() {
        new Admin();
    });

so of course this has error while browserify:

browserify -t haxeify public/js/admin/Admin.js > public/js/AADDIIMMIINN.js
SyntaxError: Unexpected token (38:2) while parsing /Volumes/Work/develop/js/devinflow.hu/public/js/admin/Admin.js while parsing file: /Volumes/Work/develop/js/devinflow.hu/public/js/admin/Admin.js
    at DestroyableTransform.end [as _flush] (/usr/local/lib/node_modules/browserify/node_modules/insert-module-globals/index.js:114:21)
    at DestroyableTransform.prefinish (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_transform.js:138:10)
    at DestroyableTransform.emit (events.js:182:13)
    at prefinish (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:619:14)
    at finishMaybe (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:627:5)
    at endWritable (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:638:3)
    at DestroyableTransform.Writable.end (/usr/local/lib/node_modules/browserify/node_modules/readable-stream/lib/_stream_writable.js:594:41)
    at DestroyableTransform.onend (/Volumes/Work/develop/js/devinflow.hu/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js:523:10)
    at Object.onceWrapper (events.js:275:13)
    at DestroyableTransform.emit (events.js:187:15)
kevinresol commented 5 years ago

ref: https://github.com/HaxeFoundation/haxe/issues/7639