Skip to content

Commit 1e0863a

Browse files
Fix exception on older browsers
Closes GH-246. Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com> Reviewed-by: Remco Haszing <remcohaszing@gmail.com> Reviewed-by: Titus Wormer <tituswormer@gmail.com>
1 parent 69202f9 commit 1e0863a

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

lib/callable-instance.js

+11-6
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,17 @@ export const CallableInstance =
2626

2727
Object.setPrototypeOf(apply, proto)
2828

29-
const names = Object.getOwnPropertyNames(value)
30-
31-
for (const p of names) {
32-
const descriptor = Object.getOwnPropertyDescriptor(value, p)
33-
if (descriptor) Object.defineProperty(apply, p, descriptor)
34-
}
29+
// Not needed for us in `unified`: we only call this on the `copy`
30+
// function,
31+
// and we don't need to add its fields (`length`, `name`)
32+
// over.
33+
// See also: GH-246.
34+
// const names = Object.getOwnPropertyNames(value)
35+
//
36+
// for (const p of names) {
37+
// const descriptor = Object.getOwnPropertyDescriptor(value, p)
38+
// if (descriptor) Object.defineProperty(apply, p, descriptor)
39+
// }
3540

3641
return apply
3742
}

0 commit comments

Comments
 (0)