File tree Expand file tree Collapse file tree
babel-helper-define-polyfill-provider/src
babel-plugin-polyfill-corejs3/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { declare } from "@babel/helper-plugin-utils" ;
22import type { NodePath } from "@babel/traverse" ;
33
4- import _getTargets , {
4+ import getTargets , {
55 isRequired ,
66 getInclusionReasons ,
77} from "@babel/helper-compilation-targets" ;
8- const getTargets = _getTargets . default || _getTargets ;
98
109import { createUtilsGetter } from "./utils" ;
1110import ImportsCachedInjector from "./imports-injector" ;
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ export default defineProvider<Options>(function (
270270 coreJSPureHelper ( "get-iterator" , useBabelRuntime , ext ) ,
271271 "getIterator" ,
272272 ) ,
273- [ node . object ] ,
273+ [ node . object as t . Expression ] ,
274274 ) ,
275275 ) ;
276276 path . skip ( ) ;
@@ -345,7 +345,7 @@ export default defineProvider<Options>(function (
345345 parentPath . type === "OptionalMemberExpression"
346346 ? "MemberExpression"
347347 : "CallExpression" ;
348- delete parentAsNotOptional . node . optional ;
348+ delete parentPath . node . optional ;
349349
350350 ( { parentPath } = parentPath ) ;
351351 } while (
@@ -400,7 +400,7 @@ export default defineProvider<Options>(function (
400400 path . replaceWith ( check ( t . callExpression ( id , [ node . object ] ) ) ) ;
401401 if ( t . isOptionalMemberExpression ( parent ) ) parent . optional = true ;
402402 } else {
403- path . replaceWith ( t . callExpression ( id , [ node . object ] ) ) ;
403+ path . replaceWith ( t . callExpression ( id , [ node . object as t . Expression ] ) ) ;
404404 }
405405 }
406406 } ,
Original file line number Diff line number Diff line change @@ -37,7 +37,11 @@ export function maybeMemoizeContext(
3737 context1 = t . cloneNode ( object ) ;
3838 } else {
3939 context2 = scope . generateDeclaredUidIdentifier ( "context" ) ;
40- context1 = t . assignmentExpression ( "=" , t . cloneNode ( context2 ) , object ) ;
40+ context1 = t . assignmentExpression (
41+ "=" ,
42+ t . cloneNode ( context2 ) ,
43+ object as t . Expression ,
44+ ) ;
4145 }
4246
4347 return [ context1 , context2 ] ;
You can’t perform that action at this time.
0 commit comments