Skip to content
This repository has been archived by the owner on Nov 4, 2018. It is now read-only.

Object function Object() { [native code] } has no method 'assign' #30

Closed
juneryo opened this issue Apr 19, 2016 · 7 comments
Closed

Object function Object() { [native code] } has no method 'assign' #30

juneryo opened this issue Apr 19, 2016 · 7 comments

Comments

@juneryo
Copy link

juneryo commented Apr 19, 2016

使用antd-init整合redux时候抛出这样的异常。。。
Object function Object() { [native code] } has no method 'assign'
不管是npm run dev还是rpm run build命令都一样有这个问题。
dev下查看生成的index.js中,也有这样的代码:
module.exports = Object.assign || function (target, source) {...}

不知道问题出在哪里了。。。

@juneryo
Copy link
Author

juneryo commented Apr 19, 2016

现在是把
module.exports = Object.assign || function (target, source) {...}
中的实现直接拿出来,放到自己定义的assignObject方法中来代替Object.assign使用。。。

另外,实现中有段代码
if (hasOwnProperty.call(from, key)) {...}
在IE8下不支持,改成了
if (from.hasOwnProperty(key)) {...}
这样才没问题。。。

@afc163
Copy link
Member

afc163 commented Apr 19, 2016

reduxjs/redux#774

@juneryo
Copy link
Author

juneryo commented Apr 20, 2016

@afc163
那个链接里的issue我看了下,好像也只是说添加了一个_es5-shim_吧。
但是这个我一开始就加上了,而且_es5-shim_里面也没有Object.assign的实现。

现在的情况是npm run dev(或npm run build)后,
生成index.js中有Object.assign的实现,但是在IE中(包括IE9),外部却无法使用,而且实现代码在IE8上是有问题的。

@afc163
Copy link
Member

afc163 commented Apr 20, 2016

redux 不支持 IE8...

Object.assign 是 es6-shim 的东西。

@afc163 afc163 closed this as completed Apr 20, 2016
@juneryo
Copy link
Author

juneryo commented Apr 20, 2016

@afc163
擦。。。就这样关掉了。。。
刚才也说了在 IE9 上也是一样呀。。。

@afc163
Copy link
Member

afc163 commented Apr 20, 2016

es6-shim ...

@juneryo
Copy link
Author

juneryo commented Apr 20, 2016

@afc163
好吧。。。
我错了。。。脑子一下子没转过来。。。谢谢。。。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants