-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggest adding non-enumerable properties support when implementing Object.assign under IE8 #541
Comments
The solved code snippet is shown as followed: let fn = Object.assign;
Object.assign = function () {
const [target, ...sources] = [].slice.call(arguments, 0);
const result = fn.apply(this, [target, ...sources]);
[
'valueOf',
'isPrototypeOf',
'toString',
'hasOwnProperty',
'toLocaleString',
'propertyIsEnumerable',
].forEach(property => {
if (property === 'propertyIsEnumerable'
|| !({[property] : null}).propertyIsEnumerable(property)) {
/** non-enumerable properties */
sources.forEach(source => source
&& source.hasOwnProperty(property)
&& (result[property] = source[property]));
}
});
return result;
}; |
A workaround like this should be already used in enumerable keys related |
Has that feature been already released? |
Yes. I'll test it a little later. |
Thanks for your responses. |
Looks like a bug. |
Seems the problem in one |
Check it and wait for upgrading. |
@aleen42 your test case passed in 3.1.2, |
Nope, 2.6.8 also works fine, some problems with the cache in the testing platform. |
Are you sure you have run your test under IE8? |
It is my fault where I have a sub dependencie which depends on another low version. |
Under IE8, there are some non-enumerable properties like
toString
, which is actually not standard. However, the shim forObject.assign
has not solved the problem for us, like what described here, and I hope the source shim can do this for us.The text was updated successfully, but these errors were encountered: