@bytecodealliance/jco 1.17.6 → 1.17.7

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/obj/wasm-tools.js CHANGED
@@ -4,7 +4,6 @@ import { preopens, types } from '@bytecodealliance/preview2-shim/filesystem';
4
4
  import { error, streams } from '@bytecodealliance/preview2-shim/io';
5
5
  import { random } from '@bytecodealliance/preview2-shim/random';
6
6
  const { getEnvironment } = environment;
7
- getEnvironment._isHostProvided = true;
8
7
 
9
8
  if (getEnvironment=== undefined) {
10
9
  const err = new Error("unexpectedly undefined local import 'getEnvironment', was 'getEnvironment' available at instantiation?");
@@ -12,8 +11,8 @@ if (getEnvironment=== undefined) {
12
11
  throw err;
13
12
  }
14
13
 
14
+ getEnvironment._isHostProvided = true;
15
15
  const { exit } = exit$1;
16
- exit._isHostProvided = true;
17
16
 
18
17
  if (exit=== undefined) {
19
18
  const err = new Error("unexpectedly undefined local import 'exit', was 'exit' available at instantiation?");
@@ -21,8 +20,8 @@ if (exit=== undefined) {
21
20
  throw err;
22
21
  }
23
22
 
23
+ exit._isHostProvided = true;
24
24
  const { getStderr } = stderr;
25
- getStderr._isHostProvided = true;
26
25
 
27
26
  if (getStderr=== undefined) {
28
27
  const err = new Error("unexpectedly undefined local import 'getStderr', was 'getStderr' available at instantiation?");
@@ -30,8 +29,8 @@ if (getStderr=== undefined) {
30
29
  throw err;
31
30
  }
32
31
 
32
+ getStderr._isHostProvided = true;
33
33
  const { getStdin } = stdin;
34
- getStdin._isHostProvided = true;
35
34
 
36
35
  if (getStdin=== undefined) {
37
36
  const err = new Error("unexpectedly undefined local import 'getStdin', was 'getStdin' available at instantiation?");
@@ -39,8 +38,8 @@ if (getStdin=== undefined) {
39
38
  throw err;
40
39
  }
41
40
 
41
+ getStdin._isHostProvided = true;
42
42
  const { getStdout } = stdout;
43
- getStdout._isHostProvided = true;
44
43
 
45
44
  if (getStdout=== undefined) {
46
45
  const err = new Error("unexpectedly undefined local import 'getStdout', was 'getStdout' available at instantiation?");
@@ -48,8 +47,8 @@ if (getStdout=== undefined) {
48
47
  throw err;
49
48
  }
50
49
 
50
+ getStdout._isHostProvided = true;
51
51
  const { TerminalInput } = terminalInput;
52
- TerminalInput._isHostProvided = true;
53
52
 
54
53
  if (TerminalInput=== undefined) {
55
54
  const err = new Error("unexpectedly undefined local import 'TerminalInput', was 'TerminalInput' available at instantiation?");
@@ -57,8 +56,8 @@ if (TerminalInput=== undefined) {
57
56
  throw err;
58
57
  }
59
58
 
59
+ TerminalInput._isHostProvided = true;
60
60
  const { TerminalOutput } = terminalOutput;
61
- TerminalOutput._isHostProvided = true;
62
61
 
63
62
  if (TerminalOutput=== undefined) {
64
63
  const err = new Error("unexpectedly undefined local import 'TerminalOutput', was 'TerminalOutput' available at instantiation?");
@@ -66,8 +65,8 @@ if (TerminalOutput=== undefined) {
66
65
  throw err;
67
66
  }
68
67
 
68
+ TerminalOutput._isHostProvided = true;
69
69
  const { getTerminalStderr } = terminalStderr;
70
- getTerminalStderr._isHostProvided = true;
71
70
 
72
71
  if (getTerminalStderr=== undefined) {
73
72
  const err = new Error("unexpectedly undefined local import 'getTerminalStderr', was 'getTerminalStderr' available at instantiation?");
@@ -75,8 +74,8 @@ if (getTerminalStderr=== undefined) {
75
74
  throw err;
76
75
  }
77
76
 
77
+ getTerminalStderr._isHostProvided = true;
78
78
  const { getTerminalStdin } = terminalStdin;
79
- getTerminalStdin._isHostProvided = true;
80
79
 
81
80
  if (getTerminalStdin=== undefined) {
82
81
  const err = new Error("unexpectedly undefined local import 'getTerminalStdin', was 'getTerminalStdin' available at instantiation?");
@@ -84,8 +83,8 @@ if (getTerminalStdin=== undefined) {
84
83
  throw err;
85
84
  }
86
85
 
86
+ getTerminalStdin._isHostProvided = true;
87
87
  const { getTerminalStdout } = terminalStdout;
88
- getTerminalStdout._isHostProvided = true;
89
88
 
90
89
  if (getTerminalStdout=== undefined) {
91
90
  const err = new Error("unexpectedly undefined local import 'getTerminalStdout', was 'getTerminalStdout' available at instantiation?");
@@ -93,8 +92,8 @@ if (getTerminalStdout=== undefined) {
93
92
  throw err;
94
93
  }
95
94
 
95
+ getTerminalStdout._isHostProvided = true;
96
96
  const { getDirectories } = preopens;
97
- getDirectories._isHostProvided = true;
98
97
 
99
98
  if (getDirectories=== undefined) {
100
99
  const err = new Error("unexpectedly undefined local import 'getDirectories', was 'getDirectories' available at instantiation?");
@@ -102,10 +101,10 @@ if (getDirectories=== undefined) {
102
101
  throw err;
103
102
  }
104
103
 
104
+ getDirectories._isHostProvided = true;
105
105
  const { Descriptor,
106
106
  DirectoryEntryStream,
107
107
  filesystemErrorCode } = types;
108
- Descriptor._isHostProvided = true;
109
108
 
110
109
  if (Descriptor=== undefined) {
111
110
  const err = new Error("unexpectedly undefined local import 'Descriptor', was 'Descriptor' available at instantiation?");
@@ -113,7 +112,7 @@ if (Descriptor=== undefined) {
113
112
  throw err;
114
113
  }
115
114
 
116
- DirectoryEntryStream._isHostProvided = true;
115
+ Descriptor._isHostProvided = true;
117
116
 
118
117
  if (DirectoryEntryStream=== undefined) {
119
118
  const err = new Error("unexpectedly undefined local import 'DirectoryEntryStream', was 'DirectoryEntryStream' available at instantiation?");
@@ -121,7 +120,7 @@ if (DirectoryEntryStream=== undefined) {
121
120
  throw err;
122
121
  }
123
122
 
124
- filesystemErrorCode._isHostProvided = true;
123
+ DirectoryEntryStream._isHostProvided = true;
125
124
 
126
125
  if (filesystemErrorCode=== undefined) {
127
126
  const err = new Error("unexpectedly undefined local import 'filesystemErrorCode', was 'filesystemErrorCode' available at instantiation?");
@@ -129,8 +128,8 @@ if (filesystemErrorCode=== undefined) {
129
128
  throw err;
130
129
  }
131
130
 
131
+ filesystemErrorCode._isHostProvided = true;
132
132
  const { Error: Error$1 } = error;
133
- Error$1._isHostProvided = true;
134
133
 
135
134
  if (Error$1=== undefined) {
136
135
  const err = new Error("unexpectedly undefined local import 'Error$1', was 'Error' available at instantiation?");
@@ -138,9 +137,9 @@ if (Error$1=== undefined) {
138
137
  throw err;
139
138
  }
140
139
 
140
+ Error$1._isHostProvided = true;
141
141
  const { InputStream,
142
142
  OutputStream } = streams;
143
- InputStream._isHostProvided = true;
144
143
 
145
144
  if (InputStream=== undefined) {
146
145
  const err = new Error("unexpectedly undefined local import 'InputStream', was 'InputStream' available at instantiation?");
@@ -148,7 +147,7 @@ if (InputStream=== undefined) {
148
147
  throw err;
149
148
  }
150
149
 
151
- OutputStream._isHostProvided = true;
150
+ InputStream._isHostProvided = true;
152
151
 
153
152
  if (OutputStream=== undefined) {
154
153
  const err = new Error("unexpectedly undefined local import 'OutputStream', was 'OutputStream' available at instantiation?");
@@ -156,8 +155,8 @@ if (OutputStream=== undefined) {
156
155
  throw err;
157
156
  }
158
157
 
158
+ OutputStream._isHostProvided = true;
159
159
  const { getRandomBytes } = random;
160
- getRandomBytes._isHostProvided = true;
161
160
 
162
161
  if (getRandomBytes=== undefined) {
163
162
  const err = new Error("unexpectedly undefined local import 'getRandomBytes', was 'getRandomBytes' available at instantiation?");
@@ -165,6 +164,7 @@ if (getRandomBytes=== undefined) {
165
164
  throw err;
166
165
  }
167
166
 
167
+ getRandomBytes._isHostProvided = true;
168
168
 
169
169
  function promiseWithResolvers() {
170
170
  if (Promise.withResolvers) {
@@ -179,8 +179,9 @@ function promiseWithResolvers() {
179
179
  return { promise, resolve, reject };
180
180
  }
181
181
  }
182
-
183
182
  const symbolDispose = Symbol.dispose || Symbol.for('dispose');
183
+ const symbolAsyncIterator = Symbol.asyncIterator;
184
+ const symbolIterator = Symbol.iterator;
184
185
 
185
186
  const _debugLog = (...args) => {
186
187
  if (!globalThis?.process?.env?.JCO_DEBUG) { return; }
@@ -275,7 +276,7 @@ async function _clearCurrentTask(args) {
275
276
  const { taskID, componentIdx } = args;
276
277
 
277
278
  const meta = CURRENT_TASK_META[componentIdx];
278
- if (!meta) { throw new Error(`missing current task meta for component idx [${componentIdx}]`); }
279
+ if (!meta) { throw new Error(`missing current task meta for component idx [${componentIdx}]n`); }
279
280
 
280
281
  if (meta.taskID !== taskID) {
281
282
  throw new Error(`task ID [${meta.taskID}] != requested ID [${taskID}]`);
@@ -383,13 +384,54 @@ const _coinFlip = () => { return Math.random() > 0.5; };
383
384
  let SCOPE_ID = 0;
384
385
  const I32_MIN = -2_147_483_648;
385
386
  const I32_MAX = 2_147_483_647;
387
+
388
+ function _isValidNumericPrimitive(ty, v) {
389
+ if (v === undefined || v === null) { return false; }
390
+ switch (ty) {
391
+ case 'bool':
392
+ return v === 0 || v === 1;
393
+ break;
394
+ case 'u8':
395
+ return v >= 0 && v <= 255;
396
+ break;
397
+ case 's8':
398
+ return v >= -128 && v <= 127;
399
+ break;
400
+ case 'u16':
401
+ return v >= 0 && v <= 65535;
402
+ break;
403
+ case 's16':
404
+ return v >= -32768 && v <= 32767;
405
+ case 'u32':
406
+ return v >= 0 && v <= 4_294_967_295;
407
+ case 's32':
408
+ return v >= -2_147_483_648 && v <= 2_147_483_647;
409
+ case 'u64':
410
+ return typeof v === 'bigint' && v >= 0 && v <= 18_446_744_073_709_551_615n;
411
+ case 's64':
412
+ return typeof v === 'bigint' && v >= -9223372036854775808n && v <= 9223372036854775807n;
413
+ break;
414
+ case 'f32':
415
+ case 'f64': return typeof v === 'number';
416
+ default:
417
+ return false;
418
+ }
419
+ return true;
420
+ }
421
+
422
+ function _requireValidNumericPrimitive(ty, v) {
423
+ if (v === undefined || v === null || !_isValidNumericPrimitive(ty, v)) {
424
+ throw new TypeError(`invalid ${ty} value [${v}]`);
425
+ }
426
+ return true;
427
+ }
386
428
  const _typeCheckValidI32 = (n) => typeof n === 'number' && n >= I32_MIN && n <= I32_MAX;
387
429
 
388
430
  const _typeCheckAsyncFn= (f) => {
389
431
  return f instanceof ASYNC_FN_CTOR;
390
432
  };
391
433
 
392
- const ASYNC_FN_CTOR = (async () => {}).constructor;
434
+ let RESOURCE_CALL_BORROWS = [];const ASYNC_FN_CTOR = (async () => {}).constructor;
393
435
 
394
436
  function clearCurrentTask(componentIdx, taskID) {
395
437
  _debugLog('[clearCurrentTask()] args', { componentIdx, taskID });
@@ -678,6 +720,7 @@ class AsyncSubtask {
678
720
  realloc,
679
721
  vals: [subtaskValue],
680
722
  storagePtr: resultPtr,
723
+ stringEncoding: callMetadata.stringEncoding,
681
724
  });
682
725
  }
683
726
  }
@@ -867,6 +910,7 @@ resultCountOrAsync,
867
910
  resultPtr,
868
911
  returnFn,
869
912
  startFn,
913
+ stringEncoding,
870
914
  }
871
915
  });
872
916
 
@@ -1032,7 +1076,8 @@ function _asyncStartCall(args, callee, paramCount, resultCount, flags) {
1032
1076
  memory: callerMemory,
1033
1077
  vals: [res],
1034
1078
  storagePtr: subtaskCallMeta.resultPtr,
1035
- componentIdx: callerComponentIdx
1079
+ componentIdx: callerComponentIdx,
1080
+ stringEncoding: subtaskCallMeta.stringEncoding,
1036
1081
  });
1037
1082
 
1038
1083
  });
@@ -1270,11 +1315,19 @@ class Waitable {
1270
1315
  let dv = new DataView(new ArrayBuffer());
1271
1316
  const dataView = mem => dv.buffer === mem.buffer ? dv : dv = new DataView(mem.buffer);
1272
1317
 
1273
- const toUint64 = val => BigInt.asUintN(64, BigInt(val));
1318
+ function toUint64(val) {
1319
+ const converted = BigInt(val)
1320
+ _requireValidNumericPrimitive('u64', converted);
1321
+ return BigInt.asUintN(64, converted);
1322
+ }
1323
+
1274
1324
 
1275
1325
  function toUint32(val) {
1326
+ _requireValidNumericPrimitive('u32', val);
1276
1327
  return val >>> 0;
1277
1328
  }
1329
+
1330
+ const utf16Decoder = new TextDecoder('utf-16');
1278
1331
  const TEXT_DECODER_UTF8 = new TextDecoder();
1279
1332
  const TEXT_ENCODER_UTF8 = new TextEncoder();
1280
1333
 
@@ -2051,6 +2104,7 @@ function _lowerImportBackwardsCompat(args) {
2051
2104
  getMemoryFn,
2052
2105
  getReallocFn,
2053
2106
  importFn,
2107
+ stringEncoding,
2054
2108
  } = args;
2055
2109
 
2056
2110
  let meta = _getGlobalCurrentTaskMeta(componentIdx);
@@ -2130,6 +2184,7 @@ function _lowerImportBackwardsCompat(args) {
2130
2184
  realloc: getReallocFn(),
2131
2185
  resultPtr: params[0],
2132
2186
  lowers: resultLowerFns,
2187
+ stringEncoding,
2133
2188
  }
2134
2189
  });
2135
2190
  task.setReturnMemoryIdx(memoryIdx);
@@ -2259,8 +2314,8 @@ function _lowerImportBackwardsCompat(args) {
2259
2314
  return [val, ctx];
2260
2315
  }
2261
2316
 
2262
- if (ctx.storageLen !== undefined && ctx.storageLen < ctx.storagePtr + 1) {
2263
- throw new Error('not enough storage remaining for lift');
2317
+ if (ctx.storageLen !== undefined && ctx.storageLen < 1) {
2318
+ throw new Error(`insufficient storage ([${ctx.storageLen}] bytes) for lift (u8 requires 1 byte)`);
2264
2319
  }
2265
2320
 
2266
2321
  val = new DataView(ctx.memory.buffer).getUint8(ctx.storagePtr, true);
@@ -2271,6 +2326,7 @@ function _lowerImportBackwardsCompat(args) {
2271
2326
  return [val, ctx];
2272
2327
  }
2273
2328
 
2329
+
2274
2330
  function _liftFlatU16(ctx) {
2275
2331
  _debugLog('[_liftFlatU16()] args', { ctx });
2276
2332
  let val;
@@ -2282,8 +2338,8 @@ function _lowerImportBackwardsCompat(args) {
2282
2338
  return [val, ctx];
2283
2339
  }
2284
2340
 
2285
- if (ctx.storageLen !== undefined && ctx.storageLen < ctx.storagePtr + 2) {
2286
- throw new Error('not enough storage remaining for lift');
2341
+ if (ctx.storageLen !== undefined && ctx.storageLen < 2) {
2342
+ throw new Error(`insufficient storage ([${ctx.storageLen}] bytes) for lift (u16 requires 2 bytes)`);
2287
2343
  }
2288
2344
 
2289
2345
  val = new DataView(ctx.memory.buffer).getUint16(ctx.storagePtr, true);
@@ -2297,6 +2353,7 @@ function _lowerImportBackwardsCompat(args) {
2297
2353
  return [val, ctx];
2298
2354
  }
2299
2355
 
2356
+
2300
2357
  function _liftFlatU32(ctx) {
2301
2358
  _debugLog('[_liftFlatU32()] args', { ctx });
2302
2359
  let val;
@@ -2308,8 +2365,8 @@ function _lowerImportBackwardsCompat(args) {
2308
2365
  return [val, ctx];
2309
2366
  }
2310
2367
 
2311
- if (ctx.storageLen !== undefined && ctx.storageLen < ctx.storagePtr + 4) {
2312
- throw new Error('not enough storage remaining for lift');
2368
+ if (ctx.storageLen !== undefined && ctx.storageLen < 4) {
2369
+ throw new Error(`insufficient storage ([${ctx.storageLen}] bytes) for lift (u32 requires 4 bytes)`);
2313
2370
  }
2314
2371
  val = new DataView(ctx.memory.buffer).getUint32(ctx.storagePtr, true);
2315
2372
  ctx.storagePtr += 4;
@@ -2318,6 +2375,7 @@ function _lowerImportBackwardsCompat(args) {
2318
2375
  return [val, ctx];
2319
2376
  }
2320
2377
 
2378
+
2321
2379
  function _liftFlatU64(ctx) {
2322
2380
  _debugLog('[_liftFlatU64()] args', { ctx });
2323
2381
  let val;
@@ -2330,9 +2388,10 @@ function _lowerImportBackwardsCompat(args) {
2330
2388
  return [val, ctx];
2331
2389
  }
2332
2390
 
2333
- if (ctx.storageLen !== undefined && ctx.storageLen < ctx.storagePtr + 8) {
2334
- throw new Error('not enough storage remaining for lift');
2391
+ if (ctx.storageLen !== undefined && ctx.storageLen < 8) {
2392
+ throw new Error(`insufficient storage ([${ctx.storageLen}] bytes) for lift (u64 requires 8 bytes)`);
2335
2393
  }
2394
+
2336
2395
  val = new DataView(ctx.memory.buffer).getBigUint64(ctx.storagePtr, true);
2337
2396
  ctx.storagePtr += 8;
2338
2397
  if (ctx.storageLen !== undefined) { ctx.storageLen -= 8; }
@@ -2340,6 +2399,18 @@ function _lowerImportBackwardsCompat(args) {
2340
2399
  return [val, ctx];
2341
2400
  }
2342
2401
 
2402
+
2403
+ function _liftFlatStringAny(ctx) {
2404
+ switch (ctx.stringEncoding) {
2405
+ case 'utf8':
2406
+ return _liftFlatStringUTF8(ctx);
2407
+ case 'utf16':
2408
+ return _liftFlatStringUTF16(ctx);
2409
+ default:
2410
+ throw new Error(`missing/unrecognized/unsupported string encoding [${ctx.stringEncoding}]`);
2411
+ }
2412
+ }
2413
+
2343
2414
  function _liftFlatStringUTF8(ctx) {
2344
2415
  _debugLog('[_liftFlatStringUTF8()] args', { ctx });
2345
2416
  let val;
@@ -2355,14 +2426,42 @@ function _lowerImportBackwardsCompat(args) {
2355
2426
  return [val, ctx];
2356
2427
  }
2357
2428
 
2358
- const start = new DataView(ctx.memory.buffer).getUint32(ctx.storagePtr, true);
2359
- const codeUnits = new DataView(ctx.memory.buffer).getUint32(ctx.storagePtr + 4, true);
2429
+ const rem = ctx.storagePtr % 4;
2430
+ if (rem !== 0) { ctx.storagePtr += (4 - rem); }
2431
+
2432
+ const dv = new DataView(ctx.memory.buffer);
2433
+ const start = dv.getUint32(ctx.storagePtr, true);
2434
+ const codeUnits = dv.getUint32(ctx.storagePtr + 4, true);
2435
+
2360
2436
  val = TEXT_DECODER_UTF8.decode(new Uint8Array(ctx.memory.buffer, start, codeUnits));
2361
2437
 
2362
2438
  ctx.storagePtr += 8;
2439
+ if (ctx.storageLen !== undefined) { ctx.storagelen -= 8; }
2363
2440
 
2364
- const rem = ctx.storagePtr % 4;
2365
- if (rem !== 0) { ctx.storagePtr += (4 - rem); }
2441
+ return [val, ctx];
2442
+ }
2443
+
2444
+ function _liftFlatStringUTF16(ctx) {
2445
+ _debugLog('[_liftFlatStringUTF16()] args', { ctx });
2446
+ let val;
2447
+
2448
+ if (ctx.useDirectParams) {
2449
+ if (ctx.params.length < 2) { throw new Error('expected at least two u32 arguments'); }
2450
+ const offset = ctx.params[0];
2451
+ if (!Number.isSafeInteger(offset)) { throw new Error('invalid offset'); }
2452
+ const len = ctx.params[1];
2453
+ if (!Number.isSafeInteger(len)) { throw new Error('invalid len'); }
2454
+ val = utf16Decoder.decode(new DataView(ctx.memory.buffer, offset, len));
2455
+ ctx.params = ctx.params.slice(2);
2456
+ return [val, ctx];
2457
+ }
2458
+
2459
+ const data = new DataView(ctx.memory.buffer)
2460
+ const start = data.getUint32(ctx.storagePtr, vals[0], true);
2461
+ const codeUnits = data.getUint32(ctx.storagePtr, vals[0] + 4, true);
2462
+ val = utf16Decoder.decode(new Uint16Array(ctx.memory.buffer, start, codeUnits));
2463
+ ctx.storagePtr = ctx.storagePtr + 2 * codeUnits;
2464
+ if (ctx.storageLen !== undefined) { ctx.storageLen = ctx.storageLen - 2 * codeUnits }
2366
2465
 
2367
2466
  return [val, ctx];
2368
2467
  }
@@ -2422,7 +2521,7 @@ function _lowerImportBackwardsCompat(args) {
2422
2521
  }
2423
2522
 
2424
2523
  function _liftFlatList(meta) {
2425
- const { elemLiftFn, align32, knownLen } = meta;
2524
+ const { elemLiftFn, elemSize32, elemAlign32, knownLen } = meta;
2426
2525
 
2427
2526
  const readValuesAndReset = (ctx, originalPtr, dataPtr, len) => {
2428
2527
  ctx.storagePtr = dataPtr;
@@ -2432,37 +2531,40 @@ function _lowerImportBackwardsCompat(args) {
2432
2531
  val.push(res);
2433
2532
  ctx = nextCtx;
2434
2533
 
2435
- const rem = ctx.storagePtr % align32;
2436
- if (rem !== 0) { ctx.storagePtr += align32 - rem; }
2534
+ const rem = ctx.storagePtr % elemAlign32;
2535
+ if (rem !== 0) { ctx.storagePtr += elemAlign32 - rem; }
2437
2536
  }
2438
2537
  if (originalPtr !== null) { ctx.storagePtr = originalPtr; }
2439
2538
  return [val, ctx];
2440
2539
  };
2441
2540
 
2541
+ // TODO(fix): special case for u8/u16/etc into appropriate type
2542
+
2442
2543
  return function _liftFlatListInner(ctx) {
2443
2544
  _debugLog('[_liftFlatList()] args', { ctx });
2444
2545
 
2445
2546
  let liftResults;
2446
- if (knownLen) { // list with known length
2547
+ if (knownLen !== undefined) { // list with known length
2447
2548
 
2448
2549
  if (ctx.useDirectParams) {
2449
2550
  // list with known length w/ direct params
2450
2551
  const dataPtr = ctx.params[0];
2451
2552
  ctx.params = ctx.params.slice(1);
2452
2553
 
2453
- // TODO: is it possible for all values to come in from params?
2554
+ // TODO(???): is it possible for all values to come in from params?
2454
2555
 
2455
2556
  ctx.useDirectParams = false;
2456
2557
  const originalPtr = ctx.storagePtr;
2457
- ctx.storageLen = 8;
2558
+ ctx.storageLen = knownLen * elemSize32;
2458
2559
 
2459
- liftResults = readValuesAndReset(ctx, originalPtr, dataPtr, len);
2560
+ liftResults = readValuesAndReset(ctx, originalPtr, dataPtr, knownLen);
2460
2561
 
2461
2562
  ctx.useDirectParams = true;
2462
2563
  ctx.storagePtr = null;
2463
2564
  ctx.storageLen = null;
2464
2565
 
2465
2566
  } else {
2567
+ ctx.storageLen = knownLen * elemSize32;
2466
2568
  liftResults = readValuesAndReset(ctx, null, ctx.storagePtr, knownLen);
2467
2569
  }
2468
2570
 
@@ -2476,7 +2578,7 @@ function _lowerImportBackwardsCompat(args) {
2476
2578
 
2477
2579
  ctx.useDirectParams = false;
2478
2580
  const originalPtr = ctx.storagePtr;
2479
- ctx.storageLen = 8;
2581
+ ctx.storageLen = len * elemSize32;
2480
2582
 
2481
2583
  liftResults = readValuesAndReset(ctx, originalPtr, dataPtr, len);
2482
2584
 
@@ -2486,6 +2588,8 @@ function _lowerImportBackwardsCompat(args) {
2486
2588
 
2487
2589
  } else {
2488
2590
  // unknown length list ptr w/ in-memory params
2591
+ ctx.storageLen = 8;
2592
+
2489
2593
  const dataPtrLiftRes = _liftFlatU32(ctx);
2490
2594
  const dataPtr = dataPtrLiftRes[0];
2491
2595
  ctx = dataPtrLiftRes[1];
@@ -2497,6 +2601,7 @@ function _lowerImportBackwardsCompat(args) {
2497
2601
  const originalPtr = ctx.storagePtr;
2498
2602
  ctx.storagePtr = dataPtr;
2499
2603
 
2604
+ ctx.storageLen = len * elemSize32;
2500
2605
  liftResults = readValuesAndReset(ctx, originalPtr, dataPtr, len);
2501
2606
  }
2502
2607
  }
@@ -2506,7 +2611,7 @@ function _lowerImportBackwardsCompat(args) {
2506
2611
  }
2507
2612
 
2508
2613
  function _liftFlatFlags(meta) {
2509
- const { names, size32, align32, intSize } = meta;
2614
+ const { names, size32, align32, intSizeBytes } = meta;
2510
2615
 
2511
2616
  return function _liftFlatFlagsInner(ctx) {
2512
2617
  _debugLog('[_liftFlatFlags()] args', { ctx });
@@ -2515,7 +2620,7 @@ function _liftFlatFlags(meta) {
2515
2620
 
2516
2621
  let liftRes;
2517
2622
  let align;
2518
- switch (intSize) {
2623
+ switch (intSizeBytes) {
2519
2624
  case 1:
2520
2625
  liftRes = _liftFlatU8(ctx);
2521
2626
  break;
@@ -2555,109 +2660,149 @@ function _liftFlatBorrow(componentTableIdx, size, memory, vals, storagePtr, stor
2555
2660
  throw new Error('flat lift for borrowed resources is not supported!');
2556
2661
  }
2557
2662
 
2663
+
2558
2664
  function _lowerFlatU8(ctx) {
2559
2665
  _debugLog('[_lowerFlatU8()] args', ctx);
2560
- const { memory, realloc, vals, storagePtr, storageLen } = ctx;
2561
- if (vals.length !== 1) {
2562
- throw new Error('unexpected number (' + vals.length + ') of core vals (expected 1)');
2666
+
2667
+ if (ctx.vals.length !== 1) {
2668
+ throw new Error(`unexpected number [${ctx.vals.length}] of vals (expected 1)`);
2563
2669
  }
2564
- if (vals[0] > 255 || vals[0] < 0) { throw new Error('invalid value for core value representing u8'); }
2565
- if (!memory) { throw new Error("missing memory for lower"); }
2566
- new DataView(memory.buffer).setUint32(storagePtr, vals[0], true);
2567
2670
 
2568
- // TODO: ALIGNMENT IS WRONG?
2671
+ _requireValidNumericPrimitive.bind('u8', ctx.vals[0]);
2569
2672
 
2570
- return 1;
2673
+ if (!ctx.memory) { throw new Error("missing memory for lower"); }
2674
+ new DataView(ctx.memory.buffer).setUint32(ctx.storagePtr, ctx.vals[0], true);
2675
+
2676
+ ctx.storagePtr += 1;
2571
2677
  }
2572
2678
 
2573
- function _lowerFlatU16(memory, vals, storagePtr, storageLen) {
2574
- _debugLog('[_lowerFlatU16()] args', { memory, vals, storagePtr, storageLen });
2575
- if (vals.length !== 1) {
2576
- throw new Error('unexpected number (' + vals.length + ') of core vals (expected 1)');
2679
+ function _lowerFlatU16(ctx) {
2680
+ _debugLog('[_lowerFlatU16()] args', { ctx });
2681
+
2682
+ if (!ctx.memory) { throw new Error("missing memory for lower"); }
2683
+ if (ctx.vals.length !== 1) {
2684
+ throw new Error(`unexpected number [${ctx.vals.length}] of vals (expected 1)`);
2577
2685
  }
2578
- if (vals[0] > 65_535 || vals[0] < 0) { throw new Error('invalid value for core value representing u16'); }
2579
- new DataView(memory.buffer).setUint16(storagePtr, vals[0], true);
2580
- return 2;
2686
+
2687
+ const rem = ctx.storagePtr % 2;
2688
+ if (rem !== 0) { ctx.storagePtr += (2 - rem); }
2689
+
2690
+ _requireValidNumericPrimitive.bind('u16', ctx.vals[0]);
2691
+ new DataView(ctx.memory.buffer).setUint16(ctx.storagePtr, ctx.vals[0], true);
2692
+
2693
+ ctx.storagePtr += 2;
2581
2694
  }
2582
2695
 
2583
2696
  function _lowerFlatU32(ctx) {
2584
2697
  _debugLog('[_lowerFlatU32()] args', { ctx });
2585
- const { memory, realloc, vals, storagePtr, storageLen } = ctx;
2586
- if (vals.length !== 1) { throw new Error('expected single value to lower, got (' + vals.length + ')'); }
2587
- if (vals[0] > 4_294_967_295 || vals[0] < 0) { throw new Error('invalid value for core value representing u32'); }
2588
2698
 
2589
- // TODO(refactor): fail loudly on misaligned flat lowers?
2699
+ if (ctx.vals.length !== 1) {
2700
+ throw new Error(`expected single value to lower, got [${ctx.vals.length}]`);
2701
+ }
2702
+
2590
2703
  const rem = ctx.storagePtr % 4;
2591
2704
  if (rem !== 0) { ctx.storagePtr += (4 - rem); }
2592
2705
 
2593
- new DataView(memory.buffer).setUint32(storagePtr, vals[0], true);
2706
+ _requireValidNumericPrimitive.bind('u32', ctx.vals[0]);
2707
+ new DataView(ctx.memory.buffer).setUint32(ctx.storagePtr, ctx.vals[0], true);
2708
+
2709
+ ctx.storagePtr += 4;
2710
+ }
2711
+
2712
+ function _lowerFlatU64(ctx) {
2713
+ _debugLog('[_lowerFlatU64()] args', { ctx });
2714
+
2715
+ if (ctx.vals.length !== 1) { throw new Error('unexpected number of vals'); }
2716
+
2717
+ const rem = ctx.storagePtr % 8;
2718
+ if (rem !== 0) { ctx.storagePtr += (8 - rem); }
2719
+
2720
+ _requireValidNumericPrimitive.bind('u64', ctx.vals[0]);
2721
+ new DataView(ctx.memory.buffer).setBigUint64(ctx.storagePtr, ctx.vals[0], true);
2594
2722
 
2595
- return 4;
2723
+ ctx.storagePtr += 8;
2596
2724
  }
2597
2725
 
2598
- function _lowerFlatU64(memory, vals, storagePtr, storageLen) {
2599
- _debugLog('[_lowerFlatU64()] args', { memory, vals, storagePtr, storageLen });
2600
- if (vals.length !== 1) { throw new Error('unexpected number of core vals'); }
2601
- if (vals[0] > 18_446_744_073_709_551_615n || vals[0] < 0n) { throw new Error('invalid value for core value representing u64'); }
2602
- new DataView(memory.buffer).setBigUint64(storagePtr, vals[0], true);
2603
- return 8;
2726
+ function _lowerFlatStringAny(ctx) {
2727
+ switch (ctx.stringEncoding) {
2728
+ case 'utf8':
2729
+ return _lowerFlatStringUTF8(ctx);
2730
+ case 'utf16':
2731
+ return _lowerFlatStringUTF16(ctx);
2732
+ default:
2733
+ throw new Error(`missing/unrecognized/unsupported string encoding [${ctx.stringEncoding}]`);
2734
+ }
2604
2735
  }
2605
2736
 
2606
2737
  function _lowerFlatStringUTF8(ctx) {
2607
2738
  _debugLog('[_lowerFlatStringUTF8()] args', ctx);
2739
+ if (!ctx.realloc) { throw new Error('missing realloc during flat string lower'); }
2608
2740
 
2609
- const { memory, realloc, vals, storagePtr, storageLen } = ctx;
2741
+ const s = ctx.vals[0];
2742
+ const { ptr, codepoints } = _utf8AllocateAndEncode(ctx.vals[0], ctx.realloc, ctx.memory);
2610
2743
 
2611
- const s = vals[0];
2612
- const { ptr, len, codepoints } = _utf8AllocateAndEncode(vals[0], realloc, memory);
2744
+ const view = new DataView(ctx.memory.buffer);
2745
+ view.setUint32(ctx.storagePtr, ptr, true);
2746
+ view.setUint32(ctx.storagePtr + 4, codepoints, true);
2613
2747
 
2614
- const view = new DataView(memory.buffer);
2615
- view.setUint32(storagePtr, ptr, true);
2616
- view.setUint32(storagePtr + 4, codepoints, true);
2748
+ ctx.storagePtr += 8;
2749
+ }
2750
+
2751
+ function _lowerFlatStringUTF16(ctx) {
2752
+ _debugLog('[_lowerFlatStringUTF16()] args', { ctx });
2753
+ if (!ctx.realloc) { throw new Error('missing realloc during flat string lower'); }
2754
+
2755
+ const s = ctx.vals[0];
2756
+ const { ptr, len, codepoints } = _utf16AllocateAndEncode(ctx.vals[0], ctx.realloc, ctx.memory);
2617
2757
 
2618
- return len;
2758
+ const view = new DataView(ctx.memory.buffer);
2759
+ view.setUint32(ctx.storagePtr, ptr, true);
2760
+ view.setUint32(ctx.storagePtr + 4, codepoints, true);
2761
+
2762
+ const bytes = new Uint16Array(ctx.memory.buffer, start, codeUnits);
2763
+ if (ctx.memory.buffer.byteLength < start + bytes.byteLength) {
2764
+ throw new Error('memory out of bounds');
2765
+ }
2766
+ if (ctx.storageLen !== undefined && ctx.storageLen !== bytes.byteLength) {
2767
+ throw new Error(`storage length [${ctx.storageLen}] != [${bytes.byteLength}])`);
2768
+ }
2769
+ new Uint16Array(ctx.memory.buffer, ctx.storagePtr).set(bytes);
2770
+
2771
+ ctx.storagePtr += len;
2619
2772
  }
2620
2773
 
2621
2774
  function _lowerFlatRecord(fieldMetas) {
2622
- return (size, memory, vals, storagePtr, storageLen) => {
2623
- const params = [...arguments].slice(5);
2624
- _debugLog('[_lowerFlatRecord()] args', {
2625
- size,
2626
- memory,
2627
- vals,
2628
- storagePtr,
2629
- storageLen,
2630
- params,
2631
- fieldMetas
2632
- });
2775
+ return function _lowerFlatRecordInner(ctx) {
2776
+ _debugLog('[_lowerFlatRecord()] args', { ctx });
2633
2777
 
2634
- const [start] = vals;
2635
- if (storageLen !== undefined && size !== undefined && size > storageLen) {
2636
- throw new Error('not enough storage remaining for record flat lower');
2778
+ const r = ctx.vals[0];
2779
+ for (const [tag, lowerFn, size32, align32 ] of fieldMetas) {
2780
+ ctx.vals = [r[tag]];
2781
+ lowerFn(ctx);
2637
2782
  }
2638
- const data = new Uint8Array(memory.buffer, start, size);
2639
- new Uint8Array(memory.buffer, storagePtr, size).set(data);
2640
- return data.byteLength;
2641
2783
  }
2642
2784
  }
2643
2785
 
2644
2786
  function _lowerFlatVariant(lowerMetas) {
2787
+ let caseLookup = {};
2788
+ for (const [idx, meta] of lowerMetas.entries()) {
2789
+ let tag = meta[0];
2790
+ caseLookup[tag] = { discriminant: idx, meta };
2791
+ }
2792
+
2645
2793
  return function _lowerFlatVariantInner(ctx) {
2646
- _debugLog('[_lowerFlatVariant()] args', ctx);
2647
-
2648
- const { memory, realloc, vals, storageLen, componentIdx } = ctx;
2649
- let storagePtr = ctx.storagePtr;
2794
+ _debugLog('[_lowerFlatVariant()] args', { ctx });
2650
2795
 
2651
- const { tag, val } = vals[0];
2652
- const disc = lowerMetas.findIndex(m => m[0] === tag);
2653
- if (disc === -1) {
2654
- throw new Error(`invalid variant tag/discriminant [${tag}] (valid tags: ${variantMetas.map(m => m[0])})`);
2796
+ const { tag, val } = ctx.vals[0];
2797
+ const variantCase = caseLookup[tag];
2798
+ if (!variantCase) {
2799
+ throw new Error(`missing tag [${tag}] (valid tags: ${Object.keys(caseLookup)})`);
2655
2800
  }
2656
2801
 
2657
- const [ _tag, lowerFn, size32, align32, payloadOffset32 ] = lowerMetas[disc];
2802
+ const [ _tag, lowerFn, size32, align32, payloadOffset32 ] = variantCase.meta;
2658
2803
 
2659
- const originalPtr = ctx.resultPtr;
2660
- ctx.vals = [disc];
2804
+ const originalPtr = ctx.storagePtr;
2805
+ ctx.vals = [variantCase.discriminant];
2661
2806
  let discLowerRes;
2662
2807
  if (lowerMetas.length < 256) {
2663
2808
  discLowerRes = _lowerFlatU8(ctx);
@@ -2666,23 +2811,15 @@ function _lowerFlatVariant(lowerMetas) {
2666
2811
  } else if (lowerMetas.length >= 65536 && lowerMetas.length < 4_294_967_296) {
2667
2812
  discLowerRes = _lowerFlatU32(ctx);
2668
2813
  } else {
2669
- throw new Error('unsupported number of cases [' + lowerMetas.legnth + ']');
2814
+ throw new Error(`unsupported number of cases [${lowerMetas.length}]`);
2670
2815
  }
2671
2816
 
2672
- ctx.resultPtr = originalPtr + payloadOffset32;
2817
+ const payloadOffsetPtr = originalPtr + payloadOffset32;
2818
+ ctx.storagePtr = payloadOffsetPtr;
2819
+ ctx.vals = [val];
2820
+ if (lowerFn) { lowerFn(ctx); }
2673
2821
 
2674
- let payloadBytesWritten = 0;
2675
- if (lowerFn) {
2676
- lowerFn({
2677
- memory,
2678
- realloc,
2679
- vals: [val],
2680
- storagePtr,
2681
- storageLen,
2682
- componentIdx,
2683
- });
2684
- }
2685
- let bytesWritten = payloadOffset + payloadBytesWritten;
2822
+ let bytesWritten = ctx.storagePtr - payloadOffsetPtr;
2686
2823
 
2687
2824
  const rem = ctx.storagePtr % align32;
2688
2825
  if (rem !== 0) {
@@ -2691,99 +2828,219 @@ function _lowerFlatVariant(lowerMetas) {
2691
2828
  bytesWritten += pad;
2692
2829
  }
2693
2830
 
2694
- return bytesWritten;
2831
+ ctx.storagePtr += bytesWritten;
2695
2832
  }
2696
2833
  }
2697
2834
 
2698
- function _lowerFlatList(args) {
2699
- const { elemLowerFn } = args;
2835
+ function _lowerFlatList(meta) {
2836
+ const {
2837
+ elemLowerFn,
2838
+ knownLen,
2839
+ size32,
2840
+ align32,
2841
+ elemSize32,
2842
+ elemAlign32,
2843
+ } = meta;
2844
+
2700
2845
  if (!elemLowerFn) { throw new TypeError("missing/invalid element lower fn for list"); }
2701
2846
 
2702
2847
  return function _lowerFlatListInner(ctx) {
2703
2848
  _debugLog('[_lowerFlatList()] args', { ctx });
2704
2849
 
2705
- if (ctx.params.length < 2) { throw new Error('insufficient params left to lower list'); }
2706
- const storagePtr = ctx.params[0];
2707
- const elemCount = ctx.params[1];
2708
- ctx.params = ctx.params.slice(2);
2709
-
2710
2850
  if (ctx.useDirectParams) {
2851
+ if (ctx.params.length < 2) { throw new Error('insufficient params left to lower list'); }
2852
+ const storagePtr = ctx.params[0];
2853
+ const elemCount = ctx.params[1];
2854
+ ctx.params = ctx.params.slice(2);
2855
+
2711
2856
  const list = ctx.vals[0];
2712
2857
  if (!list) { throw new Error("missing direct param value"); }
2713
2858
 
2714
- const elemLowerCtx = { storagePtr, memory: ctx.memory };
2859
+ const lowerCtx = {
2860
+ storagePtr,
2861
+ memory: ctx.memory,
2862
+ stringEncoding: ctx.stringEncoding,
2863
+ };
2715
2864
  for (let idx = 0; idx < list.length; idx++) {
2716
- elemLowerCtx.vals = list.slice(idx, idx+1);
2717
- elemLowerCtx.storagePtr += elemLowerFn(elemLowerCtx);
2865
+ lowerCtx.vals = list.slice(idx, idx+1);
2866
+ elemLowerFn(lowerCtx);
2718
2867
  }
2719
2868
 
2720
- const bytesLowered = elemLowerCtx.storagePtr - ctx.storagePtr;
2721
- ctx.storagePtr = elemLowerCtx.storagePtr;
2722
- return bytesLowered;
2869
+ const bytesLowered = lowerCtx.storagePtr - ctx.storagePtr;
2870
+ ctx.storagePtr = lowerCtx.storagePtr;
2871
+
2872
+ // TODO: implement parma-only known-length processing
2873
+
2874
+ ctx.storagePtr += bytesLowered;
2875
+ return;
2723
2876
  }
2724
2877
 
2725
- if (ctx.vals.length !== 2) {
2726
- throw new Error('indirect parameter loading must have a pointer and length as vals');
2878
+ // TODO(fix): is it possible to get a vals that are a addr and length here from
2879
+ // a component lower?
2880
+
2881
+ const elems = ctx.vals[0];
2882
+ if (knownLen === undefined) {
2883
+ // unknown length
2884
+ if (!ctx.realloc) { throw new Error('missing realloc during flat string lower'); }
2885
+ const dataPtr = ctx.realloc(0, 0, elemAlign32, elemSize32 * elems.length);
2886
+
2887
+ ctx.vals[0] = dataPtr;
2888
+ _lowerFlatU32(ctx);
2889
+
2890
+ ctx.vals[0] = elems.length;
2891
+ _lowerFlatU32(ctx);
2892
+
2893
+ const origPtr = ctx.storagePtr;
2894
+ ctx.storagePtr = dataPtr;
2895
+
2896
+ ctx.storagePtr = dataPtr;
2897
+ for (const elem of elems) {
2898
+ ctx.vals = [elem];
2899
+ elemLowerFn(ctx);
2900
+ }
2901
+
2902
+ ctx.storagePtr = origPtr;
2903
+
2904
+ } else {
2905
+ // known length
2906
+
2907
+ if (elems.length !== knownLen) {
2908
+ throw new TypeError(`invalid list input of length [${elems.length}], must be length [${knownLen}]`);
2909
+ }
2910
+
2911
+ for (const elem of elems) {
2912
+ ctx.vals = [elem];
2913
+ elemLowerFn(ctx);
2914
+ }
2727
2915
  }
2728
- let [valStartPtr, valLen] = ctx.vals;
2729
- const totalSizeBytes = valLen * size;
2916
+
2917
+ // TODO(fix): special case for u8/u16/etc, we can do a direct copy
2918
+
2919
+ const totalSizeBytes = elems.length * size32;
2730
2920
  if (ctx.storageLen !== undefined && totalSizeBytes > ctx.storageLen) {
2731
2921
  throw new Error('not enough storage remaining for list flat lower');
2732
2922
  }
2733
-
2734
- const data = new Uint8Array(memory.buffer, valStartPtr, totalSizeBytes);
2735
- new Uint8Array(memory.buffer, storagePtr, totalSizeBytes).set(data);
2736
-
2737
- return totalSizeBytes;
2738
2923
  }
2739
2924
  }
2740
2925
 
2741
- function _lowerFlatTuple(size, memory, vals, storagePtr, storageLen) {
2742
- _debugLog('[_lowerFlatTuple()] args', { size, memory, vals, storagePtr, storageLen });
2743
- let [start, len] = vals;
2744
- if (storageLen !== undefined && len > storageLen) {
2745
- throw new Error('not enough storage remaining for tuple flat lower');
2926
+ function _lowerFlatTuple(elemLowerMetas) {
2927
+ return function _lowerFlatTupleInner(ctx) {
2928
+ _debugLog('[_lowerFlatTuple()] args', { ctx });
2929
+ const tuple = ctx.vals[0];
2930
+ for (const [idx, [ lowerFn, size32, align32 ]] of elemLowerMetas.entries()) {
2931
+ ctx.vals = [tuple[idx]];
2932
+ lowerFn(ctx);
2933
+ }
2746
2934
  }
2747
- const data = new Uint8Array(memory.buffer, start, len);
2748
- new Uint8Array(memory.buffer, storagePtr, len).set(data);
2749
- return data.byteLength;
2750
2935
  }
2751
2936
 
2752
- function _lowerFlatFlags(memory, vals, storagePtr, storageLen) {
2753
- _debugLog('[_lowerFlatFlags()] args', { size, memory, vals, storagePtr, storageLen });
2754
- if (vals.length !== 1) { throw new Error('unexpected number of core vals'); }
2755
- new DataView(memory.buffer).setInt32(storagePtr, vals[0], true);
2756
- return 4;
2937
+ function _lowerFlatFlags(meta) {
2938
+ const { names, size32, align32, intSizeBytes } = meta;
2939
+
2940
+ return function _lowerFlatFlagsInner(ctx) {
2941
+ _debugLog('[_lowerFlatFlags()] args', { ctx });
2942
+ if (ctx.vals.length !== 1) { throw new Error('unexpected number of vals'); }
2943
+
2944
+ let flagObj = ctx.vals[0];
2945
+ let flagValue = 0;
2946
+ for (const [idx, name] of names.entries()) {
2947
+ if (flagObj[name] === true) {
2948
+ flagValue |= 1 << idx;
2949
+ }
2950
+ }
2951
+
2952
+ const rem = ctx.storagePtr % align32;
2953
+ if (rem !== 0) { ctx.storagePtr += (align32 - rem); }
2954
+
2955
+ const dv = new DataView(ctx.memory.buffer);
2956
+ if (intSizeBytes === 1) {
2957
+ dv.setUint8(ctx.storagePtr, flagValue);
2958
+ } else if (intSizeBytes === 2) {
2959
+ dv.setUint16(ctx.storagePtr, flagValue);
2960
+ } else if (intSizeBytes === 4) {
2961
+ dv.setUint32(ctx.storagePtr, flagValue);
2962
+ } else {
2963
+ throw new Error(`unrecognized flag size [${intSizeBytes} bytes]`);
2964
+ }
2965
+
2966
+ ctx.storagePtr += intSizeBytes;
2967
+ }
2757
2968
  }
2758
2969
 
2759
- function _lowerFlatEnum(size, memory, vals, storagePtr, storageLen) {
2760
- _debugLog('[_lowerFlatEnum()] args', { size, memory, vals, storagePtr, storageLen });
2761
- let [start] = vals;
2762
- if (storageLen !== undefined && size !== undefined && size > storageLen) {
2763
- throw new Error('not enough storage remaining for enum flat lower');
2970
+ function _lowerFlatEnum(lowerMetas) {
2971
+ return function _lowerFlatEnumInner(ctx) {
2972
+ _debugLog('[_lowerFlatEnum()] args', { ctx });
2973
+
2974
+ const v = ctx.vals[0];
2975
+ const isNotEnumObject = typeof v !== 'object'
2976
+ || Object.keys(v).length !== 2
2977
+ || !('tag' in v);
2978
+ if (isNotEnumObject) {
2979
+ ctx.vals[0] = { tag: v };
2980
+ }
2981
+
2982
+ _lowerFlatVariant(lowerMetas)(ctx);
2764
2983
  }
2765
- const data = new Uint8Array(memory.buffer, start, size);
2766
- new Uint8Array(memory.buffer, storagePtr, size).set(data);
2767
- return data.byteLength;
2768
2984
  }
2769
2985
 
2770
2986
  function _lowerFlatOption(lowerMetas) {
2771
- function _lowerFlatOptionInner(ctx) {
2987
+ return function _lowerFlatOptionInner(ctx) {
2772
2988
  _debugLog('[_lowerFlatOption()] args', { ctx });
2773
- return _lowerFlatVariant(lowerMetas)(ctx);
2989
+
2990
+ const v = ctx.vals[0];
2991
+ if (v === null) {
2992
+ ctx.vals[0] = { tag: 'none' };
2993
+ } else {
2994
+ const isNotOptionObject = typeof v !== 'object'
2995
+ || Object.keys(v).length !== 2
2996
+ || !('tag' in v)
2997
+ || !(v.tag === 'some' || v.tag === 'none')
2998
+ || !('val' in v);
2999
+ if (isNotOptionObject) {
3000
+ ctx.vals[0] = { tag: 'some', val: v };
3001
+ }
3002
+ }
3003
+
3004
+ _lowerFlatVariant(lowerMetas)(ctx);
2774
3005
  }
2775
3006
  }
2776
3007
 
2777
3008
  function _lowerFlatResult(lowerMetas) {
2778
3009
  return function _lowerFlatResultInner(ctx) {
2779
3010
  _debugLog('[_lowerFlatResult()] args', { lowerMetas });
2780
- return _lowerFlatVariant(lowerMetas)(ctx);
3011
+
3012
+ const v = ctx.vals[0];
3013
+ const isNotResultObject = typeof v !== 'object'
3014
+ || Object.keys(v).length !== 2
3015
+ || !('tag' in v)
3016
+ || !('ok' === v.tag || 'err' === v.tag)
3017
+ || !('val' in v);
3018
+ if (isNotResultObject) {
3019
+ ctx.vals[0] = { tag: 'ok', val: v };
3020
+ }
3021
+
3022
+ _lowerFlatVariant(lowerMetas)(ctx);
2781
3023
  };
2782
3024
  }
2783
3025
 
2784
- function _lowerFlatOwn(size, memory, vals, storagePtr, storageLen) {
2785
- _debugLog('[_lowerFlatOwn()] args', { size, memory, vals, storagePtr, storageLen });
2786
- throw new Error('flat lower for owned resources not yet implemented!');
3026
+ function _lowerFlatOwn(meta) {
3027
+ const { lowerFn, componentIdx } = meta;
3028
+
3029
+ return function _lowerFlatOwnInner(ctx) {
3030
+ _debugLog('[_lowerFlatOwn()] args', { ctx });
3031
+ const { createFn } = ctx;
3032
+
3033
+ if (ctx.componentIdx !== componentIdx) {
3034
+ throw new Error(`component index mismatch (expected [${componentIdx}], lift called from [${ctx.componentIdx}])`);
3035
+ }
3036
+
3037
+ const obj = ctx.vals[0];
3038
+ if (obj === undefined || obj === null) { throw new Error('missing resource'); }
3039
+ const handle = lowerFn(obj);
3040
+
3041
+ ctx.vals[0] = handle;
3042
+ _lowerFlatU32(ctx);
3043
+ };
2787
3044
  }
2788
3045
 
2789
3046
  const STREAMS = new RepTable({ target: 'global stream map' });
@@ -3130,9 +3387,48 @@ class ComponentAsyncState {
3130
3387
  return new Waitable({ target: args?.target, });
3131
3388
  }
3132
3389
 
3390
+ createReadableStreamEnd(args) {
3391
+ _debugLog('[ComponentAsyncState#createStreamEnd()] args', args);
3392
+ const { tableIdx, elemMeta, hostInjectFn } = args;
3393
+
3394
+ const { table: localStreamTable, componentIdx } = STREAM_TABLES[tableIdx];
3395
+ if (!localStreamTable) {
3396
+ throw new Error(`missing global stream table lookup for table [${tableIdx}] while creating stream`);
3397
+ }
3398
+ if (componentIdx !== this.#componentIdx) {
3399
+ throw new Error('component idx mismatch while creating stream');
3400
+ }
3401
+
3402
+ const waitable = this.createWaitable();
3403
+ const streamEnd = new StreamReadableEnd({
3404
+ tableIdx,
3405
+ elemMeta,
3406
+ hostInjectFn,
3407
+ pendingBufferMeta: {},
3408
+ target: `stream read end (lowered, @init)`,
3409
+ waitable,
3410
+ });
3411
+
3412
+ streamEnd.setWaitableIdx(this.handles.insert(streamEnd));
3413
+ streamEnd.setHandle(localStreamTable.insert(streamEnd));
3414
+ if (streamEnd.streamTableIdx() !== tableIdx) {
3415
+ throw new Error("unexpectedly mismatched stream table");
3416
+ }
3417
+ const streamEndWaitableIdx = streamEnd.waitableIdx();
3418
+ const streamEndHandle = streamEnd.handle();
3419
+ waitable.setTarget(`waitable for stream read end (lowered, waitable [${streamEndWaitableIdx}])`);
3420
+ streamEnd.setTarget(`stream read end (lowered, waitable [${streamEndWaitableIdx}])`);
3421
+
3422
+ return {
3423
+ waitableIdx: streamEndWaitableIdx,
3424
+ handle: streamEndHandle,
3425
+ streamEnd,
3426
+ };
3427
+ }
3428
+
3133
3429
  createStream(args) {
3134
3430
  _debugLog('[ComponentAsyncState#createStream()] args', args);
3135
- const { tableIdx, elemMeta } = args;
3431
+ const { tableIdx, elemMeta, hostInjectFn } = args;
3136
3432
  if (tableIdx === undefined) { throw new Error("missing table idx while adding stream"); }
3137
3433
  if (elemMeta === undefined) { throw new Error("missing element metadata while adding stream"); }
3138
3434
 
@@ -3149,10 +3445,10 @@ class ComponentAsyncState {
3149
3445
 
3150
3446
  const stream = new InternalStream({
3151
3447
  tableIdx,
3152
- componentIdx: this.#componentIdx,
3153
3448
  elemMeta,
3154
3449
  readWaitable,
3155
3450
  writeWaitable,
3451
+ hostInjectFn,
3156
3452
  });
3157
3453
  stream.setGlobalStreamMapRep(STREAMS.insert(stream));
3158
3454
 
@@ -3177,17 +3473,21 @@ class ComponentAsyncState {
3177
3473
  readEnd.setTarget(`stream read end (waitable [${readEndWaitableIdx}])`);
3178
3474
 
3179
3475
  return {
3476
+ writeEnd,
3180
3477
  writeEndWaitableIdx,
3181
3478
  writeEndHandle,
3182
3479
  readEndWaitableIdx,
3183
3480
  readEndHandle,
3481
+ readEnd,
3184
3482
  };
3185
3483
  }
3186
3484
 
3187
3485
  getStreamEnd(args) {
3188
3486
  _debugLog('[ComponentAsyncState#getStreamEnd()] args', args);
3189
3487
  const { tableIdx, streamEndHandle, streamEndWaitableIdx } = args;
3190
- if (tableIdx === undefined) { throw new Error('missing table idx while getting stream end'); }
3488
+ if (tableIdx === undefined) {
3489
+ throw new Error('missing table idx while getting stream end');
3490
+ }
3191
3491
 
3192
3492
  const { table, componentIdx } = STREAM_TABLES[tableIdx];
3193
3493
  const cstate = getOrCreateAsyncState(componentIdx);
@@ -3274,6 +3574,128 @@ class ComponentAsyncState {
3274
3574
 
3275
3575
  return streamEnd;
3276
3576
  }
3577
+
3578
+ createFuture(args) {
3579
+ _debugLog('[ComponentAsyncState#createFuture()] args', args);
3580
+ const { tableIdx, elemMeta, hostInjectFn } = args;
3581
+ if (tableIdx === undefined) { throw new Error("missing table idx while adding future"); }
3582
+ if (elemMeta === undefined) { throw new Error("missing element metadata while adding future"); }
3583
+
3584
+ const { table: futureTable, componentIdx } = FUTURE_TABLES[tableIdx];
3585
+ if (!futureTable) {
3586
+ throw new Error(`missing global future table lookup for table [${tableIdx}] while creating future`);
3587
+ }
3588
+ if (componentIdx !== this.#componentIdx) {
3589
+ throw new Error('component idx mismatch while creating future');
3590
+ }
3591
+
3592
+ const readWaitable = this.createWaitable();
3593
+ const writeWaitable = this.createWaitable();
3594
+
3595
+ const future = new InternalFuture({
3596
+ tableIdx,
3597
+ componentIdx: this.#componentIdx,
3598
+ elemMeta,
3599
+ readWaitable,
3600
+ writeWaitable,
3601
+ hostInjectFn,
3602
+ });
3603
+ future.setGlobalFutureMapRep(FUTURES.insert(future));
3604
+
3605
+ const writeEnd = future.writeEnd();
3606
+ writeEnd.setWaitableIdx(this.handles.insert(writeEnd));
3607
+ writeEnd.setHandle(futureTable.insert(writeEnd));
3608
+ if (writeEnd.futureTableIdx() !== tableIdx) { throw new Error("unexpectedly mismatched future table"); }
3609
+
3610
+ const writeEndWaitableIdx = writeEnd.waitableIdx();
3611
+ const writeEndHandle = writeEnd.handle();
3612
+ writeWaitable.setTarget(`waitable for future write end (waitable [${writeEndWaitableIdx}])`);
3613
+ writeEnd.setTarget(`future write end (waitable [${writeEndWaitableIdx}])`);
3614
+
3615
+ const readEnd = future.readEnd();
3616
+ readEnd.setWaitableIdx(this.handles.insert(readEnd));
3617
+ readEnd.setHandle(futureTable.insert(readEnd));
3618
+ if (readEnd.futureTableIdx() !== tableIdx) { throw new Error("unexpectedly mismatched future table"); }
3619
+
3620
+ const readEndWaitableIdx = readEnd.waitableIdx();
3621
+ const readEndHandle = readEnd.handle();
3622
+ readWaitable.setTarget(`waitable for read end (waitable [${readEndWaitableIdx}])`);
3623
+ readEnd.setTarget(`future read end (waitable [${readEndWaitableIdx}])`);
3624
+
3625
+ return {
3626
+ writeEnd,
3627
+ writeEndWaitableIdx,
3628
+ writeEndHandle,
3629
+ readEndWaitableIdx,
3630
+ readEndHandle,
3631
+ readEnd,
3632
+ };
3633
+ }
3634
+
3635
+ getFutureEnd(args) {
3636
+ _debugLog('[ComponentAsyncState#getFutureEnd()] args', args);
3637
+ const { tableIdx, futureEndHandle, futureEndWaitableIdx } = args;
3638
+ if (tableIdx === undefined) {
3639
+ throw new Error('missing table idx while getting future end');
3640
+ }
3641
+
3642
+ const { table, componentIdx } = FUTURE_TABLES[tableIdx];
3643
+ const cstate = getOrCreateAsyncState(componentIdx);
3644
+
3645
+ let futureEnd;
3646
+ if (futureEndWaitableIdx !== undefined) {
3647
+ futureEnd = cstate.handles.get(futureEndWaitableIdx);
3648
+ } else if (futureEndHandle !== undefined) {
3649
+ if (!table) { throw new Error(`missing/invalid table [${tableIdx}] while getting future end`); }
3650
+ futureEnd = table.get(futureEndHandle);
3651
+ } else {
3652
+ console.log("args?", args);
3653
+ throw new TypeError("must specify either waitable idx or handle to retrieve future");
3654
+ }
3655
+
3656
+ if (!futureEnd) {
3657
+ throw new Error(`missing future end (tableIdx [${tableIdx}], handle [${futureEndHandle}], waitableIdx [${futureEndWaitableIdx}])`);
3658
+ }
3659
+ if (tableIdx && futureEnd.futureTableIdx() !== tableIdx) {
3660
+ throw new Error(`future end table idx [${futureEnd.futureTableIdx()}] does not match [${tableIdx}]`);
3661
+ }
3662
+
3663
+ return futureEnd;
3664
+ }
3665
+
3666
+ removeFutureEndFromTable(args) {
3667
+ _debugLog('[ComponentAsyncState#removeFutureEndFromTable()] args', args);
3668
+
3669
+ const { tableIdx, futureWaitableIdx } = args;
3670
+ if (tableIdx === undefined) { throw new Error("missing table idx while removing future end"); }
3671
+ if (futureWaitableIdx === undefined) {
3672
+ throw new Error("missing future end waitable idx while removing future end");
3673
+ }
3674
+
3675
+ const { table, componentIdx } = FUTURE_TABLES[tableIdx];
3676
+ if (!table) { throw new Error(`missing/invalid table [${tableIdx}] while removing future end`); }
3677
+
3678
+ const cstate = getOrCreateAsyncState(componentIdx);
3679
+
3680
+ const futureEnd = cstate.handles.get(futureWaitableIdx);
3681
+ if (!futureEnd) {
3682
+ throw new Error(`missing future end (handle [${futureWaitableIdx}], table [${tableIdx}])`);
3683
+ }
3684
+ const handle = futureEnd.handle();
3685
+
3686
+ let removed = cstate.handles.remove(futureWaitableIdx);
3687
+ if (!removed) {
3688
+ throw new Error(`failed to remove futureEnd from handles (waitable idx [${futureWaitableIdx}]), component [${componentIdx}])`);
3689
+ }
3690
+
3691
+ removed = table.remove(handle);
3692
+ if (!removed) {
3693
+ throw new Error(`failed to remove futureEnd from table (handle [${handle}]), table [${tableIdx}], component [${componentIdx}])`);
3694
+ }
3695
+
3696
+ return futureEnd;
3697
+ }
3698
+
3277
3699
  }
3278
3700
 
3279
3701
  const base64Compile = str => WebAssembly.compile(typeof Buffer !== 'undefined' ? Buffer.from(str, 'base64') : Uint8Array.from(atob(str), b => b.charCodeAt(0)));
@@ -3310,6 +3732,8 @@ function getErrorPayload(e) {
3310
3732
  return e;
3311
3733
  }
3312
3734
 
3735
+ const isLE = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
3736
+
3313
3737
  function throwUninitialized() {
3314
3738
  throw new TypeError('Wasm uninitialized use `await $init` first');
3315
3739
  }
@@ -3372,8 +3796,9 @@ const _trampoline5 = function() {
3372
3796
  fn: () => getStderr()
3373
3797
  })
3374
3798
  ;
3799
+
3375
3800
  if (!(ret instanceof OutputStream)) {
3376
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
3801
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
3377
3802
  }
3378
3803
  var handle0 = ret[symbolRscHandle];
3379
3804
  if (!handle0) {
@@ -3381,6 +3806,7 @@ const _trampoline5 = function() {
3381
3806
  captureTable2.set(rep, ret);
3382
3807
  handle0 = rscTableCreateOwn(handleTable2, rep);
3383
3808
  }
3809
+
3384
3810
  _debugLog('[iface="wasi:cli/stderr@0.2.3", function="get-stderr"][Instruction::Return]', {
3385
3811
  funcName: 'get-stderr',
3386
3812
  paramCount: 1,
@@ -3443,8 +3869,9 @@ const _trampoline8 = function() {
3443
3869
  fn: () => getStdin()
3444
3870
  })
3445
3871
  ;
3872
+
3446
3873
  if (!(ret instanceof InputStream)) {
3447
- throw new TypeError('Resource error: Not a valid "InputStream" resource.');
3874
+ throw new TypeError('Resource error: Not a valid \"InputStream\" resource.');
3448
3875
  }
3449
3876
  var handle0 = ret[symbolRscHandle];
3450
3877
  if (!handle0) {
@@ -3452,6 +3879,7 @@ const _trampoline8 = function() {
3452
3879
  captureTable1.set(rep, ret);
3453
3880
  handle0 = rscTableCreateOwn(handleTable1, rep);
3454
3881
  }
3882
+
3455
3883
  _debugLog('[iface="wasi:cli/stdin@0.2.3", function="get-stdin"][Instruction::Return]', {
3456
3884
  funcName: 'get-stdin',
3457
3885
  paramCount: 1,
@@ -3510,8 +3938,9 @@ const _trampoline9 = function() {
3510
3938
  fn: () => getStdout()
3511
3939
  })
3512
3940
  ;
3941
+
3513
3942
  if (!(ret instanceof OutputStream)) {
3514
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
3943
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
3515
3944
  }
3516
3945
  var handle0 = ret[symbolRscHandle];
3517
3946
  if (!handle0) {
@@ -3519,6 +3948,7 @@ const _trampoline9 = function() {
3519
3948
  captureTable2.set(rep, ret);
3520
3949
  handle0 = rscTableCreateOwn(handleTable2, rep);
3521
3950
  }
3951
+
3522
3952
  _debugLog('[iface="wasi:cli/stdout@0.2.3", function="get-stdout"][Instruction::Return]', {
3523
3953
  funcName: 'get-stdout',
3524
3954
  paramCount: 1,
@@ -5110,8 +5540,9 @@ switch (variant5.tag) {
5110
5540
  case 'ok': {
5111
5541
  const e = variant5.val;
5112
5542
  dataView(memory0).setInt8(arg2 + 0, 0, true);
5543
+
5113
5544
  if (!(e instanceof InputStream)) {
5114
- throw new TypeError('Resource error: Not a valid "InputStream" resource.');
5545
+ throw new TypeError('Resource error: Not a valid \"InputStream\" resource.');
5115
5546
  }
5116
5547
  var handle3 = e[symbolRscHandle];
5117
5548
  if (!handle3) {
@@ -5119,6 +5550,7 @@ switch (variant5.tag) {
5119
5550
  captureTable1.set(rep, e);
5120
5551
  handle3 = rscTableCreateOwn(handleTable1, rep);
5121
5552
  }
5553
+
5122
5554
  dataView(memory0).setInt32(arg2 + 4, handle3, true);
5123
5555
 
5124
5556
  break;
@@ -5378,8 +5810,9 @@ switch (variant5.tag) {
5378
5810
  case 'ok': {
5379
5811
  const e = variant5.val;
5380
5812
  dataView(memory0).setInt8(arg2 + 0, 0, true);
5813
+
5381
5814
  if (!(e instanceof OutputStream)) {
5382
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
5815
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
5383
5816
  }
5384
5817
  var handle3 = e[symbolRscHandle];
5385
5818
  if (!handle3) {
@@ -5387,6 +5820,7 @@ switch (variant5.tag) {
5387
5820
  captureTable2.set(rep, e);
5388
5821
  handle3 = rscTableCreateOwn(handleTable2, rep);
5389
5822
  }
5823
+
5390
5824
  dataView(memory0).setInt32(arg2 + 4, handle3, true);
5391
5825
 
5392
5826
  break;
@@ -5646,8 +6080,9 @@ switch (variant5.tag) {
5646
6080
  case 'ok': {
5647
6081
  const e = variant5.val;
5648
6082
  dataView(memory0).setInt8(arg1 + 0, 0, true);
6083
+
5649
6084
  if (!(e instanceof OutputStream)) {
5650
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
6085
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
5651
6086
  }
5652
6087
  var handle3 = e[symbolRscHandle];
5653
6088
  if (!handle3) {
@@ -5655,6 +6090,7 @@ switch (variant5.tag) {
5655
6090
  captureTable2.set(rep, e);
5656
6091
  handle3 = rscTableCreateOwn(handleTable2, rep);
5657
6092
  }
6093
+
5658
6094
  dataView(memory0).setInt32(arg1 + 4, handle3, true);
5659
6095
 
5660
6096
  break;
@@ -5918,8 +6354,9 @@ switch (variant5.tag) {
5918
6354
  case 'ok': {
5919
6355
  const e = variant5.val;
5920
6356
  dataView(memory0).setInt8(arg1 + 0, 0, true);
6357
+
5921
6358
  if (!(e instanceof DirectoryEntryStream)) {
5922
- throw new TypeError('Resource error: Not a valid "DirectoryEntryStream" resource.');
6359
+ throw new TypeError('Resource error: Not a valid \"DirectoryEntryStream\" resource.');
5923
6360
  }
5924
6361
  var handle3 = e[symbolRscHandle];
5925
6362
  if (!handle3) {
@@ -5927,6 +6364,7 @@ switch (variant5.tag) {
5927
6364
  captureTable5.set(rep, e);
5928
6365
  handle3 = rscTableCreateOwn(handleTable5, rep);
5929
6366
  }
6367
+
5930
6368
  dataView(memory0).setInt32(arg1 + 4, handle3, true);
5931
6369
 
5932
6370
  break;
@@ -6894,8 +7332,9 @@ switch (variant9.tag) {
6894
7332
  case 'ok': {
6895
7333
  const e = variant9.val;
6896
7334
  dataView(memory0).setInt8(arg6 + 0, 0, true);
7335
+
6897
7336
  if (!(e instanceof Descriptor)) {
6898
- throw new TypeError('Resource error: Not a valid "Descriptor" resource.');
7337
+ throw new TypeError('Resource error: Not a valid \"Descriptor\" resource.');
6899
7338
  }
6900
7339
  var handle7 = e[symbolRscHandle];
6901
7340
  if (!handle7) {
@@ -6903,6 +7342,7 @@ switch (variant9.tag) {
6903
7342
  captureTable6.set(rep, e);
6904
7343
  handle7 = rscTableCreateOwn(handleTable6, rep);
6905
7344
  }
7345
+
6906
7346
  dataView(memory0).setInt32(arg6 + 4, handle7, true);
6907
7347
 
6908
7348
  break;
@@ -7490,13 +7930,14 @@ switch (variant6.tag) {
7490
7930
  let offset = 0;
7491
7931
  const dv3 = new DataView(memory0.buffer);
7492
7932
  for (const v of val3) {
7933
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
7493
7934
  dv3.setUint8(ptr3+ offset, v, true);
7494
7935
  offset += 1;
7495
7936
  }
7496
7937
  } else {
7497
7938
  // TypedArray / ArrayBuffer-like, direct copy
7498
7939
  valData3 = new Uint8Array(val3.buffer || val3, val3.byteOffset, valLenBytes3);
7499
- const out3 = new Uint8Array(memory0.buffer, ptr3,valLenBytes3);
7940
+ const out3 = new Uint8Array(memory0.buffer, ptr3, valLenBytes3);
7500
7941
  out3.set(valData3);
7501
7942
  }
7502
7943
 
@@ -7513,8 +7954,9 @@ switch (variant6.tag) {
7513
7954
  case 'last-operation-failed': {
7514
7955
  const e = variant5.val;
7515
7956
  dataView(memory0).setInt8(arg2 + 4, 0, true);
7957
+
7516
7958
  if (!(e instanceof Error$1)) {
7517
- throw new TypeError('Resource error: Not a valid "Error" resource.');
7959
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7518
7960
  }
7519
7961
  var handle4 = e[symbolRscHandle];
7520
7962
  if (!handle4) {
@@ -7522,6 +7964,7 @@ switch (variant6.tag) {
7522
7964
  captureTable0.set(rep, e);
7523
7965
  handle4 = rscTableCreateOwn(handleTable0, rep);
7524
7966
  }
7967
+
7525
7968
  dataView(memory0).setInt32(arg2 + 8, handle4, true);
7526
7969
  break;
7527
7970
  }
@@ -7636,13 +8079,14 @@ switch (variant6.tag) {
7636
8079
  let offset = 0;
7637
8080
  const dv3 = new DataView(memory0.buffer);
7638
8081
  for (const v of val3) {
8082
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
7639
8083
  dv3.setUint8(ptr3+ offset, v, true);
7640
8084
  offset += 1;
7641
8085
  }
7642
8086
  } else {
7643
8087
  // TypedArray / ArrayBuffer-like, direct copy
7644
8088
  valData3 = new Uint8Array(val3.buffer || val3, val3.byteOffset, valLenBytes3);
7645
- const out3 = new Uint8Array(memory0.buffer, ptr3,valLenBytes3);
8089
+ const out3 = new Uint8Array(memory0.buffer, ptr3, valLenBytes3);
7646
8090
  out3.set(valData3);
7647
8091
  }
7648
8092
 
@@ -7659,8 +8103,9 @@ switch (variant6.tag) {
7659
8103
  case 'last-operation-failed': {
7660
8104
  const e = variant5.val;
7661
8105
  dataView(memory0).setInt8(arg2 + 4, 0, true);
8106
+
7662
8107
  if (!(e instanceof Error$1)) {
7663
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8108
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7664
8109
  }
7665
8110
  var handle4 = e[symbolRscHandle];
7666
8111
  if (!handle4) {
@@ -7668,6 +8113,7 @@ switch (variant6.tag) {
7668
8113
  captureTable0.set(rep, e);
7669
8114
  handle4 = rscTableCreateOwn(handleTable0, rep);
7670
8115
  }
8116
+
7671
8117
  dataView(memory0).setInt32(arg2 + 8, handle4, true);
7672
8118
  break;
7673
8119
  }
@@ -7783,8 +8229,9 @@ switch (variant5.tag) {
7783
8229
  case 'last-operation-failed': {
7784
8230
  const e = variant4.val;
7785
8231
  dataView(memory0).setInt8(arg1 + 8, 0, true);
8232
+
7786
8233
  if (!(e instanceof Error$1)) {
7787
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8234
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7788
8235
  }
7789
8236
  var handle3 = e[symbolRscHandle];
7790
8237
  if (!handle3) {
@@ -7792,6 +8239,7 @@ switch (variant5.tag) {
7792
8239
  captureTable0.set(rep, e);
7793
8240
  handle3 = rscTableCreateOwn(handleTable0, rep);
7794
8241
  }
8242
+
7795
8243
  dataView(memory0).setInt32(arg1 + 12, handle3, true);
7796
8244
  break;
7797
8245
  }
@@ -7909,8 +8357,9 @@ switch (variant6.tag) {
7909
8357
  case 'last-operation-failed': {
7910
8358
  const e = variant5.val;
7911
8359
  dataView(memory0).setInt8(arg3 + 4, 0, true);
8360
+
7912
8361
  if (!(e instanceof Error$1)) {
7913
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8362
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7914
8363
  }
7915
8364
  var handle4 = e[symbolRscHandle];
7916
8365
  if (!handle4) {
@@ -7918,6 +8367,7 @@ switch (variant6.tag) {
7918
8367
  captureTable0.set(rep, e);
7919
8368
  handle4 = rscTableCreateOwn(handleTable0, rep);
7920
8369
  }
8370
+
7921
8371
  dataView(memory0).setInt32(arg3 + 8, handle4, true);
7922
8372
  break;
7923
8373
  }
@@ -8035,8 +8485,9 @@ switch (variant6.tag) {
8035
8485
  case 'last-operation-failed': {
8036
8486
  const e = variant5.val;
8037
8487
  dataView(memory0).setInt8(arg3 + 4, 0, true);
8488
+
8038
8489
  if (!(e instanceof Error$1)) {
8039
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8490
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
8040
8491
  }
8041
8492
  var handle4 = e[symbolRscHandle];
8042
8493
  if (!handle4) {
@@ -8044,6 +8495,7 @@ switch (variant6.tag) {
8044
8495
  captureTable0.set(rep, e);
8045
8496
  handle4 = rscTableCreateOwn(handleTable0, rep);
8046
8497
  }
8498
+
8047
8499
  dataView(memory0).setInt32(arg3 + 8, handle4, true);
8048
8500
  break;
8049
8501
  }
@@ -8158,8 +8610,9 @@ switch (variant5.tag) {
8158
8610
  case 'last-operation-failed': {
8159
8611
  const e = variant4.val;
8160
8612
  dataView(memory0).setInt8(arg1 + 4, 0, true);
8613
+
8161
8614
  if (!(e instanceof Error$1)) {
8162
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8615
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
8163
8616
  }
8164
8617
  var handle3 = e[symbolRscHandle];
8165
8618
  if (!handle3) {
@@ -8167,6 +8620,7 @@ switch (variant5.tag) {
8167
8620
  captureTable0.set(rep, e);
8168
8621
  handle3 = rscTableCreateOwn(handleTable0, rep);
8169
8622
  }
8623
+
8170
8624
  dataView(memory0).setInt32(arg1 + 8, handle3, true);
8171
8625
  break;
8172
8626
  }
@@ -8254,13 +8708,14 @@ const _trampoline31 = function(arg0, arg1) {
8254
8708
  let offset = 0;
8255
8709
  const dv0 = new DataView(memory0.buffer);
8256
8710
  for (const v of val0) {
8711
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8257
8712
  dv0.setUint8(ptr0+ offset, v, true);
8258
8713
  offset += 1;
8259
8714
  }
8260
8715
  } else {
8261
8716
  // TypedArray / ArrayBuffer-like, direct copy
8262
8717
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
8263
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
8718
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
8264
8719
  out0.set(valData0);
8265
8720
  }
8266
8721
 
@@ -8329,8 +8784,9 @@ const _trampoline32 = function(arg0) {
8329
8784
  for (let i = 0; i < vec3.length; i++) {
8330
8785
  const e = vec3[i];
8331
8786
  const base = result3 + i * 12;var [tuple0_0, tuple0_1] = e;
8787
+
8332
8788
  if (!(tuple0_0 instanceof Descriptor)) {
8333
- throw new TypeError('Resource error: Not a valid "Descriptor" resource.');
8789
+ throw new TypeError('Resource error: Not a valid \"Descriptor\" resource.');
8334
8790
  }
8335
8791
  var handle1 = tuple0_0[symbolRscHandle];
8336
8792
  if (!handle1) {
@@ -8338,6 +8794,7 @@ const _trampoline32 = function(arg0) {
8338
8794
  captureTable6.set(rep, tuple0_0);
8339
8795
  handle1 = rscTableCreateOwn(handleTable6, rep);
8340
8796
  }
8797
+
8341
8798
  dataView(memory0).setInt32(base + 0, handle1, true);
8342
8799
 
8343
8800
  var encodeRes = _utf8AllocateAndEncode(tuple0_1, realloc0, memory0);
@@ -8416,8 +8873,9 @@ const _trampoline33 = function(arg0) {
8416
8873
  } else {
8417
8874
  const e = variant1;
8418
8875
  dataView(memory0).setInt8(arg0 + 0, 1, true);
8876
+
8419
8877
  if (!(e instanceof TerminalInput)) {
8420
- throw new TypeError('Resource error: Not a valid "TerminalInput" resource.');
8878
+ throw new TypeError('Resource error: Not a valid \"TerminalInput\" resource.');
8421
8879
  }
8422
8880
  var handle0 = e[symbolRscHandle];
8423
8881
  if (!handle0) {
@@ -8425,6 +8883,7 @@ const _trampoline33 = function(arg0) {
8425
8883
  captureTable3.set(rep, e);
8426
8884
  handle0 = rscTableCreateOwn(handleTable3, rep);
8427
8885
  }
8886
+
8428
8887
  dataView(memory0).setInt32(arg0 + 4, handle0, true);
8429
8888
  }
8430
8889
  _debugLog('[iface="wasi:cli/terminal-stdin@0.2.3", function="get-terminal-stdin"][Instruction::Return]', {
@@ -8494,8 +8953,9 @@ const _trampoline34 = function(arg0) {
8494
8953
  } else {
8495
8954
  const e = variant1;
8496
8955
  dataView(memory0).setInt8(arg0 + 0, 1, true);
8956
+
8497
8957
  if (!(e instanceof TerminalOutput)) {
8498
- throw new TypeError('Resource error: Not a valid "TerminalOutput" resource.');
8958
+ throw new TypeError('Resource error: Not a valid \"TerminalOutput\" resource.');
8499
8959
  }
8500
8960
  var handle0 = e[symbolRscHandle];
8501
8961
  if (!handle0) {
@@ -8503,6 +8963,7 @@ const _trampoline34 = function(arg0) {
8503
8963
  captureTable4.set(rep, e);
8504
8964
  handle0 = rscTableCreateOwn(handleTable4, rep);
8505
8965
  }
8966
+
8506
8967
  dataView(memory0).setInt32(arg0 + 4, handle0, true);
8507
8968
  }
8508
8969
  _debugLog('[iface="wasi:cli/terminal-stdout@0.2.3", function="get-terminal-stdout"][Instruction::Return]', {
@@ -8568,8 +9029,9 @@ const _trampoline35 = function(arg0) {
8568
9029
  } else {
8569
9030
  const e = variant1;
8570
9031
  dataView(memory0).setInt8(arg0 + 0, 1, true);
9032
+
8571
9033
  if (!(e instanceof TerminalOutput)) {
8572
- throw new TypeError('Resource error: Not a valid "TerminalOutput" resource.');
9034
+ throw new TypeError('Resource error: Not a valid \"TerminalOutput\" resource.');
8573
9035
  }
8574
9036
  var handle0 = e[symbolRscHandle];
8575
9037
  if (!handle0) {
@@ -8577,6 +9039,7 @@ const _trampoline35 = function(arg0) {
8577
9039
  captureTable4.set(rep, e);
8578
9040
  handle0 = rscTableCreateOwn(handleTable4, rep);
8579
9041
  }
9042
+
8580
9043
  dataView(memory0).setInt32(arg0 + 4, handle0, true);
8581
9044
  }
8582
9045
  _debugLog('[iface="wasi:cli/terminal-stderr@0.2.3", function="get-terminal-stderr"][Instruction::Return]', {
@@ -8697,13 +9160,14 @@ function print(arg0) {
8697
9160
  let offset = 0;
8698
9161
  const dv0 = new DataView(memory0.buffer);
8699
9162
  for (const v of val0) {
9163
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8700
9164
  dv0.setUint8(ptr0+ offset, v, true);
8701
9165
  offset += 1;
8702
9166
  }
8703
9167
  } else {
8704
9168
  // TypedArray / ArrayBuffer-like, direct copy
8705
9169
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
8706
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
9170
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
8707
9171
  out0.set(valData0);
8708
9172
  }
8709
9173
 
@@ -8799,13 +9263,14 @@ function componentNew(arg0, arg1) {
8799
9263
  let offset = 0;
8800
9264
  const dv0 = new DataView(memory0.buffer);
8801
9265
  for (const v of val0) {
9266
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8802
9267
  dv0.setUint8(ptr0+ offset, v, true);
8803
9268
  offset += 1;
8804
9269
  }
8805
9270
  } else {
8806
9271
  // TypedArray / ArrayBuffer-like, direct copy
8807
9272
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
8808
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
9273
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
8809
9274
  out0.set(valData0);
8810
9275
  }
8811
9276
 
@@ -8843,13 +9308,14 @@ function componentNew(arg0, arg1) {
8843
9308
  let offset = 0;
8844
9309
  const dv3 = new DataView(memory0.buffer);
8845
9310
  for (const v of val3) {
9311
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8846
9312
  dv3.setUint8(ptr3+ offset, v, true);
8847
9313
  offset += 1;
8848
9314
  }
8849
9315
  } else {
8850
9316
  // TypedArray / ArrayBuffer-like, direct copy
8851
9317
  valData3 = new Uint8Array(val3.buffer || val3, val3.byteOffset, valLenBytes3);
8852
- const out3 = new Uint8Array(memory0.buffer, ptr3,valLenBytes3);
9318
+ const out3 = new Uint8Array(memory0.buffer, ptr3, valLenBytes3);
8853
9319
  out3.set(valData3);
8854
9320
  }
8855
9321
 
@@ -8952,13 +9418,14 @@ function componentWit(arg0) {
8952
9418
  let offset = 0;
8953
9419
  const dv0 = new DataView(memory0.buffer);
8954
9420
  for (const v of val0) {
9421
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8955
9422
  dv0.setUint8(ptr0+ offset, v, true);
8956
9423
  offset += 1;
8957
9424
  }
8958
9425
  } else {
8959
9426
  // TypedArray / ArrayBuffer-like, direct copy
8960
9427
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
8961
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
9428
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
8962
9429
  out0.set(valData0);
8963
9430
  }
8964
9431
 
@@ -9062,13 +9529,14 @@ function componentEmbed(arg0) {
9062
9529
  let offset = 0;
9063
9530
  const dv2 = new DataView(memory0.buffer);
9064
9531
  for (const v of val2) {
9532
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
9065
9533
  dv2.setUint8(ptr2+ offset, v, true);
9066
9534
  offset += 1;
9067
9535
  }
9068
9536
  } else {
9069
9537
  // TypedArray / ArrayBuffer-like, direct copy
9070
9538
  valData2 = new Uint8Array(val2.buffer || val2, val2.byteOffset, valLenBytes2);
9071
- const out2 = new Uint8Array(memory0.buffer, ptr2,valLenBytes2);
9539
+ const out2 = new Uint8Array(memory0.buffer, ptr2, valLenBytes2);
9072
9540
  out2.set(valData2);
9073
9541
  }
9074
9542
 
@@ -9331,13 +9799,14 @@ function metadataShow(arg0) {
9331
9799
  let offset = 0;
9332
9800
  const dv0 = new DataView(memory0.buffer);
9333
9801
  for (const v of val0) {
9802
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
9334
9803
  dv0.setUint8(ptr0+ offset, v, true);
9335
9804
  offset += 1;
9336
9805
  }
9337
9806
  } else {
9338
9807
  // TypedArray / ArrayBuffer-like, direct copy
9339
9808
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
9340
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
9809
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
9341
9810
  out0.set(valData0);
9342
9811
  }
9343
9812
 
@@ -9516,13 +9985,14 @@ function metadataAdd(arg0, arg1) {
9516
9985
  let offset = 0;
9517
9986
  const dv0 = new DataView(memory0.buffer);
9518
9987
  for (const v of val0) {
9988
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
9519
9989
  dv0.setUint8(ptr0+ offset, v, true);
9520
9990
  offset += 1;
9521
9991
  }
9522
9992
  } else {
9523
9993
  // TypedArray / ArrayBuffer-like, direct copy
9524
9994
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
9525
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
9995
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
9526
9996
  out0.set(valData0);
9527
9997
  }
9528
9998
 
@@ -9713,12 +10183,16 @@ null,
9713
10183
  isAsync: false,
9714
10184
  isManualAsync: _trampoline5.manuallyAsync,
9715
10185
  paramLiftFns: [],
9716
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
10186
+ resultLowerFns: [_lowerFlatOwn({
10187
+ componentIdx: 0,
10188
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10189
+ })],
9717
10190
  funcTypeIsAsync: false,
9718
10191
  getCallbackFn: () => null,
9719
10192
  getPostReturnFn: () => null,
9720
10193
  isCancellable: false,
9721
10194
  memoryIdx: null,
10195
+ stringEncoding: 'utf8',
9722
10196
  getMemoryFn: () => null,
9723
10197
  getReallocFn: () => null,
9724
10198
  importFn: _trampoline5,
@@ -9731,12 +10205,16 @@ null,
9731
10205
  isAsync: false,
9732
10206
  isManualAsync: _trampoline5.manuallyAsync,
9733
10207
  paramLiftFns: [],
9734
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
10208
+ resultLowerFns: [_lowerFlatOwn({
10209
+ componentIdx: 0,
10210
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10211
+ })],
9735
10212
  funcTypeIsAsync: false,
9736
10213
  getCallbackFn: () => null,
9737
10214
  getPostReturnFn: () => null,
9738
10215
  isCancellable: false,
9739
10216
  memoryIdx: null,
10217
+ stringEncoding: 'utf8',
9740
10218
  getMemoryFn: () => null,
9741
10219
  getReallocFn: () => null,
9742
10220
  importFn: _trampoline5,
@@ -9776,12 +10254,16 @@ null,
9776
10254
  isAsync: false,
9777
10255
  isManualAsync: _trampoline8.manuallyAsync,
9778
10256
  paramLiftFns: [],
9779
- resultLowerFns: [_lowerFlatOwn.bind(null, 1)],
10257
+ resultLowerFns: [_lowerFlatOwn({
10258
+ componentIdx: 0,
10259
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10260
+ })],
9780
10261
  funcTypeIsAsync: false,
9781
10262
  getCallbackFn: () => null,
9782
10263
  getPostReturnFn: () => null,
9783
10264
  isCancellable: false,
9784
10265
  memoryIdx: null,
10266
+ stringEncoding: 'utf8',
9785
10267
  getMemoryFn: () => null,
9786
10268
  getReallocFn: () => null,
9787
10269
  importFn: _trampoline8,
@@ -9794,12 +10276,16 @@ null,
9794
10276
  isAsync: false,
9795
10277
  isManualAsync: _trampoline8.manuallyAsync,
9796
10278
  paramLiftFns: [],
9797
- resultLowerFns: [_lowerFlatOwn.bind(null, 1)],
10279
+ resultLowerFns: [_lowerFlatOwn({
10280
+ componentIdx: 0,
10281
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10282
+ })],
9798
10283
  funcTypeIsAsync: false,
9799
10284
  getCallbackFn: () => null,
9800
10285
  getPostReturnFn: () => null,
9801
10286
  isCancellable: false,
9802
10287
  memoryIdx: null,
10288
+ stringEncoding: 'utf8',
9803
10289
  getMemoryFn: () => null,
9804
10290
  getReallocFn: () => null,
9805
10291
  importFn: _trampoline8,
@@ -9813,12 +10299,16 @@ null,
9813
10299
  isAsync: false,
9814
10300
  isManualAsync: _trampoline9.manuallyAsync,
9815
10301
  paramLiftFns: [],
9816
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
10302
+ resultLowerFns: [_lowerFlatOwn({
10303
+ componentIdx: 0,
10304
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10305
+ })],
9817
10306
  funcTypeIsAsync: false,
9818
10307
  getCallbackFn: () => null,
9819
10308
  getPostReturnFn: () => null,
9820
10309
  isCancellable: false,
9821
10310
  memoryIdx: null,
10311
+ stringEncoding: 'utf8',
9822
10312
  getMemoryFn: () => null,
9823
10313
  getReallocFn: () => null,
9824
10314
  importFn: _trampoline9,
@@ -9831,12 +10321,16 @@ null,
9831
10321
  isAsync: false,
9832
10322
  isManualAsync: _trampoline9.manuallyAsync,
9833
10323
  paramLiftFns: [],
9834
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
10324
+ resultLowerFns: [_lowerFlatOwn({
10325
+ componentIdx: 0,
10326
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10327
+ })],
9835
10328
  funcTypeIsAsync: false,
9836
10329
  getCallbackFn: () => null,
9837
10330
  getPostReturnFn: () => null,
9838
10331
  isCancellable: false,
9839
10332
  memoryIdx: null,
10333
+ stringEncoding: 'utf8',
9840
10334
  getMemoryFn: () => null,
9841
10335
  getReallocFn: () => null,
9842
10336
  importFn: _trampoline9,
@@ -9856,6 +10350,7 @@ null,
9856
10350
  getPostReturnFn: () => null,
9857
10351
  isCancellable: false,
9858
10352
  memoryIdx: null,
10353
+ stringEncoding: 'utf8',
9859
10354
  getMemoryFn: () => null,
9860
10355
  getReallocFn: () => null,
9861
10356
  importFn: _trampoline10,
@@ -9874,6 +10369,7 @@ null,
9874
10369
  getPostReturnFn: () => null,
9875
10370
  isCancellable: false,
9876
10371
  memoryIdx: null,
10372
+ stringEncoding: 'utf8',
9877
10373
  getMemoryFn: () => null,
9878
10374
  getReallocFn: () => null,
9879
10375
  importFn: _trampoline10,
@@ -9887,12 +10383,17 @@ null,
9887
10383
  isAsync: false,
9888
10384
  isManualAsync: _trampoline11.manuallyAsync,
9889
10385
  paramLiftFns: [],
9890
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 0), typeIdx: 0 })],
10386
+ resultLowerFns: [_lowerFlatList({
10387
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatStringAny, 16, 4],[_lowerFlatStringAny, 16, 4],]),
10388
+ elemSize32: 16,
10389
+ elemAlign32: 4,
10390
+ })],
9891
10391
  funcTypeIsAsync: false,
9892
10392
  getCallbackFn: () => null,
9893
10393
  getPostReturnFn: () => null,
9894
10394
  isCancellable: false,
9895
10395
  memoryIdx: 0,
10396
+ stringEncoding: 'utf8',
9896
10397
  getMemoryFn: () => memory0,
9897
10398
  getReallocFn: () => realloc0,
9898
10399
  importFn: _trampoline11,
@@ -9905,12 +10406,17 @@ null,
9905
10406
  isAsync: false,
9906
10407
  isManualAsync: _trampoline11.manuallyAsync,
9907
10408
  paramLiftFns: [],
9908
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 0), typeIdx: 0 })],
10409
+ resultLowerFns: [_lowerFlatList({
10410
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatStringAny, 16, 4],[_lowerFlatStringAny, 16, 4],]),
10411
+ elemSize32: 16,
10412
+ elemAlign32: 4,
10413
+ })],
9909
10414
  funcTypeIsAsync: false,
9910
10415
  getCallbackFn: () => null,
9911
10416
  getPostReturnFn: () => null,
9912
10417
  isCancellable: false,
9913
10418
  memoryIdx: 0,
10419
+ stringEncoding: 'utf8',
9914
10420
  getMemoryFn: () => memory0,
9915
10421
  getReallocFn: () => realloc0,
9916
10422
  importFn: _trampoline11,
@@ -9924,12 +10430,17 @@ null,
9924
10430
  isAsync: false,
9925
10431
  isManualAsync: _trampoline12.manuallyAsync,
9926
10432
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9927
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatFlags.bind(null, 0), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10433
+ resultLowerFns: [_lowerFlatResult([
10434
+ [ 'ok', _lowerFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSizeBytes: 1 }), 2, 1, 1 ],
10435
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10436
+ ])
10437
+ ],
9928
10438
  funcTypeIsAsync: false,
9929
10439
  getCallbackFn: () => null,
9930
10440
  getPostReturnFn: () => null,
9931
10441
  isCancellable: false,
9932
10442
  memoryIdx: 0,
10443
+ stringEncoding: 'utf8',
9933
10444
  getMemoryFn: () => memory0,
9934
10445
  getReallocFn: () => null,
9935
10446
  importFn: _trampoline12,
@@ -9942,12 +10453,17 @@ null,
9942
10453
  isAsync: false,
9943
10454
  isManualAsync: _trampoline12.manuallyAsync,
9944
10455
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9945
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatFlags.bind(null, 0), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10456
+ resultLowerFns: [_lowerFlatResult([
10457
+ [ 'ok', _lowerFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSizeBytes: 1 }), 2, 1, 1 ],
10458
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10459
+ ])
10460
+ ],
9946
10461
  funcTypeIsAsync: false,
9947
10462
  getCallbackFn: () => null,
9948
10463
  getPostReturnFn: () => null,
9949
10464
  isCancellable: false,
9950
10465
  memoryIdx: 0,
10466
+ stringEncoding: 'utf8',
9951
10467
  getMemoryFn: () => memory0,
9952
10468
  getReallocFn: () => null,
9953
10469
  importFn: _trampoline12,
@@ -9961,12 +10477,17 @@ null,
9961
10477
  isAsync: false,
9962
10478
  isManualAsync: _trampoline13.manuallyAsync,
9963
10479
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9964
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatEnum.bind(null, 1), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10480
+ resultLowerFns: [_lowerFlatResult([
10481
+ [ 'ok', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 2, 1, 1 ],
10482
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10483
+ ])
10484
+ ],
9965
10485
  funcTypeIsAsync: false,
9966
10486
  getCallbackFn: () => null,
9967
10487
  getPostReturnFn: () => null,
9968
10488
  isCancellable: false,
9969
10489
  memoryIdx: 0,
10490
+ stringEncoding: 'utf8',
9970
10491
  getMemoryFn: () => memory0,
9971
10492
  getReallocFn: () => null,
9972
10493
  importFn: _trampoline13,
@@ -9979,12 +10500,17 @@ null,
9979
10500
  isAsync: false,
9980
10501
  isManualAsync: _trampoline13.manuallyAsync,
9981
10502
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9982
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatEnum.bind(null, 1), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10503
+ resultLowerFns: [_lowerFlatResult([
10504
+ [ 'ok', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 2, 1, 1 ],
10505
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10506
+ ])
10507
+ ],
9983
10508
  funcTypeIsAsync: false,
9984
10509
  getCallbackFn: () => null,
9985
10510
  getPostReturnFn: () => null,
9986
10511
  isCancellable: false,
9987
10512
  memoryIdx: 0,
10513
+ stringEncoding: 'utf8',
9988
10514
  getMemoryFn: () => memory0,
9989
10515
  getReallocFn: () => null,
9990
10516
  importFn: _trampoline13,
@@ -9998,12 +10524,17 @@ null,
9998
10524
  isAsync: false,
9999
10525
  isManualAsync: _trampoline14.manuallyAsync,
10000
10526
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10001
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 24, 8, 8 ],])],
10527
+ resultLowerFns: [_lowerFlatResult([
10528
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10529
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 24, 8, 8 ],
10530
+ ])
10531
+ ],
10002
10532
  funcTypeIsAsync: false,
10003
10533
  getCallbackFn: () => null,
10004
10534
  getPostReturnFn: () => null,
10005
10535
  isCancellable: false,
10006
10536
  memoryIdx: 0,
10537
+ stringEncoding: 'utf8',
10007
10538
  getMemoryFn: () => memory0,
10008
10539
  getReallocFn: () => null,
10009
10540
  importFn: _trampoline14,
@@ -10016,12 +10547,17 @@ null,
10016
10547
  isAsync: false,
10017
10548
  isManualAsync: _trampoline14.manuallyAsync,
10018
10549
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10019
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 24, 8, 8 ],])],
10550
+ resultLowerFns: [_lowerFlatResult([
10551
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10552
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 24, 8, 8 ],
10553
+ ])
10554
+ ],
10020
10555
  funcTypeIsAsync: false,
10021
10556
  getCallbackFn: () => null,
10022
10557
  getPostReturnFn: () => null,
10023
10558
  isCancellable: false,
10024
10559
  memoryIdx: 0,
10560
+ stringEncoding: 'utf8',
10025
10561
  getMemoryFn: () => memory0,
10026
10562
  getReallocFn: () => null,
10027
10563
  importFn: _trampoline14,
@@ -10035,12 +10571,17 @@ null,
10035
10571
  isAsync: false,
10036
10572
  isManualAsync: _trampoline15.manuallyAsync,
10037
10573
  paramLiftFns: [_liftFlatBorrow.bind(null, 0)],
10038
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],[ 'none', null, 2, 1, 1 ],])],
10574
+ resultLowerFns: [_lowerFlatOption([
10575
+ [ 'none', null, 2, 1, 1 ],
10576
+ [ 'some', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10577
+ ])
10578
+ ],
10039
10579
  funcTypeIsAsync: false,
10040
10580
  getCallbackFn: () => null,
10041
10581
  getPostReturnFn: () => null,
10042
10582
  isCancellable: false,
10043
10583
  memoryIdx: 0,
10584
+ stringEncoding: 'utf8',
10044
10585
  getMemoryFn: () => memory0,
10045
10586
  getReallocFn: () => null,
10046
10587
  importFn: _trampoline15,
@@ -10053,12 +10594,17 @@ null,
10053
10594
  isAsync: false,
10054
10595
  isManualAsync: _trampoline15.manuallyAsync,
10055
10596
  paramLiftFns: [_liftFlatBorrow.bind(null, 0)],
10056
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],[ 'none', null, 2, 1, 1 ],])],
10597
+ resultLowerFns: [_lowerFlatOption([
10598
+ [ 'none', null, 2, 1, 1 ],
10599
+ [ 'some', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 2, 1, 1 ],
10600
+ ])
10601
+ ],
10057
10602
  funcTypeIsAsync: false,
10058
10603
  getCallbackFn: () => null,
10059
10604
  getPostReturnFn: () => null,
10060
10605
  isCancellable: false,
10061
10606
  memoryIdx: 0,
10607
+ stringEncoding: 'utf8',
10062
10608
  getMemoryFn: () => memory0,
10063
10609
  getReallocFn: () => null,
10064
10610
  importFn: _trampoline15,
@@ -10071,13 +10617,18 @@ null,
10071
10617
  componentIdx: 0,
10072
10618
  isAsync: false,
10073
10619
  isManualAsync: _trampoline16.manuallyAsync,
10074
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
10075
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 24, 8, 8 ],])],
10620
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10621
+ resultLowerFns: [_lowerFlatResult([
10622
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10623
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 24, 8, 8 ],
10624
+ ])
10625
+ ],
10076
10626
  funcTypeIsAsync: false,
10077
10627
  getCallbackFn: () => null,
10078
10628
  getPostReturnFn: () => null,
10079
10629
  isCancellable: false,
10080
10630
  memoryIdx: 0,
10631
+ stringEncoding: 'utf8',
10081
10632
  getMemoryFn: () => memory0,
10082
10633
  getReallocFn: () => null,
10083
10634
  importFn: _trampoline16,
@@ -10089,13 +10640,18 @@ null,
10089
10640
  componentIdx: 0,
10090
10641
  isAsync: false,
10091
10642
  isManualAsync: _trampoline16.manuallyAsync,
10092
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
10093
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 24, 8, 8 ],])],
10643
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10644
+ resultLowerFns: [_lowerFlatResult([
10645
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10646
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 24, 8, 8 ],
10647
+ ])
10648
+ ],
10094
10649
  funcTypeIsAsync: false,
10095
10650
  getCallbackFn: () => null,
10096
10651
  getPostReturnFn: () => null,
10097
10652
  isCancellable: false,
10098
10653
  memoryIdx: 0,
10654
+ stringEncoding: 'utf8',
10099
10655
  getMemoryFn: () => memory0,
10100
10656
  getReallocFn: () => null,
10101
10657
  importFn: _trampoline16,
@@ -10109,12 +10665,20 @@ null,
10109
10665
  isAsync: false,
10110
10666
  isManualAsync: _trampoline17.manuallyAsync,
10111
10667
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
10112
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 1), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10668
+ resultLowerFns: [_lowerFlatResult([
10669
+ [ 'ok', _lowerFlatOwn({
10670
+ componentIdx: 0,
10671
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10672
+ }), 8, 4, 4 ],
10673
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10674
+ ])
10675
+ ],
10113
10676
  funcTypeIsAsync: false,
10114
10677
  getCallbackFn: () => null,
10115
10678
  getPostReturnFn: () => null,
10116
10679
  isCancellable: false,
10117
10680
  memoryIdx: 0,
10681
+ stringEncoding: 'utf8',
10118
10682
  getMemoryFn: () => memory0,
10119
10683
  getReallocFn: () => null,
10120
10684
  importFn: _trampoline17,
@@ -10127,12 +10691,20 @@ null,
10127
10691
  isAsync: false,
10128
10692
  isManualAsync: _trampoline17.manuallyAsync,
10129
10693
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
10130
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 1), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10694
+ resultLowerFns: [_lowerFlatResult([
10695
+ [ 'ok', _lowerFlatOwn({
10696
+ componentIdx: 0,
10697
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10698
+ }), 8, 4, 4 ],
10699
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10700
+ ])
10701
+ ],
10131
10702
  funcTypeIsAsync: false,
10132
10703
  getCallbackFn: () => null,
10133
10704
  getPostReturnFn: () => null,
10134
10705
  isCancellable: false,
10135
10706
  memoryIdx: 0,
10707
+ stringEncoding: 'utf8',
10136
10708
  getMemoryFn: () => memory0,
10137
10709
  getReallocFn: () => null,
10138
10710
  importFn: _trampoline17,
@@ -10146,12 +10718,20 @@ null,
10146
10718
  isAsync: false,
10147
10719
  isManualAsync: _trampoline18.manuallyAsync,
10148
10720
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
10149
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10721
+ resultLowerFns: [_lowerFlatResult([
10722
+ [ 'ok', _lowerFlatOwn({
10723
+ componentIdx: 0,
10724
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10725
+ }), 8, 4, 4 ],
10726
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10727
+ ])
10728
+ ],
10150
10729
  funcTypeIsAsync: false,
10151
10730
  getCallbackFn: () => null,
10152
10731
  getPostReturnFn: () => null,
10153
10732
  isCancellable: false,
10154
10733
  memoryIdx: 0,
10734
+ stringEncoding: 'utf8',
10155
10735
  getMemoryFn: () => memory0,
10156
10736
  getReallocFn: () => null,
10157
10737
  importFn: _trampoline18,
@@ -10164,12 +10744,20 @@ null,
10164
10744
  isAsync: false,
10165
10745
  isManualAsync: _trampoline18.manuallyAsync,
10166
10746
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
10167
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10747
+ resultLowerFns: [_lowerFlatResult([
10748
+ [ 'ok', _lowerFlatOwn({
10749
+ componentIdx: 0,
10750
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10751
+ }), 8, 4, 4 ],
10752
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10753
+ ])
10754
+ ],
10168
10755
  funcTypeIsAsync: false,
10169
10756
  getCallbackFn: () => null,
10170
10757
  getPostReturnFn: () => null,
10171
10758
  isCancellable: false,
10172
10759
  memoryIdx: 0,
10760
+ stringEncoding: 'utf8',
10173
10761
  getMemoryFn: () => memory0,
10174
10762
  getReallocFn: () => null,
10175
10763
  importFn: _trampoline18,
@@ -10183,12 +10771,20 @@ null,
10183
10771
  isAsync: false,
10184
10772
  isManualAsync: _trampoline19.manuallyAsync,
10185
10773
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10186
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10774
+ resultLowerFns: [_lowerFlatResult([
10775
+ [ 'ok', _lowerFlatOwn({
10776
+ componentIdx: 0,
10777
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10778
+ }), 8, 4, 4 ],
10779
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10780
+ ])
10781
+ ],
10187
10782
  funcTypeIsAsync: false,
10188
10783
  getCallbackFn: () => null,
10189
10784
  getPostReturnFn: () => null,
10190
10785
  isCancellable: false,
10191
10786
  memoryIdx: 0,
10787
+ stringEncoding: 'utf8',
10192
10788
  getMemoryFn: () => memory0,
10193
10789
  getReallocFn: () => null,
10194
10790
  importFn: _trampoline19,
@@ -10201,12 +10797,20 @@ null,
10201
10797
  isAsync: false,
10202
10798
  isManualAsync: _trampoline19.manuallyAsync,
10203
10799
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10204
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10800
+ resultLowerFns: [_lowerFlatResult([
10801
+ [ 'ok', _lowerFlatOwn({
10802
+ componentIdx: 0,
10803
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10804
+ }), 8, 4, 4 ],
10805
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10806
+ ])
10807
+ ],
10205
10808
  funcTypeIsAsync: false,
10206
10809
  getCallbackFn: () => null,
10207
10810
  getPostReturnFn: () => null,
10208
10811
  isCancellable: false,
10209
10812
  memoryIdx: 0,
10813
+ stringEncoding: 'utf8',
10210
10814
  getMemoryFn: () => memory0,
10211
10815
  getReallocFn: () => null,
10212
10816
  importFn: _trampoline19,
@@ -10220,12 +10824,20 @@ null,
10220
10824
  isAsync: false,
10221
10825
  isManualAsync: _trampoline20.manuallyAsync,
10222
10826
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10223
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 5), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10827
+ resultLowerFns: [_lowerFlatResult([
10828
+ [ 'ok', _lowerFlatOwn({
10829
+ componentIdx: 0,
10830
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10831
+ }), 8, 4, 4 ],
10832
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10833
+ ])
10834
+ ],
10224
10835
  funcTypeIsAsync: false,
10225
10836
  getCallbackFn: () => null,
10226
10837
  getPostReturnFn: () => null,
10227
10838
  isCancellable: false,
10228
10839
  memoryIdx: 0,
10840
+ stringEncoding: 'utf8',
10229
10841
  getMemoryFn: () => memory0,
10230
10842
  getReallocFn: () => null,
10231
10843
  importFn: _trampoline20,
@@ -10238,12 +10850,20 @@ null,
10238
10850
  isAsync: false,
10239
10851
  isManualAsync: _trampoline20.manuallyAsync,
10240
10852
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10241
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 5), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10853
+ resultLowerFns: [_lowerFlatResult([
10854
+ [ 'ok', _lowerFlatOwn({
10855
+ componentIdx: 0,
10856
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10857
+ }), 8, 4, 4 ],
10858
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
10859
+ ])
10860
+ ],
10242
10861
  funcTypeIsAsync: false,
10243
10862
  getCallbackFn: () => null,
10244
10863
  getPostReturnFn: () => null,
10245
10864
  isCancellable: false,
10246
10865
  memoryIdx: 0,
10866
+ stringEncoding: 'utf8',
10247
10867
  getMemoryFn: () => memory0,
10248
10868
  getReallocFn: () => null,
10249
10869
  importFn: _trampoline20,
@@ -10257,12 +10877,29 @@ null,
10257
10877
  isAsync: false,
10258
10878
  isManualAsync: _trampoline21.manuallyAsync,
10259
10879
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10260
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],]), 104, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 104, 8, 8 ],])],
10880
+ resultLowerFns: [_lowerFlatResult([
10881
+ [ 'ok', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([
10882
+ [ 'none', null, 24, 8, 8 ],
10883
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10884
+ ])
10885
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10886
+ [ 'none', null, 24, 8, 8 ],
10887
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10888
+ ])
10889
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10890
+ [ 'none', null, 24, 8, 8 ],
10891
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10892
+ ])
10893
+ , 96, 8 ],]), 104, 8, 8 ],
10894
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 104, 8, 8 ],
10895
+ ])
10896
+ ],
10261
10897
  funcTypeIsAsync: false,
10262
10898
  getCallbackFn: () => null,
10263
10899
  getPostReturnFn: () => null,
10264
10900
  isCancellable: false,
10265
10901
  memoryIdx: 0,
10902
+ stringEncoding: 'utf8',
10266
10903
  getMemoryFn: () => memory0,
10267
10904
  getReallocFn: () => null,
10268
10905
  importFn: _trampoline21,
@@ -10275,12 +10912,29 @@ null,
10275
10912
  isAsync: false,
10276
10913
  isManualAsync: _trampoline21.manuallyAsync,
10277
10914
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10278
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],]), 104, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 104, 8, 8 ],])],
10915
+ resultLowerFns: [_lowerFlatResult([
10916
+ [ 'ok', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([
10917
+ [ 'none', null, 24, 8, 8 ],
10918
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10919
+ ])
10920
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10921
+ [ 'none', null, 24, 8, 8 ],
10922
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10923
+ ])
10924
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10925
+ [ 'none', null, 24, 8, 8 ],
10926
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10927
+ ])
10928
+ , 96, 8 ],]), 104, 8, 8 ],
10929
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 104, 8, 8 ],
10930
+ ])
10931
+ ],
10279
10932
  funcTypeIsAsync: false,
10280
10933
  getCallbackFn: () => null,
10281
10934
  getPostReturnFn: () => null,
10282
10935
  isCancellable: false,
10283
10936
  memoryIdx: 0,
10937
+ stringEncoding: 'utf8',
10284
10938
  getMemoryFn: () => memory0,
10285
10939
  getReallocFn: () => null,
10286
10940
  importFn: _trampoline21,
@@ -10293,13 +10947,30 @@ null,
10293
10947
  componentIdx: 0,
10294
10948
  isAsync: false,
10295
10949
  isManualAsync: _trampoline22.manuallyAsync,
10296
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
10297
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],]), 104, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 104, 8, 8 ],])],
10950
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10951
+ resultLowerFns: [_lowerFlatResult([
10952
+ [ 'ok', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([
10953
+ [ 'none', null, 24, 8, 8 ],
10954
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10955
+ ])
10956
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10957
+ [ 'none', null, 24, 8, 8 ],
10958
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10959
+ ])
10960
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10961
+ [ 'none', null, 24, 8, 8 ],
10962
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10963
+ ])
10964
+ , 96, 8 ],]), 104, 8, 8 ],
10965
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 104, 8, 8 ],
10966
+ ])
10967
+ ],
10298
10968
  funcTypeIsAsync: false,
10299
10969
  getCallbackFn: () => null,
10300
10970
  getPostReturnFn: () => null,
10301
10971
  isCancellable: false,
10302
10972
  memoryIdx: 0,
10973
+ stringEncoding: 'utf8',
10303
10974
  getMemoryFn: () => memory0,
10304
10975
  getReallocFn: () => null,
10305
10976
  importFn: _trampoline22,
@@ -10311,13 +10982,30 @@ null,
10311
10982
  componentIdx: 0,
10312
10983
  isAsync: false,
10313
10984
  isManualAsync: _trampoline22.manuallyAsync,
10314
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
10315
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],[ 'none', null, 24, 8, 8 ],]), 96, 8 ],]), 104, 8, 8 ],[ 'err', _lowerFlatEnum.bind(null, 0), 104, 8, 8 ],])],
10985
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10986
+ resultLowerFns: [_lowerFlatResult([
10987
+ [ 'ok', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 96, 8 ],['linkCount', _lowerFlatU64, 96, 8 ],['size', _lowerFlatU64, 96, 8 ],['dataAccessTimestamp', _lowerFlatOption([
10988
+ [ 'none', null, 24, 8, 8 ],
10989
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10990
+ ])
10991
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10992
+ [ 'none', null, 24, 8, 8 ],
10993
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10994
+ ])
10995
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10996
+ [ 'none', null, 24, 8, 8 ],
10997
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10998
+ ])
10999
+ , 96, 8 ],]), 104, 8, 8 ],
11000
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 104, 8, 8 ],
11001
+ ])
11002
+ ],
10316
11003
  funcTypeIsAsync: false,
10317
11004
  getCallbackFn: () => null,
10318
11005
  getPostReturnFn: () => null,
10319
11006
  isCancellable: false,
10320
11007
  memoryIdx: 0,
11008
+ stringEncoding: 'utf8',
10321
11009
  getMemoryFn: () => memory0,
10322
11010
  getReallocFn: () => null,
10323
11011
  importFn: _trampoline22,
@@ -10330,13 +11018,21 @@ null,
10330
11018
  componentIdx: 0,
10331
11019
  isAsync: false,
10332
11020
  isManualAsync: _trampoline23.manuallyAsync,
10333
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8,_liftFlatFlags({ names: ['create','directory','exclusive','truncate'], size32: 1, align32: 1, intSize: 1 }),_liftFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSize: 1 })],
10334
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 6), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
11021
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny,_liftFlatFlags({ names: ['create','directory','exclusive','truncate'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSizeBytes: 1 })],
11022
+ resultLowerFns: [_lowerFlatResult([
11023
+ [ 'ok', _lowerFlatOwn({
11024
+ componentIdx: 0,
11025
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11026
+ }), 8, 4, 4 ],
11027
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
11028
+ ])
11029
+ ],
10335
11030
  funcTypeIsAsync: false,
10336
11031
  getCallbackFn: () => null,
10337
11032
  getPostReturnFn: () => null,
10338
11033
  isCancellable: false,
10339
11034
  memoryIdx: 0,
11035
+ stringEncoding: 'utf8',
10340
11036
  getMemoryFn: () => memory0,
10341
11037
  getReallocFn: () => null,
10342
11038
  importFn: _trampoline23,
@@ -10348,13 +11044,21 @@ null,
10348
11044
  componentIdx: 0,
10349
11045
  isAsync: false,
10350
11046
  isManualAsync: _trampoline23.manuallyAsync,
10351
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8,_liftFlatFlags({ names: ['create','directory','exclusive','truncate'], size32: 1, align32: 1, intSize: 1 }),_liftFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSize: 1 })],
10352
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 6), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
11047
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny,_liftFlatFlags({ names: ['create','directory','exclusive','truncate'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatFlags({ names: ['read','write','file-integrity-sync','data-integrity-sync','requested-write-sync','mutate-directory'], size32: 1, align32: 1, intSizeBytes: 1 })],
11048
+ resultLowerFns: [_lowerFlatResult([
11049
+ [ 'ok', _lowerFlatOwn({
11050
+ componentIdx: 0,
11051
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11052
+ }), 8, 4, 4 ],
11053
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 8, 4, 4 ],
11054
+ ])
11055
+ ],
10353
11056
  funcTypeIsAsync: false,
10354
11057
  getCallbackFn: () => null,
10355
11058
  getPostReturnFn: () => null,
10356
11059
  isCancellable: false,
10357
11060
  memoryIdx: 0,
11061
+ stringEncoding: 'utf8',
10358
11062
  getMemoryFn: () => memory0,
10359
11063
  getReallocFn: () => null,
10360
11064
  importFn: _trampoline23,
@@ -10368,12 +11072,21 @@ null,
10368
11072
  isAsync: false,
10369
11073
  isManualAsync: _trampoline24.manuallyAsync,
10370
11074
  paramLiftFns: [_liftFlatBorrow.bind(null, 5)],
10371
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 12, 4 ],['name', _lowerFlatStringUTF8, 12, 4 ],]), 16, 4, 4 ],[ 'none', null, 16, 4, 4 ],]), 20, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 20, 4, 4 ],])],
11075
+ resultLowerFns: [_lowerFlatResult([
11076
+ [ 'ok', _lowerFlatOption([
11077
+ [ 'none', null, 16, 4, 4 ],
11078
+ [ 'some', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 12, 4 ],['name', _lowerFlatStringAny, 12, 4 ],]), 16, 4, 4 ],
11079
+ ])
11080
+ , 20, 4, 4 ],
11081
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 20, 4, 4 ],
11082
+ ])
11083
+ ],
10372
11084
  funcTypeIsAsync: false,
10373
11085
  getCallbackFn: () => null,
10374
11086
  getPostReturnFn: () => null,
10375
11087
  isCancellable: false,
10376
11088
  memoryIdx: 0,
11089
+ stringEncoding: 'utf8',
10377
11090
  getMemoryFn: () => memory0,
10378
11091
  getReallocFn: () => realloc0,
10379
11092
  importFn: _trampoline24,
@@ -10386,12 +11099,21 @@ null,
10386
11099
  isAsync: false,
10387
11100
  isManualAsync: _trampoline24.manuallyAsync,
10388
11101
  paramLiftFns: [_liftFlatBorrow.bind(null, 5)],
10389
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOption([[ 'some', _lowerFlatRecord.bind(null, [['type', _lowerFlatEnum.bind(null, 1), 12, 4 ],['name', _lowerFlatStringUTF8, 12, 4 ],]), 16, 4, 4 ],[ 'none', null, 16, 4, 4 ],]), 20, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 20, 4, 4 ],])],
11102
+ resultLowerFns: [_lowerFlatResult([
11103
+ [ 'ok', _lowerFlatOption([
11104
+ [ 'none', null, 16, 4, 4 ],
11105
+ [ 'some', _lowerFlatRecord([['type', _lowerFlatEnum([['unknown', null, 1, 1, 1],['block-device', null, 1, 1, 1],['character-device', null, 1, 1, 1],['directory', null, 1, 1, 1],['fifo', null, 1, 1, 1],['symbolic-link', null, 1, 1, 1],['regular-file', null, 1, 1, 1],['socket', null, 1, 1, 1],]), 12, 4 ],['name', _lowerFlatStringAny, 12, 4 ],]), 16, 4, 4 ],
11106
+ ])
11107
+ , 20, 4, 4 ],
11108
+ [ 'err', _lowerFlatEnum([['access', null, 1, 1, 1],['would-block', null, 1, 1, 1],['already', null, 1, 1, 1],['bad-descriptor', null, 1, 1, 1],['busy', null, 1, 1, 1],['deadlock', null, 1, 1, 1],['quota', null, 1, 1, 1],['exist', null, 1, 1, 1],['file-too-large', null, 1, 1, 1],['illegal-byte-sequence', null, 1, 1, 1],['in-progress', null, 1, 1, 1],['interrupted', null, 1, 1, 1],['invalid', null, 1, 1, 1],['io', null, 1, 1, 1],['is-directory', null, 1, 1, 1],['loop', null, 1, 1, 1],['too-many-links', null, 1, 1, 1],['message-size', null, 1, 1, 1],['name-too-long', null, 1, 1, 1],['no-device', null, 1, 1, 1],['no-entry', null, 1, 1, 1],['no-lock', null, 1, 1, 1],['insufficient-memory', null, 1, 1, 1],['insufficient-space', null, 1, 1, 1],['not-directory', null, 1, 1, 1],['not-empty', null, 1, 1, 1],['not-recoverable', null, 1, 1, 1],['unsupported', null, 1, 1, 1],['no-tty', null, 1, 1, 1],['no-such-device', null, 1, 1, 1],['overflow', null, 1, 1, 1],['not-permitted', null, 1, 1, 1],['pipe', null, 1, 1, 1],['read-only', null, 1, 1, 1],['invalid-seek', null, 1, 1, 1],['text-file-busy', null, 1, 1, 1],['cross-device', null, 1, 1, 1],]), 20, 4, 4 ],
11109
+ ])
11110
+ ],
10390
11111
  funcTypeIsAsync: false,
10391
11112
  getCallbackFn: () => null,
10392
11113
  getPostReturnFn: () => null,
10393
11114
  isCancellable: false,
10394
11115
  memoryIdx: 0,
11116
+ stringEncoding: 'utf8',
10395
11117
  getMemoryFn: () => memory0,
10396
11118
  getReallocFn: () => realloc0,
10397
11119
  importFn: _trampoline24,
@@ -10405,12 +11127,24 @@ null,
10405
11127
  isAsync: false,
10406
11128
  isManualAsync: _trampoline25.manuallyAsync,
10407
11129
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10408
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 }), 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11130
+ resultLowerFns: [_lowerFlatResult([
11131
+ [ 'ok', _lowerFlatList({
11132
+ elemLowerFn: _lowerFlatU8,
11133
+ elemSize32: 1,
11134
+ elemAlign32: 1,
11135
+ }), 12, 4, 4 ],
11136
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11137
+ componentIdx: 0,
11138
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11139
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11140
+ ])
11141
+ ],
10409
11142
  funcTypeIsAsync: false,
10410
11143
  getCallbackFn: () => null,
10411
11144
  getPostReturnFn: () => null,
10412
11145
  isCancellable: false,
10413
11146
  memoryIdx: 0,
11147
+ stringEncoding: 'utf8',
10414
11148
  getMemoryFn: () => memory0,
10415
11149
  getReallocFn: () => realloc0,
10416
11150
  importFn: _trampoline25,
@@ -10423,12 +11157,24 @@ null,
10423
11157
  isAsync: false,
10424
11158
  isManualAsync: _trampoline25.manuallyAsync,
10425
11159
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10426
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 }), 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11160
+ resultLowerFns: [_lowerFlatResult([
11161
+ [ 'ok', _lowerFlatList({
11162
+ elemLowerFn: _lowerFlatU8,
11163
+ elemSize32: 1,
11164
+ elemAlign32: 1,
11165
+ }), 12, 4, 4 ],
11166
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11167
+ componentIdx: 0,
11168
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11169
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11170
+ ])
11171
+ ],
10427
11172
  funcTypeIsAsync: false,
10428
11173
  getCallbackFn: () => null,
10429
11174
  getPostReturnFn: () => null,
10430
11175
  isCancellable: false,
10431
11176
  memoryIdx: 0,
11177
+ stringEncoding: 'utf8',
10432
11178
  getMemoryFn: () => memory0,
10433
11179
  getReallocFn: () => realloc0,
10434
11180
  importFn: _trampoline25,
@@ -10442,12 +11188,24 @@ null,
10442
11188
  isAsync: false,
10443
11189
  isManualAsync: _trampoline26.manuallyAsync,
10444
11190
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10445
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 }), 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11191
+ resultLowerFns: [_lowerFlatResult([
11192
+ [ 'ok', _lowerFlatList({
11193
+ elemLowerFn: _lowerFlatU8,
11194
+ elemSize32: 1,
11195
+ elemAlign32: 1,
11196
+ }), 12, 4, 4 ],
11197
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11198
+ componentIdx: 0,
11199
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11200
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11201
+ ])
11202
+ ],
10446
11203
  funcTypeIsAsync: false,
10447
11204
  getCallbackFn: () => null,
10448
11205
  getPostReturnFn: () => null,
10449
11206
  isCancellable: false,
10450
11207
  memoryIdx: 0,
11208
+ stringEncoding: 'utf8',
10451
11209
  getMemoryFn: () => memory0,
10452
11210
  getReallocFn: () => realloc0,
10453
11211
  importFn: _trampoline26,
@@ -10460,12 +11218,24 @@ null,
10460
11218
  isAsync: false,
10461
11219
  isManualAsync: _trampoline26.manuallyAsync,
10462
11220
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10463
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 }), 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11221
+ resultLowerFns: [_lowerFlatResult([
11222
+ [ 'ok', _lowerFlatList({
11223
+ elemLowerFn: _lowerFlatU8,
11224
+ elemSize32: 1,
11225
+ elemAlign32: 1,
11226
+ }), 12, 4, 4 ],
11227
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11228
+ componentIdx: 0,
11229
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11230
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11231
+ ])
11232
+ ],
10464
11233
  funcTypeIsAsync: false,
10465
11234
  getCallbackFn: () => null,
10466
11235
  getPostReturnFn: () => null,
10467
11236
  isCancellable: false,
10468
11237
  memoryIdx: 0,
11238
+ stringEncoding: 'utf8',
10469
11239
  getMemoryFn: () => memory0,
10470
11240
  getReallocFn: () => realloc0,
10471
11241
  importFn: _trampoline26,
@@ -10479,12 +11249,20 @@ null,
10479
11249
  isAsync: false,
10480
11250
  isManualAsync: _trampoline27.manuallyAsync,
10481
11251
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10482
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatU64, 16, 8, 8 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],])],
11252
+ resultLowerFns: [_lowerFlatResult([
11253
+ [ 'ok', _lowerFlatU64, 16, 8, 8 ],
11254
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11255
+ componentIdx: 0,
11256
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11257
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],
11258
+ ])
11259
+ ],
10483
11260
  funcTypeIsAsync: false,
10484
11261
  getCallbackFn: () => null,
10485
11262
  getPostReturnFn: () => null,
10486
11263
  isCancellable: false,
10487
11264
  memoryIdx: 0,
11265
+ stringEncoding: 'utf8',
10488
11266
  getMemoryFn: () => memory0,
10489
11267
  getReallocFn: () => null,
10490
11268
  importFn: _trampoline27,
@@ -10497,12 +11275,20 @@ null,
10497
11275
  isAsync: false,
10498
11276
  isManualAsync: _trampoline27.manuallyAsync,
10499
11277
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10500
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatU64, 16, 8, 8 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],])],
11278
+ resultLowerFns: [_lowerFlatResult([
11279
+ [ 'ok', _lowerFlatU64, 16, 8, 8 ],
11280
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11281
+ componentIdx: 0,
11282
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11283
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],
11284
+ ])
11285
+ ],
10501
11286
  funcTypeIsAsync: false,
10502
11287
  getCallbackFn: () => null,
10503
11288
  getPostReturnFn: () => null,
10504
11289
  isCancellable: false,
10505
11290
  memoryIdx: 0,
11291
+ stringEncoding: 'utf8',
10506
11292
  getMemoryFn: () => memory0,
10507
11293
  getReallocFn: () => null,
10508
11294
  importFn: _trampoline27,
@@ -10515,13 +11301,25 @@ null,
10515
11301
  componentIdx: 0,
10516
11302
  isAsync: false,
10517
11303
  isManualAsync: _trampoline28.manuallyAsync,
10518
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10519
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11304
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11305
+ elemLiftFn: _liftFlatU8,
11306
+ elemAlign32: 1,
11307
+ elemSize32: 1,
11308
+ })],
11309
+ resultLowerFns: [_lowerFlatResult([
11310
+ [ 'ok', null, 12, 4, 4 ],
11311
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11312
+ componentIdx: 0,
11313
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11314
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11315
+ ])
11316
+ ],
10520
11317
  funcTypeIsAsync: false,
10521
11318
  getCallbackFn: () => null,
10522
11319
  getPostReturnFn: () => null,
10523
11320
  isCancellable: false,
10524
11321
  memoryIdx: 0,
11322
+ stringEncoding: 'utf8',
10525
11323
  getMemoryFn: () => memory0,
10526
11324
  getReallocFn: () => null,
10527
11325
  importFn: _trampoline28,
@@ -10533,13 +11331,25 @@ null,
10533
11331
  componentIdx: 0,
10534
11332
  isAsync: false,
10535
11333
  isManualAsync: _trampoline28.manuallyAsync,
10536
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10537
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11334
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11335
+ elemLiftFn: _liftFlatU8,
11336
+ elemAlign32: 1,
11337
+ elemSize32: 1,
11338
+ })],
11339
+ resultLowerFns: [_lowerFlatResult([
11340
+ [ 'ok', null, 12, 4, 4 ],
11341
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11342
+ componentIdx: 0,
11343
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11344
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11345
+ ])
11346
+ ],
10538
11347
  funcTypeIsAsync: false,
10539
11348
  getCallbackFn: () => null,
10540
11349
  getPostReturnFn: () => null,
10541
11350
  isCancellable: false,
10542
11351
  memoryIdx: 0,
11352
+ stringEncoding: 'utf8',
10543
11353
  getMemoryFn: () => memory0,
10544
11354
  getReallocFn: () => null,
10545
11355
  importFn: _trampoline28,
@@ -10552,13 +11362,25 @@ null,
10552
11362
  componentIdx: 0,
10553
11363
  isAsync: false,
10554
11364
  isManualAsync: _trampoline29.manuallyAsync,
10555
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10556
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11365
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11366
+ elemLiftFn: _liftFlatU8,
11367
+ elemAlign32: 1,
11368
+ elemSize32: 1,
11369
+ })],
11370
+ resultLowerFns: [_lowerFlatResult([
11371
+ [ 'ok', null, 12, 4, 4 ],
11372
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11373
+ componentIdx: 0,
11374
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11375
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11376
+ ])
11377
+ ],
10557
11378
  funcTypeIsAsync: false,
10558
11379
  getCallbackFn: () => null,
10559
11380
  getPostReturnFn: () => null,
10560
11381
  isCancellable: false,
10561
11382
  memoryIdx: 0,
11383
+ stringEncoding: 'utf8',
10562
11384
  getMemoryFn: () => memory0,
10563
11385
  getReallocFn: () => null,
10564
11386
  importFn: _trampoline29,
@@ -10570,13 +11392,25 @@ null,
10570
11392
  componentIdx: 0,
10571
11393
  isAsync: false,
10572
11394
  isManualAsync: _trampoline29.manuallyAsync,
10573
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10574
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11395
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11396
+ elemLiftFn: _liftFlatU8,
11397
+ elemAlign32: 1,
11398
+ elemSize32: 1,
11399
+ })],
11400
+ resultLowerFns: [_lowerFlatResult([
11401
+ [ 'ok', null, 12, 4, 4 ],
11402
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11403
+ componentIdx: 0,
11404
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11405
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11406
+ ])
11407
+ ],
10575
11408
  funcTypeIsAsync: false,
10576
11409
  getCallbackFn: () => null,
10577
11410
  getPostReturnFn: () => null,
10578
11411
  isCancellable: false,
10579
11412
  memoryIdx: 0,
11413
+ stringEncoding: 'utf8',
10580
11414
  getMemoryFn: () => memory0,
10581
11415
  getReallocFn: () => null,
10582
11416
  importFn: _trampoline29,
@@ -10590,12 +11424,20 @@ null,
10590
11424
  isAsync: false,
10591
11425
  isManualAsync: _trampoline30.manuallyAsync,
10592
11426
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10593
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11427
+ resultLowerFns: [_lowerFlatResult([
11428
+ [ 'ok', null, 12, 4, 4 ],
11429
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11430
+ componentIdx: 0,
11431
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11432
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11433
+ ])
11434
+ ],
10594
11435
  funcTypeIsAsync: false,
10595
11436
  getCallbackFn: () => null,
10596
11437
  getPostReturnFn: () => null,
10597
11438
  isCancellable: false,
10598
11439
  memoryIdx: 0,
11440
+ stringEncoding: 'utf8',
10599
11441
  getMemoryFn: () => memory0,
10600
11442
  getReallocFn: () => null,
10601
11443
  importFn: _trampoline30,
@@ -10608,12 +11450,20 @@ null,
10608
11450
  isAsync: false,
10609
11451
  isManualAsync: _trampoline30.manuallyAsync,
10610
11452
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10611
- resultLowerFns: [_lowerFlatResult([[ 'ok', null, 12, 4, 4 ],[ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn.bind(null, 0), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],])],
11453
+ resultLowerFns: [_lowerFlatResult([
11454
+ [ 'ok', null, 12, 4, 4 ],
11455
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11456
+ componentIdx: 0,
11457
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11458
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11459
+ ])
11460
+ ],
10612
11461
  funcTypeIsAsync: false,
10613
11462
  getCallbackFn: () => null,
10614
11463
  getPostReturnFn: () => null,
10615
11464
  isCancellable: false,
10616
11465
  memoryIdx: 0,
11466
+ stringEncoding: 'utf8',
10617
11467
  getMemoryFn: () => memory0,
10618
11468
  getReallocFn: () => null,
10619
11469
  importFn: _trampoline30,
@@ -10627,12 +11477,17 @@ null,
10627
11477
  isAsync: false,
10628
11478
  isManualAsync: _trampoline31.manuallyAsync,
10629
11479
  paramLiftFns: [_liftFlatU64],
10630
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 })],
11480
+ resultLowerFns: [_lowerFlatList({
11481
+ elemLowerFn: _lowerFlatU8,
11482
+ elemSize32: 1,
11483
+ elemAlign32: 1,
11484
+ })],
10631
11485
  funcTypeIsAsync: false,
10632
11486
  getCallbackFn: () => null,
10633
11487
  getPostReturnFn: () => null,
10634
11488
  isCancellable: false,
10635
11489
  memoryIdx: 0,
11490
+ stringEncoding: 'utf8',
10636
11491
  getMemoryFn: () => memory0,
10637
11492
  getReallocFn: () => realloc0,
10638
11493
  importFn: _trampoline31,
@@ -10645,12 +11500,17 @@ null,
10645
11500
  isAsync: false,
10646
11501
  isManualAsync: _trampoline31.manuallyAsync,
10647
11502
  paramLiftFns: [_liftFlatU64],
10648
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 })],
11503
+ resultLowerFns: [_lowerFlatList({
11504
+ elemLowerFn: _lowerFlatU8,
11505
+ elemSize32: 1,
11506
+ elemAlign32: 1,
11507
+ })],
10649
11508
  funcTypeIsAsync: false,
10650
11509
  getCallbackFn: () => null,
10651
11510
  getPostReturnFn: () => null,
10652
11511
  isCancellable: false,
10653
11512
  memoryIdx: 0,
11513
+ stringEncoding: 'utf8',
10654
11514
  getMemoryFn: () => memory0,
10655
11515
  getReallocFn: () => realloc0,
10656
11516
  importFn: _trampoline31,
@@ -10664,12 +11524,20 @@ null,
10664
11524
  isAsync: false,
10665
11525
  isManualAsync: _trampoline32.manuallyAsync,
10666
11526
  paramLiftFns: [],
10667
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 30), typeIdx: 2 })],
11527
+ resultLowerFns: [_lowerFlatList({
11528
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatOwn({
11529
+ componentIdx: 0,
11530
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11531
+ }), 12, 4],[_lowerFlatStringAny, 12, 4],]),
11532
+ elemSize32: 12,
11533
+ elemAlign32: 4,
11534
+ })],
10668
11535
  funcTypeIsAsync: false,
10669
11536
  getCallbackFn: () => null,
10670
11537
  getPostReturnFn: () => null,
10671
11538
  isCancellable: false,
10672
11539
  memoryIdx: 0,
11540
+ stringEncoding: 'utf8',
10673
11541
  getMemoryFn: () => memory0,
10674
11542
  getReallocFn: () => realloc0,
10675
11543
  importFn: _trampoline32,
@@ -10682,12 +11550,20 @@ null,
10682
11550
  isAsync: false,
10683
11551
  isManualAsync: _trampoline32.manuallyAsync,
10684
11552
  paramLiftFns: [],
10685
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 30), typeIdx: 2 })],
11553
+ resultLowerFns: [_lowerFlatList({
11554
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatOwn({
11555
+ componentIdx: 0,
11556
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11557
+ }), 12, 4],[_lowerFlatStringAny, 12, 4],]),
11558
+ elemSize32: 12,
11559
+ elemAlign32: 4,
11560
+ })],
10686
11561
  funcTypeIsAsync: false,
10687
11562
  getCallbackFn: () => null,
10688
11563
  getPostReturnFn: () => null,
10689
11564
  isCancellable: false,
10690
11565
  memoryIdx: 0,
11566
+ stringEncoding: 'utf8',
10691
11567
  getMemoryFn: () => memory0,
10692
11568
  getReallocFn: () => realloc0,
10693
11569
  importFn: _trampoline32,
@@ -10701,12 +11577,20 @@ null,
10701
11577
  isAsync: false,
10702
11578
  isManualAsync: _trampoline33.manuallyAsync,
10703
11579
  paramLiftFns: [],
10704
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 3), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11580
+ resultLowerFns: [_lowerFlatOption([
11581
+ [ 'none', null, 8, 4, 4 ],
11582
+ [ 'some', _lowerFlatOwn({
11583
+ componentIdx: 0,
11584
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11585
+ }), 8, 4, 4 ],
11586
+ ])
11587
+ ],
10705
11588
  funcTypeIsAsync: false,
10706
11589
  getCallbackFn: () => null,
10707
11590
  getPostReturnFn: () => null,
10708
11591
  isCancellable: false,
10709
11592
  memoryIdx: 0,
11593
+ stringEncoding: 'utf8',
10710
11594
  getMemoryFn: () => memory0,
10711
11595
  getReallocFn: () => null,
10712
11596
  importFn: _trampoline33,
@@ -10719,12 +11603,20 @@ null,
10719
11603
  isAsync: false,
10720
11604
  isManualAsync: _trampoline33.manuallyAsync,
10721
11605
  paramLiftFns: [],
10722
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 3), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11606
+ resultLowerFns: [_lowerFlatOption([
11607
+ [ 'none', null, 8, 4, 4 ],
11608
+ [ 'some', _lowerFlatOwn({
11609
+ componentIdx: 0,
11610
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11611
+ }), 8, 4, 4 ],
11612
+ ])
11613
+ ],
10723
11614
  funcTypeIsAsync: false,
10724
11615
  getCallbackFn: () => null,
10725
11616
  getPostReturnFn: () => null,
10726
11617
  isCancellable: false,
10727
11618
  memoryIdx: 0,
11619
+ stringEncoding: 'utf8',
10728
11620
  getMemoryFn: () => memory0,
10729
11621
  getReallocFn: () => null,
10730
11622
  importFn: _trampoline33,
@@ -10738,12 +11630,20 @@ null,
10738
11630
  isAsync: false,
10739
11631
  isManualAsync: _trampoline34.manuallyAsync,
10740
11632
  paramLiftFns: [],
10741
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11633
+ resultLowerFns: [_lowerFlatOption([
11634
+ [ 'none', null, 8, 4, 4 ],
11635
+ [ 'some', _lowerFlatOwn({
11636
+ componentIdx: 0,
11637
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11638
+ }), 8, 4, 4 ],
11639
+ ])
11640
+ ],
10742
11641
  funcTypeIsAsync: false,
10743
11642
  getCallbackFn: () => null,
10744
11643
  getPostReturnFn: () => null,
10745
11644
  isCancellable: false,
10746
11645
  memoryIdx: 0,
11646
+ stringEncoding: 'utf8',
10747
11647
  getMemoryFn: () => memory0,
10748
11648
  getReallocFn: () => null,
10749
11649
  importFn: _trampoline34,
@@ -10756,12 +11656,20 @@ null,
10756
11656
  isAsync: false,
10757
11657
  isManualAsync: _trampoline34.manuallyAsync,
10758
11658
  paramLiftFns: [],
10759
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11659
+ resultLowerFns: [_lowerFlatOption([
11660
+ [ 'none', null, 8, 4, 4 ],
11661
+ [ 'some', _lowerFlatOwn({
11662
+ componentIdx: 0,
11663
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11664
+ }), 8, 4, 4 ],
11665
+ ])
11666
+ ],
10760
11667
  funcTypeIsAsync: false,
10761
11668
  getCallbackFn: () => null,
10762
11669
  getPostReturnFn: () => null,
10763
11670
  isCancellable: false,
10764
11671
  memoryIdx: 0,
11672
+ stringEncoding: 'utf8',
10765
11673
  getMemoryFn: () => memory0,
10766
11674
  getReallocFn: () => null,
10767
11675
  importFn: _trampoline34,
@@ -10775,12 +11683,20 @@ null,
10775
11683
  isAsync: false,
10776
11684
  isManualAsync: _trampoline35.manuallyAsync,
10777
11685
  paramLiftFns: [],
10778
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11686
+ resultLowerFns: [_lowerFlatOption([
11687
+ [ 'none', null, 8, 4, 4 ],
11688
+ [ 'some', _lowerFlatOwn({
11689
+ componentIdx: 0,
11690
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11691
+ }), 8, 4, 4 ],
11692
+ ])
11693
+ ],
10779
11694
  funcTypeIsAsync: false,
10780
11695
  getCallbackFn: () => null,
10781
11696
  getPostReturnFn: () => null,
10782
11697
  isCancellable: false,
10783
11698
  memoryIdx: 0,
11699
+ stringEncoding: 'utf8',
10784
11700
  getMemoryFn: () => memory0,
10785
11701
  getReallocFn: () => null,
10786
11702
  importFn: _trampoline35,
@@ -10793,12 +11709,20 @@ null,
10793
11709
  isAsync: false,
10794
11710
  isManualAsync: _trampoline35.manuallyAsync,
10795
11711
  paramLiftFns: [],
10796
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11712
+ resultLowerFns: [_lowerFlatOption([
11713
+ [ 'none', null, 8, 4, 4 ],
11714
+ [ 'some', _lowerFlatOwn({
11715
+ componentIdx: 0,
11716
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11717
+ }), 8, 4, 4 ],
11718
+ ])
11719
+ ],
10797
11720
  funcTypeIsAsync: false,
10798
11721
  getCallbackFn: () => null,
10799
11722
  getPostReturnFn: () => null,
10800
11723
  isCancellable: false,
10801
11724
  memoryIdx: 0,
11725
+ stringEncoding: 'utf8',
10802
11726
  getMemoryFn: () => memory0,
10803
11727
  getReallocFn: () => null,
10804
11728
  importFn: _trampoline35,