From 8de1e5aa11a056b12870fa3bac62d0bec1475932 Mon Sep 17 00:00:00 2001 From: FineArchs <133759614+FineArchs@users.noreply.github.com> Date: Fri, 25 Oct 2024 06:39:46 +0900 Subject: [PATCH] =?UTF-8?q?IRQ=E3=82=92=E3=82=AB=E3=82=B9=E3=82=BF?= =?UTF-8?q?=E3=83=9E=E3=82=A4=E3=82=BA=E5=8F=AF=E8=83=BD=E3=81=AB=20(#817)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * irq configuration * changelog * type fix * test * IRQ rate value restriction * fix and add test * test wip * fix test * api report * add comment * unuse concurrent for time-related tests --- etc/aiscript.api.md | 14 +++++- playground/src/App.vue | 14 +++++- playground/src/Settings.vue | 59 +++++++++++++++++++++++ src/error.ts | 9 ++++ src/interpreter/index.ts | 33 +++++++++++-- test/interpreter.ts | 94 ++++++++++++++++++++++++++++++++++++- unreleased/irq-config.md | 3 ++ 7 files changed, 215 insertions(+), 11 deletions(-) create mode 100644 playground/src/Settings.vue create mode 100644 unreleased/irq-config.md diff --git a/etc/aiscript.api.md b/etc/aiscript.api.md index 34eb9211..ad73857f 100644 --- a/etc/aiscript.api.md +++ b/etc/aiscript.api.md @@ -34,6 +34,13 @@ abstract class AiScriptError extends Error { pos?: Pos; } +// @public +class AiScriptHostsideError extends AiScriptError { + constructor(message: string, info?: unknown); + // (undocumented) + name: string; +} + // @public class AiScriptIndexOutOfRangeError extends AiScriptRuntimeError { constructor(message: string, info?: unknown); @@ -281,7 +288,8 @@ declare namespace errors { AiScriptNamespaceError, AiScriptRuntimeError, AiScriptIndexOutOfRangeError, - AiScriptUserError + AiScriptUserError, + AiScriptHostsideError } } export { errors } @@ -391,6 +399,8 @@ export class Interpreter { log?(type: string, params: LogObject): void; maxStep?: number; abortOnError?: boolean; + irqRate?: number; + irqSleep?: number | (() => Promise); }); // (undocumented) abort(): void; @@ -854,7 +864,7 @@ type VUserFn = VFnBase & { // Warnings were encountered during analysis: // -// src/interpreter/index.ts:39:4 - (ae-forgotten-export) The symbol "LogObject" needs to be exported by the entry point index.d.ts +// src/interpreter/index.ts:38:4 - (ae-forgotten-export) The symbol "LogObject" needs to be exported by the entry point index.d.ts // src/interpreter/value.ts:46:2 - (ae-forgotten-export) The symbol "Type" needs to be exported by the entry point index.d.ts // (No @packageDocumentation comment for this package) diff --git a/playground/src/App.vue b/playground/src/App.vue index 8a870b1a..9fb1351a 100644 --- a/playground/src/App.vue +++ b/playground/src/App.vue @@ -1,6 +1,7 @@