We define weex module method like this on iOS platform:

- (void)someFunction:(NSDictionary *)options {
        // parse options dictionary
}

Parameter options is treated as NSDictionary *, expecting any javascript object 
is converted to a NSDictionary * instance. undefined/null should convert to 
nil, but not a NSString *.

It is reasonable to check the parameter types, but not for this weird rule. And 
if parameter of a method is string, we can never distinguish between empty 
string and undefined.

在 2018/1/5 11:29,“Drew Hansen”<[email protected]> 写入:

    The undefined type in the client does not have an explicit corresponding
    type, it will resulting from the `Object` to `String`, this problem will
    cause the iOS application to crash.
    
    JS Framework source code:
    
https://github.com/alibaba/weex/blame/7a9bb149f415f0cf49e4e5f59bf743f7671e3688/src/js-framework/lib/util/index.js#L151
    
    Dotwe demo: http://dotwe.org/vue/94e3d5e3f7f9017c49d82bcfb927f879
    
    Thanks.
    

Reply via email to