This file contains hidden or 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 { |
This file contains hidden or 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; | |
| @:callable abstract Function<T>(T) from T {} | |
| class Main { | |
| static function main() { | |
| var a:Function<Int->Int> = function(v) return v * v; | |
| a(31); | |
| } |
This file contains hidden or 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 js.html; | |
| @:native("Blob") | |
| extern class Blob | |
| { | |
| var size(default,null) : Int; | |
| var type(default,null) : String; | |
| /** @throws DOMError */ | |
| @:overload( function() : Void {} ) |
This file contains hidden or 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; | |
| import js.node.Net; | |
| class Main { | |
| static function main() { | |
| var server = Net.createServer(function(socket) { | |
| socket.write("Echo server\n\n"); | |
| socket.pipe(socket); |
This file contains hidden or 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; | |
| import unifill.Utf8; | |
| import unifill.InternalEncoding; | |
| using unifill.Unifill; | |
| /** | |
| * ... | |
| * @author Skial Bainn |
This file contains hidden or 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; | |
| import haxe.macro.Type; | |
| import haxe.macro.Context; | |
| import haxe.macro.Printer; | |
| class Macro { | |
| // Runs on class `Test`. | |
| public static function build() { |
This file contains hidden or 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; | |
| import haxe.macro.Expr; | |
| class Main { | |
| static function main() { | |
| var smap:StringMap = ['firstName' => 'Skial', 'lastName' => 'Bainn']; | |
| trace( smap.lastName, smap.firstName ); // Bainn, Skial |
This file contains hidden or 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 unit.issues; | |
| #if js | |
| @:native("__issue4862__http_status") | |
| @:enum private extern abstract HttpStatus(Int) to Int { | |
| var Ok; | |
| var NotFound; | |
| static function __init__():Void { | |
| untyped __js__("var __issue4862__http_status = {Ok: 200, NotFound: 404};"); |
This file contains hidden or 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; | |
| import haxe.macro.Printer; | |
| #if macro | |
| import haxe.macro.Type; | |
| import haxe.macro.Expr; | |
| import haxe.macro.Context; | |
| #end | |
| /** |
This file contains hidden or 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 ; | |
| @:build(MyMacro.build()) | |
| class Main { | |
| public static function main() { | |
| MyMacro.register('c'); | |
| foo('bar'); | |
| MyMacro.register('a'); | |
| foo('baz'); |