jseption 0.0.0-stage → 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +26 -0
- package/README.md +191 -2
- package/dist/atoms.d.ts +255 -0
- package/dist/atoms.js +445 -0
- package/dist/atoms.js.map +1 -0
- package/dist/builtins/array.d.ts +3 -0
- package/dist/builtins/array.js +116 -0
- package/dist/builtins/array.js.map +1 -0
- package/dist/builtins/bigint.d.ts +3 -0
- package/dist/builtins/bigint.js +122 -0
- package/dist/builtins/bigint.js.map +1 -0
- package/dist/builtins/boolean.d.ts +2 -0
- package/dist/builtins/boolean.js +26 -0
- package/dist/builtins/boolean.js.map +1 -0
- package/dist/builtins/date.d.ts +3 -0
- package/dist/builtins/date.js +1046 -0
- package/dist/builtins/date.js.map +1 -0
- package/dist/builtins/error.d.ts +2 -0
- package/dist/builtins/error.js +154 -0
- package/dist/builtins/error.js.map +1 -0
- package/dist/builtins/function.d.ts +5 -0
- package/dist/builtins/function.js +164 -0
- package/dist/builtins/function.js.map +1 -0
- package/dist/builtins/global.d.ts +2 -0
- package/dist/builtins/global.js +29 -0
- package/dist/builtins/global.js.map +1 -0
- package/dist/builtins/index.d.ts +3 -0
- package/dist/builtins/index.js +139 -0
- package/dist/builtins/index.js.map +1 -0
- package/dist/builtins/json.d.ts +6 -0
- package/dist/builtins/json.js +984 -0
- package/dist/builtins/json.js.map +1 -0
- package/dist/builtins/mapset.d.ts +4 -0
- package/dist/builtins/mapset.js +234 -0
- package/dist/builtins/mapset.js.map +1 -0
- package/dist/builtins/math.d.ts +2 -0
- package/dist/builtins/math.js +62 -0
- package/dist/builtins/math.js.map +1 -0
- package/dist/builtins/native.d.ts +22 -0
- package/dist/builtins/native.js +250 -0
- package/dist/builtins/native.js.map +1 -0
- package/dist/builtins/number.d.ts +4 -0
- package/dist/builtins/number.js +76 -0
- package/dist/builtins/number.js.map +1 -0
- package/dist/builtins/object.d.ts +12 -0
- package/dist/builtins/object.js +575 -0
- package/dist/builtins/object.js.map +1 -0
- package/dist/builtins/promise.d.ts +13 -0
- package/dist/builtins/promise.js +582 -0
- package/dist/builtins/promise.js.map +1 -0
- package/dist/builtins/proxy.d.ts +3 -0
- package/dist/builtins/proxy.js +226 -0
- package/dist/builtins/proxy.js.map +1 -0
- package/dist/builtins/reflect.d.ts +2 -0
- package/dist/builtins/reflect.js +109 -0
- package/dist/builtins/reflect.js.map +1 -0
- package/dist/builtins/regexp.d.ts +2 -0
- package/dist/builtins/regexp.js +203 -0
- package/dist/builtins/regexp.js.map +1 -0
- package/dist/builtins/string.d.ts +4 -0
- package/dist/builtins/string.js +135 -0
- package/dist/builtins/string.js.map +1 -0
- package/dist/builtins/symbol.d.ts +3 -0
- package/dist/builtins/symbol.js +98 -0
- package/dist/builtins/symbol.js.map +1 -0
- package/dist/builtins/typedarray.d.ts +15 -0
- package/dist/builtins/typedarray.js +1838 -0
- package/dist/builtins/typedarray.js.map +1 -0
- package/dist/builtins/weakref.d.ts +18 -0
- package/dist/builtins/weakref.js +130 -0
- package/dist/builtins/weakref.js.map +1 -0
- package/dist/dump.d.ts +2 -0
- package/dist/dump.js +124 -0
- package/dist/dump.js.map +1 -0
- package/dist/embed.d.ts +18 -0
- package/dist/embed.js +286 -0
- package/dist/embed.js.map +1 -0
- package/dist/interpreter.d.ts +81 -0
- package/dist/interpreter.js +3768 -0
- package/dist/interpreter.js.map +1 -0
- package/dist/jit.d.ts +59 -0
- package/dist/jit.js +3429 -0
- package/dist/jit.js.map +1 -0
- package/dist/jit_hook.d.ts +21 -0
- package/dist/jit_hook.js +4 -0
- package/dist/jit_hook.js.map +1 -0
- package/dist/jit_runtime.d.ts +101 -0
- package/dist/jit_runtime.js +690 -0
- package/dist/jit_runtime.js.map +1 -0
- package/dist/jit_stack.d.ts +24 -0
- package/dist/jit_stack.js +227 -0
- package/dist/jit_stack.js.map +1 -0
- package/dist/jseption.d.ts +15 -0
- package/dist/jseption.js +61 -0
- package/dist/jseption.js.map +1 -0
- package/dist/opcodes.d.ts +347 -0
- package/dist/opcodes.js +322 -0
- package/dist/opcodes.js.map +1 -0
- package/dist/parser.d.ts +283 -0
- package/dist/parser.js +9752 -0
- package/dist/parser.js.map +1 -0
- package/dist/qjs.d.ts +2 -0
- package/dist/qjs.js +122 -0
- package/dist/qjs.js.map +1 -0
- package/dist/quickjs.d.ts +460 -0
- package/dist/quickjs.js +3408 -0
- package/dist/quickjs.js.map +1 -0
- package/dist/std.d.ts +4 -0
- package/dist/std.js +273 -0
- package/dist/std.js.map +1 -0
- package/dist/values.d.ts +447 -0
- package/dist/values.js +461 -0
- package/dist/values.js.map +1 -0
- package/package.json +59 -4
package/dist/values.d.ts
ADDED
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
import { JSAtom } from './atoms.ts';
|
|
2
|
+
export declare const enum JSTag {
|
|
3
|
+
UNINITIALIZED = 0,
|
|
4
|
+
INT = 1,
|
|
5
|
+
BOOL = 2,
|
|
6
|
+
NULL = 3,
|
|
7
|
+
UNDEFINED = 4,
|
|
8
|
+
CATCH_OFFSET = 5,
|
|
9
|
+
EXCEPTION = 6,
|
|
10
|
+
FLOAT64 = 7,
|
|
11
|
+
BIG_INT = 8,
|
|
12
|
+
STRING = 9,
|
|
13
|
+
SYMBOL = 10,
|
|
14
|
+
OBJECT = 11
|
|
15
|
+
}
|
|
16
|
+
export declare class JSSpecial {
|
|
17
|
+
tag: JSTag;
|
|
18
|
+
v: number;
|
|
19
|
+
constructor(tag: JSTag, v: number);
|
|
20
|
+
}
|
|
21
|
+
export declare const JS_UNINITIALIZED: JSSpecial;
|
|
22
|
+
export declare const JS_EXCEPTION: JSSpecial;
|
|
23
|
+
export declare const JS_UNDEFINED: undefined;
|
|
24
|
+
export declare const JS_NULL: null;
|
|
25
|
+
export declare const JS_TRUE = true;
|
|
26
|
+
export declare const JS_FALSE = false;
|
|
27
|
+
export type JSObject = object;
|
|
28
|
+
export type JSValue = undefined | null | boolean | number | string | bigint | symbol | JSObject | JSSpecial;
|
|
29
|
+
export type JSValueConst = JSValue;
|
|
30
|
+
export declare function JS_NewCatchOffset(v: number): JSSpecial;
|
|
31
|
+
export declare function JS_VALUE_GET_TAG(v: JSValue): JSTag;
|
|
32
|
+
export declare function JS_IsException(v: JSValue): v is JSSpecial;
|
|
33
|
+
export declare function JS_IsUninitialized(v: JSValue): boolean;
|
|
34
|
+
export declare function JS_IsUndefined(v: JSValue): v is undefined;
|
|
35
|
+
export declare function JS_IsNull(v: JSValue): v is null;
|
|
36
|
+
export declare function JS_IsObject(v: JSValue): v is JSObject;
|
|
37
|
+
export declare function JS_IsString(v: JSValue): v is string;
|
|
38
|
+
export declare function JS_IsSymbol(v: JSValue): v is symbol;
|
|
39
|
+
export declare function JS_IsNumber(v: JSValue): v is number;
|
|
40
|
+
export declare function JS_IsBigInt(v: JSValue): v is bigint;
|
|
41
|
+
export declare function JS_IsBool(v: JSValue): v is boolean;
|
|
42
|
+
export declare function JS_IsCatchOffset(v: JSValue): v is JSSpecial;
|
|
43
|
+
export declare const enum JSClassID {
|
|
44
|
+
OBJECT = 1,
|
|
45
|
+
ARRAY = 2,
|
|
46
|
+
ERROR = 3,
|
|
47
|
+
NUMBER = 4,
|
|
48
|
+
STRING = 5,
|
|
49
|
+
BOOLEAN = 6,
|
|
50
|
+
SYMBOL = 7,
|
|
51
|
+
ARGUMENTS = 8,
|
|
52
|
+
MAPPED_ARGUMENTS = 9,
|
|
53
|
+
DATE = 10,
|
|
54
|
+
MODULE_NS = 11,
|
|
55
|
+
C_FUNCTION = 12,
|
|
56
|
+
BYTECODE_FUNCTION = 13,
|
|
57
|
+
BOUND_FUNCTION = 14,
|
|
58
|
+
C_FUNCTION_DATA = 15,
|
|
59
|
+
GENERATOR_FUNCTION = 16,
|
|
60
|
+
FOR_IN_ITERATOR = 17,
|
|
61
|
+
REGEXP = 18,
|
|
62
|
+
ARRAY_BUFFER = 19,
|
|
63
|
+
SHARED_ARRAY_BUFFER = 20,
|
|
64
|
+
UINT8C_ARRAY = 21,
|
|
65
|
+
INT8_ARRAY = 22,
|
|
66
|
+
UINT8_ARRAY = 23,
|
|
67
|
+
INT16_ARRAY = 24,
|
|
68
|
+
UINT16_ARRAY = 25,
|
|
69
|
+
INT32_ARRAY = 26,
|
|
70
|
+
UINT32_ARRAY = 27,
|
|
71
|
+
BIG_INT64_ARRAY = 28,
|
|
72
|
+
BIG_UINT64_ARRAY = 29,
|
|
73
|
+
FLOAT32_ARRAY = 30,
|
|
74
|
+
FLOAT64_ARRAY = 31,
|
|
75
|
+
DATAVIEW = 32,
|
|
76
|
+
BIG_INT = 33,
|
|
77
|
+
MAP = 34,
|
|
78
|
+
SET = 35,
|
|
79
|
+
WEAKMAP = 36,
|
|
80
|
+
WEAKSET = 37,
|
|
81
|
+
MAP_ITERATOR = 38,
|
|
82
|
+
SET_ITERATOR = 39,
|
|
83
|
+
ARRAY_ITERATOR = 40,
|
|
84
|
+
STRING_ITERATOR = 41,
|
|
85
|
+
REGEXP_STRING_ITERATOR = 42,
|
|
86
|
+
GENERATOR = 43,
|
|
87
|
+
PROXY = 44,
|
|
88
|
+
PROMISE = 45,
|
|
89
|
+
PROMISE_RESOLVE_FUNCTION = 46,
|
|
90
|
+
PROMISE_REJECT_FUNCTION = 47,
|
|
91
|
+
ASYNC_FUNCTION = 48,
|
|
92
|
+
ASYNC_FUNCTION_RESOLVE = 49,
|
|
93
|
+
ASYNC_FUNCTION_REJECT = 50,
|
|
94
|
+
ASYNC_FROM_SYNC_ITERATOR = 51,
|
|
95
|
+
ASYNC_GENERATOR_FUNCTION = 52,
|
|
96
|
+
ASYNC_GENERATOR = 53,
|
|
97
|
+
WEAK_REF = 54,
|
|
98
|
+
FINALIZATION_REGISTRY = 55,
|
|
99
|
+
INIT_COUNT = 56
|
|
100
|
+
}
|
|
101
|
+
export declare const JS_PROP_CONFIGURABLE: number;
|
|
102
|
+
export declare const JS_PROP_WRITABLE: number;
|
|
103
|
+
export declare const JS_PROP_ENUMERABLE: number;
|
|
104
|
+
export declare const JS_PROP_C_W_E: number;
|
|
105
|
+
export declare const JS_PROP_LENGTH: number;
|
|
106
|
+
export declare const JS_PROP_TMASK: number;
|
|
107
|
+
export declare const JS_PROP_NORMAL: number;
|
|
108
|
+
export declare const JS_PROP_GETSET: number;
|
|
109
|
+
export declare const JS_PROP_VARREF: number;
|
|
110
|
+
export declare const JS_PROP_AUTOINIT: number;
|
|
111
|
+
export declare const JS_PROP_HAS_SHIFT = 8;
|
|
112
|
+
export declare const JS_PROP_HAS_CONFIGURABLE: number;
|
|
113
|
+
export declare const JS_PROP_HAS_WRITABLE: number;
|
|
114
|
+
export declare const JS_PROP_HAS_ENUMERABLE: number;
|
|
115
|
+
export declare const JS_PROP_HAS_GET: number;
|
|
116
|
+
export declare const JS_PROP_HAS_SET: number;
|
|
117
|
+
export declare const JS_PROP_HAS_VALUE: number;
|
|
118
|
+
export declare const JS_PROP_THROW: number;
|
|
119
|
+
export declare const JS_PROP_THROW_STRICT: number;
|
|
120
|
+
export declare const JS_PROP_NO_ADD: number;
|
|
121
|
+
export declare const JS_PROP_NO_EXOTIC: number;
|
|
122
|
+
export declare const JS_PROP_DEFINE_PROPERTY: number;
|
|
123
|
+
export declare const JS_PROP_REFLECT_DEFINE_PROPERTY: number;
|
|
124
|
+
export declare const JS_GPN_STRING_MASK: number;
|
|
125
|
+
export declare const JS_GPN_SYMBOL_MASK: number;
|
|
126
|
+
export declare const JS_GPN_PRIVATE_MASK: number;
|
|
127
|
+
export declare const JS_GPN_ENUM_ONLY: number;
|
|
128
|
+
export declare const JS_GPN_SET_ENUM: number;
|
|
129
|
+
export declare const JS_EVAL_TYPE_GLOBAL: number;
|
|
130
|
+
export declare const JS_EVAL_TYPE_MODULE: number;
|
|
131
|
+
export declare const JS_EVAL_TYPE_DIRECT: number;
|
|
132
|
+
export declare const JS_EVAL_TYPE_INDIRECT: number;
|
|
133
|
+
export declare const JS_EVAL_TYPE_MASK: number;
|
|
134
|
+
export declare const JS_EVAL_FLAG_STRICT: number;
|
|
135
|
+
export declare const JS_EVAL_FLAG_COMPILE_ONLY: number;
|
|
136
|
+
export declare const JS_EVAL_FLAG_BACKTRACE_BARRIER: number;
|
|
137
|
+
export declare const JS_EVAL_FLAG_ASYNC: number;
|
|
138
|
+
export declare const JS_CALL_FLAG_CONSTRUCTOR: number;
|
|
139
|
+
export declare const JS_CALL_FLAG_COPY_ARGV: number;
|
|
140
|
+
export declare const JS_CALL_FLAG_GENERATOR: number;
|
|
141
|
+
export declare const JS_MODE_STRICT: number;
|
|
142
|
+
export declare const JS_MODE_ASYNC: number;
|
|
143
|
+
export declare const JS_MODE_BACKTRACE_BARRIER: number;
|
|
144
|
+
export declare const enum JSFunctionKind {
|
|
145
|
+
NORMAL = 0,
|
|
146
|
+
GENERATOR = 1,
|
|
147
|
+
ASYNC = 2,
|
|
148
|
+
ASYNC_GENERATOR = 3
|
|
149
|
+
}
|
|
150
|
+
export declare const enum JSVarKind {
|
|
151
|
+
NORMAL = 0,
|
|
152
|
+
FUNCTION_DECL = 1,/* lexical var with function declaration */
|
|
153
|
+
NEW_FUNCTION_DECL = 2,/* lexical var with async/generator function declaration */
|
|
154
|
+
CATCH = 3,
|
|
155
|
+
FUNCTION_NAME = 4,/* function expression name */
|
|
156
|
+
PRIVATE_FIELD = 5,
|
|
157
|
+
PRIVATE_METHOD = 6,
|
|
158
|
+
PRIVATE_GETTER = 7,
|
|
159
|
+
PRIVATE_SETTER = 8,
|
|
160
|
+
PRIVATE_GETTER_SETTER = 9
|
|
161
|
+
}
|
|
162
|
+
export declare const enum JSErrorEnum {
|
|
163
|
+
EVAL_ERROR = 0,
|
|
164
|
+
RANGE_ERROR = 1,
|
|
165
|
+
REFERENCE_ERROR = 2,
|
|
166
|
+
SYNTAX_ERROR = 3,
|
|
167
|
+
TYPE_ERROR = 4,
|
|
168
|
+
URI_ERROR = 5,
|
|
169
|
+
INTERNAL_ERROR = 6,
|
|
170
|
+
AGGREGATE_ERROR = 7,
|
|
171
|
+
NATIVE_ERROR_COUNT = 8,
|
|
172
|
+
PLAIN_ERROR = 8
|
|
173
|
+
}
|
|
174
|
+
export declare class JSVarDef {
|
|
175
|
+
var_name: JSAtom;
|
|
176
|
+
scope_level: number;
|
|
177
|
+
scope_next: number;
|
|
178
|
+
is_const: boolean;
|
|
179
|
+
is_lexical: boolean;
|
|
180
|
+
is_captured: boolean;
|
|
181
|
+
is_static_private: boolean;
|
|
182
|
+
var_kind: JSVarKind;
|
|
183
|
+
func_pool_idx: number;
|
|
184
|
+
constructor(var_name: JSAtom);
|
|
185
|
+
}
|
|
186
|
+
export declare class JSClosureVar {
|
|
187
|
+
is_local: boolean;
|
|
188
|
+
is_arg: boolean;
|
|
189
|
+
is_const: boolean;
|
|
190
|
+
is_lexical: boolean;
|
|
191
|
+
var_kind: JSVarKind;
|
|
192
|
+
var_idx: number;
|
|
193
|
+
var_name: JSAtom;
|
|
194
|
+
}
|
|
195
|
+
export declare class JSFunctionBytecode {
|
|
196
|
+
js_mode: number;
|
|
197
|
+
has_prototype: boolean;
|
|
198
|
+
has_simple_parameter_list: boolean;
|
|
199
|
+
is_derived_class_constructor: boolean;
|
|
200
|
+
need_home_object: boolean;
|
|
201
|
+
func_kind: JSFunctionKind;
|
|
202
|
+
new_target_allowed: boolean;
|
|
203
|
+
super_call_allowed: boolean;
|
|
204
|
+
super_allowed: boolean;
|
|
205
|
+
arguments_allowed: boolean;
|
|
206
|
+
has_debug: boolean;
|
|
207
|
+
is_direct_or_indirect_eval: boolean;
|
|
208
|
+
byte_code_buf: Uint8Array;
|
|
209
|
+
byte_code_len: number;
|
|
210
|
+
func_name: JSAtom;
|
|
211
|
+
vardefs: JSVarDef[];
|
|
212
|
+
closure_var: JSClosureVar[];
|
|
213
|
+
arg_count: number;
|
|
214
|
+
var_count: number;
|
|
215
|
+
defined_arg_count: number;
|
|
216
|
+
stack_size: number;
|
|
217
|
+
realm: any;
|
|
218
|
+
cpool: (JSValue | JSFunctionBytecode)[];
|
|
219
|
+
debug: {
|
|
220
|
+
filename: JSAtom;
|
|
221
|
+
source: string | null;
|
|
222
|
+
pc2line: Uint8Array | null;
|
|
223
|
+
source_len: number;
|
|
224
|
+
};
|
|
225
|
+
call_count: number;
|
|
226
|
+
no_jit: boolean;
|
|
227
|
+
compiled: any;
|
|
228
|
+
compiled_ctor: any;
|
|
229
|
+
wrapper_factory: any;
|
|
230
|
+
uses_args: number;
|
|
231
|
+
loop_count: number;
|
|
232
|
+
osr: Map<number, any> | null;
|
|
233
|
+
}
|
|
234
|
+
export declare class JSVarRef {
|
|
235
|
+
is_detached: boolean;
|
|
236
|
+
frame: JSStackFrame | null;
|
|
237
|
+
is_arg: boolean;
|
|
238
|
+
var_idx: number;
|
|
239
|
+
value: JSValue;
|
|
240
|
+
constructor(frame: JSStackFrame | null, is_arg: boolean, var_idx: number);
|
|
241
|
+
get(): JSValue;
|
|
242
|
+
set(v: JSValue): void;
|
|
243
|
+
detach(): void;
|
|
244
|
+
}
|
|
245
|
+
export declare function new_var_ref_cell(value: JSValue): JSVarRef;
|
|
246
|
+
export declare const EMPTY_BUF: JSValue[];
|
|
247
|
+
export declare const EMPTY_VAR_REFS: JSVarRef[];
|
|
248
|
+
export declare class JSStackFrame {
|
|
249
|
+
prev_frame: JSStackFrame | null;
|
|
250
|
+
cur_func: JSValue;
|
|
251
|
+
arg_buf: JSValue[];
|
|
252
|
+
var_buf: JSValue[];
|
|
253
|
+
stack_buf: JSValue[];
|
|
254
|
+
sp: number;
|
|
255
|
+
cur_pc: number;
|
|
256
|
+
arg_count: number;
|
|
257
|
+
js_mode: number;
|
|
258
|
+
cur_sp: number;
|
|
259
|
+
var_refs: JSVarRef[];
|
|
260
|
+
this_obj: JSValue;
|
|
261
|
+
new_target: JSValue;
|
|
262
|
+
osr: boolean;
|
|
263
|
+
}
|
|
264
|
+
export declare const enum JSGeneratorState {
|
|
265
|
+
SUSPENDED_START = 0,
|
|
266
|
+
SUSPENDED_YIELD = 1,
|
|
267
|
+
SUSPENDED_YIELD_STAR = 2,
|
|
268
|
+
EXECUTING = 3,
|
|
269
|
+
COMPLETED = 4
|
|
270
|
+
}
|
|
271
|
+
export declare class JSAsyncFunctionState {
|
|
272
|
+
this_val: JSValue;
|
|
273
|
+
argc: number;
|
|
274
|
+
throw_flag: boolean;
|
|
275
|
+
is_completed: boolean;
|
|
276
|
+
frame: JSStackFrame;
|
|
277
|
+
func_obj: JSValue;
|
|
278
|
+
resolving_funcs: [JSValue, JSValue];
|
|
279
|
+
promise: JSValue;
|
|
280
|
+
}
|
|
281
|
+
export declare class JSGeneratorData {
|
|
282
|
+
state: JSGeneratorState;
|
|
283
|
+
func_state: JSAsyncFunctionState | null;
|
|
284
|
+
}
|
|
285
|
+
export declare class JSBoundFunctionData {
|
|
286
|
+
func_obj: JSObject;
|
|
287
|
+
this_val: JSValue;
|
|
288
|
+
argv: JSValue[];
|
|
289
|
+
constructor(func_obj: JSObject, this_val: JSValue, argv: JSValue[]);
|
|
290
|
+
}
|
|
291
|
+
export type JSCFunction = (ctx: any, this_val: JSValue, argv: JSValue[]) => JSValue;
|
|
292
|
+
export type JSCFunctionMagic = (ctx: any, this_val: JSValue, argv: JSValue[], magic: number) => JSValue;
|
|
293
|
+
export type JSCFunctionData = (ctx: any, this_val: JSValue, argv: JSValue[], magic: number, data: JSValue[]) => JSValue;
|
|
294
|
+
export type JSCFunctionConstructor = (ctx: any, new_target: JSValue, argv: JSValue[]) => JSValue;
|
|
295
|
+
export type JSCFunctionConstructorMagic = (ctx: any, new_target: JSValue, argv: JSValue[], magic: number) => JSValue;
|
|
296
|
+
export declare const enum JSCFunctionEnum {
|
|
297
|
+
generic = 0,
|
|
298
|
+
generic_magic = 1,
|
|
299
|
+
constructor = 2,
|
|
300
|
+
constructor_magic = 3,
|
|
301
|
+
constructor_or_func = 4,
|
|
302
|
+
constructor_or_func_magic = 5,
|
|
303
|
+
f_f = 6,
|
|
304
|
+
f_f_f = 7,
|
|
305
|
+
getter = 8,
|
|
306
|
+
setter = 9,
|
|
307
|
+
getter_magic = 10,
|
|
308
|
+
setter_magic = 11,
|
|
309
|
+
iterator_next = 12
|
|
310
|
+
}
|
|
311
|
+
export declare class JSCFunctionRecord {
|
|
312
|
+
func: Function;
|
|
313
|
+
length: number;
|
|
314
|
+
cproto: JSCFunctionEnum;
|
|
315
|
+
magic: number;
|
|
316
|
+
constructor(func: Function, length: number, cproto: JSCFunctionEnum, magic: number);
|
|
317
|
+
}
|
|
318
|
+
export declare class JSCFunctionDataRecord {
|
|
319
|
+
func: JSCFunctionData;
|
|
320
|
+
length: number;
|
|
321
|
+
magic: number;
|
|
322
|
+
data: JSValue[];
|
|
323
|
+
constructor(func: JSCFunctionData, length: number, magic: number, data: JSValue[]);
|
|
324
|
+
}
|
|
325
|
+
export declare class JSForInState {
|
|
326
|
+
obj: JSValue;
|
|
327
|
+
idx: number;
|
|
328
|
+
keys: (string | number)[];
|
|
329
|
+
own_count: number;
|
|
330
|
+
}
|
|
331
|
+
export declare class JSMapRecord {
|
|
332
|
+
key: JSValue;
|
|
333
|
+
value: JSValue;
|
|
334
|
+
empty: boolean;
|
|
335
|
+
constructor(key: JSValue, value: JSValue);
|
|
336
|
+
}
|
|
337
|
+
export declare class JSMapState {
|
|
338
|
+
is_weak: boolean;
|
|
339
|
+
records: JSMapRecord[];
|
|
340
|
+
map: Map<unknown, JSMapRecord>;
|
|
341
|
+
weak: WeakMap<object, JSMapRecord> | null;
|
|
342
|
+
record_count: number;
|
|
343
|
+
iterator_count: number;
|
|
344
|
+
constructor(is_weak: boolean);
|
|
345
|
+
}
|
|
346
|
+
export declare class JSMapIteratorData {
|
|
347
|
+
obj: JSValue;
|
|
348
|
+
kind: number;
|
|
349
|
+
idx: number;
|
|
350
|
+
constructor(obj: JSValue, kind: number);
|
|
351
|
+
}
|
|
352
|
+
export declare class JSArrayIteratorData {
|
|
353
|
+
obj: JSValue;
|
|
354
|
+
kind: number;
|
|
355
|
+
idx: number;
|
|
356
|
+
constructor(obj: JSValue, kind: number);
|
|
357
|
+
}
|
|
358
|
+
export declare class JSRegExpStringIteratorData {
|
|
359
|
+
iterating_regexp: JSValue;
|
|
360
|
+
iterated_string: JSValue;
|
|
361
|
+
global: boolean;
|
|
362
|
+
unicode: boolean;
|
|
363
|
+
done: boolean;
|
|
364
|
+
constructor(re: JSValue, str: JSValue, global: boolean, unicode: boolean);
|
|
365
|
+
}
|
|
366
|
+
export declare const enum JSPromiseState {
|
|
367
|
+
PENDING = 0,
|
|
368
|
+
FULFILLED = 1,
|
|
369
|
+
REJECTED = 2
|
|
370
|
+
}
|
|
371
|
+
export declare class JSPromiseReactionData {
|
|
372
|
+
resolving_funcs: [JSValue, JSValue];
|
|
373
|
+
handler: JSValue;
|
|
374
|
+
constructor(resolving_funcs: [JSValue, JSValue], handler: JSValue);
|
|
375
|
+
}
|
|
376
|
+
export declare class JSPromiseData {
|
|
377
|
+
promise_state: JSPromiseState;
|
|
378
|
+
is_handled: boolean;
|
|
379
|
+
promise_reactions: [JSPromiseReactionData[], JSPromiseReactionData[]];
|
|
380
|
+
promise_result: JSValue;
|
|
381
|
+
}
|
|
382
|
+
export declare class JSPromiseFunctionData {
|
|
383
|
+
promise: JSValue;
|
|
384
|
+
presolved: {
|
|
385
|
+
already_resolved: boolean;
|
|
386
|
+
};
|
|
387
|
+
constructor(promise: JSValue, presolved: {
|
|
388
|
+
already_resolved: boolean;
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
export declare class JSProxyData {
|
|
392
|
+
host_revoke: (() => void) | null;
|
|
393
|
+
target: JSValue;
|
|
394
|
+
handler: JSValue;
|
|
395
|
+
is_func: boolean;
|
|
396
|
+
is_revoked: boolean;
|
|
397
|
+
constructor(target: JSValue, handler: JSValue, is_func: boolean);
|
|
398
|
+
}
|
|
399
|
+
export declare class JSRegExp {
|
|
400
|
+
pattern: string;
|
|
401
|
+
flags: string;
|
|
402
|
+
re: RegExp;
|
|
403
|
+
constructor(pattern: string, flags: string, re: RegExp);
|
|
404
|
+
}
|
|
405
|
+
export declare class JSArrayBuffer {
|
|
406
|
+
buffer: ArrayBuffer | SharedArrayBuffer;
|
|
407
|
+
data: Uint8Array;
|
|
408
|
+
detached: boolean;
|
|
409
|
+
shared: boolean;
|
|
410
|
+
constructor(buffer: ArrayBuffer | SharedArrayBuffer, shared?: boolean);
|
|
411
|
+
get byteLength(): number;
|
|
412
|
+
}
|
|
413
|
+
export declare class JSTypedArray {
|
|
414
|
+
buffer: JSObject;
|
|
415
|
+
offset: number;
|
|
416
|
+
length: number;
|
|
417
|
+
track_rab: boolean;
|
|
418
|
+
constructor(buffer: JSObject, offset: number, length: number);
|
|
419
|
+
}
|
|
420
|
+
export declare class JSFunctionData {
|
|
421
|
+
function_bytecode: JSFunctionBytecode;
|
|
422
|
+
var_refs: JSVarRef[];
|
|
423
|
+
home_object: JSObject | null;
|
|
424
|
+
compiled: Function | null;
|
|
425
|
+
priv: Function | null;
|
|
426
|
+
mkpriv: (() => Function) | null;
|
|
427
|
+
ctor: Function | null;
|
|
428
|
+
constructor(b: JSFunctionBytecode, var_refs: JSVarRef[]);
|
|
429
|
+
}
|
|
430
|
+
export declare class JSObjectMeta {
|
|
431
|
+
class_id: JSClassID;
|
|
432
|
+
u: any;
|
|
433
|
+
func: JSFunctionData | null;
|
|
434
|
+
cfunc: JSCFunctionRecord | null;
|
|
435
|
+
realm: any;
|
|
436
|
+
is_constructor: boolean;
|
|
437
|
+
is_class: boolean;
|
|
438
|
+
is_uncatchable_error: boolean;
|
|
439
|
+
has_backtrace: boolean;
|
|
440
|
+
constructor(class_id: JSClassID);
|
|
441
|
+
}
|
|
442
|
+
export declare function JS_VALUE_GET_OBJ(v: JSValue): JSObject;
|
|
443
|
+
export declare function JS_VALUE_GET_INT(v: JSValue): number;
|
|
444
|
+
export declare function JS_VALUE_GET_FLOAT64(v: JSValue): number;
|
|
445
|
+
export declare function JS_VALUE_GET_BOOL(v: JSValue): boolean;
|
|
446
|
+
export declare function JS_VALUE_GET_STRING(v: JSValue): string;
|
|
447
|
+
export declare function js_mkval_bool(v: boolean): JSValue;
|