Skip to content

Commit f64a833

Browse files
jdaltonsindresorhus
authored andcommitted
Store a reference to Object.getOwnPropertySymbols (#39)
1 parent 022fe39 commit f64a833

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

index.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
'use strict';
22
/* eslint-disable no-unused-vars */
3+
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
34
var hasOwnProperty = Object.prototype.hasOwnProperty;
45
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
56

@@ -69,8 +70,8 @@ module.exports = shouldUseNative() ? Object.assign : function (target, source) {
6970
}
7071
}
7172

72-
if (Object.getOwnPropertySymbols) {
73-
symbols = Object.getOwnPropertySymbols(from);
73+
if (getOwnPropertySymbols) {
74+
symbols = getOwnPropertySymbols(from);
7475
for (var i = 0; i < symbols.length; i++) {
7576
if (propIsEnumerable.call(from, symbols[i])) {
7677
to[symbols[i]] = from[symbols[i]];

0 commit comments

Comments
 (0)