@@ -2,15 +2,15 @@ import {
2
2
CommonFlags ,
3
3
NodeKind ,
4
4
ElementKind ,
5
- Transform ,
6
5
IdentifierExpression ,
7
6
FunctionPrototype ,
8
7
StringLiteralExpression ,
9
8
Module ,
10
9
Function ,
11
10
DeclaredElement ,
12
11
Type
13
- } from "visitor-as/as" ;
12
+ } from "assemblyscript/dist/assemblyscript.js" ;
13
+ import { Transform } from "assemblyscript/dist/transform.js" ;
14
14
import { TypeDef } from "./lib/types" ;
15
15
16
16
function isInternalElement ( element : DeclaredElement ) {
@@ -77,18 +77,18 @@ export default class AsBindTransform extends Transform {
77
77
const flatExportedFunctions = [
78
78
...this . program . elementsByDeclaration . values ( )
79
79
]
80
- . filter ( el => elementHasFlag ( el , CommonFlags . MODULE_EXPORT ) )
80
+ . filter ( el => elementHasFlag ( el , CommonFlags . ModuleExport ) )
81
81
. filter ( el => ! isInternalElement ( el ) )
82
82
. filter (
83
- el => el . declaration . kind === NodeKind . FUNCTIONDECLARATION
83
+ el => el . declaration . kind === NodeKind . FunctionDeclaration
84
84
) as FunctionPrototype [ ] ;
85
85
const flatImportedFunctions = [
86
86
...this . program . elementsByDeclaration . values ( )
87
87
]
88
- . filter ( el => elementHasFlag ( el , CommonFlags . DECLARE ) )
88
+ . filter ( el => elementHasFlag ( el , CommonFlags . Declare ) )
89
89
. filter ( el => ! isInternalElement ( el ) )
90
90
. filter (
91
- v => v . declaration . kind === NodeKind . FUNCTIONDECLARATION
91
+ v => v . declaration . kind === NodeKind . FunctionDeclaration
92
92
) as FunctionPrototype [ ] ;
93
93
94
94
const typeIds : TypeDef [ "typeIds" ] = { } ;
@@ -108,8 +108,8 @@ export default class AsBindTransform extends Transform {
108
108
109
109
const iFunction = importedFunction . instances . get ( "" ) ! ;
110
110
111
- let external_module ;
112
- let external_name ;
111
+ let external_module : string | undefined ;
112
+ let external_name : string | undefined ;
113
113
114
114
let decorators = iFunction . declaration . decorators ;
115
115
@@ -147,7 +147,7 @@ export default class AsBindTransform extends Transform {
147
147
importedFunctionName = external_name ;
148
148
} else if (
149
149
iFunction . parent &&
150
- iFunction . parent . kind === ElementKind . NAMESPACE
150
+ iFunction . parent . kind === ElementKind . Namespace
151
151
) {
152
152
importedFunctionName = iFunction . parent . name + "." + iFunction . name ;
153
153
}
0 commit comments