We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7b85570 commit c55c1b8Copy full SHA for c55c1b8
2 files changed
clone.js
@@ -2,12 +2,16 @@
2
3
module.exports = clone
4
5
+var getPrototypeOf = Object.getPrototypeOf || function (obj) {
6
+ return obj.__proto__
7
+}
8
+
9
function clone (obj) {
10
if (obj === null || typeof obj !== 'object')
11
return obj
12
13
if (obj instanceof Object)
- var copy = { __proto__: obj.__proto__ }
14
+ var copy = { __proto__: getPrototypeOf(obj) }
15
else
16
var copy = Object.create(null)
17
polyfills.js
@@ -133,7 +133,7 @@ function patch (fs) {
133
}
134
135
// This ensures `util.promisify` works as it does for native `fs.read`.
136
- read.__proto__ = fs$read
+ if (Object.setPrototypeOf) Object.setPrototypeOf(read, fs$read)
137
return read
138
})(fs.read)
139
0 commit comments