typescript-to-lua 1.31.2 → 1.31.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -95,7 +95,8 @@ function getFileAnnotations(sourceFile) {
95
95
  function getTagArgsFromComment(tag) {
96
96
  if (tag.comment) {
97
97
  if (typeof tag.comment === "string") {
98
- return tag.comment.split(" ");
98
+ const firstLine = tag.comment.split("\n")[0];
99
+ return firstLine.trim().split(" ");
99
100
  }
100
101
  else {
101
102
  return tag.comment.map(part => part.text);
@@ -111,7 +111,8 @@ function computeDeclarationContextType(context, signatureDeclaration) {
111
111
  ts.isConstructSignatureDeclaration(signatureDeclaration) ||
112
112
  ts.isConstructorDeclaration(signatureDeclaration) ||
113
113
  (signatureDeclaration.parent && ts.isPropertyDeclaration(signatureDeclaration.parent)) ||
114
- (signatureDeclaration.parent && ts.isPropertySignature(signatureDeclaration.parent))) {
114
+ (signatureDeclaration.parent && ts.isPropertySignature(signatureDeclaration.parent)) ||
115
+ (signatureDeclaration.parent && ts.isIndexSignatureDeclaration(signatureDeclaration.parent))) {
115
116
  // Class/interface methods only respect @noSelf on their parent
116
117
  const scopeDeclaration = (0, typescript_1.findFirstNodeAbove)(signatureDeclaration, (n) => ts.isClassDeclaration(n) || ts.isClassExpression(n) || ts.isInterfaceDeclaration(n));
117
118
  if (scopeDeclaration !== undefined && (0, annotations_1.getNodeAnnotations)(scopeDeclaration).has(annotations_1.AnnotationKind.NoSelf)) {
@@ -143,7 +143,7 @@ function transformClassLikeDeclaration(classDeclaration, context, nameOverride)
143
143
  const iif = lua.createFunctionExpression(lua.createBlock(bodyStatements), [
144
144
  lua.createIdentifier("self"),
145
145
  ]);
146
- const iife = lua.createCallExpression(iif, [className]);
146
+ const iife = lua.createCallExpression(iif, [localClassName]);
147
147
  result.push(lua.createExpressionStatement(iife, member));
148
148
  }
149
149
  }
@@ -156,7 +156,7 @@ function transformClassLikeDeclaration(classDeclaration, context, nameOverride)
156
156
  if ((0, export_1.shouldBeExported)(classDeclaration)) {
157
157
  const exportExpression = (0, export_1.hasDefaultExportModifier)(classDeclaration)
158
158
  ? (0, export_1.createDefaultExportExpression)(classDeclaration)
159
- : (0, export_1.createExportedIdentifier)(context, className);
159
+ : (0, export_1.createExportedIdentifier)(context, localClassName);
160
160
  const classAssignment = lua.createAssignmentStatement(exportExpression, localClassName);
161
161
  result.push(classAssignment);
162
162
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-to-lua",
3
- "version": "1.31.2",
3
+ "version": "1.31.4",
4
4
  "description": "A generic TypeScript to Lua transpiler. Write your code in TypeScript and publish Lua!",
5
5
  "repository": "https://github.com/TypeScriptToLua/TypeScriptToLua",
6
6
  "homepage": "https://typescripttolua.github.io/",