Simn / ts2hx

Typescript external definitions to haxe converter
80 stars 16 forks source link

keyword variables #13

Open nadako opened 9 years ago

nadako commented 9 years ago

TypeScript apparently allows to use keywords as a variable/function name (e.g. declare var class). We should handle haxe keywords somehow. I'm not sure whether @:native is enough for that (e.g. @:native("class") var class_:Dynamic;) or we should generate a property with inline getters/setters (e.g. var class_(get,set):Dynamic; inline function get_class_():Dynamic return untyped this["class"];)

nadako commented 9 years ago

btw, it's not just keywords, but also things like $scope.

back2dos commented 9 years ago

If @:native handles that well, then let's use it. The result should be a lot easier to grasp for the reader.