@bikky/compiler 0.0.38 → 0.0.39
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.
|
@@ -26,14 +26,14 @@ let source;
|
|
|
26
26
|
let numDeclarations = 0;
|
|
27
27
|
Class_1.Class.onClass((mixClass) => {
|
|
28
28
|
let isMixin = false;
|
|
29
|
-
console.log(`Found class: ${mixClass.name.text}, decorators: ${mixClass.decorators.map((e)
|
|
29
|
+
// console.log(`Found class: ${mixClass.name.text}, decorators: ${mixClass.decorators.map((e)=>e.name.text)}`);
|
|
30
30
|
// console.log(mixClass.base);
|
|
31
31
|
// console.log(`${((mixClass.base as any).decorators ?? []).map((e: any)=>e.getText())}`);
|
|
32
32
|
//Find out if the class has the @mixin decorator. If it does, remove it (by returning null).
|
|
33
33
|
mixClass.decorator("mixin", (dec) => {
|
|
34
34
|
if (dec == null)
|
|
35
35
|
return null;
|
|
36
|
-
console.log(`Found class with mixin decorator! ${mixClass.name.text}, ${dec.name.text}`);
|
|
36
|
+
// console.log(`Found class with mixin decorator! ${mixClass.name.text}, ${dec.name.text}`);
|
|
37
37
|
isMixin = true;
|
|
38
38
|
return null;
|
|
39
39
|
});
|
|
@@ -69,12 +69,12 @@ Class_1.Class.onClass((mixClass) => {
|
|
|
69
69
|
}
|
|
70
70
|
//Replace all `super` instances with `this[SuperSymbol_0]`;
|
|
71
71
|
if (node.kind === ts.SyntaxKind.SuperKeyword) {
|
|
72
|
-
console.log(`Found super! ${node}`);
|
|
72
|
+
// console.log(`Found super! ${node}`);
|
|
73
73
|
return getSuperClass().getExpression();
|
|
74
74
|
}
|
|
75
75
|
//Replace all instances of tryCallSuper<Class, "method">(...args) with (this[SuperSymbol].method) ?? (this[SuperSymbol].method(...args));
|
|
76
76
|
if ((0, ASTSearcher_1.FROM)(node).MATCH.FUNCTION_CALL("tryCallSuper")) {
|
|
77
|
-
console.log(`Found tryCallSuper! ${node}`);
|
|
77
|
+
// console.log(`Found tryCallSuper! ${node}`);
|
|
78
78
|
let foo = node;
|
|
79
79
|
if (((_a = foo.typeArguments) === null || _a === void 0 ? void 0 : _a.length) != 2)
|
|
80
80
|
throw new Error(`tryCallSuper must have two type arguments!`);
|
|
@@ -91,7 +91,7 @@ Class_1.Class.onClass((mixClass) => {
|
|
|
91
91
|
}
|
|
92
92
|
//Replace all instances of tryCallSuperOr<Class, "method">(...args)(fail) with (this[SuperSymbol].method) ? (this[SuperSymbol].method(...args)) : fail;
|
|
93
93
|
if (ts.isCallExpression(node) && (0, ASTSearcher_1.FROM)(node.expression).MATCH.FUNCTION_CALL("tryCallSuperOr")) {
|
|
94
|
-
console.log(`Found tryCallSuperOr! ${node}`);
|
|
94
|
+
// console.log(`Found tryCallSuperOr! ${node}`);
|
|
95
95
|
let foo = node.expression;
|
|
96
96
|
if (((_b = foo.typeArguments) === null || _b === void 0 ? void 0 : _b.length) != 2)
|
|
97
97
|
throw new Error(`tryCallSuper must have two type arguments!`);
|
|
Binary file
|