some minor restructuring

This commit is contained in:
2025-01-24 00:22:15 +02:00
parent 4389d115b6
commit 1e982cd2ef
6 changed files with 17 additions and 13 deletions

View File

@@ -72,7 +72,7 @@ export interface BufferPrimordials {
export interface FunctionPrimordials {
invokeType(args: IArguments, self: any): "new" | "call";
invokeTypeInfer(): "new" | "call";
target(): Function | null | undefined;
target(level?: number): Function | null | undefined;
setConstructable(func: Function, flag: boolean): void;
setCallable(func: Function, flag: boolean): void;
invoke(func: Function, self: any, args: any[]): any;

View File

@@ -58,6 +58,10 @@ export const Function = (() => {
public static compile(src: string, filename?: string) {
return compile(String(src), filename);
}
public static newTarget() {
return func.target(1);
}
}
func.setCallable(Function, true);