tvcutsem / harmony-reflect

ES5 shim for ES6 Reflect and Proxy objects
http://www.ecma-international.org/ecma-262/6.0/#sec-reflection
Other
478 stars 48 forks source link

Not working with react-native #47

Closed brysgo closed 9 years ago

brysgo commented 9 years ago

I haven't figured out why yet, but requiring 'harmony-reflect' in react-native is giving me "SyntaxError: Unexpected end of script".

I am using harmony and the Proxy object is present.

tvcutsem commented 9 years ago

I think I see what's going on. react-native concatenates all the files, but is not robust against the last line of a file containing a comment. You can see the concatenated files by navigating to http://localhost:8081/index.ios.bundle (react-native put a closing }) after my comment)

Simply adding a newline at the end of your node_modules/harmony_reflect/reflect.js solves the issue.

I'll update my code and add the newline, even though this is really a concatenation issue of react-native.

Thanks for reporting!

brysgo commented 9 years ago

thanks!