@markw65/monkeyc-optimizer 1.1.20 → 1.1.22

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,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 chunk_APACX34C_exports = {};
30
- __export(chunk_APACX34C_exports, {
29
+ var chunk_HHQDDCTP_exports = {};
30
+ __export(chunk_HHQDDCTP_exports, {
31
31
  GenericQueue: () => GenericQueue,
32
32
  __commonJS: () => __commonJS,
33
33
  __esm: () => __esm,
@@ -41,6 +41,7 @@ __export(chunk_APACX34C_exports, {
41
41
  forEach: () => forEach,
42
42
  globSome: () => globSome,
43
43
  globa: () => globa,
44
+ init_logger: () => init_logger,
44
45
  init_util: () => init_util,
45
46
  last_modified: () => last_modified,
46
47
  log: () => log,
@@ -57,7 +58,7 @@ __export(chunk_APACX34C_exports, {
57
58
  spawnByLine: () => spawnByLine,
58
59
  wouldLog: () => wouldLog
59
60
  });
60
- module.exports = __toCommonJS(chunk_APACX34C_exports);
61
+ module.exports = __toCommonJS(chunk_HHQDDCTP_exports);
61
62
  var child_process = __toESM(require("child_process"));
62
63
  var fsc = __toESM(require("fs"));
63
64
  var fs = __toESM(require("fs/promises"));
@@ -5461,7 +5462,7 @@ function wouldLog(module2, level) {
5461
5462
  if (!loggerSettings) {
5462
5463
  loggerSettings = getLoggerSettings();
5463
5464
  }
5464
- return (loggerSettings.get(module2) ?? 0) >= level + loggerLevelOffset;
5465
+ return (loggerSettings.get(module2) ?? loggerSettings.get("*") ?? 0) >= level + loggerLevelOffset;
5465
5466
  }
5466
5467
  function bumpLogging(module2, amount) {
5467
5468
  if (!module2) {
@@ -5802,6 +5803,7 @@ run-parallel/index.js:
5802
5803
  forEach,
5803
5804
  globSome,
5804
5805
  globa,
5806
+ init_logger,
5805
5807
  init_util,
5806
5808
  last_modified,
5807
5809
  log,
@@ -18,27 +18,27 @@ 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: () => import_chunk_DCGJCC63.StateNodeAttributes,
22
- buildOptimizedProject: () => import_chunk_DCGJCC63.buildOptimizedProject,
23
- copyRecursiveAsNeeded: () => import_chunk_APACX34C.copyRecursiveAsNeeded,
24
- defaultConfig: () => import_chunk_DCGJCC63.defaultConfig,
25
- display: () => import_chunk_DCGJCC63.display,
26
- generateApiMirTests: () => import_chunk_DCGJCC63.generateApiMirTests,
27
- generateOneConfig: () => import_chunk_DCGJCC63.generateOneConfig,
28
- generateOptimizedProject: () => import_chunk_DCGJCC63.generateOptimizedProject,
29
- getConfig: () => import_chunk_DCGJCC63.getConfig,
30
- getProjectAnalysis: () => import_chunk_DCGJCC63.getProjectAnalysis,
31
- get_jungle: () => import_chunk_DCGJCC63.get_jungle,
32
- isErrorWithLocation: () => import_chunk_DCGJCC63.isErrorWithLocation,
33
- launchSimulator: () => import_chunk_DCGJCC63.launchSimulator,
34
- manifestProducts: () => import_chunk_DCGJCC63.manifestProducts,
35
- mctree: () => import_chunk_DCGJCC63.mctree,
36
- simulateProgram: () => import_chunk_DCGJCC63.simulateProgram
21
+ StateNodeAttributes: () => import_chunk_563GVBVT.StateNodeAttributes,
22
+ buildOptimizedProject: () => import_chunk_563GVBVT.buildOptimizedProject,
23
+ copyRecursiveAsNeeded: () => import_chunk_HHQDDCTP.copyRecursiveAsNeeded,
24
+ defaultConfig: () => import_chunk_563GVBVT.defaultConfig,
25
+ display: () => import_chunk_563GVBVT.display,
26
+ generateApiMirTests: () => import_chunk_563GVBVT.generateApiMirTests,
27
+ generateOneConfig: () => import_chunk_563GVBVT.generateOneConfig,
28
+ generateOptimizedProject: () => import_chunk_563GVBVT.generateOptimizedProject,
29
+ getConfig: () => import_chunk_563GVBVT.getConfig,
30
+ getProjectAnalysis: () => import_chunk_563GVBVT.getProjectAnalysis,
31
+ get_jungle: () => import_chunk_563GVBVT.get_jungle,
32
+ isErrorWithLocation: () => import_chunk_563GVBVT.isErrorWithLocation,
33
+ launchSimulator: () => import_chunk_563GVBVT.launchSimulator,
34
+ manifestProducts: () => import_chunk_563GVBVT.manifestProducts,
35
+ mctree: () => import_chunk_563GVBVT.mctree,
36
+ simulateProgram: () => import_chunk_563GVBVT.simulateProgram
37
37
  });
38
38
  module.exports = __toCommonJS(optimizer_exports);
39
- var import_chunk_DCGJCC63 = require("./chunk-DCGJCC63.cjs");
40
- var import_chunk_APACX34C = require("./chunk-APACX34C.cjs");
41
- (0, import_chunk_DCGJCC63.init_optimizer)();
39
+ var import_chunk_563GVBVT = require("./chunk-563GVBVT.cjs");
40
+ var import_chunk_HHQDDCTP = require("./chunk-HHQDDCTP.cjs");
41
+ (0, import_chunk_563GVBVT.init_optimizer)();
42
42
  // Annotate the CommonJS export names for ESM import in node:
43
43
  0 && (module.exports = {
44
44
  StateNodeAttributes,
@@ -18,23 +18,23 @@ 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: () => import_chunk_DCGJCC63.SectionKinds,
22
- appSupport: () => import_chunk_DCGJCC63.appSupport,
23
- connectiq: () => import_chunk_DCGJCC63.connectiq,
24
- getDeviceInfo: () => import_chunk_DCGJCC63.getDeviceInfo,
25
- getFunctionDocumentation: () => import_chunk_DCGJCC63.getFunctionDocumentation,
26
- getLanguages: () => import_chunk_DCGJCC63.getLanguages,
27
- getSdkPath: () => import_chunk_DCGJCC63.getSdkPath,
28
- isWin: () => import_chunk_DCGJCC63.isWin,
29
- optimizeProgram: () => import_chunk_DCGJCC63.optimizeProgram,
30
- readPrg: () => import_chunk_DCGJCC63.readPrg,
31
- readPrgWithOffsets: () => import_chunk_DCGJCC63.readPrgWithOffsets,
32
- xmlUtil: () => import_chunk_DCGJCC63.xml_util_exports
21
+ SectionKinds: () => import_chunk_563GVBVT.SectionKinds,
22
+ appSupport: () => import_chunk_563GVBVT.appSupport,
23
+ connectiq: () => import_chunk_563GVBVT.connectiq,
24
+ getDeviceInfo: () => import_chunk_563GVBVT.getDeviceInfo,
25
+ getFunctionDocumentation: () => import_chunk_563GVBVT.getFunctionDocumentation,
26
+ getLanguages: () => import_chunk_563GVBVT.getLanguages,
27
+ getSdkPath: () => import_chunk_563GVBVT.getSdkPath,
28
+ isWin: () => import_chunk_563GVBVT.isWin,
29
+ optimizeProgram: () => import_chunk_563GVBVT.optimizeProgram,
30
+ readPrg: () => import_chunk_563GVBVT.readPrg,
31
+ readPrgWithOffsets: () => import_chunk_563GVBVT.readPrgWithOffsets,
32
+ xmlUtil: () => import_chunk_563GVBVT.xml_util_exports
33
33
  });
34
34
  module.exports = __toCommonJS(sdk_util_exports);
35
- var import_chunk_DCGJCC63 = require("./chunk-DCGJCC63.cjs");
36
- var import_chunk_APACX34C = require("./chunk-APACX34C.cjs");
37
- (0, import_chunk_DCGJCC63.init_sdk_util)();
35
+ var import_chunk_563GVBVT = require("./chunk-563GVBVT.cjs");
36
+ var import_chunk_HHQDDCTP = require("./chunk-HHQDDCTP.cjs");
37
+ (0, import_chunk_563GVBVT.init_sdk_util)();
38
38
  // Annotate the CommonJS export names for ESM import in node:
39
39
  0 && (module.exports = {
40
40
  SectionKinds,
@@ -26,7 +26,7 @@ export declare function findNamesInScope(declStack: StateNode[][], pattern: stri
26
26
  parent: StateNode;
27
27
  depth: number;
28
28
  }][];
29
- export declare function mapVarDeclsByType(state: ProgramStateAnalysis, decls: StateNodeDecl[], node: mctree.Node, typeMap: TypeMap | null | undefined): (mctree.Identifier | mctree.EnumStringMember | mctree.AsIdentifier | ModuleStateNode | FunctionStateNode | ClassStateNode | TypedefStateNode | ProgramStateNode | import("./optimizer-types").BlockStateNode | VariableStateNode | EnumStateNode)[];
29
+ export declare function mapVarDeclsByType(state: ProgramStateAnalysis, decls: StateNodeDecl[], node: mctree.Node, typeMap: TypeMap | null | undefined): (mctree.Identifier | mctree.EnumStringMember | mctree.AsIdentifier | FunctionStateNode | ClassStateNode | ModuleStateNode | ProgramStateNode | VariableStateNode | import("./optimizer-types").BlockStateNode | TypedefStateNode | EnumStateNode)[];
30
30
  export declare function formatAstLongLines(node: mctree.Node): string;
31
31
  export declare function createDocumentationMap(functionDocumentation: {
32
32
  name: string;
@@ -44,6 +44,7 @@ export declare type BuildConfig = {
44
44
  iterateOptimizer?: boolean;
45
45
  covarianceWarnings?: boolean;
46
46
  checkTypes?: DiagnosticType | "OFF";
47
+ removeArgc?: boolean;
47
48
  };
48
49
  export declare type StateNodeDecl = StateNode | mctree.EnumStringMember | mctree.TypedIdentifier;
49
50
  export declare type StateNodeDecls = {
@@ -1,2 +1,3 @@
1
1
  import { Block, Context, FuncEntry } from "./bytecode";
2
- export declare function optimizeArrayInit(func: FuncEntry, block: Block, index: number, stackPreserving: boolean, context: Context): boolean;
2
+ import { InterpState } from "./interp";
3
+ export declare function optimizeArrayInit(func: FuncEntry, block: Block, index: number, context: Context, interpState: InterpState | null): boolean;
@@ -1,5 +1,6 @@
1
1
  /// <reference types="node" />
2
2
  import * as crypto from "node:crypto";
3
+ import { BuildConfig } from "src/optimizer-types";
3
4
  import { xmlUtil } from "../sdk-util";
4
5
  import { ExceptionEntry, ExceptionsMap } from "./exceptions";
5
6
  import { Header } from "./header";
@@ -23,6 +24,7 @@ export declare type SectionInfo = {
23
24
  };
24
25
  export declare type Logger = (module: string, level: number, message: string) => void;
25
26
  export declare type Context = {
27
+ config: BuildConfig;
26
28
  filepath: string;
27
29
  sections: Record<number, SectionInfo>;
28
30
  header: Header;
@@ -51,10 +53,11 @@ export declare type FuncEntry = {
51
53
  export declare function offsetToString(offset: number): string;
52
54
  export declare function fixSectionSize(section: SectionKinds, sections: Context["sections"], newSize: number): void;
53
55
  export declare function optimizeBytecode(context: Context): void;
54
- export declare function functionBanner(func: FuncEntry, context: Context | null, pass: string, footer?: (block: Block) => string): () => string;
56
+ export declare function functionBanner(func: FuncEntry, context: Context | null, pass: string, extra?: (block: Block, footer: boolean) => string): () => string;
55
57
  export declare function printFunction(func: FuncEntry, context: Context | null): void;
56
- export declare function functionToString(func: FuncEntry, context: Context | null, footer?: (block: Block) => string): string;
58
+ export declare function functionToString(func: FuncEntry, context: Context | null, extra?: (block: Block, footer: boolean) => string): string;
57
59
  export declare function blockToString(block: Block, context: Context | null): string;
60
+ export declare function lineInfoToString(lineInfo: LineNumber, context: Context | null): string;
58
61
  export declare function bytecodeToString(bytecode: Bytecode, symbolTable: SymbolTable | null | undefined): string;
59
62
  export declare function findFunctions({ bytecodes, symbolTable, exceptionsMap, }: Context): Map<number, FuncEntry>;
60
63
  export declare function makeArgless(bc: Bytecode, op: Opcodes): void;
@@ -1,5 +1,15 @@
1
1
  import { Block, FuncEntry } from "./bytecode";
2
+ import { Bytecode } from "./opcodes";
2
3
  export declare function postOrderTraverse(func: FuncEntry, visitor: (block: Block) => void): void;
3
4
  export declare function intersect<T>(a: Set<T>, b: Set<T>): Set<T>;
4
5
  export declare type DomLike = Map<number, Set<number>>;
5
6
  export declare function computePostDominators(func: FuncEntry): DomLike;
7
+ export declare function postOrderPropagate<T>(func: FuncEntry, preBlock: (block: Block) => T, processBc: (block: Block, bc: Bytecode, state: T) => void, postBlock: (block: Block, state: T) => void, merge: (state: T, predBlock: Block, isExPred: boolean) => boolean): void;
8
+ export declare enum RpoFlags {
9
+ EnqueueTaken = 1,
10
+ EnqueueNext = 2,
11
+ SkipTaken = 4,
12
+ SkipNext = 8,
13
+ RestartBlock = 16
14
+ }
15
+ export declare function rpoPropagate<T>(func: FuncEntry, preBlock: (block: Block) => T, processBc: (block: Block, bc: Bytecode, state: T) => RpoFlags | null | undefined | void, postBlock: (block: Block, state: T) => void, merge: (from: Block, state: T, predBlock: Block, isExSucc: boolean) => boolean): void;
@@ -1,3 +1,6 @@
1
1
  import { Context, FuncEntry } from "./bytecode";
2
2
  export declare function localDCE(func: FuncEntry, context: Context): boolean;
3
- export declare function computeLiveLocals(func: FuncEntry): Map<number, Set<number>>;
3
+ export declare function computeLiveLocals(func: FuncEntry): {
4
+ liveInLocals: Map<number, Set<number>>;
5
+ liveOutLocals: Map<number, Set<number>>;
6
+ };
@@ -0,0 +1,20 @@
1
+ import { ExactOrUnion } from "../optimizer";
2
+ import { Context, FuncEntry } from "./bytecode";
3
+ import { Bytecode, Lputv } from "./opcodes";
4
+ interface InterpItemInfo {
5
+ type: ExactOrUnion;
6
+ equivs?: Set<number>;
7
+ }
8
+ export declare type InterpState = {
9
+ stack: InterpItemInfo[];
10
+ locals: InterpItemInfo[];
11
+ loopBlock?: true;
12
+ };
13
+ export declare function cloneState(state: InterpState | null | undefined): InterpState;
14
+ export declare function interpBytecode(bc: Bytecode, localState: InterpState, context: Context): void;
15
+ export declare function interpFunc(func: FuncEntry, context: Context): {
16
+ liveInState: Map<number, InterpState>;
17
+ equivSets: Map<Lputv, Set<number>>;
18
+ };
19
+ export declare function instForType(type: ExactOrUnion, offset: number): Bytecode | null;
20
+ export {};
@@ -0,0 +1,3 @@
1
+ import { Context, FuncEntry } from "./bytecode";
2
+ import { Lputv } from "./opcodes";
3
+ export declare function minimizeLocals(func: FuncEntry, equivSets: Map<Lputv, Set<number>>, context: Context): boolean;
@@ -1,6 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="node" />
3
3
  import * as crypto from "node:crypto";
4
+ import { BuildConfig } from "./optimizer-types";
4
5
  import { SectionInfo } from "./readprg/bytecode";
5
6
  import { xmlUtil } from "./sdk-util";
6
7
  export declare function readPrg(path: string): Promise<{
@@ -14,12 +15,12 @@ export declare function readPrgWithOffsets(view: DataView): {
14
15
  view: DataView;
15
16
  sections: Record<number, SectionInfo>;
16
17
  };
17
- export declare function optimizeProgram(filepath: string, devKey?: string | undefined, output?: string): Promise<unknown>;
18
- export declare function optimizeProgramBuffer(filepath: string, view: DataView, debugXml: xmlUtil.Document, key: crypto.KeyObject | undefined): {
18
+ export declare function optimizeProgram(filepath: string, devKey?: string | undefined, output?: string, config?: BuildConfig): Promise<unknown>;
19
+ export declare function optimizeProgramBuffer(filepath: string, view: DataView, debugXml: xmlUtil.Document, key: crypto.KeyObject | undefined, config: BuildConfig | undefined): {
19
20
  signature: Buffer | undefined;
20
21
  buffer: Buffer;
21
22
  };
22
- export declare function optimizePrgAndDebug(prgName: string, prgBuffer: ArrayBuffer, prgOffset: number, prgLength: number, xmlName: string, xmlBuffer: ArrayBuffer, xmlOffset: number, xmlLength: number, key: crypto.KeyObject): Promise<{
23
+ export declare function optimizePrgAndDebug(prgName: string, prgBuffer: ArrayBuffer, prgOffset: number, prgLength: number, xmlName: string, xmlBuffer: ArrayBuffer, xmlOffset: number, xmlLength: number, key: crypto.KeyObject, config: BuildConfig | undefined): Promise<{
23
24
  sigBuffer: ArrayBufferLike | undefined;
24
25
  sigOffset: number | undefined;
25
26
  sigLength: number | undefined;
@@ -17,7 +17,7 @@ export declare function printBlockHeader(block: TypeFlowBlock): void;
17
17
  export declare function describeEvent(event: Event): string;
18
18
  export declare function printBlockEvents(block: TypeFlowBlock, extra?: (event: Event) => string): void;
19
19
  export declare function printBlockTrailer(block: TypeFlowBlock): void;
20
- export declare function findObjectDeclsByProperty(state: ProgramStateAnalysis, object: ExactOrUnion, next: mctree.DottedMemberExpression): [StateNode[], StateNode[]] | readonly [null, null];
20
+ export declare function findObjectDeclsByProperty(state: ProgramStateAnalysis, object: ExactOrUnion, next: mctree.DottedMemberExpression): readonly [null, null] | [StateNode[], StateNode[]];
21
21
  export declare function refineObjectTypeByDecls(istate: InterpState, object: ExactOrUnion, trueDecls: StateNode[]): ExactOrUnion;
22
22
  export declare function findNextObjectType(istate: InterpState, trueDecls: StateNode[], next: mctree.DottedMemberExpression): import("./types").UnionType | import("./types").NumberType | import("./types").LongType | import("./types").FloatType | import("./types").DoubleType | import("./types").CharType | import("./types").StringType | import("./types").ArrayType | import("./types").DictionaryType | import("./types").MethodType | import("./types").ModuleType | import("./types").FunctionType | import("./types").ClassType | import("./types").ObjectType | import("./types").EnumType | import("./types").SymbolType | import("./types").TypedefType | null;
23
23
  export declare function resolveDottedMember(istate: InterpState, object: ExactOrUnion, next: mctree.DottedMemberExpression): {
@@ -41,6 +41,7 @@ interface OptimizePrgAndDebug extends BaseNode {
41
41
  xmlOffset: number;
42
42
  xmlLength: number;
43
43
  key: crypto.KeyObject;
44
+ config: BuildConfig | undefined;
44
45
  };
45
46
  }
46
47
  export declare type WorkerTask = BuildOptimizedProject | GenerateOptimizedProject | GenerateOneConfig | OptimizePrgAndDebug;
package/build/util.cjs CHANGED
@@ -18,32 +18,32 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
  var util_exports = {};
20
20
  __export(util_exports, {
21
- GenericQueue: () => import_chunk_APACX34C.GenericQueue,
22
- bumpLogging: () => import_chunk_APACX34C.bumpLogging,
23
- copyRecursiveAsNeeded: () => import_chunk_APACX34C.copyRecursiveAsNeeded,
24
- every: () => import_chunk_APACX34C.every,
25
- first_modified: () => import_chunk_APACX34C.first_modified,
26
- forEach: () => import_chunk_APACX34C.forEach,
27
- globSome: () => import_chunk_APACX34C.globSome,
28
- globa: () => import_chunk_APACX34C.globa,
29
- last_modified: () => import_chunk_APACX34C.last_modified,
30
- log: () => import_chunk_APACX34C.log,
31
- logger: () => import_chunk_APACX34C.logger,
32
- map: () => import_chunk_APACX34C.map,
33
- popcount: () => import_chunk_APACX34C.popcount,
34
- promiseAll: () => import_chunk_APACX34C.promiseAll,
35
- pushUnique: () => import_chunk_APACX34C.pushUnique,
36
- readByLine: () => import_chunk_APACX34C.readByLine,
37
- reduce: () => import_chunk_APACX34C.reduce,
38
- sameArrays: () => import_chunk_APACX34C.sameArrays,
39
- setBanner: () => import_chunk_APACX34C.setBanner,
40
- some: () => import_chunk_APACX34C.some,
41
- spawnByLine: () => import_chunk_APACX34C.spawnByLine,
42
- wouldLog: () => import_chunk_APACX34C.wouldLog
21
+ GenericQueue: () => import_chunk_HHQDDCTP.GenericQueue,
22
+ bumpLogging: () => import_chunk_HHQDDCTP.bumpLogging,
23
+ copyRecursiveAsNeeded: () => import_chunk_HHQDDCTP.copyRecursiveAsNeeded,
24
+ every: () => import_chunk_HHQDDCTP.every,
25
+ first_modified: () => import_chunk_HHQDDCTP.first_modified,
26
+ forEach: () => import_chunk_HHQDDCTP.forEach,
27
+ globSome: () => import_chunk_HHQDDCTP.globSome,
28
+ globa: () => import_chunk_HHQDDCTP.globa,
29
+ last_modified: () => import_chunk_HHQDDCTP.last_modified,
30
+ log: () => import_chunk_HHQDDCTP.log,
31
+ logger: () => import_chunk_HHQDDCTP.logger,
32
+ map: () => import_chunk_HHQDDCTP.map,
33
+ popcount: () => import_chunk_HHQDDCTP.popcount,
34
+ promiseAll: () => import_chunk_HHQDDCTP.promiseAll,
35
+ pushUnique: () => import_chunk_HHQDDCTP.pushUnique,
36
+ readByLine: () => import_chunk_HHQDDCTP.readByLine,
37
+ reduce: () => import_chunk_HHQDDCTP.reduce,
38
+ sameArrays: () => import_chunk_HHQDDCTP.sameArrays,
39
+ setBanner: () => import_chunk_HHQDDCTP.setBanner,
40
+ some: () => import_chunk_HHQDDCTP.some,
41
+ spawnByLine: () => import_chunk_HHQDDCTP.spawnByLine,
42
+ wouldLog: () => import_chunk_HHQDDCTP.wouldLog
43
43
  });
44
44
  module.exports = __toCommonJS(util_exports);
45
- var import_chunk_APACX34C = require("./chunk-APACX34C.cjs");
46
- (0, import_chunk_APACX34C.init_util)();
45
+ var import_chunk_HHQDDCTP = require("./chunk-HHQDDCTP.cjs");
46
+ (0, import_chunk_HHQDDCTP.init_util)();
47
47
  // Annotate the CommonJS export names for ESM import in node:
48
48
  0 && (module.exports = {
49
49
  GenericQueue,
@@ -21,15 +21,15 @@ __export(worker_thread_exports, {
21
21
  default: () => worker_thread_default
22
22
  });
23
23
  module.exports = __toCommonJS(worker_thread_exports);
24
- var import_chunk_DCGJCC63 = require("./chunk-DCGJCC63.cjs");
25
- var import_chunk_APACX34C = require("./chunk-APACX34C.cjs");
24
+ var import_chunk_563GVBVT = require("./chunk-563GVBVT.cjs");
25
+ var import_chunk_HHQDDCTP = require("./chunk-HHQDDCTP.cjs");
26
26
  var import_node_worker_threads = require("node:worker_threads");
27
- var require_worker_thread = (0, import_chunk_APACX34C.__commonJS)({
27
+ var require_worker_thread = (0, import_chunk_HHQDDCTP.__commonJS)({
28
28
  "src/worker-thread.ts"() {
29
- (0, import_chunk_DCGJCC63.init_worker_task)();
29
+ (0, import_chunk_563GVBVT.init_worker_task)();
30
30
  if (import_node_worker_threads.parentPort) {
31
31
  import_node_worker_threads.parentPort.on("message", async (task) => {
32
- return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_DCGJCC63.performTask)(task));
32
+ return import_node_worker_threads.parentPort.postMessage(await (0, import_chunk_563GVBVT.performTask)(task));
33
33
  });
34
34
  }
35
35
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@markw65/monkeyc-optimizer",
3
3
  "type": "commonjs",
4
- "version": "1.1.20",
4
+ "version": "1.1.22",
5
5
  "description": "Source to source optimizer for Garmin Monkey C code",
6
6
  "main": "build/optimizer.cjs",
7
7
  "types": "build/src/optimizer.d.ts",
@@ -21,12 +21,13 @@
21
21
  "build-debug": "node esbuild.mjs",
22
22
  "build-release": "node esbuild.mjs --release",
23
23
  "prepack": "node esbuild.mjs --release",
24
- "test": "npm run test-mocha && npm run test-optimized && npm run test-unopt && npm run test-remote && npm run test-remote-tests",
24
+ "test": "npm run test-mocha && npm run test-optimized && npm run test-unopt && npm run test-post-only && npm run test-remote && npm run test-remote-tests",
25
25
  "test-mocha": "npx mocha --timeout 999999 build/mocha.cjs",
26
26
  "test-remote": "node ./test/test.js --showInfo --postOptimize --product=pick-one --github",
27
27
  "test-remote-tests": "node ./test/test.js --showInfo --postOptimize --product=pick-one --run-tests --github",
28
28
  "test-optimized": "node test/test.js --showInfo --postOptimize --typeCheckLevel Strict --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
29
29
  "test-unopt": "node test/test.js --typeCheckLevel Strict --skipOptimization --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
30
+ "test-post-only": "node test/test.js --typeCheckLevel Strict --skipOptimization --postOptimize --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
30
31
  "test-garmin-opt": "node test/test.js --typeCheckLevel Strict --skipOptimization --garminOptLevel=2 --run-tests --product=fenix5 --product=fr235 --jungle ./test/OptimizerTests/monkey.jungle",
31
32
  "eslint": "npx eslint ."
32
33
  },
@@ -36,7 +37,6 @@
36
37
  "build/sdk-util.cjs",
37
38
  "build/api.cjs",
38
39
  "build/worker-thread.cjs",
39
- "build/worker-pool.cjs",
40
40
  "build/chunk-*.cjs",
41
41
  "build/src/**/*.d.ts"
42
42
  ],
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var worker_pool_exports = {};
20
- __export(worker_pool_exports, {
21
- runTaskInPool: () => import_chunk_DCGJCC63.runTaskInPool,
22
- startPool: () => import_chunk_DCGJCC63.startPool,
23
- stopPool: () => import_chunk_DCGJCC63.stopPool
24
- });
25
- module.exports = __toCommonJS(worker_pool_exports);
26
- var import_chunk_DCGJCC63 = require("./chunk-DCGJCC63.cjs");
27
- var import_chunk_APACX34C = require("./chunk-APACX34C.cjs");
28
- (0, import_chunk_DCGJCC63.init_worker_pool)();
29
- // Annotate the CommonJS export names for ESM import in node:
30
- 0 && (module.exports = {
31
- runTaskInPool,
32
- startPool,
33
- stopPool
34
- });