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 ember; | |
| import haxe.macro.Expr; | |
| import haxe.macro.Context; | |
| @:autoBuild(ember.GetterSetterBuilder.build()) | |
| @:native("Ember.Object") | |
| extern class Object { | |
| public function new():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 ember; | |
| @:native("Ember.StateManager") | |
| extern class StateManager extends State { | |
| public function new():Void; | |
| public var enableLogging:Bool; | |
| /** |
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 ember; | |
| import haxe.macro.Expr; | |
| import haxe.macro.Context; | |
| @:autoBuild(ember.GetterSetterBuilder.build()) | |
| @:ember @:native("Ember.Object") | |
| extern class Object { | |
| public function new():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 haxe.macro.Compiler; | |
| import haxe.macro.Context; | |
| import haxe.macro.ExampleJSGenerator; | |
| import haxe.macro.JSGenApi; | |
| import haxe.macro.Type; | |
| import haxe.macro.Expr; | |
| using Lambda; | |
| class EmberJSGenerator extends ExampleJSGenerator { |
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
| MyApp.views.FriendSelectorView = $hxClasses['MyApp.views.FriendSelectorView'] = Ember.View.extend(); | |
| MyApp.views.FriendSelectorView.prototype.friendsBinding = null; | |
| MyApp.views.FriendSelectorView.prototype.friends = null; | |
| MyApp.views.FriendSelectorView.prototype.init = function() { | |
| this._set_template(Ember.Handlebars.compile(haxe.Resource.getString("friendSelector.html"))); | |
| this._set_friendsBinding(Ember.Binding.single("MyApp.passController.friends")); | |
| Ember.View.prototype.init.call(this); | |
| }; | |
| MyApp.views.FriendSelectorView.prototype._get_friendsBinding = function() { | |
| return this.get("friendsBinding"); |
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
| private function hasSuperClass(c:ClassType, searchForClassType:ClassType) { | |
| var superClass = c; | |
| do { | |
| superClass = superClass.superClass.t.get(); | |
| if (superClass == searchForClassType) return true; | |
| } while (superClass != null); | |
| return false; | |
| } |
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
| private function hasSuperClass(c:ClassType, searchForClassType:String) { | |
| var currentClassType = c; | |
| do { | |
| if (currentClassType.superClass != null) { | |
| currentClassType = currentClassType.superClass.t.get(); | |
| if (currentClassType.pack.concat([currentClassType.name]).join(".") == searchForClassType) return true; | |
| } | |
| } while (currentClassType.superClass != null); | |
| return false; |
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
| private String doSync(String operation, IClient client, RequestFunction function, AMFDataList params, String host, String data) { | |
| StringBuffer resultBuffer = new StringBuffer(); | |
| HttpClient httpClient = null; | |
| BufferedReader in = null; | |
| OutputStreamWriter out = null; | |
| try { | |
| httpClient = new DefaultHttpClient(); | |
| httpClient.getParams().setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_0); // disable chunking | |
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
| extern class State { | |
| public static function create(options:State):State; | |
| @:optional public var route:String; | |
| } | |
| // I am aiming for type safety for something like: | |
| var state = State.create({route:"Hello", somethingRandom: 1}); | |
| // If instead I do |
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
| class TypeTest { | |
| public static function main() { | |
| myFunc({}); | |
| myFunc({ a: "Hello" }); | |
| myFunc({ b: 1 }); | |
| myFunc({ another: "something" }); | |
| } | |
| private static function myFunc(o:Opts):Void { } |