Skip to content

EF/UIView 在查找model值的时候有个隐含的bug #44

@acelan86

Description

@acelan86
      function getProperty(target, path) {
            var value = target;
            for (var i = 0; i < path.length; i++) {
                value = value[path[i]];
            }

            return value;
        }

ef/UIView这块代码有点隐藏的bug

   getProperty({}, ['a', 'b']); //会报错,因为obj.a === undefined

因为模板中怎么写程序是没法预知的,所以,这里的查找放到try里面更好些

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions