Skip to content

Init the static members directly without __init__. - #16

Open
andyli wants to merge 1 commit into
cloudshift:masterfrom
andyli:moduleloading
Open

Init the static members directly without __init__.#16
andyli wants to merge 1 commit into
cloudshift:masterfrom
andyli:moduleloading

Conversation

@andyli

Copy link
Copy Markdown

Initialization the static members directly without __init__.
The benefit here is, with -dce full, haxe will only generate require(xxx) statement for the the actually used modules.

Eg.

importjs.Node;
classTest {
staticfunctionmain():Void {
Node.childProcess;
}
}

with -dce full, will output:

(function(){"use strict";varTest=function(){}Test.main=function(){js.Node.childProcess;}varjs={}js.Node=function(){}js.Node.require=require;js.Node.childProcess=js.Node.require("child_process");BrackaxeDomain.main();})();

Btw, I also:

  • Added require('tty'); for tty, which was missing.
  • Removed public static var queryString:NodeQueryString; since there is already public static var querystring(default,null) : NodeQueryString;

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@andyli