fix: remove unneeded LOAD_REGEX instruction

This commit is contained in:
2025-01-22 01:54:03 +02:00
parent 01e86b5e70
commit 582753440b
7 changed files with 9 additions and 29 deletions

View File

@@ -1,4 +1,4 @@
import { object, setGlobalPrototypes, target } from "./primordials.ts";
import { object, setGlobalPrototypes, setIntrinsic, target } from "./primordials.ts";
import { Error, RangeError, SyntaxError, TypeError } from "./values/errors.ts";
import { Boolean } from "./values/boolean.ts";
import { Function } from "./values/function.ts";
@@ -87,5 +87,5 @@ setGlobalPrototypes({
type: TypeError.prototype,
uint8: Uint8Array.prototype,
int32: Int32Array.prototype,
regex: RegExp,
});
setIntrinsic("regex", RegExp);

View File

@@ -110,6 +110,7 @@ export interface Primordials {
now(): number;
next(func: () => void): void;
schedule(func: () => void, delay: number): () => void;
setIntrinsic(key: string, val: any): void;
}
// prevent optimization to "undefined", which doesn't exist yet
@@ -132,6 +133,7 @@ export const {
now,
next,
schedule,
setIntrinsic,
} = primordials;
export type regex = InstanceType<typeof regex>;