@@ -17,7 +17,7 @@ import {
1717 type Node ,
1818 NodeFlags ,
1919 SyntaxKind ,
20- } from "@typescript/native-preview/ast" ;
20+ } from "@typescript/native-preview/unstable/ ast" ;
2121import {
2222 createArrayTypeNode ,
2323 createFunctionTypeNode ,
@@ -28,8 +28,8 @@ import {
2828 createTypeAliasDeclaration ,
2929 createTypeReferenceNode ,
3030 createUnionTypeNode ,
31- } from "@typescript/native-preview/ast/factory" ;
32- import { visitEachChild } from "@typescript/native-preview/ast/visitor" ;
31+ } from "@typescript/native-preview/unstable/ ast/factory" ;
32+ import { visitEachChild } from "@typescript/native-preview/unstable/ ast/visitor" ;
3333import {
3434 API ,
3535 type ConditionalType ,
@@ -46,9 +46,9 @@ import {
4646 TypePredicateKind ,
4747 type TypeReference ,
4848 type UnionOrIntersectionType ,
49- } from "@typescript/native-preview/async" ; // @sync : } from "@typescript/native-preview/sync";
50- import { createVirtualFileSystem } from "@typescript/native-preview/fs" ;
51- import type { FileSystem } from "@typescript/native-preview/fs" ;
49+ } from "@typescript/native-preview/unstable/ async" ; // @sync : } from "@typescript/native-preview/unstable /sync";
50+ import { createVirtualFileSystem } from "@typescript/native-preview/unstable/ fs" ;
51+ import type { FileSystem } from "@typescript/native-preview/unstable/ fs" ;
5252import assert from "node:assert" ;
5353import { globSync } from "node:fs" ;
5454import { resolve } from "node:path" ;
@@ -1295,7 +1295,7 @@ foo(42);
12951295 // statement[1] = foo(42); which is an ExpressionStatement -> CallExpression
12961296 const callStmt = sourceFile . statements [ 1 ] ;
12971297 assert . ok ( callStmt ) ;
1298- let numLiteral : import ( "@typescript/native-preview/ast" ) . Expression | undefined ;
1298+ let numLiteral : import ( "@typescript/native-preview/unstable/ ast" ) . Expression | undefined ;
12991299 callStmt . forEachChild ( function visit ( node ) {
13001300 if ( isCallExpression ( node ) ) {
13011301 // First argument
@@ -1351,7 +1351,7 @@ export function check(x: string | number) {
13511351 const funcDecl = sourceFile . statements [ 0 ] ;
13521352 assert . ok ( funcDecl ) ;
13531353 // Walk to find the first "return x" — inside the if, x should be narrowed to string
1354- let firstReturnX : import ( "@typescript/native-preview/ast" ) . Node | undefined ;
1354+ let firstReturnX : import ( "@typescript/native-preview/unstable/ ast" ) . Node | undefined ;
13551355 funcDecl . forEachChild ( function visit ( node ) {
13561356 if ( isReturnStatement ( node ) && ! firstReturnX ) {
13571357 // The expression of the return statement is the identifier "x"
@@ -1391,7 +1391,7 @@ export const obj = { name };
13911391
13921392 // Find the shorthand property assignment { name }
13931393 // statement[1] = export const obj = { name };
1394- let shorthandNode : import ( "@typescript/native-preview/ast" ) . Node | undefined ;
1394+ let shorthandNode : import ( "@typescript/native-preview/unstable/ ast" ) . Node | undefined ;
13951395 sourceFile . forEachChild ( function visit ( node ) {
13961396 if ( isShorthandPropertyAssignment ( node ) ) {
13971397 shorthandNode = node ;
@@ -1864,7 +1864,7 @@ describe("Checker - isContextSensitive", () => {
18641864 const sourceFile = await project . program . getSourceFile ( "/src/main.ts" ) ;
18651865 assert . ok ( sourceFile ) ;
18661866 // Find the arrow function node
1867- let arrowFn : import ( "@typescript/native-preview/ast" ) . Node | undefined ;
1867+ let arrowFn : import ( "@typescript/native-preview/unstable/ ast" ) . Node | undefined ;
18681868 sourceFile . forEachChild ( function visit ( node ) {
18691869 if ( node . kind === SyntaxKind . ArrowFunction ) {
18701870 arrowFn = node ;
@@ -2086,7 +2086,7 @@ export const obj = { m: 1, s: "hi", b: true };
20862086 assert . ok ( sourceFile ) ;
20872087
20882088 // Find the regex literal node
2089- let regexNode : import ( "@typescript/native-preview/ast" ) . Node | undefined ;
2089+ let regexNode : import ( "@typescript/native-preview/unstable/ ast" ) . Node | undefined ;
20902090 sourceFile . forEachChild ( function visit ( node ) {
20912091 if ( node . kind === SyntaxKind . RegularExpressionLiteral ) {
20922092 regexNode = node ;
@@ -2122,7 +2122,7 @@ describe("modifierFlags", () => {
21222122 const sourceFile = await project . program . getSourceFile ( "/src/index.ts" ) ;
21232123 assert . ok ( sourceFile ) ;
21242124
2125- let fnNode : import ( "@typescript/native-preview/ast" ) . FunctionDeclaration | undefined ;
2125+ let fnNode : import ( "@typescript/native-preview/unstable/ ast" ) . FunctionDeclaration | undefined ;
21262126 sourceFile . forEachChild ( function visit ( node ) {
21272127 if ( isFunctionDeclaration ( node ) ) {
21282128 fnNode = node ;
@@ -2150,7 +2150,7 @@ describe("modifierFlags", () => {
21502150 const sourceFile = await project . program . getSourceFile ( "/src/index.ts" ) ;
21512151 assert . ok ( sourceFile ) ;
21522152
2153- let fnNode : import ( "@typescript/native-preview/ast" ) . FunctionDeclaration | undefined ;
2153+ let fnNode : import ( "@typescript/native-preview/unstable/ ast" ) . FunctionDeclaration | undefined ;
21542154 sourceFile . forEachChild ( function visit ( node ) {
21552155 if ( isFunctionDeclaration ( node ) ) {
21562156 fnNode = node ;
@@ -2179,7 +2179,7 @@ describe("Checker - getResolvedSymbol", () => {
21792179 assert . ok ( sourceFile ) ;
21802180
21812181 // Find the 'x' identifier in `const y = x`
2182- let refNode : import ( "@typescript/native-preview/ast" ) . Identifier | undefined ;
2182+ let refNode : import ( "@typescript/native-preview/unstable/ ast" ) . Identifier | undefined ;
21832183 sourceFile . forEachChild ( function visit ( node ) {
21842184 if ( isIdentifier ( node ) && node . text === "x" ) {
21852185 // We want the reference, not the declaration - take the last one
@@ -2211,7 +2211,7 @@ describe("VariableDeclarationList - BlockScoped flags", () => {
22112211 const sourceFile = await project . program . getSourceFile ( "/src/index.ts" ) ;
22122212 assert . ok ( sourceFile ) ;
22132213
2214- let declList : import ( "@typescript/native-preview/ast" ) . Node | undefined ;
2214+ let declList : import ( "@typescript/native-preview/unstable/ ast" ) . Node | undefined ;
22152215 sourceFile . forEachChild ( function visit ( node ) {
22162216 if ( isVariableDeclarationList ( node ) ) {
22172217 declList = node ;
@@ -2237,7 +2237,7 @@ describe("VariableDeclarationList - BlockScoped flags", () => {
22372237 const sourceFile = await project . program . getSourceFile ( "/src/index.ts" ) ;
22382238 assert . ok ( sourceFile ) ;
22392239
2240- let declList : import ( "@typescript/native-preview/ast" ) . Node | undefined ;
2240+ let declList : import ( "@typescript/native-preview/unstable/ ast" ) . Node | undefined ;
22412241 sourceFile . forEachChild ( function visit ( node ) {
22422242 if ( isVariableDeclarationList ( node ) ) {
22432243 declList = node ;
@@ -2263,9 +2263,9 @@ test("TypeOperator operator kind", async () => {
22632263 const project = snapshot . getProject ( "/tsconfig.json" ) ! ;
22642264 const sourceFile = await project . program . getSourceFile ( "/src/index.ts" ) ;
22652265 assert ( sourceFile ) ;
2266- const param = ( sourceFile . statements [ 0 ] as import ( "@typescript/native-preview/ast" ) . FunctionDeclaration ) . parameters [ 0 ] ;
2266+ const param = ( sourceFile . statements [ 0 ] as import ( "@typescript/native-preview/unstable/ ast" ) . FunctionDeclaration ) . parameters [ 0 ] ;
22672267 assert ( param ) ;
2268- const type = param . type as import ( "@typescript/native-preview/ast" ) . TypeOperatorNode ;
2268+ const type = param . type as import ( "@typescript/native-preview/unstable/ ast" ) . TypeOperatorNode ;
22692269 assert ( type ) ;
22702270 assert . equal ( type . kind , SyntaxKind . TypeOperator ) ;
22712271 assert . equal ( type . operator , SyntaxKind . ReadonlyKeyword ) ;
@@ -2287,9 +2287,9 @@ test("SpreadAssignment roundtrip", async () => {
22872287 const project = snapshot . getProject ( "/tsconfig.json" ) ! ;
22882288 const sourceFile = await project . program . getSourceFile ( "/src/index.ts" ) ;
22892289 assert ( sourceFile ) ;
2290- const stmt = sourceFile . statements [ 0 ] as import ( "@typescript/native-preview/ast" ) . VariableStatement ;
2291- const object = stmt . declarationList . declarations [ 0 ] . initializer as import ( "@typescript/native-preview/ast" ) . ObjectLiteralExpression ;
2292- const assignment = object . properties [ 0 ] as import ( "@typescript/native-preview/ast" ) . SpreadAssignment ;
2290+ const stmt = sourceFile . statements [ 0 ] as import ( "@typescript/native-preview/unstable/ ast" ) . VariableStatement ;
2291+ const object = stmt . declarationList . declarations [ 0 ] . initializer as import ( "@typescript/native-preview/unstable/ ast" ) . ObjectLiteralExpression ;
2292+ const assignment = object . properties [ 0 ] as import ( "@typescript/native-preview/unstable/ ast" ) . SpreadAssignment ;
22932293 assert ( assignment ) ;
22942294 assert . equal ( assignment . kind , SyntaxKind . SpreadAssignment ) ;
22952295 const expr = assignment . expression ;
@@ -2314,13 +2314,13 @@ test("VariableDeclarationList const flag clone", async () => {
23142314 const sourceFile = await project . program . getSourceFile ( "/src/index.ts" ) ;
23152315 assert ( sourceFile ) ;
23162316 {
2317- const stmt = sourceFile . statements [ 0 ] as import ( "@typescript/native-preview/ast" ) . VariableStatement ;
2317+ const stmt = sourceFile . statements [ 0 ] as import ( "@typescript/native-preview/unstable/ ast" ) . VariableStatement ;
23182318 const list = stmt . declarationList ;
23192319 assert ( list . flags & NodeFlags . Const ) ;
23202320 }
23212321 const cloned = getSynthesizedDeepClone ( sourceFile ) ;
23222322 {
2323- const stmt = cloned . statements [ 0 ] as import ( "@typescript/native-preview/ast" ) . VariableStatement ;
2323+ const stmt = cloned . statements [ 0 ] as import ( "@typescript/native-preview/unstable/ ast" ) . VariableStatement ;
23242324 const list = stmt . declarationList ;
23252325 assert ( list . flags & NodeFlags . Const ) ;
23262326 }
0 commit comments