File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,10 @@ export function proxyApplyFn(
8585 : new proxyApplyFn . ApplyContext ( ...args ) ;
8686 }
8787 } ;
88+ proxyApplyFn . isCtor = new Map ( ) ;
89+ }
90+ if ( proxyApplyFn . isCtor . has ( target ) === false ) {
91+ proxyApplyFn . isCtor . set ( target , fn . prototype ?. constructor === fn ) ;
8892 }
8993 const fnStr = fn . toString ( ) ;
9094 const toString = ( function toString ( ) { return fnStr ; } ) . bind ( null ) ;
@@ -97,7 +101,7 @@ export function proxyApplyFn(
97101 return Reflect . get ( target , prop ) ;
98102 } ,
99103 } ;
100- if ( fn . prototype ?. constructor === fn ) {
104+ if ( proxyApplyFn . isCtor . get ( target ) ) {
101105 proxyDetails . construct = function ( target , args ) {
102106 return handler ( proxyApplyFn . CtorContext . factory ( target , args ) ) ;
103107 } ;
You can’t perform that action at this time.
0 commit comments