Last active
February 25, 2021 06:41
-
-
Save skial/a1fc270e84babb0af500 to your computer and use it in GitHub Desktop.
Haxe 3.2.0 @:selfCall example used in http://haxe.io/releases/3.2.0/
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
-js Main.js | |
-main Main |
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
package; | |
extern class A { | |
@:selfCall public function new(v:String); | |
@:selfCall public function run():Void; | |
} | |
extern class B { | |
public function new(v:String); | |
public function run():Void; | |
} | |
class Main { | |
static function main() { | |
var a = new A( '<a href="http://haxememes.tumblr.com/post/46032739244">Haxe Memes</a>' ); | |
var b = new B( '<a href="http://haxememes.tumblr.com/post/46032739244">Haxe Memes</a>' ); | |
a.run(); | |
b.run(); | |
} | |
} |
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
(function (console) { "use strict"; | |
var Main = function() { }; | |
Main.main = function() { | |
var a = A("<a href=\"http://haxememes.tumblr.com/post/46032739244\">Haxe Memes</a>"); | |
var b = new B("<a href=\"http://haxememes.tumblr.com/post/46032739244\">Haxe Memes</a>"); | |
a(); | |
b.run(); | |
}; | |
Main.main(); | |
})(typeof console != "undefined" ? console : {log:function(){}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment