darknoon / cocoascript-class

Lets you create real ObjC classes in cocoascript so you can implement delegates, subclass builtin types, etc
MIT License
22 stars 8 forks source link

transpile with babel-preset-airbnb #1

Open jemgold opened 7 years ago

jemgold commented 7 years ago

@darknoon I think this module needs to be transpiled to work in some environments, possibly those with an old JSC environment.

I found the bug on my home Mac, and it was just reported here too: https://github.com/airbnb/react-sketchapp/issues/90

SyntaxError: Unexpected keyword 'const'. Const declarations are not supported in strict mode..
Plugin “react-sketchapp: Foursquare + Google Maps”, line 12175:
» const SuperInit = (0, _runtime.SuperCall)(NSStringFromSelector("init"), [], { type: "@" });

With this change, it gets transpiled to

var SuperInit = (0, _runtime.SuperCall)(NSStringFromSelector("init"), [], { type: "@" });

Thoughts?

darknoon commented 7 years ago

@jongold I don't see a solution to the arguments issue with transpilation here, so how will it not break?

darknoon commented 7 years ago

for #2