Created
August 9, 2012 18:39
-
-
Save jgranick/3306935 to your computer and use it in GitHub Desktop.
"Hello World" in Haxe/Javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class TestJS { | |
static function main () { | |
trace ("Hello World"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-main TestJS | |
-js TestJS.js | |
--dead-code-elimination |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var TestJS = function() { } | |
TestJS.main = function() { | |
console.log("Hello World"); | |
} | |
TestJS.main(); |
If you use the --js-modern flag while compiling, the output will be encapsulated within a function() call. Otherwise it looks like the above
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"TestJS.js" is a file that is generated from the Haxe compiler.