@@ -2,15 +2,15 @@ import {
22 CommonFlags ,
33 NodeKind ,
44 ElementKind ,
5- Transform ,
65 IdentifierExpression ,
76 FunctionPrototype ,
87 StringLiteralExpression ,
98 Module ,
109 Function ,
1110 DeclaredElement ,
1211 Type
13- } from "visitor-as/as" ;
12+ } from "assemblyscript/dist/assemblyscript.js" ;
13+ import { Transform } from "assemblyscript/dist/transform.js" ;
1414import { TypeDef } from "./lib/types" ;
1515
1616function isInternalElement ( element : DeclaredElement ) {
@@ -77,18 +77,18 @@ export default class AsBindTransform extends Transform {
7777 const flatExportedFunctions = [
7878 ...this . program . elementsByDeclaration . values ( )
7979 ]
80- . filter ( el => elementHasFlag ( el , CommonFlags . MODULE_EXPORT ) )
80+ . filter ( el => elementHasFlag ( el , CommonFlags . ModuleExport ) )
8181 . filter ( el => ! isInternalElement ( el ) )
8282 . filter (
83- el => el . declaration . kind === NodeKind . FUNCTIONDECLARATION
83+ el => el . declaration . kind === NodeKind . FunctionDeclaration
8484 ) as FunctionPrototype [ ] ;
8585 const flatImportedFunctions = [
8686 ...this . program . elementsByDeclaration . values ( )
8787 ]
88- . filter ( el => elementHasFlag ( el , CommonFlags . DECLARE ) )
88+ . filter ( el => elementHasFlag ( el , CommonFlags . Declare ) )
8989 . filter ( el => ! isInternalElement ( el ) )
9090 . filter (
91- v => v . declaration . kind === NodeKind . FUNCTIONDECLARATION
91+ v => v . declaration . kind === NodeKind . FunctionDeclaration
9292 ) as FunctionPrototype [ ] ;
9393
9494 const typeIds : TypeDef [ "typeIds" ] = { } ;
@@ -108,8 +108,8 @@ export default class AsBindTransform extends Transform {
108108
109109 const iFunction = importedFunction . instances . get ( "" ) ! ;
110110
111- let external_module ;
112- let external_name ;
111+ let external_module : string | undefined ;
112+ let external_name : string | undefined ;
113113
114114 let decorators = iFunction . declaration . decorators ;
115115
@@ -147,7 +147,7 @@ export default class AsBindTransform extends Transform {
147147 importedFunctionName = external_name ;
148148 } else if (
149149 iFunction . parent &&
150- iFunction . parent . kind === ElementKind . NAMESPACE
150+ iFunction . parent . kind === ElementKind . Namespace
151151 ) {
152152 importedFunctionName = iFunction . parent . name + "." + iFunction . name ;
153153 }
0 commit comments