Compare commits

..

3 Commits

Author SHA1 Message Date
4ea14ca1f5
build: enable minification 2025-01-06 17:06:10 +02:00
f6ce261485
fix: add custom global functions to ts decls 2025-01-06 17:05:59 +02:00
51b347e0d7
fix: more stable engine exit 2025-01-06 17:05:37 +02:00
4 changed files with 8 additions and 3 deletions

View File

@ -7,7 +7,7 @@ const nodeResolve = require("@rollup/plugin-node-resolve");
const json = require("@rollup/plugin-json"); const json = require("@rollup/plugin-json");
const { resolve } = require("path"); const { resolve } = require("path");
const shouldMinify = () => false; const shouldMinify = () => true;
const shouldEmitSourcemaps = () => true; const shouldEmitSourcemaps = () => true;
const shouldPolyfill = () => !!process.env.POLYFILLS; const shouldPolyfill = () => !!process.env.POLYFILLS;
@ -99,6 +99,7 @@ const construct = (input, output) => defineConfig({
shouldMinify() && terser({ shouldMinify() && terser({
sourceMap: shouldEmitSourcemaps(), sourceMap: shouldEmitSourcemaps(),
keep_classnames: true, keep_classnames: true,
keep_fnames: true,
}), }),
], ],
output: { output: {

View File

@ -40,7 +40,7 @@ public final class Engine implements EventLoop {
try { try {
((Task<Object>)task).notifier.complete(task.runnable.get()); ((Task<Object>)task).notifier.complete(task.runnable.get());
} }
catch (CancellationException e) { throw e; } catch (CancellationException e) { task.notifier.cancel(false); throw e; }
catch (RuntimeException e) { task.notifier.completeExceptionally(e); } catch (RuntimeException e) { task.notifier.completeExceptionally(e); }
} }
catch (InterruptedException | CancellationException e) { catch (InterruptedException | CancellationException e) {

View File

@ -213,7 +213,9 @@ public final class Frame {
catch (StackOverflowError e) { throw STACK_OVERFLOW; } catch (StackOverflowError e) { throw STACK_OVERFLOW; }
catch (EngineException e) { error = e; } catch (EngineException e) { error = e; }
catch (RuntimeException e) { catch (RuntimeException e) {
System.out.println(dbg.getMapOrEmpty(function).toLocation(codePtr, true)); if (!(e instanceof CancellationException)) {
System.out.println(dbg.getMapOrEmpty(function).toLocation(codePtr, true));
}
throw e; throw e;
} }
} }

View File

@ -17,6 +17,8 @@
/// <reference path="./globals/weak-map.d.ts"/> /// <reference path="./globals/weak-map.d.ts"/>
declare function print(...args: any[]): void; declare function print(...args: any[]): void;
declare function exit(): never;
declare function measure(func: () => void): void;
declare type IArguments = Array<any>; declare type IArguments = Array<any>;