Skip to content

Commit

Permalink
fix #541
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed May 7, 2019
1 parent 0af298b commit fe7c851
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core-js/internals/object-assign.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
'use strict';
// 19.1.2.1 Object.assign(target, source, ...)
var DESCRIPTORS = require('../internals/descriptors');
var objectKeys = require('../internals/object-keys');
var getOwnPropertySymbolsModule = require('../internals/object-get-own-property-symbols');
var propertyIsEnumerableModule = require('../internals/object-property-is-enumerable');
Expand Down Expand Up @@ -29,6 +30,9 @@ module.exports = !nativeAssign || require('../internals/fails')(function () {
var length = keys.length;
var j = 0;
var key;
while (length > j) if (propertyIsEnumerable.call(S, key = keys[j++])) T[key] = S[key];
while (length > j) {
key = keys[j++];
if (!DESCRIPTORS || propertyIsEnumerable.call(S, key)) T[key] = S[key];
}
} return T;
} : nativeAssign;
1 change: 1 addition & 0 deletions tests/pure/es.object.assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ QUnit.test('Object.assign', assert => {
assert.strictEqual(typeof string, 'object');
assert.strictEqual(String(string), 'qwe');
assert.strictEqual(string.q, 1);
assert.same(assign({}, { valueOf: 42 }).valueOf, 42, 'IE enum keys bug');
if (DESCRIPTORS) {
object = { baz: 1 };
assign(object, defineProperty({}, 'bar', {
Expand Down
1 change: 1 addition & 0 deletions tests/tests/es.object.assign.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ QUnit.test('Object.assign', assert => {
assert.strictEqual(typeof string, 'object');
assert.strictEqual(String(string), 'qwe');
assert.strictEqual(string.q, 1);
assert.same(assign({}, { valueOf: 42 }).valueOf, 42, 'IE enum keys bug');
if (DESCRIPTORS) {
object = { baz: 1 };
assign(object, defineProperty({}, 'bar', {
Expand Down

0 comments on commit fe7c851

Please sign in to comment.