Skip to content

Model 中复制 datasource 有 bug #173

@yibuyisheng

Description

@yibuyisheng

这一行代码:https://github.com/ecomfe/er/blob/master/src/Model.js#L203 ,在支持 Object.create 的浏览器中会使用 Object.create,但是 Object.create(datasource) 会把 datasource 放到创建出来的新 Object 的 proto 上面去,所以效果并不等价于 u.clone ,如下截图:

image

image

后续再遇到 u.deepClone 之类的就崩溃了。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions