ios-jsc
ios-jsc copied to clipboard
Passing number to a method that expects NSString*
void TNSLog(NSString*);
TNSLog(5); // Converted to NSNumber instead and crashes
This behavior also happens in alert() calls.
I'm almost tempted to properly implement canConvert for the Objective-C FFI types and throw an error during FFI if canConvert fails.
I think it would be better to throw an error here, rather than try to out-JavaScript JavaScript by inventing even more inexplicable type coercion rules.