Skip to content

Commit 5b544cd

Browse files
committed
Class creation -> setup
1 parent 53c5722 commit 5b544cd

File tree

2 files changed

+4
-10
lines changed

2 files changed

+4
-10
lines changed

src/transformation/transformers/class/index.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ import { popScope, pushScope, ScopeType } from "../../utils/scope";
3232
import { isAmbientNode } from "../../utils/typescript";
3333
import { transformIdentifier } from "../identifier";
3434
import { transformPropertyName } from "../literal";
35-
import { createClassCreationMethods } from "./creation";
3635
import { createConstructorDecorationStatement } from "./decorators";
3736
import { isGetAccessorOverride, transformAccessorDeclaration } from "./members/accessors";
3837
import { createConstructorName, transformConstructorDeclaration } from "./members/constructor";
3938
import { transformClassInstanceFields } from "./members/fields";
4039
import { transformMethodDeclaration } from "./members/method";
4140
import { checkForLuaLibType } from "./new";
41+
import { createClassSetup } from "./setup";
4242
import { getExtendedType, getExtendedTypeNode, isStaticNode } from "./utils";
4343

4444
export function transformClassAsExpression(
@@ -204,15 +204,9 @@ export function transformClassDeclaration(
204204
}
205205

206206
if (!isExtension && !isMetaExtension) {
207-
const classCreationMethods = createClassCreationMethods(
208-
context,
209-
classDeclaration,
210-
className,
211-
localClassName,
212-
classNameText,
213-
extendsType
207+
result.push(
208+
...createClassSetup(context, classDeclaration, className, localClassName, classNameText, extendsType)
214209
);
215-
result.push(...classCreationMethods);
216210
} else {
217211
for (const f of instanceFields) {
218212
const fieldName = transformPropertyName(context, f.name);

src/transformation/transformers/class/creation.ts renamed to src/transformation/transformers/class/setup.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { importLuaLibFeature, LuaLibFeature, transformLuaLibFunction } from "../
1717
import { hasMemberInClassOrAncestor } from "./members/accessors";
1818
import { getExtendedTypeNode, isStaticNode } from "./utils";
1919

20-
export function createClassCreationMethods(
20+
export function createClassSetup(
2121
context: TransformationContext,
2222
statement: ts.ClassLikeDeclarationBase,
2323
className: lua.Identifier,

0 commit comments

Comments
 (0)