@@ -26,6 +26,7 @@ import * as NodePath_comments from "./comments.ts";
2626import * as NodePath_virtual_types_validator from "./lib/virtual-types-validator.ts" ;
2727import type { NodePathAssertions } from "./generated/asserts.ts" ;
2828import type { NodePathValidators } from "./generated/validators.ts" ;
29+ import { setup } from "./context.ts" ;
2930
3031const debug = buildDebug ( "babel" ) ;
3132
@@ -104,7 +105,7 @@ const NodePath_Final = class NodePath {
104105 if ( targetNode ) paths . set ( targetNode , path ) ;
105106 }
106107
107- path . setup ( parentPath , container , listKey , key ) ;
108+ setup . call ( path , parentPath , container , listKey , key ) ;
108109
109110 return path ;
110111 }
@@ -231,11 +232,7 @@ const methods = {
231232
232233 // NodePath_introspection
233234 matchesPattern : NodePath_introspection . matchesPattern ,
234- has : NodePath_introspection . has ,
235235 isStatic : NodePath_introspection . isStatic ,
236- is : NodePath_introspection . is ,
237- isnt : NodePath_introspection . isnt ,
238- equals : NodePath_introspection . equals ,
239236 isNodeType : NodePath_introspection . isNodeType ,
240237 canHaveVariableDeclarationOrExpression :
241238 NodePath_introspection . canHaveVariableDeclarationOrExpression ,
@@ -253,20 +250,12 @@ const methods = {
253250 isInStrictMode : NodePath_introspection . isInStrictMode ,
254251
255252 // NodePath_context
256- call : NodePath_context . call ,
257253 isDenylisted : NodePath_context . isDenylisted ,
258- isBlacklisted : NodePath_context . isBlacklisted ,
259254 visit : NodePath_context . visit ,
260255 skip : NodePath_context . skip ,
261256 skipKey : NodePath_context . skipKey ,
262257 stop : NodePath_context . stop ,
263- setScope : NodePath_context . setScope ,
264258 setContext : NodePath_context . setContext ,
265- resync : NodePath_context . resync ,
266- popContext : NodePath_context . popContext ,
267- pushContext : NodePath_context . pushContext ,
268- setup : NodePath_context . setup ,
269- setKey : NodePath_context . setKey ,
270259 requeue : NodePath_context . requeue ,
271260 requeueComputedKeyAndDecorators :
272261 NodePath_context . requeueComputedKeyAndDecorators ,
@@ -277,10 +266,8 @@ const methods = {
277266 // NodePath_modification
278267 insertBefore : NodePath_modification . insertBefore ,
279268 insertAfter : NodePath_modification . insertAfter ,
280- updateSiblingKeys : NodePath_modification . updateSiblingKeys ,
281269 unshiftContainer : NodePath_modification . unshiftContainer ,
282270 pushContainer : NodePath_modification . pushContainer ,
283- hoist : NodePath_modification . hoist ,
284271
285272 // NodePath_family
286273 getOpposite : NodePath_family . getOpposite ,
@@ -307,21 +294,43 @@ const methods = {
307294Object . assign ( NodePath_Final . prototype , methods ) ;
308295
309296if ( ! process . env . BABEL_8_BREAKING && ! USE_ESM ) {
297+ // String(x) is workaround for rollup
298+
310299 // @ts -expect-error babel 7 only
311300 NodePath_Final . prototype . arrowFunctionToShadowed =
312- // workaround for rollup
313301 // @ts -expect-error babel 7 only
314302 NodePath_conversion [ String ( "arrowFunctionToShadowed" ) ] ;
303+
304+ Object . assign ( NodePath_Final . prototype , {
305+ // @ts -expect-error Babel 7 only
306+ has : NodePath_introspection [ String ( "has" ) ] ,
307+ // @ts -expect-error Babel 7 only
308+ is : NodePath_introspection [ String ( "is" ) ] ,
309+ // @ts -expect-error Babel 7 only
310+ isnt : NodePath_introspection [ String ( "isnt" ) ] ,
311+ // @ts -expect-error Babel 7 only
312+ equals : NodePath_introspection [ String ( "equals" ) ] ,
313+ // @ts -expect-error Babel 7 only
314+ hoist : NodePath_modification [ String ( "hoist" ) ] ,
315+ updateSiblingKeys : NodePath_modification . updateSiblingKeys ,
316+ call : NodePath_context . call ,
317+ // @ts -expect-error Babel 7 only
318+ isBlacklisted : NodePath_context [ String ( "isBlacklisted" ) ] ,
319+ setScope : NodePath_context . setScope ,
320+ resync : NodePath_context . resync ,
321+ popContext : NodePath_context . popContext ,
322+ pushContext : NodePath_context . pushContext ,
323+ setup : NodePath_context . setup ,
324+ setKey : NodePath_context . setKey ,
325+ } ) ;
315326}
316327
317328if ( ! process . env . BABEL_8_BREAKING ) {
318329 // @ts -expect-error The original _guessExecutionStatusRelativeToDifferentFunctions only worked for paths in
319330 // different functions, but _guessExecutionStatusRelativeTo works as a replacement in those cases.
320331 NodePath_Final . prototype . _guessExecutionStatusRelativeToDifferentFunctions =
321332 NodePath_introspection . _guessExecutionStatusRelativeTo ;
322- }
323333
324- if ( ! process . env . BABEL_8_BREAKING ) {
325334 // @ts -expect-error The original _guessExecutionStatusRelativeToDifferentFunctions only worked for paths in
326335 // different functions, but _guessExecutionStatusRelativeTo works as a replacement in those cases.
327336 NodePath_Final . prototype . _guessExecutionStatusRelativeToDifferentFunctions =
0 commit comments