postgrest-parser 0.1.1 → 0.2.0
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/package.json +1 -1
- package/pkg/client.d.ts +29 -155
- package/pkg/client.js +39 -96
- package/pkg/package.json +1 -1
- package/pkg/postgrest_parser.d.ts +76 -92
- package/pkg/postgrest_parser.js +205 -180
- package/pkg/postgrest_parser_bg.wasm +0 -0
- package/pkg/postgrest_parser_bg.wasm.d.ts +12 -10
package/pkg/postgrest_parser.js
CHANGED
|
@@ -97,6 +97,50 @@ export function buildFilterClause(filters_json) {
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Clear all schema cache entries, freeing all cached memory.
|
|
102
|
+
*
|
|
103
|
+
* Useful as a safety net during shutdown or when all tenants are being evicted.
|
|
104
|
+
*
|
|
105
|
+
* # Example (TypeScript)
|
|
106
|
+
*
|
|
107
|
+
* ```typescript
|
|
108
|
+
* import { clearAllSchemas } from './pkg/postgrest_parser.js';
|
|
109
|
+
*
|
|
110
|
+
* // Clear everything on shutdown
|
|
111
|
+
* clearAllSchemas();
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
export function clearAllSchemas() {
|
|
115
|
+
wasm.clearAllSchemas();
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Clear a schema cache entry, freeing its memory.
|
|
120
|
+
*
|
|
121
|
+
* Call this when a tenant is paused or evicted to prevent memory leaks.
|
|
122
|
+
* If the schema ID does not exist, this is a no-op.
|
|
123
|
+
*
|
|
124
|
+
* # Arguments
|
|
125
|
+
*
|
|
126
|
+
* * `schema_id` - The schema key to remove. If empty, removes "default".
|
|
127
|
+
*
|
|
128
|
+
* # Example (TypeScript)
|
|
129
|
+
*
|
|
130
|
+
* ```typescript
|
|
131
|
+
* import { clearSchema } from './pkg/postgrest_parser.js';
|
|
132
|
+
*
|
|
133
|
+
* // Clear a tenant's schema when they are paused/evicted
|
|
134
|
+
* clearSchema("tenant-123");
|
|
135
|
+
* ```
|
|
136
|
+
* @param {string} schema_id
|
|
137
|
+
*/
|
|
138
|
+
export function clearSchema(schema_id) {
|
|
139
|
+
const ptr0 = passStringToWasm0(schema_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
140
|
+
const len0 = WASM_VECTOR_LEN;
|
|
141
|
+
wasm.clearSchema(ptr0, len0);
|
|
142
|
+
}
|
|
143
|
+
|
|
100
144
|
/**
|
|
101
145
|
* Initialize schema cache from a database query executor.
|
|
102
146
|
*
|
|
@@ -104,8 +148,18 @@ export function buildFilterClause(filters_json) {
|
|
|
104
148
|
* and returns results. The schema introspection queries will be executed via
|
|
105
149
|
* this callback to populate the relationship cache.
|
|
106
150
|
*
|
|
151
|
+
* # Trust
|
|
152
|
+
*
|
|
153
|
+
* The `query_executor` is **fully trusted**. It receives a hardcoded SQL
|
|
154
|
+
* introspection query and its result is used verbatim to build the FK cache.
|
|
155
|
+
* Only pass executors that connect to the correct tenant database.
|
|
156
|
+
*
|
|
107
157
|
* # Arguments
|
|
108
158
|
*
|
|
159
|
+
* * `schema_id` - A unique key to store this schema under (e.g., tenant ID).
|
|
160
|
+
* If empty, uses "default". Callers must ensure schema IDs are not
|
|
161
|
+
* attacker-controlled — passing another tenant's ID would overwrite their
|
|
162
|
+
* cached schema.
|
|
109
163
|
* * `query_executor` - An async JavaScript function with signature:
|
|
110
164
|
* `async (sql: string) => { rows: any[] }`
|
|
111
165
|
*
|
|
@@ -123,14 +177,17 @@ export function buildFilterClause(filters_json) {
|
|
|
123
177
|
* return { rows: result.rows };
|
|
124
178
|
* };
|
|
125
179
|
*
|
|
126
|
-
* // Initialize schema
|
|
127
|
-
* await initSchemaFromDb(queryExecutor);
|
|
180
|
+
* // Initialize schema for a specific tenant
|
|
181
|
+
* await initSchemaFromDb("tenant-123", queryExecutor);
|
|
128
182
|
* ```
|
|
183
|
+
* @param {string} schema_id
|
|
129
184
|
* @param {Function} query_executor
|
|
130
185
|
* @returns {Promise<void>}
|
|
131
186
|
*/
|
|
132
|
-
export function initSchemaFromDb(query_executor) {
|
|
133
|
-
const
|
|
187
|
+
export function initSchemaFromDb(schema_id, query_executor) {
|
|
188
|
+
const ptr0 = passStringToWasm0(schema_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
189
|
+
const len0 = WASM_VECTOR_LEN;
|
|
190
|
+
const ret = wasm.initSchemaFromDb(ptr0, len0, addHeapObject(query_executor));
|
|
134
191
|
return takeObject(ret);
|
|
135
192
|
}
|
|
136
193
|
|
|
@@ -149,20 +206,14 @@ export function init_panic_hook() {
|
|
|
149
206
|
* * `table` - The table name
|
|
150
207
|
* * `query_string` - Query string with filters and optional returning
|
|
151
208
|
* * `headers` - Optional headers as JSON string
|
|
152
|
-
*
|
|
153
|
-
* # Example (TypeScript)
|
|
154
|
-
*
|
|
155
|
-
* ```typescript
|
|
156
|
-
* const result = parseDelete("users", "id=eq.123&returning=id", null);
|
|
157
|
-
* console.log(result.query); // DELETE FROM "users" WHERE ...
|
|
158
|
-
* console.log(result.params); // ["123"]
|
|
159
|
-
* ```
|
|
209
|
+
* * `schema_id` - Optional schema cache key for per-tenant schema resolution
|
|
160
210
|
* @param {string} table
|
|
161
211
|
* @param {string} query_string
|
|
162
212
|
* @param {string | null} [headers]
|
|
213
|
+
* @param {string | null} [schema_id]
|
|
163
214
|
* @returns {WasmQueryResult}
|
|
164
215
|
*/
|
|
165
|
-
export function parseDelete(table, query_string, headers) {
|
|
216
|
+
export function parseDelete(table, query_string, headers, schema_id) {
|
|
166
217
|
try {
|
|
167
218
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
168
219
|
const ptr0 = passStringToWasm0(table, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -171,7 +222,9 @@ export function parseDelete(table, query_string, headers) {
|
|
|
171
222
|
const len1 = WASM_VECTOR_LEN;
|
|
172
223
|
var ptr2 = isLikeNone(headers) ? 0 : passStringToWasm0(headers, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
173
224
|
var len2 = WASM_VECTOR_LEN;
|
|
174
|
-
|
|
225
|
+
var ptr3 = isLikeNone(schema_id) ? 0 : passStringToWasm0(schema_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
226
|
+
var len3 = WASM_VECTOR_LEN;
|
|
227
|
+
wasm.parseDelete(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
|
|
175
228
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
176
229
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
177
230
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -193,25 +246,15 @@ export function parseDelete(table, query_string, headers) {
|
|
|
193
246
|
* * `body` - JSON body (single object or array of objects)
|
|
194
247
|
* * `query_string` - Optional query string for returning, on_conflict, etc.
|
|
195
248
|
* * `headers` - Optional headers as JSON string (e.g., '{"Prefer":"return=representation"}')
|
|
196
|
-
*
|
|
197
|
-
* # Example (TypeScript)
|
|
198
|
-
*
|
|
199
|
-
* ```typescript
|
|
200
|
-
* const result = parseInsert("users",
|
|
201
|
-
* JSON.stringify({ name: "Alice", email: "alice@example.com" }),
|
|
202
|
-
* "on_conflict=email&returning=id,name",
|
|
203
|
-
* JSON.stringify({ Prefer: "return=representation" })
|
|
204
|
-
* );
|
|
205
|
-
* console.log(result.query); // INSERT INTO "users" ...
|
|
206
|
-
* console.log(result.params); // ["Alice", "alice@example.com"]
|
|
207
|
-
* ```
|
|
249
|
+
* * `schema_id` - Optional schema cache key for per-tenant schema resolution
|
|
208
250
|
* @param {string} table
|
|
209
251
|
* @param {string} body
|
|
210
252
|
* @param {string | null} [query_string]
|
|
211
253
|
* @param {string | null} [headers]
|
|
254
|
+
* @param {string | null} [schema_id]
|
|
212
255
|
* @returns {WasmQueryResult}
|
|
213
256
|
*/
|
|
214
|
-
export function parseInsert(table, body, query_string, headers) {
|
|
257
|
+
export function parseInsert(table, body, query_string, headers, schema_id) {
|
|
215
258
|
try {
|
|
216
259
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
217
260
|
const ptr0 = passStringToWasm0(table, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -222,7 +265,9 @@ export function parseInsert(table, body, query_string, headers) {
|
|
|
222
265
|
var len2 = WASM_VECTOR_LEN;
|
|
223
266
|
var ptr3 = isLikeNone(headers) ? 0 : passStringToWasm0(headers, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
224
267
|
var len3 = WASM_VECTOR_LEN;
|
|
225
|
-
|
|
268
|
+
var ptr4 = isLikeNone(schema_id) ? 0 : passStringToWasm0(schema_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
269
|
+
var len4 = WASM_VECTOR_LEN;
|
|
270
|
+
wasm.parseInsert(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
226
271
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
227
272
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
228
273
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -275,31 +320,26 @@ export function parseOnly(query_string) {
|
|
|
275
320
|
*
|
|
276
321
|
* * `table` - The table name to query
|
|
277
322
|
* * `query_string` - The PostgREST query string (e.g., "select=id,name&age=gte.18")
|
|
323
|
+
* * `schema_id` - Optional schema cache key for per-tenant schema resolution
|
|
278
324
|
*
|
|
279
325
|
* # Returns
|
|
280
326
|
*
|
|
281
327
|
* Returns a `WasmQueryResult` containing the SQL query, parameters, and affected tables.
|
|
282
|
-
*
|
|
283
|
-
* # Example (TypeScript)
|
|
284
|
-
*
|
|
285
|
-
* ```typescript
|
|
286
|
-
* const result = parseQueryString("users", "age=gte.18&status=eq.active");
|
|
287
|
-
* console.log(result.query); // SELECT * FROM "users" WHERE ...
|
|
288
|
-
* console.log(result.params); // ["18", "active"]
|
|
289
|
-
* console.log(result.tables); // ["users"]
|
|
290
|
-
* ```
|
|
291
328
|
* @param {string} table
|
|
292
329
|
* @param {string} query_string
|
|
330
|
+
* @param {string | null} [schema_id]
|
|
293
331
|
* @returns {WasmQueryResult}
|
|
294
332
|
*/
|
|
295
|
-
export function parseQueryString(table, query_string) {
|
|
333
|
+
export function parseQueryString(table, query_string, schema_id) {
|
|
296
334
|
try {
|
|
297
335
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
298
336
|
const ptr0 = passStringToWasm0(table, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
299
337
|
const len0 = WASM_VECTOR_LEN;
|
|
300
338
|
const ptr1 = passStringToWasm0(query_string, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
301
339
|
const len1 = WASM_VECTOR_LEN;
|
|
302
|
-
|
|
340
|
+
var ptr2 = isLikeNone(schema_id) ? 0 : passStringToWasm0(schema_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
341
|
+
var len2 = WASM_VECTOR_LEN;
|
|
342
|
+
wasm.parseQueryString(retptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
303
343
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
304
344
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
305
345
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -325,34 +365,18 @@ export function parseQueryString(table, query_string) {
|
|
|
325
365
|
* * `query_string` - URL query string
|
|
326
366
|
* * `body` - Request body as JSON string (or null)
|
|
327
367
|
* * `headers` - Optional headers as JSON object (for Prefer header)
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
* ```typescript
|
|
332
|
-
* // SELECT query
|
|
333
|
-
* const getResult = parseRequest("GET", "users", "age=gte.18&limit=10", null, null);
|
|
334
|
-
*
|
|
335
|
-
* // INSERT with upsert
|
|
336
|
-
* const postResult = parseRequest("POST", "users", "on_conflict=email",
|
|
337
|
-
* JSON.stringify({ name: "Alice", email: "alice@example.com" }),
|
|
338
|
-
* JSON.stringify({ Prefer: "return=representation" })
|
|
339
|
-
* );
|
|
340
|
-
*
|
|
341
|
-
* // RPC call
|
|
342
|
-
* const rpcResult = parseRequest("POST", "rpc/my_function",
|
|
343
|
-
* "select=result",
|
|
344
|
-
* JSON.stringify({ arg1: "value" }),
|
|
345
|
-
* null
|
|
346
|
-
* );
|
|
347
|
-
* ```
|
|
368
|
+
* * `schema_id` - Optional schema cache key for per-tenant schema resolution.
|
|
369
|
+
* Must match a key previously passed to [`init_schema_from_db`]. If not
|
|
370
|
+
* provided, falls back to the "default" cache entry (if one exists).
|
|
348
371
|
* @param {string} method
|
|
349
372
|
* @param {string} path
|
|
350
373
|
* @param {string} query_string
|
|
351
374
|
* @param {string | null} [body]
|
|
352
375
|
* @param {string | null} [headers]
|
|
376
|
+
* @param {string | null} [schema_id]
|
|
353
377
|
* @returns {WasmQueryResult}
|
|
354
378
|
*/
|
|
355
|
-
export function parseRequest(method, path, query_string, body, headers) {
|
|
379
|
+
export function parseRequest(method, path, query_string, body, headers, schema_id) {
|
|
356
380
|
try {
|
|
357
381
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
358
382
|
const ptr0 = passStringToWasm0(method, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -365,7 +389,9 @@ export function parseRequest(method, path, query_string, body, headers) {
|
|
|
365
389
|
var len3 = WASM_VECTOR_LEN;
|
|
366
390
|
var ptr4 = isLikeNone(headers) ? 0 : passStringToWasm0(headers, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
367
391
|
var len4 = WASM_VECTOR_LEN;
|
|
368
|
-
|
|
392
|
+
var ptr5 = isLikeNone(schema_id) ? 0 : passStringToWasm0(schema_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
393
|
+
var len5 = WASM_VECTOR_LEN;
|
|
394
|
+
wasm.parseRequest(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4, ptr5, len5);
|
|
369
395
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
370
396
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
371
397
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -387,25 +413,15 @@ export function parseRequest(method, path, query_string, body, headers) {
|
|
|
387
413
|
* * `body` - JSON object with function arguments (or null for no args)
|
|
388
414
|
* * `query_string` - Optional query string for filtering/ordering results
|
|
389
415
|
* * `headers` - Optional headers as JSON string
|
|
390
|
-
*
|
|
391
|
-
* # Example (TypeScript)
|
|
392
|
-
*
|
|
393
|
-
* ```typescript
|
|
394
|
-
* const result = parseRpc("calculate_total",
|
|
395
|
-
* JSON.stringify({ order_id: 123, tax_rate: 0.08 }),
|
|
396
|
-
* "select=total,tax&limit=1",
|
|
397
|
-
* null
|
|
398
|
-
* );
|
|
399
|
-
* console.log(result.query); // SELECT * FROM calculate_total(...)
|
|
400
|
-
* console.log(result.params); // [123, 0.08]
|
|
401
|
-
* ```
|
|
416
|
+
* * `schema_id` - Optional schema cache key for per-tenant schema resolution
|
|
402
417
|
* @param {string} function_name
|
|
403
418
|
* @param {string | null} [body]
|
|
404
419
|
* @param {string | null} [query_string]
|
|
405
420
|
* @param {string | null} [headers]
|
|
421
|
+
* @param {string | null} [schema_id]
|
|
406
422
|
* @returns {WasmQueryResult}
|
|
407
423
|
*/
|
|
408
|
-
export function parseRpc(function_name, body, query_string, headers) {
|
|
424
|
+
export function parseRpc(function_name, body, query_string, headers, schema_id) {
|
|
409
425
|
try {
|
|
410
426
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
411
427
|
const ptr0 = passStringToWasm0(function_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -416,7 +432,9 @@ export function parseRpc(function_name, body, query_string, headers) {
|
|
|
416
432
|
var len2 = WASM_VECTOR_LEN;
|
|
417
433
|
var ptr3 = isLikeNone(headers) ? 0 : passStringToWasm0(headers, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
418
434
|
var len3 = WASM_VECTOR_LEN;
|
|
419
|
-
|
|
435
|
+
var ptr4 = isLikeNone(schema_id) ? 0 : passStringToWasm0(schema_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
436
|
+
var len4 = WASM_VECTOR_LEN;
|
|
437
|
+
wasm.parseRpc(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
420
438
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
421
439
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
422
440
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -438,25 +456,15 @@ export function parseRpc(function_name, body, query_string, headers) {
|
|
|
438
456
|
* * `body` - JSON object with fields to update
|
|
439
457
|
* * `query_string` - Query string with filters and optional returning
|
|
440
458
|
* * `headers` - Optional headers as JSON string
|
|
441
|
-
*
|
|
442
|
-
* # Example (TypeScript)
|
|
443
|
-
*
|
|
444
|
-
* ```typescript
|
|
445
|
-
* const result = parseUpdate("users",
|
|
446
|
-
* JSON.stringify({ status: "active" }),
|
|
447
|
-
* "id=eq.123&returning=id,status",
|
|
448
|
-
* null
|
|
449
|
-
* );
|
|
450
|
-
* console.log(result.query); // UPDATE "users" SET ...
|
|
451
|
-
* console.log(result.params); // ["active", "123"]
|
|
452
|
-
* ```
|
|
459
|
+
* * `schema_id` - Optional schema cache key for per-tenant schema resolution
|
|
453
460
|
* @param {string} table
|
|
454
461
|
* @param {string} body
|
|
455
462
|
* @param {string} query_string
|
|
456
463
|
* @param {string | null} [headers]
|
|
464
|
+
* @param {string | null} [schema_id]
|
|
457
465
|
* @returns {WasmQueryResult}
|
|
458
466
|
*/
|
|
459
|
-
export function parseUpdate(table, body, query_string, headers) {
|
|
467
|
+
export function parseUpdate(table, body, query_string, headers, schema_id) {
|
|
460
468
|
try {
|
|
461
469
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
462
470
|
const ptr0 = passStringToWasm0(table, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -467,7 +475,9 @@ export function parseUpdate(table, body, query_string, headers) {
|
|
|
467
475
|
const len2 = WASM_VECTOR_LEN;
|
|
468
476
|
var ptr3 = isLikeNone(headers) ? 0 : passStringToWasm0(headers, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
469
477
|
var len3 = WASM_VECTOR_LEN;
|
|
470
|
-
|
|
478
|
+
var ptr4 = isLikeNone(schema_id) ? 0 : passStringToWasm0(schema_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
479
|
+
var len4 = WASM_VECTOR_LEN;
|
|
480
|
+
wasm.parseUpdate(retptr, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, ptr4, len4);
|
|
471
481
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
472
482
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
473
483
|
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
@@ -483,79 +493,79 @@ export function parseUpdate(table, body, query_string, headers) {
|
|
|
483
493
|
function __wbg_get_imports() {
|
|
484
494
|
const import0 = {
|
|
485
495
|
__proto__: null,
|
|
486
|
-
|
|
496
|
+
__wbg_Error_55538483de6e3abe: function(arg0, arg1) {
|
|
487
497
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
488
498
|
return addHeapObject(ret);
|
|
489
499
|
},
|
|
490
|
-
|
|
500
|
+
__wbg_Number_f257194b7002d6f9: function(arg0) {
|
|
491
501
|
const ret = Number(getObject(arg0));
|
|
492
502
|
return ret;
|
|
493
503
|
},
|
|
494
|
-
|
|
504
|
+
__wbg_String_8564e559799eccda: function(arg0, arg1) {
|
|
495
505
|
const ret = String(getObject(arg1));
|
|
496
506
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
497
507
|
const len1 = WASM_VECTOR_LEN;
|
|
498
508
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
499
509
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
500
510
|
},
|
|
501
|
-
|
|
511
|
+
__wbg___wbindgen_bigint_get_as_i64_a738e80c0fe6f6a7: function(arg0, arg1) {
|
|
502
512
|
const v = getObject(arg1);
|
|
503
513
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
504
514
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
505
515
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
506
516
|
},
|
|
507
|
-
|
|
517
|
+
__wbg___wbindgen_boolean_get_fe2a24fdfdb4064f: function(arg0) {
|
|
508
518
|
const v = getObject(arg0);
|
|
509
519
|
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
510
520
|
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
511
521
|
},
|
|
512
|
-
|
|
522
|
+
__wbg___wbindgen_debug_string_d89627202d0155b7: function(arg0, arg1) {
|
|
513
523
|
const ret = debugString(getObject(arg1));
|
|
514
524
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
515
525
|
const len1 = WASM_VECTOR_LEN;
|
|
516
526
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
517
527
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
518
528
|
},
|
|
519
|
-
|
|
529
|
+
__wbg___wbindgen_in_fe3eb6a509f75744: function(arg0, arg1) {
|
|
520
530
|
const ret = getObject(arg0) in getObject(arg1);
|
|
521
531
|
return ret;
|
|
522
532
|
},
|
|
523
|
-
|
|
533
|
+
__wbg___wbindgen_is_bigint_ca270ac12ef71091: function(arg0) {
|
|
524
534
|
const ret = typeof(getObject(arg0)) === 'bigint';
|
|
525
535
|
return ret;
|
|
526
536
|
},
|
|
527
|
-
|
|
537
|
+
__wbg___wbindgen_is_function_2a95406423ea8626: function(arg0) {
|
|
528
538
|
const ret = typeof(getObject(arg0)) === 'function';
|
|
529
539
|
return ret;
|
|
530
540
|
},
|
|
531
|
-
|
|
541
|
+
__wbg___wbindgen_is_object_59a002e76b059312: function(arg0) {
|
|
532
542
|
const val = getObject(arg0);
|
|
533
543
|
const ret = typeof(val) === 'object' && val !== null;
|
|
534
544
|
return ret;
|
|
535
545
|
},
|
|
536
|
-
|
|
546
|
+
__wbg___wbindgen_is_string_624d5244bb2bc87c: function(arg0) {
|
|
537
547
|
const ret = typeof(getObject(arg0)) === 'string';
|
|
538
548
|
return ret;
|
|
539
549
|
},
|
|
540
|
-
|
|
550
|
+
__wbg___wbindgen_is_undefined_87a3a837f331fef5: function(arg0) {
|
|
541
551
|
const ret = getObject(arg0) === undefined;
|
|
542
552
|
return ret;
|
|
543
553
|
},
|
|
544
|
-
|
|
554
|
+
__wbg___wbindgen_jsval_eq_eedd705f9f2a4f35: function(arg0, arg1) {
|
|
545
555
|
const ret = getObject(arg0) === getObject(arg1);
|
|
546
556
|
return ret;
|
|
547
557
|
},
|
|
548
|
-
|
|
558
|
+
__wbg___wbindgen_jsval_loose_eq_cf851f110c48f9ba: function(arg0, arg1) {
|
|
549
559
|
const ret = getObject(arg0) == getObject(arg1);
|
|
550
560
|
return ret;
|
|
551
561
|
},
|
|
552
|
-
|
|
562
|
+
__wbg___wbindgen_number_get_769f3676dc20c1d7: function(arg0, arg1) {
|
|
553
563
|
const obj = getObject(arg1);
|
|
554
564
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
555
565
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
556
566
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
557
567
|
},
|
|
558
|
-
|
|
568
|
+
__wbg___wbindgen_string_get_f1161390414f9b59: function(arg0, arg1) {
|
|
559
569
|
const obj = getObject(arg1);
|
|
560
570
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
561
571
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
@@ -563,29 +573,29 @@ function __wbg_get_imports() {
|
|
|
563
573
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
564
574
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
565
575
|
},
|
|
566
|
-
|
|
576
|
+
__wbg___wbindgen_throw_5549492daedad139: function(arg0, arg1) {
|
|
567
577
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
568
578
|
},
|
|
569
|
-
|
|
579
|
+
__wbg__wbg_cb_unref_fbe69bb076c16bad: function(arg0) {
|
|
570
580
|
getObject(arg0)._wbg_cb_unref();
|
|
571
581
|
},
|
|
572
|
-
|
|
582
|
+
__wbg_call_6ae20895a60069a2: function() { return handleError(function (arg0, arg1) {
|
|
573
583
|
const ret = getObject(arg0).call(getObject(arg1));
|
|
574
584
|
return addHeapObject(ret);
|
|
575
585
|
}, arguments); },
|
|
576
|
-
|
|
586
|
+
__wbg_call_8f5d7bb070283508: function() { return handleError(function (arg0, arg1, arg2) {
|
|
577
587
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
578
588
|
return addHeapObject(ret);
|
|
579
589
|
}, arguments); },
|
|
580
|
-
|
|
590
|
+
__wbg_done_19f92cb1f8738aba: function(arg0) {
|
|
581
591
|
const ret = getObject(arg0).done;
|
|
582
592
|
return ret;
|
|
583
593
|
},
|
|
584
|
-
|
|
594
|
+
__wbg_entries_28ed7cb892e12eff: function(arg0) {
|
|
585
595
|
const ret = Object.entries(getObject(arg0));
|
|
586
596
|
return addHeapObject(ret);
|
|
587
597
|
},
|
|
588
|
-
|
|
598
|
+
__wbg_error_a6fa202b58aa1cd3: function(arg0, arg1) {
|
|
589
599
|
let deferred0_0;
|
|
590
600
|
let deferred0_1;
|
|
591
601
|
try {
|
|
@@ -596,19 +606,31 @@ function __wbg_get_imports() {
|
|
|
596
606
|
wasm.__wbindgen_export4(deferred0_0, deferred0_1, 1);
|
|
597
607
|
}
|
|
598
608
|
},
|
|
599
|
-
|
|
609
|
+
__wbg_from_45cebbf5e49a6ac6: function(arg0) {
|
|
610
|
+
const ret = Array.from(getObject(arg0));
|
|
611
|
+
return addHeapObject(ret);
|
|
612
|
+
},
|
|
613
|
+
__wbg_get_94f5fc088edd3138: function(arg0, arg1) {
|
|
600
614
|
const ret = getObject(arg0)[arg1 >>> 0];
|
|
601
615
|
return addHeapObject(ret);
|
|
602
616
|
},
|
|
603
|
-
|
|
617
|
+
__wbg_get_a50328e7325d7f9b: function() { return handleError(function (arg0, arg1) {
|
|
618
|
+
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
619
|
+
return addHeapObject(ret);
|
|
620
|
+
}, arguments); },
|
|
621
|
+
__wbg_get_ff5f1fb220233477: function() { return handleError(function (arg0, arg1) {
|
|
604
622
|
const ret = Reflect.get(getObject(arg0), getObject(arg1));
|
|
605
623
|
return addHeapObject(ret);
|
|
606
624
|
}, arguments); },
|
|
607
|
-
|
|
625
|
+
__wbg_get_unchecked_7c6bbabf5b0b1fbf: function(arg0, arg1) {
|
|
626
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
627
|
+
return addHeapObject(ret);
|
|
628
|
+
},
|
|
629
|
+
__wbg_get_with_ref_key_6412cf3094599694: function(arg0, arg1) {
|
|
608
630
|
const ret = getObject(arg0)[getObject(arg1)];
|
|
609
631
|
return addHeapObject(ret);
|
|
610
632
|
},
|
|
611
|
-
|
|
633
|
+
__wbg_instanceof_ArrayBuffer_8d855993947fc3a2: function(arg0) {
|
|
612
634
|
let result;
|
|
613
635
|
try {
|
|
614
636
|
result = getObject(arg0) instanceof ArrayBuffer;
|
|
@@ -618,7 +640,7 @@ function __wbg_get_imports() {
|
|
|
618
640
|
const ret = result;
|
|
619
641
|
return ret;
|
|
620
642
|
},
|
|
621
|
-
|
|
643
|
+
__wbg_instanceof_Map_238410f1463c05ed: function(arg0) {
|
|
622
644
|
let result;
|
|
623
645
|
try {
|
|
624
646
|
result = getObject(arg0) instanceof Map;
|
|
@@ -628,7 +650,7 @@ function __wbg_get_imports() {
|
|
|
628
650
|
const ret = result;
|
|
629
651
|
return ret;
|
|
630
652
|
},
|
|
631
|
-
|
|
653
|
+
__wbg_instanceof_Uint8Array_ce24d58a5f4bdcc3: function(arg0) {
|
|
632
654
|
let result;
|
|
633
655
|
try {
|
|
634
656
|
result = getObject(arg0) instanceof Uint8Array;
|
|
@@ -638,49 +660,54 @@ function __wbg_get_imports() {
|
|
|
638
660
|
const ret = result;
|
|
639
661
|
return ret;
|
|
640
662
|
},
|
|
641
|
-
|
|
663
|
+
__wbg_isArray_867202cf8f195ed8: function(arg0) {
|
|
642
664
|
const ret = Array.isArray(getObject(arg0));
|
|
643
665
|
return ret;
|
|
644
666
|
},
|
|
645
|
-
|
|
667
|
+
__wbg_isSafeInteger_1dfae065cbfe1915: function(arg0) {
|
|
646
668
|
const ret = Number.isSafeInteger(getObject(arg0));
|
|
647
669
|
return ret;
|
|
648
670
|
},
|
|
649
|
-
|
|
671
|
+
__wbg_iterator_54661826e186eb6a: function() {
|
|
650
672
|
const ret = Symbol.iterator;
|
|
651
673
|
return addHeapObject(ret);
|
|
652
674
|
},
|
|
653
|
-
|
|
675
|
+
__wbg_length_e6e1633fbea6cfa9: function(arg0) {
|
|
654
676
|
const ret = getObject(arg0).length;
|
|
655
677
|
return ret;
|
|
656
678
|
},
|
|
657
|
-
|
|
679
|
+
__wbg_length_fae3e439140f48a4: function(arg0) {
|
|
658
680
|
const ret = getObject(arg0).length;
|
|
659
681
|
return ret;
|
|
660
682
|
},
|
|
661
|
-
|
|
662
|
-
|
|
683
|
+
__wbg_new_0934b88171ef61b0: function() {
|
|
684
|
+
const ret = new Map();
|
|
685
|
+
return addHeapObject(ret);
|
|
663
686
|
},
|
|
664
|
-
|
|
665
|
-
const ret = new
|
|
687
|
+
__wbg_new_1d96678aaacca32e: function(arg0) {
|
|
688
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
666
689
|
return addHeapObject(ret);
|
|
667
690
|
},
|
|
668
|
-
|
|
691
|
+
__wbg_new_227d7c05414eb861: function() {
|
|
692
|
+
const ret = new Error();
|
|
693
|
+
return addHeapObject(ret);
|
|
694
|
+
},
|
|
695
|
+
__wbg_new_4370be21fa2b2f80: function() {
|
|
669
696
|
const ret = new Array();
|
|
670
697
|
return addHeapObject(ret);
|
|
671
698
|
},
|
|
672
|
-
|
|
673
|
-
const ret = new
|
|
699
|
+
__wbg_new_48e1d86cfd30c8e7: function() {
|
|
700
|
+
const ret = new Object();
|
|
674
701
|
return addHeapObject(ret);
|
|
675
702
|
},
|
|
676
|
-
|
|
703
|
+
__wbg_new_typed_25dda2388d7e5e9f: function(arg0, arg1) {
|
|
677
704
|
try {
|
|
678
705
|
var state0 = {a: arg0, b: arg1};
|
|
679
706
|
var cb0 = (arg0, arg1) => {
|
|
680
707
|
const a = state0.a;
|
|
681
708
|
state0.a = 0;
|
|
682
709
|
try {
|
|
683
|
-
return
|
|
710
|
+
return __wasm_bindgen_func_elem_408(a, state0.b, arg0, arg1);
|
|
684
711
|
} finally {
|
|
685
712
|
state0.a = a;
|
|
686
713
|
}
|
|
@@ -688,91 +715,79 @@ function __wbg_get_imports() {
|
|
|
688
715
|
const ret = new Promise(cb0);
|
|
689
716
|
return addHeapObject(ret);
|
|
690
717
|
} finally {
|
|
691
|
-
state0.a =
|
|
718
|
+
state0.a = 0;
|
|
692
719
|
}
|
|
693
720
|
},
|
|
694
|
-
|
|
695
|
-
const ret =
|
|
696
|
-
return addHeapObject(ret);
|
|
697
|
-
},
|
|
698
|
-
__wbg_new_dd2b680c8bf6ae29: function(arg0) {
|
|
699
|
-
const ret = new Uint8Array(getObject(arg0));
|
|
700
|
-
return addHeapObject(ret);
|
|
701
|
-
},
|
|
702
|
-
__wbg_new_no_args_1c7c842f08d00ebb: function(arg0, arg1) {
|
|
703
|
-
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
721
|
+
__wbg_next_55d835fe0ab5b3e7: function(arg0) {
|
|
722
|
+
const ret = getObject(arg0).next;
|
|
704
723
|
return addHeapObject(ret);
|
|
705
724
|
},
|
|
706
|
-
|
|
725
|
+
__wbg_next_e34cfb9df1518d7c: function() { return handleError(function (arg0) {
|
|
707
726
|
const ret = getObject(arg0).next();
|
|
708
727
|
return addHeapObject(ret);
|
|
709
728
|
}, arguments); },
|
|
710
|
-
|
|
711
|
-
const ret = getObject(arg0).next;
|
|
712
|
-
return addHeapObject(ret);
|
|
713
|
-
},
|
|
714
|
-
__wbg_prototypesetcall_bdcdcc5842e4d77d: function(arg0, arg1, arg2) {
|
|
729
|
+
__wbg_prototypesetcall_3875d54d12ef2eec: function(arg0, arg1, arg2) {
|
|
715
730
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), getObject(arg2));
|
|
716
731
|
},
|
|
717
|
-
|
|
732
|
+
__wbg_queueMicrotask_8868365114fe23b5: function(arg0) {
|
|
733
|
+
queueMicrotask(getObject(arg0));
|
|
734
|
+
},
|
|
735
|
+
__wbg_queueMicrotask_cfc5a0e62f9ebdbe: function(arg0) {
|
|
718
736
|
const ret = getObject(arg0).queueMicrotask;
|
|
719
737
|
return addHeapObject(ret);
|
|
720
738
|
},
|
|
721
|
-
|
|
722
|
-
queueMicrotask(getObject(arg0));
|
|
723
|
-
},
|
|
724
|
-
__wbg_resolve_002c4b7d9d8f6b64: function(arg0) {
|
|
739
|
+
__wbg_resolve_d8059bc113e215bf: function(arg0) {
|
|
725
740
|
const ret = Promise.resolve(getObject(arg0));
|
|
726
741
|
return addHeapObject(ret);
|
|
727
742
|
},
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
return addHeapObject(ret);
|
|
743
|
+
__wbg_set_4702dfa37c77f492: function(arg0, arg1, arg2) {
|
|
744
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
731
745
|
},
|
|
732
|
-
|
|
746
|
+
__wbg_set_6be42768c690e380: function(arg0, arg1, arg2) {
|
|
733
747
|
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
734
748
|
},
|
|
735
|
-
|
|
736
|
-
getObject(arg0)
|
|
749
|
+
__wbg_set_8c6629931852a4a5: function(arg0, arg1, arg2) {
|
|
750
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
751
|
+
return addHeapObject(ret);
|
|
737
752
|
},
|
|
738
|
-
|
|
753
|
+
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
739
754
|
const ret = getObject(arg1).stack;
|
|
740
755
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
741
756
|
const len1 = WASM_VECTOR_LEN;
|
|
742
757
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
743
758
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
744
759
|
},
|
|
745
|
-
|
|
760
|
+
__wbg_static_accessor_GLOBAL_8dfb7f5e26ebe523: function() {
|
|
746
761
|
const ret = typeof global === 'undefined' ? null : global;
|
|
747
762
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
748
763
|
},
|
|
749
|
-
|
|
764
|
+
__wbg_static_accessor_GLOBAL_THIS_941154efc8395cdd: function() {
|
|
750
765
|
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
751
766
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
752
767
|
},
|
|
753
|
-
|
|
768
|
+
__wbg_static_accessor_SELF_58dac9af822f561f: function() {
|
|
754
769
|
const ret = typeof self === 'undefined' ? null : self;
|
|
755
770
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
756
771
|
},
|
|
757
|
-
|
|
772
|
+
__wbg_static_accessor_WINDOW_ee64f0b3d8354c0b: function() {
|
|
758
773
|
const ret = typeof window === 'undefined' ? null : window;
|
|
759
774
|
return isLikeNone(ret) ? 0 : addHeapObject(ret);
|
|
760
775
|
},
|
|
761
|
-
|
|
776
|
+
__wbg_then_0150352e4ad20344: function(arg0, arg1, arg2) {
|
|
762
777
|
const ret = getObject(arg0).then(getObject(arg1), getObject(arg2));
|
|
763
778
|
return addHeapObject(ret);
|
|
764
779
|
},
|
|
765
|
-
|
|
780
|
+
__wbg_then_5160486c67ddb98a: function(arg0, arg1) {
|
|
766
781
|
const ret = getObject(arg0).then(getObject(arg1));
|
|
767
782
|
return addHeapObject(ret);
|
|
768
783
|
},
|
|
769
|
-
|
|
784
|
+
__wbg_value_d5b248ce8419bd1b: function(arg0) {
|
|
770
785
|
const ret = getObject(arg0).value;
|
|
771
786
|
return addHeapObject(ret);
|
|
772
787
|
},
|
|
773
788
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
774
|
-
// Cast intrinsic for `Closure(Closure {
|
|
775
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
789
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 62, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
790
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_403);
|
|
776
791
|
return addHeapObject(ret);
|
|
777
792
|
},
|
|
778
793
|
__wbindgen_cast_0000000000000002: function(arg0) {
|
|
@@ -809,12 +824,22 @@ function __wbg_get_imports() {
|
|
|
809
824
|
};
|
|
810
825
|
}
|
|
811
826
|
|
|
812
|
-
function
|
|
813
|
-
|
|
827
|
+
function __wasm_bindgen_func_elem_403(arg0, arg1, arg2) {
|
|
828
|
+
try {
|
|
829
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
830
|
+
wasm.__wasm_bindgen_func_elem_403(retptr, arg0, arg1, addHeapObject(arg2));
|
|
831
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
832
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
833
|
+
if (r1) {
|
|
834
|
+
throw takeObject(r0);
|
|
835
|
+
}
|
|
836
|
+
} finally {
|
|
837
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
838
|
+
}
|
|
814
839
|
}
|
|
815
840
|
|
|
816
|
-
function
|
|
817
|
-
wasm.
|
|
841
|
+
function __wasm_bindgen_func_elem_408(arg0, arg1, arg2, arg3) {
|
|
842
|
+
wasm.__wasm_bindgen_func_elem_408(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
818
843
|
}
|
|
819
844
|
|
|
820
845
|
const WasmQueryResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -832,7 +857,7 @@ function addHeapObject(obj) {
|
|
|
832
857
|
|
|
833
858
|
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
834
859
|
? { register: () => {}, unregister: () => {} }
|
|
835
|
-
: new FinalizationRegistry(state =>
|
|
860
|
+
: new FinalizationRegistry(state => wasm.__wbindgen_export5(state.a, state.b));
|
|
836
861
|
|
|
837
862
|
function debugString(val) {
|
|
838
863
|
// primitive types
|
|
@@ -900,7 +925,7 @@ function debugString(val) {
|
|
|
900
925
|
}
|
|
901
926
|
|
|
902
927
|
function dropObject(idx) {
|
|
903
|
-
if (idx <
|
|
928
|
+
if (idx < 1028) return;
|
|
904
929
|
heap[idx] = heap_next;
|
|
905
930
|
heap_next = idx;
|
|
906
931
|
}
|
|
@@ -941,7 +966,7 @@ function handleError(f, args) {
|
|
|
941
966
|
}
|
|
942
967
|
}
|
|
943
968
|
|
|
944
|
-
let heap = new Array(
|
|
969
|
+
let heap = new Array(1024).fill(undefined);
|
|
945
970
|
heap.push(undefined, null, true, false);
|
|
946
971
|
|
|
947
972
|
let heap_next = heap.length;
|
|
@@ -950,8 +975,8 @@ function isLikeNone(x) {
|
|
|
950
975
|
return x === undefined || x === null;
|
|
951
976
|
}
|
|
952
977
|
|
|
953
|
-
function makeMutClosure(arg0, arg1,
|
|
954
|
-
const state = { a: arg0, b: arg1, cnt: 1
|
|
978
|
+
function makeMutClosure(arg0, arg1, f) {
|
|
979
|
+
const state = { a: arg0, b: arg1, cnt: 1 };
|
|
955
980
|
const real = (...args) => {
|
|
956
981
|
|
|
957
982
|
// First up with a closure we increment the internal reference
|
|
@@ -969,7 +994,7 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
969
994
|
};
|
|
970
995
|
real._wbg_cb_unref = () => {
|
|
971
996
|
if (--state.cnt === 0) {
|
|
972
|
-
|
|
997
|
+
wasm.__wbindgen_export5(state.a, state.b);
|
|
973
998
|
state.a = 0;
|
|
974
999
|
CLOSURE_DTORS.unregister(state);
|
|
975
1000
|
}
|