mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-15 23:30:00 -04:00
Function constructor proxy
This commit is contained in:
parent
c2d147442e
commit
d043ad0032
2 changed files with 23 additions and 37 deletions
|
@ -11,26 +11,26 @@ declare global {
|
|||
}
|
||||
|
||||
//eslint-disable-next-line
|
||||
type AnyFunction = Function;
|
||||
export type AnyFunction = Function;
|
||||
|
||||
type ProxyCtx = {
|
||||
export type ProxyCtx = {
|
||||
fn: AnyFunction;
|
||||
this: any;
|
||||
args: any[];
|
||||
newTarget: AnyFunction;
|
||||
return: (r: any) => void;
|
||||
};
|
||||
type Proxy = {
|
||||
export type Proxy = {
|
||||
construct?(ctx: ProxyCtx): any;
|
||||
apply?(ctx: ProxyCtx): any;
|
||||
};
|
||||
|
||||
type TrapCtx<T> = {
|
||||
export type TrapCtx<T> = {
|
||||
this: any;
|
||||
get: () => T;
|
||||
set: (v: T) => void;
|
||||
};
|
||||
type Trap<T> = {
|
||||
export type Trap<T> = {
|
||||
writable?: boolean;
|
||||
value?: any;
|
||||
enumerable?: boolean;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue