File tree Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Expand file tree Collapse file tree 1 file changed +3
-13
lines changed Original file line number Diff line number Diff line change @@ -751,21 +751,11 @@ export function transform(
751751 return { file, seclevel }
752752
753753 function createGetFunctionPrototypeNode ( ) {
754- for ( const globalFunction of globalFunctionsUnder7Characters ) {
755- if ( ! program . scope . hasOwnBinding ( globalFunction ) ) {
756- return t . memberExpression (
757- t . memberExpression ( t . identifier ( globalFunction ) , t . identifier ( `constructor` ) ) ,
758- t . identifier ( `prototype` )
759- )
760- }
761- }
754+ const name = globalFunctionsUnder7Characters . find ( name => ! program . scope . hasOwnBinding ( name ) )
762755
763756 return t . memberExpression (
764- t . memberExpression (
765- t . arrowFunctionExpression ( [ t . identifier ( `_` ) ] , t . identifier ( `_` ) ) ,
766- t . identifier ( `constructor` )
767- ) ,
768- t . identifier ( `prototype` )
757+ name ? t . identifier ( name ) : t . arrowFunctionExpression ( [ t . identifier ( `_` ) ] , t . identifier ( `_` ) ) ,
758+ t . identifier ( `__proto__` )
769759 )
770760 }
771761
You can’t perform that action at this time.
0 commit comments