@markw65/monkeyc-optimizer 1.1.76 → 1.1.78
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.
- package/CHANGELOG.md +10 -0
- package/build/api.cjs +38 -38
- package/build/{chunk-3OBK4E4Q.cjs → chunk-Y3DFSFGP.cjs} +28 -14
- package/build/optimizer.cjs +18 -18
- package/build/sdk-util.cjs +14 -14
- package/build/src/api.d.ts +1 -1
- package/build/src/optimizer-types.d.ts +2 -1
- package/build/worker-thread.cjs +3 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to the "monkeyc-optimizer" package will be documented in this file.
|
|
4
4
|
|
|
5
|
+
### 1.1.78
|
|
6
|
+
|
|
7
|
+
- Consistently use the name of the project directory to name the prg file
|
|
8
|
+
- Fix a bug that reported errors for conversions between enums of different types
|
|
9
|
+
|
|
10
|
+
### 1.1.77
|
|
11
|
+
|
|
12
|
+
- Fix an infinite recursion issue with nested classes
|
|
13
|
+
- Fix a problem analyzing 'instanceof Boolean'
|
|
14
|
+
|
|
5
15
|
### 1.1.76
|
|
6
16
|
|
|
7
17
|
- Fix member expression lookup when base type is exact
|
package/build/api.cjs
CHANGED
|
@@ -18,51 +18,51 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var api_exports = {};
|
|
20
20
|
__export(api_exports, {
|
|
21
|
-
checkCompilerVersion: () =>
|
|
22
|
-
collectNamespaces: () =>
|
|
23
|
-
createDocumentationMap: () =>
|
|
24
|
-
declKey: () =>
|
|
25
|
-
diagnostic: () =>
|
|
26
|
-
diagnosticHelper: () =>
|
|
27
|
-
findNamesInScope: () =>
|
|
28
|
-
findUsingForNode: () =>
|
|
29
|
-
formatAst: () =>
|
|
30
|
-
formatAstLongLines: () =>
|
|
31
|
-
formatScopedName: () =>
|
|
32
|
-
getApiFunctionInfo: () =>
|
|
33
|
-
getApiMapping: () =>
|
|
34
|
-
getSuperClasses: () =>
|
|
35
|
-
handleImportUsing: () =>
|
|
21
|
+
checkCompilerVersion: () => import_chunk_Y3DFSFGP.checkCompilerVersion,
|
|
22
|
+
collectNamespaces: () => import_chunk_Y3DFSFGP.collectNamespaces,
|
|
23
|
+
createDocumentationMap: () => import_chunk_Y3DFSFGP.createDocumentationMap,
|
|
24
|
+
declKey: () => import_chunk_Y3DFSFGP.declKey,
|
|
25
|
+
diagnostic: () => import_chunk_Y3DFSFGP.diagnostic,
|
|
26
|
+
diagnosticHelper: () => import_chunk_Y3DFSFGP.diagnosticHelper,
|
|
27
|
+
findNamesInScope: () => import_chunk_Y3DFSFGP.findNamesInScope,
|
|
28
|
+
findUsingForNode: () => import_chunk_Y3DFSFGP.findUsingForNode,
|
|
29
|
+
formatAst: () => import_chunk_Y3DFSFGP.formatAst,
|
|
30
|
+
formatAstLongLines: () => import_chunk_Y3DFSFGP.formatAstLongLines,
|
|
31
|
+
formatScopedName: () => import_chunk_Y3DFSFGP.formatScopedName,
|
|
32
|
+
getApiFunctionInfo: () => import_chunk_Y3DFSFGP.getApiFunctionInfo,
|
|
33
|
+
getApiMapping: () => import_chunk_Y3DFSFGP.getApiMapping,
|
|
34
|
+
getSuperClasses: () => import_chunk_Y3DFSFGP.getSuperClasses,
|
|
35
|
+
handleImportUsing: () => import_chunk_Y3DFSFGP.handleImportUsing,
|
|
36
36
|
hasProperty: () => import_chunk_JDC43A3I.hasProperty,
|
|
37
|
-
isClassVariable: () =>
|
|
38
|
-
isLocal: () =>
|
|
39
|
-
isLookupCandidate: () =>
|
|
40
|
-
isStateNode: () =>
|
|
41
|
-
lookupByFullName: () =>
|
|
42
|
-
lookupNext: () =>
|
|
43
|
-
lookupResultContains: () =>
|
|
44
|
-
lookupWithType: () =>
|
|
45
|
-
makeToyboxLink: () =>
|
|
46
|
-
mapVarDeclsByType: () =>
|
|
47
|
-
markInvokeClassMethod: () =>
|
|
48
|
-
parseSdkVersion: () =>
|
|
49
|
-
popRootNode: () =>
|
|
50
|
-
pushRootNode: () =>
|
|
51
|
-
resolveDiagnostics: () =>
|
|
52
|
-
resolveDiagnosticsMap: () =>
|
|
53
|
-
sameLookupResult: () =>
|
|
37
|
+
isClassVariable: () => import_chunk_Y3DFSFGP.isClassVariable,
|
|
38
|
+
isLocal: () => import_chunk_Y3DFSFGP.isLocal,
|
|
39
|
+
isLookupCandidate: () => import_chunk_Y3DFSFGP.isLookupCandidate,
|
|
40
|
+
isStateNode: () => import_chunk_Y3DFSFGP.isStateNode,
|
|
41
|
+
lookupByFullName: () => import_chunk_Y3DFSFGP.lookupByFullName,
|
|
42
|
+
lookupNext: () => import_chunk_Y3DFSFGP.lookupNext,
|
|
43
|
+
lookupResultContains: () => import_chunk_Y3DFSFGP.lookupResultContains,
|
|
44
|
+
lookupWithType: () => import_chunk_Y3DFSFGP.lookupWithType,
|
|
45
|
+
makeToyboxLink: () => import_chunk_Y3DFSFGP.makeToyboxLink,
|
|
46
|
+
mapVarDeclsByType: () => import_chunk_Y3DFSFGP.mapVarDeclsByType,
|
|
47
|
+
markInvokeClassMethod: () => import_chunk_Y3DFSFGP.markInvokeClassMethod,
|
|
48
|
+
parseSdkVersion: () => import_chunk_Y3DFSFGP.parseSdkVersion,
|
|
49
|
+
popRootNode: () => import_chunk_Y3DFSFGP.popRootNode,
|
|
50
|
+
pushRootNode: () => import_chunk_Y3DFSFGP.pushRootNode,
|
|
51
|
+
resolveDiagnostics: () => import_chunk_Y3DFSFGP.resolveDiagnostics,
|
|
52
|
+
resolveDiagnosticsMap: () => import_chunk_Y3DFSFGP.resolveDiagnosticsMap,
|
|
53
|
+
sameLookupResult: () => import_chunk_Y3DFSFGP.sameLookupResult,
|
|
54
54
|
traverseAst: () => import_chunk_JDC43A3I.traverseAst,
|
|
55
|
-
variableDeclarationName: () =>
|
|
56
|
-
visitReferences: () =>
|
|
57
|
-
visit_resources: () =>
|
|
58
|
-
visitorNode: () =>
|
|
55
|
+
variableDeclarationName: () => import_chunk_Y3DFSFGP.variableDeclarationName,
|
|
56
|
+
visitReferences: () => import_chunk_Y3DFSFGP.visitReferences,
|
|
57
|
+
visit_resources: () => import_chunk_Y3DFSFGP.visit_resources,
|
|
58
|
+
visitorNode: () => import_chunk_Y3DFSFGP.visitorNode
|
|
59
59
|
});
|
|
60
60
|
module.exports = __toCommonJS(api_exports);
|
|
61
|
-
var
|
|
61
|
+
var import_chunk_Y3DFSFGP = require("./chunk-Y3DFSFGP.cjs");
|
|
62
62
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
63
63
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
64
64
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
65
|
-
(0,
|
|
65
|
+
(0, import_chunk_Y3DFSFGP.init_api)();
|
|
66
66
|
// Annotate the CommonJS export names for ESM import in node:
|
|
67
67
|
0 && (module.exports = {
|
|
68
68
|
checkCompilerVersion,
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_Y3DFSFGP_exports = {};
|
|
30
|
+
__export(chunk_Y3DFSFGP_exports, {
|
|
31
31
|
EnumTagsConst: () => EnumTagsConst,
|
|
32
32
|
LastTypeTag: () => LastTypeTag,
|
|
33
33
|
ObjectLikeTagsConst: () => ObjectLikeTagsConst,
|
|
@@ -139,7 +139,7 @@ __export(chunk_3OBK4E4Q_exports, {
|
|
|
139
139
|
visitorNode: () => visitorNode,
|
|
140
140
|
xml_util_exports: () => xml_util_exports
|
|
141
141
|
});
|
|
142
|
-
module.exports = __toCommonJS(
|
|
142
|
+
module.exports = __toCommonJS(chunk_Y3DFSFGP_exports);
|
|
143
143
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
144
144
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
145
145
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
@@ -12303,7 +12303,7 @@ function couldBeHelper(a, b, shallow) {
|
|
|
12303
12303
|
if (result)
|
|
12304
12304
|
return true;
|
|
12305
12305
|
}
|
|
12306
|
-
if (a.type & 65536 && b.type & EnumTagsConst || b.type & 65536 && a.type & EnumTagsConst) {
|
|
12306
|
+
if (a.type & 65536 && b.type & (EnumTagsConst | 65536) || b.type & 65536 && a.type & (EnumTagsConst | 65536)) {
|
|
12307
12307
|
return true;
|
|
12308
12308
|
}
|
|
12309
12309
|
if (a.type & 32768 && b.type & ObjectLikeTagsConst && getObjectValue(a) == null) {
|
|
@@ -12798,7 +12798,7 @@ function buildTypeInfo(state, root, optimizeEquivalencies) {
|
|
|
12798
12798
|
}
|
|
12799
12799
|
}
|
|
12800
12800
|
const stack = root.stack.slice();
|
|
12801
|
-
pushRootNode(stack, root);
|
|
12801
|
+
pushRootNode(state, stack, root);
|
|
12802
12802
|
const { istate, redo } = propagateTypes(
|
|
12803
12803
|
{ ...state, stack },
|
|
12804
12804
|
root,
|
|
@@ -13828,7 +13828,7 @@ function propagateTypes(state, root, graph, optimizeEquivalencies, copyPropStore
|
|
|
13828
13828
|
let result = null;
|
|
13829
13829
|
if (truthy === (event.kind === 6)) {
|
|
13830
13830
|
result = intersection(left, right);
|
|
13831
|
-
} else if (isExact(right)) {
|
|
13831
|
+
} else if (isExact(right) || right.type === 6) {
|
|
13832
13832
|
if (right.type === 32768) {
|
|
13833
13833
|
if (right.value == null) {
|
|
13834
13834
|
result = cloneType(left);
|
|
@@ -16840,6 +16840,10 @@ function collectClassInfo(state) {
|
|
|
16840
16840
|
state.allClasses.forEach((elm) => {
|
|
16841
16841
|
if (elm.stack[elm.stack.length - 1].sn.type === "ClassDeclaration") {
|
|
16842
16842
|
elm.stack = elm.stack.slice(0, 1);
|
|
16843
|
+
if (!(0, import_chunk_JDC43A3I.hasProperty)(state.nestedClasses, elm.name)) {
|
|
16844
|
+
state.nestedClasses[elm.name] = [];
|
|
16845
|
+
}
|
|
16846
|
+
state.nestedClasses[elm.name].push(elm);
|
|
16843
16847
|
}
|
|
16844
16848
|
if (elm.node.superClass) {
|
|
16845
16849
|
const [name, lookupDefns] = state.lookup(
|
|
@@ -16974,6 +16978,7 @@ async function analyze(fnMap, resourcesMap, manifestXML, config, allowParseError
|
|
|
16974
16978
|
config,
|
|
16975
16979
|
allFunctions: {},
|
|
16976
16980
|
allClasses: [],
|
|
16981
|
+
nestedClasses: {},
|
|
16977
16982
|
allModules: /* @__PURE__ */ new Set(),
|
|
16978
16983
|
shouldExclude(node) {
|
|
16979
16984
|
if ("attrs" in node && node.attrs && "attributes" in node.attrs && node.attrs.attributes && node.loc?.source) {
|
|
@@ -18893,12 +18898,12 @@ function checkCompilerVersion(version, sdkVer) {
|
|
|
18893
18898
|
}
|
|
18894
18899
|
return sdkVer <= v2;
|
|
18895
18900
|
}
|
|
18896
|
-
function pushRootNode(stack, root) {
|
|
18901
|
+
function pushRootNode(state, stack, root) {
|
|
18897
18902
|
if (root.type === "Program")
|
|
18898
18903
|
return;
|
|
18899
18904
|
const sn = root.stack?.at(-1)?.sn?.decls?.[root.name]?.find(
|
|
18900
18905
|
(sn2) => sn2.type === root.type && (root.nodes != null || sn2.node === root.node)
|
|
18901
|
-
);
|
|
18906
|
+
) ?? state.nestedClasses[root.name]?.find((d) => d.node === root.node);
|
|
18902
18907
|
if (!sn) {
|
|
18903
18908
|
throw new Error(`Invalid stack for node ${root.fullName}`);
|
|
18904
18909
|
}
|
|
@@ -19498,6 +19503,15 @@ function stateFuncs() {
|
|
|
19498
19503
|
case "ModuleDeclaration": {
|
|
19499
19504
|
const parent = this.top().sn;
|
|
19500
19505
|
const name = "id" in node ? node.id && node.id.name : void 0;
|
|
19506
|
+
if (name && node.type === "ClassDeclaration") {
|
|
19507
|
+
const sn = this.nestedClasses?.[name]?.find(
|
|
19508
|
+
(d) => d.node === node
|
|
19509
|
+
);
|
|
19510
|
+
if (sn) {
|
|
19511
|
+
this.stack.push({ sn });
|
|
19512
|
+
break;
|
|
19513
|
+
}
|
|
19514
|
+
}
|
|
19501
19515
|
const fullName = this.stack.map((e) => e.sn.name).concat(name).filter((e) => e != null).join(".");
|
|
19502
19516
|
const elm = {
|
|
19503
19517
|
type: node.type,
|
|
@@ -29551,13 +29565,13 @@ async function analyze_module_types(state) {
|
|
|
29551
29565
|
const saved = istate.state.stack;
|
|
29552
29566
|
root.nodes.forEach((stack, node) => {
|
|
29553
29567
|
istate.state.stack = stack.slice();
|
|
29554
|
-
pushRootNode(istate.state.stack, root);
|
|
29568
|
+
pushRootNode(istate.state, istate.state.stack, root);
|
|
29555
29569
|
evaluate(istate, node);
|
|
29556
29570
|
popRootNode(istate.state.stack, root);
|
|
29557
29571
|
});
|
|
29558
29572
|
istate.state.stack = saved;
|
|
29559
29573
|
} else {
|
|
29560
|
-
pushRootNode(istate.state.stack, root);
|
|
29574
|
+
pushRootNode(istate.state, istate.state.stack, root);
|
|
29561
29575
|
evaluate(istate, root.node);
|
|
29562
29576
|
popRootNode(istate.state.stack, root);
|
|
29563
29577
|
}
|
|
@@ -29787,7 +29801,7 @@ async function generateOptimizedProject(options) {
|
|
|
29787
29801
|
return {
|
|
29788
29802
|
jungleFiles: config.jungleFiles,
|
|
29789
29803
|
xml,
|
|
29790
|
-
program: path4.basename(path4.
|
|
29804
|
+
program: path4.basename(path4.basename(workspace)),
|
|
29791
29805
|
hasTests: !!config.testBuild
|
|
29792
29806
|
};
|
|
29793
29807
|
}
|
|
@@ -30016,7 +30030,7 @@ async function generateOptimizedProject(options) {
|
|
|
30016
30030
|
return {
|
|
30017
30031
|
jungleFiles,
|
|
30018
30032
|
xml,
|
|
30019
|
-
program: path4.basename(path4.
|
|
30033
|
+
program: path4.basename(path4.basename(workspace)),
|
|
30020
30034
|
hasTests,
|
|
30021
30035
|
diagnostics
|
|
30022
30036
|
};
|
|
@@ -30184,7 +30198,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
30184
30198
|
const opt_time = await (0, import_chunk_NHZRKHZO.first_modified)(
|
|
30185
30199
|
Object.values(fnMap).map((v) => v.output)
|
|
30186
30200
|
);
|
|
30187
|
-
if (source_time < opt_time &&
|
|
30201
|
+
if (source_time < opt_time && 1730668639817 < opt_time) {
|
|
30188
30202
|
return {
|
|
30189
30203
|
hasTests,
|
|
30190
30204
|
diagnostics: prevDiagnostics,
|
|
@@ -30222,7 +30236,7 @@ async function generateOneConfig(buildConfig, manifestXML, dependencyFiles, conf
|
|
|
30222
30236
|
hasTests: hasTests2,
|
|
30223
30237
|
diagnostics,
|
|
30224
30238
|
sdkVersion,
|
|
30225
|
-
optimizerVersion: "1.1.
|
|
30239
|
+
optimizerVersion: "1.1.78",
|
|
30226
30240
|
...Object.fromEntries(
|
|
30227
30241
|
configOptionsToCheck.map((option) => [option, config[option]])
|
|
30228
30242
|
)
|
package/build/optimizer.cjs
CHANGED
|
@@ -18,30 +18,30 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var optimizer_exports = {};
|
|
20
20
|
__export(optimizer_exports, {
|
|
21
|
-
StateNodeAttributes: () =>
|
|
22
|
-
buildConfigDescription: () =>
|
|
23
|
-
buildOptimizedProject: () =>
|
|
21
|
+
StateNodeAttributes: () => import_chunk_Y3DFSFGP.StateNodeAttributes,
|
|
22
|
+
buildConfigDescription: () => import_chunk_Y3DFSFGP.buildConfigDescription,
|
|
23
|
+
buildOptimizedProject: () => import_chunk_Y3DFSFGP.buildOptimizedProject,
|
|
24
24
|
copyRecursiveAsNeeded: () => import_chunk_NHZRKHZO.copyRecursiveAsNeeded,
|
|
25
|
-
defaultConfig: () =>
|
|
26
|
-
display: () =>
|
|
27
|
-
generateOneConfig: () =>
|
|
28
|
-
generateOptimizedProject: () =>
|
|
29
|
-
getConfig: () =>
|
|
30
|
-
getFnMapAnalysis: () =>
|
|
31
|
-
getProjectAnalysis: () =>
|
|
32
|
-
get_jungle: () =>
|
|
33
|
-
isErrorWithLocation: () =>
|
|
34
|
-
launchSimulator: () =>
|
|
35
|
-
manifestProducts: () =>
|
|
36
|
-
mctree: () =>
|
|
37
|
-
simulateProgram: () =>
|
|
25
|
+
defaultConfig: () => import_chunk_Y3DFSFGP.defaultConfig,
|
|
26
|
+
display: () => import_chunk_Y3DFSFGP.display,
|
|
27
|
+
generateOneConfig: () => import_chunk_Y3DFSFGP.generateOneConfig,
|
|
28
|
+
generateOptimizedProject: () => import_chunk_Y3DFSFGP.generateOptimizedProject,
|
|
29
|
+
getConfig: () => import_chunk_Y3DFSFGP.getConfig,
|
|
30
|
+
getFnMapAnalysis: () => import_chunk_Y3DFSFGP.getFnMapAnalysis,
|
|
31
|
+
getProjectAnalysis: () => import_chunk_Y3DFSFGP.getProjectAnalysis,
|
|
32
|
+
get_jungle: () => import_chunk_Y3DFSFGP.get_jungle,
|
|
33
|
+
isErrorWithLocation: () => import_chunk_Y3DFSFGP.isErrorWithLocation,
|
|
34
|
+
launchSimulator: () => import_chunk_Y3DFSFGP.launchSimulator,
|
|
35
|
+
manifestProducts: () => import_chunk_Y3DFSFGP.manifestProducts,
|
|
36
|
+
mctree: () => import_chunk_Y3DFSFGP.mctree,
|
|
37
|
+
simulateProgram: () => import_chunk_Y3DFSFGP.simulateProgram
|
|
38
38
|
});
|
|
39
39
|
module.exports = __toCommonJS(optimizer_exports);
|
|
40
|
-
var
|
|
40
|
+
var import_chunk_Y3DFSFGP = require("./chunk-Y3DFSFGP.cjs");
|
|
41
41
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
42
42
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
43
43
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
44
|
-
(0,
|
|
44
|
+
(0, import_chunk_Y3DFSFGP.init_optimizer)();
|
|
45
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
46
46
|
0 && (module.exports = {
|
|
47
47
|
StateNodeAttributes,
|
package/build/sdk-util.cjs
CHANGED
|
@@ -18,25 +18,25 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var sdk_util_exports = {};
|
|
20
20
|
__export(sdk_util_exports, {
|
|
21
|
-
SectionKinds: () =>
|
|
22
|
-
appSupport: () =>
|
|
23
|
-
connectiq: () =>
|
|
24
|
-
getDeviceInfo: () =>
|
|
25
|
-
getFunctionDocumentation: () =>
|
|
26
|
-
getLanguages: () =>
|
|
27
|
-
getSdkPath: () =>
|
|
28
|
-
isWin: () =>
|
|
29
|
-
optimizeProgram: () =>
|
|
30
|
-
readPrg: () =>
|
|
31
|
-
readPrgWithOffsets: () =>
|
|
32
|
-
xmlUtil: () =>
|
|
21
|
+
SectionKinds: () => import_chunk_Y3DFSFGP.SectionKinds,
|
|
22
|
+
appSupport: () => import_chunk_Y3DFSFGP.appSupport,
|
|
23
|
+
connectiq: () => import_chunk_Y3DFSFGP.connectiq,
|
|
24
|
+
getDeviceInfo: () => import_chunk_Y3DFSFGP.getDeviceInfo,
|
|
25
|
+
getFunctionDocumentation: () => import_chunk_Y3DFSFGP.getFunctionDocumentation,
|
|
26
|
+
getLanguages: () => import_chunk_Y3DFSFGP.getLanguages,
|
|
27
|
+
getSdkPath: () => import_chunk_Y3DFSFGP.getSdkPath,
|
|
28
|
+
isWin: () => import_chunk_Y3DFSFGP.isWin,
|
|
29
|
+
optimizeProgram: () => import_chunk_Y3DFSFGP.optimizeProgram,
|
|
30
|
+
readPrg: () => import_chunk_Y3DFSFGP.readPrg,
|
|
31
|
+
readPrgWithOffsets: () => import_chunk_Y3DFSFGP.readPrgWithOffsets,
|
|
32
|
+
xmlUtil: () => import_chunk_Y3DFSFGP.xml_util_exports
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(sdk_util_exports);
|
|
35
|
-
var
|
|
35
|
+
var import_chunk_Y3DFSFGP = require("./chunk-Y3DFSFGP.cjs");
|
|
36
36
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
37
37
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
38
38
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
39
|
-
(0,
|
|
39
|
+
(0, import_chunk_Y3DFSFGP.init_sdk_util)();
|
|
40
40
|
// Annotate the CommonJS export names for ESM import in node:
|
|
41
41
|
0 && (module.exports = {
|
|
42
42
|
SectionKinds,
|
package/build/src/api.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export { visitReferences, visitorNode } from "./visitor";
|
|
|
10
10
|
export { hasProperty, traverseAst, visit_resources };
|
|
11
11
|
export declare function parseSdkVersion(version: string | undefined): number;
|
|
12
12
|
export declare function checkCompilerVersion(version: string, sdkVer: number): boolean | undefined;
|
|
13
|
-
export declare function pushRootNode(stack: ProgramStateStack, root: RootStateNode): void;
|
|
13
|
+
export declare function pushRootNode(state: ProgramStateAnalysis, stack: ProgramStateStack, root: RootStateNode): void;
|
|
14
14
|
export declare function popRootNode(stack: ProgramStateStack, root: RootStateNode): void;
|
|
15
15
|
export declare function getApiMapping(state?: ProgramState, resourcesMap?: Record<string, JungleResourceMap>, manifestXML?: xmlUtil.Document): Promise<ProgramStateNode>;
|
|
16
16
|
export declare function isStateNode(node: {
|
|
@@ -136,6 +136,7 @@ export type ByNameStateNodeDecls = ModuleStateNode | ClassStateNode | FunctionSt
|
|
|
136
136
|
export type ProgramState = {
|
|
137
137
|
allFunctions?: Record<string, FunctionStateNode[]>;
|
|
138
138
|
allClasses?: ClassStateNode[];
|
|
139
|
+
nestedClasses?: Record<string, ClassStateNode[]>;
|
|
139
140
|
allModules?: Set<ModuleStateNode>;
|
|
140
141
|
invokeInfo?: FunctionInfo;
|
|
141
142
|
allDeclarations?: Record<string, ByNameStateNodeDecls[]>;
|
|
@@ -190,7 +191,7 @@ export type Finalized<T, Keys extends keyof T> = T & {
|
|
|
190
191
|
[key in Keys]-?: NonNullable<T[key]>;
|
|
191
192
|
};
|
|
192
193
|
export type ProgramStateLive = Finalized<ProgramState, "stack" | "top" | "lookup" | "lookupValue" | "lookupType" | "lookupNonlocal" | "stackClone" | "traverse" | "index" | "constants" | "removeNodeComments" | "inType" | "nextExposed" | "lookupRules">;
|
|
193
|
-
export type ProgramStateAnalysis = Finalized<ProgramStateLive, "allClasses" | "allModules" | "allFunctions" | "fnMap" | "allDeclarations" | "invokeInfo">;
|
|
194
|
+
export type ProgramStateAnalysis = Finalized<ProgramStateLive, "allClasses" | "nestedClasses" | "allModules" | "allFunctions" | "fnMap" | "allDeclarations" | "invokeInfo">;
|
|
194
195
|
export type ProgramStateOptimizer = Finalized<ProgramStateAnalysis, "localsStack" | "exposed" | "calledFunctions" | "usedByName">;
|
|
195
196
|
export type ExcludeAnnotationsMap = {
|
|
196
197
|
[key: string]: boolean;
|
package/build/worker-thread.cjs
CHANGED
|
@@ -21,17 +21,17 @@ __export(worker_thread_exports, {
|
|
|
21
21
|
default: () => worker_thread_default
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(worker_thread_exports);
|
|
24
|
-
var
|
|
24
|
+
var import_chunk_Y3DFSFGP = require("./chunk-Y3DFSFGP.cjs");
|
|
25
25
|
var import_chunk_NHZRKHZO = require("./chunk-NHZRKHZO.cjs");
|
|
26
26
|
var import_chunk_JDC43A3I = require("./chunk-JDC43A3I.cjs");
|
|
27
27
|
var import_chunk_ABYVSU2C = require("./chunk-ABYVSU2C.cjs");
|
|
28
28
|
var import_node_worker_threads = require("node:worker_threads");
|
|
29
29
|
var require_worker_thread = (0, import_chunk_ABYVSU2C.__commonJS)({
|
|
30
30
|
"src/worker-thread.ts"() {
|
|
31
|
-
(0,
|
|
31
|
+
(0, import_chunk_Y3DFSFGP.init_worker_task)();
|
|
32
32
|
if (import_node_worker_threads.parentPort) {
|
|
33
33
|
import_node_worker_threads.parentPort.on("message", async (task) => {
|
|
34
|
-
return import_node_worker_threads.parentPort.postMessage(await (0,
|
|
34
|
+
return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_Y3DFSFGP.performTask)(task));
|
|
35
35
|
});
|
|
36
36
|
}
|
|
37
37
|
}
|
package/package.json
CHANGED