We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
proxy-apply
1 parent 6623889 commit dd4f764Copy full SHA for dd4f764
1 file changed
src/js/resources/proxy-apply.js
@@ -85,6 +85,10 @@ export function proxyApplyFn(
85
: new proxyApplyFn.ApplyContext(...args);
86
}
87
};
88
+ proxyApplyFn.isCtor = new Map();
89
+ }
90
+ if ( proxyApplyFn.isCtor.has(target) === false ) {
91
+ proxyApplyFn.isCtor.set(target, fn.prototype?.constructor === fn);
92
93
const fnStr = fn.toString();
94
const toString = (function toString() { return fnStr; }).bind(null);
@@ -97,7 +101,7 @@ export function proxyApplyFn(
97
101
return Reflect.get(target, prop);
98
102
},
99
103
100
- if ( fn.prototype?.constructor === fn ) {
104
+ if ( proxyApplyFn.isCtor.get(target) ) {
105
proxyDetails.construct = function(target, args) {
106
return handler(proxyApplyFn.CtorContext.factory(target, args));
107
0 commit comments