Skip to content

Commit

Permalink
Fixing issues before release 0.10.22
Browse files Browse the repository at this point in the history
  • Loading branch information
TwitchBronBron committed Mar 1, 2024
1 parent 82dc41e commit a5f3ed2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/prefixer/File.ts
Original file line number Diff line number Diff line change
Expand Up @@ -306,13 +306,14 @@ export class File {
},
//track class declarations (.bs and .d.bs only)
ClassStatement: (cls) => {
const annotations = cls.annotations ?? [];
this.classDeclarations.push({
name: cls.name.text,
nameOffset: this.positionToOffset(cls.name.range.start),
hasNamespace: !!cls.namespaceName,
//Use annotation start position if available, otherwise use class keyword
startOffset: this.positionToOffset(
(cls.annotations?.length > 0 ? cls.annotations[0] : cls.classKeyword).range.start
(annotations?.length > 0 ? annotations[0] : cls.classKeyword).range.start
),
endOffset: this.positionToOffset(cls.end.range.end)
});
Expand Down Expand Up @@ -346,13 +347,14 @@ export class File {
}
},
FunctionStatement: (func) => {
const annotations = func.annotations ?? [];
this.functionDefinitions.push({
name: func.name.text,
nameOffset: this.positionToOffset(func.name.range.start),
hasNamespace: !!func.namespaceName,
//Use annotation start position if available, otherwise use keyword
startOffset: this.positionToOffset(
(func.annotations?.length > 0 ? func.annotations[0] : func.func.functionType)!.range.start
(annotations?.length > 0 ? annotations[0] : func.func.functionType)!.range.start
),
endOffset: this.positionToOffset(func.func.end.range.end)
});
Expand Down
2 changes: 1 addition & 1 deletion src/prefixer/RopmModule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ export class RopmModule {
'!**/node_modules/**/*'
]
});
this.program = builder.program;
this.program = builder.program!;

//load all files
for (const obj of this.fileMaps) {
Expand Down

0 comments on commit a5f3ed2

Please sign in to comment.