@bytecodealliance/jco 1.17.6 → 1.17.8

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,127 @@ 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
+ throw new TypeError("must specify either waitable idx or handle to retrieve future");
3653
+ }
3654
+
3655
+ if (!futureEnd) {
3656
+ throw new Error(`missing future end (tableIdx [${tableIdx}], handle [${futureEndHandle}], waitableIdx [${futureEndWaitableIdx}])`);
3657
+ }
3658
+ if (tableIdx && futureEnd.futureTableIdx() !== tableIdx) {
3659
+ throw new Error(`future end table idx [${futureEnd.futureTableIdx()}] does not match [${tableIdx}]`);
3660
+ }
3661
+
3662
+ return futureEnd;
3663
+ }
3664
+
3665
+ removeFutureEndFromTable(args) {
3666
+ _debugLog('[ComponentAsyncState#removeFutureEndFromTable()] args', args);
3667
+
3668
+ const { tableIdx, futureWaitableIdx } = args;
3669
+ if (tableIdx === undefined) { throw new Error("missing table idx while removing future end"); }
3670
+ if (futureWaitableIdx === undefined) {
3671
+ throw new Error("missing future end waitable idx while removing future end");
3672
+ }
3673
+
3674
+ const { table, componentIdx } = FUTURE_TABLES[tableIdx];
3675
+ if (!table) { throw new Error(`missing/invalid table [${tableIdx}] while removing future end`); }
3676
+
3677
+ const cstate = getOrCreateAsyncState(componentIdx);
3678
+
3679
+ const futureEnd = cstate.handles.get(futureWaitableIdx);
3680
+ if (!futureEnd) {
3681
+ throw new Error(`missing future end (handle [${futureWaitableIdx}], table [${tableIdx}])`);
3682
+ }
3683
+ const handle = futureEnd.handle();
3684
+
3685
+ let removed = cstate.handles.remove(futureWaitableIdx);
3686
+ if (!removed) {
3687
+ throw new Error(`failed to remove futureEnd from handles (waitable idx [${futureWaitableIdx}]), component [${componentIdx}])`);
3688
+ }
3689
+
3690
+ removed = table.remove(handle);
3691
+ if (!removed) {
3692
+ throw new Error(`failed to remove futureEnd from table (handle [${handle}]), table [${tableIdx}], component [${componentIdx}])`);
3693
+ }
3694
+
3695
+ return futureEnd;
3696
+ }
3697
+
3277
3698
  }
3278
3699
 
3279
3700
  const base64Compile = str => WebAssembly.compile(typeof Buffer !== 'undefined' ? Buffer.from(str, 'base64') : Uint8Array.from(atob(str), b => b.charCodeAt(0)));
@@ -3310,6 +3731,8 @@ function getErrorPayload(e) {
3310
3731
  return e;
3311
3732
  }
3312
3733
 
3734
+ const isLE = new Uint8Array(new Uint16Array([1]).buffer)[0] === 1;
3735
+
3313
3736
  function throwUninitialized() {
3314
3737
  throw new TypeError('Wasm uninitialized use `await $init` first');
3315
3738
  }
@@ -3372,8 +3795,9 @@ const _trampoline5 = function() {
3372
3795
  fn: () => getStderr()
3373
3796
  })
3374
3797
  ;
3798
+
3375
3799
  if (!(ret instanceof OutputStream)) {
3376
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
3800
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
3377
3801
  }
3378
3802
  var handle0 = ret[symbolRscHandle];
3379
3803
  if (!handle0) {
@@ -3381,6 +3805,7 @@ const _trampoline5 = function() {
3381
3805
  captureTable2.set(rep, ret);
3382
3806
  handle0 = rscTableCreateOwn(handleTable2, rep);
3383
3807
  }
3808
+
3384
3809
  _debugLog('[iface="wasi:cli/stderr@0.2.3", function="get-stderr"][Instruction::Return]', {
3385
3810
  funcName: 'get-stderr',
3386
3811
  paramCount: 1,
@@ -3443,8 +3868,9 @@ const _trampoline8 = function() {
3443
3868
  fn: () => getStdin()
3444
3869
  })
3445
3870
  ;
3871
+
3446
3872
  if (!(ret instanceof InputStream)) {
3447
- throw new TypeError('Resource error: Not a valid "InputStream" resource.');
3873
+ throw new TypeError('Resource error: Not a valid \"InputStream\" resource.');
3448
3874
  }
3449
3875
  var handle0 = ret[symbolRscHandle];
3450
3876
  if (!handle0) {
@@ -3452,6 +3878,7 @@ const _trampoline8 = function() {
3452
3878
  captureTable1.set(rep, ret);
3453
3879
  handle0 = rscTableCreateOwn(handleTable1, rep);
3454
3880
  }
3881
+
3455
3882
  _debugLog('[iface="wasi:cli/stdin@0.2.3", function="get-stdin"][Instruction::Return]', {
3456
3883
  funcName: 'get-stdin',
3457
3884
  paramCount: 1,
@@ -3510,8 +3937,9 @@ const _trampoline9 = function() {
3510
3937
  fn: () => getStdout()
3511
3938
  })
3512
3939
  ;
3940
+
3513
3941
  if (!(ret instanceof OutputStream)) {
3514
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
3942
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
3515
3943
  }
3516
3944
  var handle0 = ret[symbolRscHandle];
3517
3945
  if (!handle0) {
@@ -3519,6 +3947,7 @@ const _trampoline9 = function() {
3519
3947
  captureTable2.set(rep, ret);
3520
3948
  handle0 = rscTableCreateOwn(handleTable2, rep);
3521
3949
  }
3950
+
3522
3951
  _debugLog('[iface="wasi:cli/stdout@0.2.3", function="get-stdout"][Instruction::Return]', {
3523
3952
  funcName: 'get-stdout',
3524
3953
  paramCount: 1,
@@ -5110,8 +5539,9 @@ switch (variant5.tag) {
5110
5539
  case 'ok': {
5111
5540
  const e = variant5.val;
5112
5541
  dataView(memory0).setInt8(arg2 + 0, 0, true);
5542
+
5113
5543
  if (!(e instanceof InputStream)) {
5114
- throw new TypeError('Resource error: Not a valid "InputStream" resource.');
5544
+ throw new TypeError('Resource error: Not a valid \"InputStream\" resource.');
5115
5545
  }
5116
5546
  var handle3 = e[symbolRscHandle];
5117
5547
  if (!handle3) {
@@ -5119,6 +5549,7 @@ switch (variant5.tag) {
5119
5549
  captureTable1.set(rep, e);
5120
5550
  handle3 = rscTableCreateOwn(handleTable1, rep);
5121
5551
  }
5552
+
5122
5553
  dataView(memory0).setInt32(arg2 + 4, handle3, true);
5123
5554
 
5124
5555
  break;
@@ -5378,8 +5809,9 @@ switch (variant5.tag) {
5378
5809
  case 'ok': {
5379
5810
  const e = variant5.val;
5380
5811
  dataView(memory0).setInt8(arg2 + 0, 0, true);
5812
+
5381
5813
  if (!(e instanceof OutputStream)) {
5382
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
5814
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
5383
5815
  }
5384
5816
  var handle3 = e[symbolRscHandle];
5385
5817
  if (!handle3) {
@@ -5387,6 +5819,7 @@ switch (variant5.tag) {
5387
5819
  captureTable2.set(rep, e);
5388
5820
  handle3 = rscTableCreateOwn(handleTable2, rep);
5389
5821
  }
5822
+
5390
5823
  dataView(memory0).setInt32(arg2 + 4, handle3, true);
5391
5824
 
5392
5825
  break;
@@ -5646,8 +6079,9 @@ switch (variant5.tag) {
5646
6079
  case 'ok': {
5647
6080
  const e = variant5.val;
5648
6081
  dataView(memory0).setInt8(arg1 + 0, 0, true);
6082
+
5649
6083
  if (!(e instanceof OutputStream)) {
5650
- throw new TypeError('Resource error: Not a valid "OutputStream" resource.');
6084
+ throw new TypeError('Resource error: Not a valid \"OutputStream\" resource.');
5651
6085
  }
5652
6086
  var handle3 = e[symbolRscHandle];
5653
6087
  if (!handle3) {
@@ -5655,6 +6089,7 @@ switch (variant5.tag) {
5655
6089
  captureTable2.set(rep, e);
5656
6090
  handle3 = rscTableCreateOwn(handleTable2, rep);
5657
6091
  }
6092
+
5658
6093
  dataView(memory0).setInt32(arg1 + 4, handle3, true);
5659
6094
 
5660
6095
  break;
@@ -5918,8 +6353,9 @@ switch (variant5.tag) {
5918
6353
  case 'ok': {
5919
6354
  const e = variant5.val;
5920
6355
  dataView(memory0).setInt8(arg1 + 0, 0, true);
6356
+
5921
6357
  if (!(e instanceof DirectoryEntryStream)) {
5922
- throw new TypeError('Resource error: Not a valid "DirectoryEntryStream" resource.');
6358
+ throw new TypeError('Resource error: Not a valid \"DirectoryEntryStream\" resource.');
5923
6359
  }
5924
6360
  var handle3 = e[symbolRscHandle];
5925
6361
  if (!handle3) {
@@ -5927,6 +6363,7 @@ switch (variant5.tag) {
5927
6363
  captureTable5.set(rep, e);
5928
6364
  handle3 = rscTableCreateOwn(handleTable5, rep);
5929
6365
  }
6366
+
5930
6367
  dataView(memory0).setInt32(arg1 + 4, handle3, true);
5931
6368
 
5932
6369
  break;
@@ -6894,8 +7331,9 @@ switch (variant9.tag) {
6894
7331
  case 'ok': {
6895
7332
  const e = variant9.val;
6896
7333
  dataView(memory0).setInt8(arg6 + 0, 0, true);
7334
+
6897
7335
  if (!(e instanceof Descriptor)) {
6898
- throw new TypeError('Resource error: Not a valid "Descriptor" resource.');
7336
+ throw new TypeError('Resource error: Not a valid \"Descriptor\" resource.');
6899
7337
  }
6900
7338
  var handle7 = e[symbolRscHandle];
6901
7339
  if (!handle7) {
@@ -6903,6 +7341,7 @@ switch (variant9.tag) {
6903
7341
  captureTable6.set(rep, e);
6904
7342
  handle7 = rscTableCreateOwn(handleTable6, rep);
6905
7343
  }
7344
+
6906
7345
  dataView(memory0).setInt32(arg6 + 4, handle7, true);
6907
7346
 
6908
7347
  break;
@@ -7490,13 +7929,14 @@ switch (variant6.tag) {
7490
7929
  let offset = 0;
7491
7930
  const dv3 = new DataView(memory0.buffer);
7492
7931
  for (const v of val3) {
7932
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
7493
7933
  dv3.setUint8(ptr3+ offset, v, true);
7494
7934
  offset += 1;
7495
7935
  }
7496
7936
  } else {
7497
7937
  // TypedArray / ArrayBuffer-like, direct copy
7498
7938
  valData3 = new Uint8Array(val3.buffer || val3, val3.byteOffset, valLenBytes3);
7499
- const out3 = new Uint8Array(memory0.buffer, ptr3,valLenBytes3);
7939
+ const out3 = new Uint8Array(memory0.buffer, ptr3, valLenBytes3);
7500
7940
  out3.set(valData3);
7501
7941
  }
7502
7942
 
@@ -7513,8 +7953,9 @@ switch (variant6.tag) {
7513
7953
  case 'last-operation-failed': {
7514
7954
  const e = variant5.val;
7515
7955
  dataView(memory0).setInt8(arg2 + 4, 0, true);
7956
+
7516
7957
  if (!(e instanceof Error$1)) {
7517
- throw new TypeError('Resource error: Not a valid "Error" resource.');
7958
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7518
7959
  }
7519
7960
  var handle4 = e[symbolRscHandle];
7520
7961
  if (!handle4) {
@@ -7522,6 +7963,7 @@ switch (variant6.tag) {
7522
7963
  captureTable0.set(rep, e);
7523
7964
  handle4 = rscTableCreateOwn(handleTable0, rep);
7524
7965
  }
7966
+
7525
7967
  dataView(memory0).setInt32(arg2 + 8, handle4, true);
7526
7968
  break;
7527
7969
  }
@@ -7636,13 +8078,14 @@ switch (variant6.tag) {
7636
8078
  let offset = 0;
7637
8079
  const dv3 = new DataView(memory0.buffer);
7638
8080
  for (const v of val3) {
8081
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
7639
8082
  dv3.setUint8(ptr3+ offset, v, true);
7640
8083
  offset += 1;
7641
8084
  }
7642
8085
  } else {
7643
8086
  // TypedArray / ArrayBuffer-like, direct copy
7644
8087
  valData3 = new Uint8Array(val3.buffer || val3, val3.byteOffset, valLenBytes3);
7645
- const out3 = new Uint8Array(memory0.buffer, ptr3,valLenBytes3);
8088
+ const out3 = new Uint8Array(memory0.buffer, ptr3, valLenBytes3);
7646
8089
  out3.set(valData3);
7647
8090
  }
7648
8091
 
@@ -7659,8 +8102,9 @@ switch (variant6.tag) {
7659
8102
  case 'last-operation-failed': {
7660
8103
  const e = variant5.val;
7661
8104
  dataView(memory0).setInt8(arg2 + 4, 0, true);
8105
+
7662
8106
  if (!(e instanceof Error$1)) {
7663
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8107
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7664
8108
  }
7665
8109
  var handle4 = e[symbolRscHandle];
7666
8110
  if (!handle4) {
@@ -7668,6 +8112,7 @@ switch (variant6.tag) {
7668
8112
  captureTable0.set(rep, e);
7669
8113
  handle4 = rscTableCreateOwn(handleTable0, rep);
7670
8114
  }
8115
+
7671
8116
  dataView(memory0).setInt32(arg2 + 8, handle4, true);
7672
8117
  break;
7673
8118
  }
@@ -7783,8 +8228,9 @@ switch (variant5.tag) {
7783
8228
  case 'last-operation-failed': {
7784
8229
  const e = variant4.val;
7785
8230
  dataView(memory0).setInt8(arg1 + 8, 0, true);
8231
+
7786
8232
  if (!(e instanceof Error$1)) {
7787
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8233
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7788
8234
  }
7789
8235
  var handle3 = e[symbolRscHandle];
7790
8236
  if (!handle3) {
@@ -7792,6 +8238,7 @@ switch (variant5.tag) {
7792
8238
  captureTable0.set(rep, e);
7793
8239
  handle3 = rscTableCreateOwn(handleTable0, rep);
7794
8240
  }
8241
+
7795
8242
  dataView(memory0).setInt32(arg1 + 12, handle3, true);
7796
8243
  break;
7797
8244
  }
@@ -7909,8 +8356,9 @@ switch (variant6.tag) {
7909
8356
  case 'last-operation-failed': {
7910
8357
  const e = variant5.val;
7911
8358
  dataView(memory0).setInt8(arg3 + 4, 0, true);
8359
+
7912
8360
  if (!(e instanceof Error$1)) {
7913
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8361
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
7914
8362
  }
7915
8363
  var handle4 = e[symbolRscHandle];
7916
8364
  if (!handle4) {
@@ -7918,6 +8366,7 @@ switch (variant6.tag) {
7918
8366
  captureTable0.set(rep, e);
7919
8367
  handle4 = rscTableCreateOwn(handleTable0, rep);
7920
8368
  }
8369
+
7921
8370
  dataView(memory0).setInt32(arg3 + 8, handle4, true);
7922
8371
  break;
7923
8372
  }
@@ -8035,8 +8484,9 @@ switch (variant6.tag) {
8035
8484
  case 'last-operation-failed': {
8036
8485
  const e = variant5.val;
8037
8486
  dataView(memory0).setInt8(arg3 + 4, 0, true);
8487
+
8038
8488
  if (!(e instanceof Error$1)) {
8039
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8489
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
8040
8490
  }
8041
8491
  var handle4 = e[symbolRscHandle];
8042
8492
  if (!handle4) {
@@ -8044,6 +8494,7 @@ switch (variant6.tag) {
8044
8494
  captureTable0.set(rep, e);
8045
8495
  handle4 = rscTableCreateOwn(handleTable0, rep);
8046
8496
  }
8497
+
8047
8498
  dataView(memory0).setInt32(arg3 + 8, handle4, true);
8048
8499
  break;
8049
8500
  }
@@ -8158,8 +8609,9 @@ switch (variant5.tag) {
8158
8609
  case 'last-operation-failed': {
8159
8610
  const e = variant4.val;
8160
8611
  dataView(memory0).setInt8(arg1 + 4, 0, true);
8612
+
8161
8613
  if (!(e instanceof Error$1)) {
8162
- throw new TypeError('Resource error: Not a valid "Error" resource.');
8614
+ throw new TypeError('Resource error: Not a valid \"Error\" resource.');
8163
8615
  }
8164
8616
  var handle3 = e[symbolRscHandle];
8165
8617
  if (!handle3) {
@@ -8167,6 +8619,7 @@ switch (variant5.tag) {
8167
8619
  captureTable0.set(rep, e);
8168
8620
  handle3 = rscTableCreateOwn(handleTable0, rep);
8169
8621
  }
8622
+
8170
8623
  dataView(memory0).setInt32(arg1 + 8, handle3, true);
8171
8624
  break;
8172
8625
  }
@@ -8254,13 +8707,14 @@ const _trampoline31 = function(arg0, arg1) {
8254
8707
  let offset = 0;
8255
8708
  const dv0 = new DataView(memory0.buffer);
8256
8709
  for (const v of val0) {
8710
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8257
8711
  dv0.setUint8(ptr0+ offset, v, true);
8258
8712
  offset += 1;
8259
8713
  }
8260
8714
  } else {
8261
8715
  // TypedArray / ArrayBuffer-like, direct copy
8262
8716
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
8263
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
8717
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
8264
8718
  out0.set(valData0);
8265
8719
  }
8266
8720
 
@@ -8329,8 +8783,9 @@ const _trampoline32 = function(arg0) {
8329
8783
  for (let i = 0; i < vec3.length; i++) {
8330
8784
  const e = vec3[i];
8331
8785
  const base = result3 + i * 12;var [tuple0_0, tuple0_1] = e;
8786
+
8332
8787
  if (!(tuple0_0 instanceof Descriptor)) {
8333
- throw new TypeError('Resource error: Not a valid "Descriptor" resource.');
8788
+ throw new TypeError('Resource error: Not a valid \"Descriptor\" resource.');
8334
8789
  }
8335
8790
  var handle1 = tuple0_0[symbolRscHandle];
8336
8791
  if (!handle1) {
@@ -8338,6 +8793,7 @@ const _trampoline32 = function(arg0) {
8338
8793
  captureTable6.set(rep, tuple0_0);
8339
8794
  handle1 = rscTableCreateOwn(handleTable6, rep);
8340
8795
  }
8796
+
8341
8797
  dataView(memory0).setInt32(base + 0, handle1, true);
8342
8798
 
8343
8799
  var encodeRes = _utf8AllocateAndEncode(tuple0_1, realloc0, memory0);
@@ -8416,8 +8872,9 @@ const _trampoline33 = function(arg0) {
8416
8872
  } else {
8417
8873
  const e = variant1;
8418
8874
  dataView(memory0).setInt8(arg0 + 0, 1, true);
8875
+
8419
8876
  if (!(e instanceof TerminalInput)) {
8420
- throw new TypeError('Resource error: Not a valid "TerminalInput" resource.');
8877
+ throw new TypeError('Resource error: Not a valid \"TerminalInput\" resource.');
8421
8878
  }
8422
8879
  var handle0 = e[symbolRscHandle];
8423
8880
  if (!handle0) {
@@ -8425,6 +8882,7 @@ const _trampoline33 = function(arg0) {
8425
8882
  captureTable3.set(rep, e);
8426
8883
  handle0 = rscTableCreateOwn(handleTable3, rep);
8427
8884
  }
8885
+
8428
8886
  dataView(memory0).setInt32(arg0 + 4, handle0, true);
8429
8887
  }
8430
8888
  _debugLog('[iface="wasi:cli/terminal-stdin@0.2.3", function="get-terminal-stdin"][Instruction::Return]', {
@@ -8494,8 +8952,9 @@ const _trampoline34 = function(arg0) {
8494
8952
  } else {
8495
8953
  const e = variant1;
8496
8954
  dataView(memory0).setInt8(arg0 + 0, 1, true);
8955
+
8497
8956
  if (!(e instanceof TerminalOutput)) {
8498
- throw new TypeError('Resource error: Not a valid "TerminalOutput" resource.');
8957
+ throw new TypeError('Resource error: Not a valid \"TerminalOutput\" resource.');
8499
8958
  }
8500
8959
  var handle0 = e[symbolRscHandle];
8501
8960
  if (!handle0) {
@@ -8503,6 +8962,7 @@ const _trampoline34 = function(arg0) {
8503
8962
  captureTable4.set(rep, e);
8504
8963
  handle0 = rscTableCreateOwn(handleTable4, rep);
8505
8964
  }
8965
+
8506
8966
  dataView(memory0).setInt32(arg0 + 4, handle0, true);
8507
8967
  }
8508
8968
  _debugLog('[iface="wasi:cli/terminal-stdout@0.2.3", function="get-terminal-stdout"][Instruction::Return]', {
@@ -8568,8 +9028,9 @@ const _trampoline35 = function(arg0) {
8568
9028
  } else {
8569
9029
  const e = variant1;
8570
9030
  dataView(memory0).setInt8(arg0 + 0, 1, true);
9031
+
8571
9032
  if (!(e instanceof TerminalOutput)) {
8572
- throw new TypeError('Resource error: Not a valid "TerminalOutput" resource.');
9033
+ throw new TypeError('Resource error: Not a valid \"TerminalOutput\" resource.');
8573
9034
  }
8574
9035
  var handle0 = e[symbolRscHandle];
8575
9036
  if (!handle0) {
@@ -8577,6 +9038,7 @@ const _trampoline35 = function(arg0) {
8577
9038
  captureTable4.set(rep, e);
8578
9039
  handle0 = rscTableCreateOwn(handleTable4, rep);
8579
9040
  }
9041
+
8580
9042
  dataView(memory0).setInt32(arg0 + 4, handle0, true);
8581
9043
  }
8582
9044
  _debugLog('[iface="wasi:cli/terminal-stderr@0.2.3", function="get-terminal-stderr"][Instruction::Return]', {
@@ -8697,13 +9159,14 @@ function print(arg0) {
8697
9159
  let offset = 0;
8698
9160
  const dv0 = new DataView(memory0.buffer);
8699
9161
  for (const v of val0) {
9162
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8700
9163
  dv0.setUint8(ptr0+ offset, v, true);
8701
9164
  offset += 1;
8702
9165
  }
8703
9166
  } else {
8704
9167
  // TypedArray / ArrayBuffer-like, direct copy
8705
9168
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
8706
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
9169
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
8707
9170
  out0.set(valData0);
8708
9171
  }
8709
9172
 
@@ -8799,13 +9262,14 @@ function componentNew(arg0, arg1) {
8799
9262
  let offset = 0;
8800
9263
  const dv0 = new DataView(memory0.buffer);
8801
9264
  for (const v of val0) {
9265
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8802
9266
  dv0.setUint8(ptr0+ offset, v, true);
8803
9267
  offset += 1;
8804
9268
  }
8805
9269
  } else {
8806
9270
  // TypedArray / ArrayBuffer-like, direct copy
8807
9271
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
8808
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
9272
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
8809
9273
  out0.set(valData0);
8810
9274
  }
8811
9275
 
@@ -8843,13 +9307,14 @@ function componentNew(arg0, arg1) {
8843
9307
  let offset = 0;
8844
9308
  const dv3 = new DataView(memory0.buffer);
8845
9309
  for (const v of val3) {
9310
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8846
9311
  dv3.setUint8(ptr3+ offset, v, true);
8847
9312
  offset += 1;
8848
9313
  }
8849
9314
  } else {
8850
9315
  // TypedArray / ArrayBuffer-like, direct copy
8851
9316
  valData3 = new Uint8Array(val3.buffer || val3, val3.byteOffset, valLenBytes3);
8852
- const out3 = new Uint8Array(memory0.buffer, ptr3,valLenBytes3);
9317
+ const out3 = new Uint8Array(memory0.buffer, ptr3, valLenBytes3);
8853
9318
  out3.set(valData3);
8854
9319
  }
8855
9320
 
@@ -8952,13 +9417,14 @@ function componentWit(arg0) {
8952
9417
  let offset = 0;
8953
9418
  const dv0 = new DataView(memory0.buffer);
8954
9419
  for (const v of val0) {
9420
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8955
9421
  dv0.setUint8(ptr0+ offset, v, true);
8956
9422
  offset += 1;
8957
9423
  }
8958
9424
  } else {
8959
9425
  // TypedArray / ArrayBuffer-like, direct copy
8960
9426
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
8961
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
9427
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
8962
9428
  out0.set(valData0);
8963
9429
  }
8964
9430
 
@@ -9062,13 +9528,14 @@ function componentEmbed(arg0) {
9062
9528
  let offset = 0;
9063
9529
  const dv2 = new DataView(memory0.buffer);
9064
9530
  for (const v of val2) {
9531
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
9065
9532
  dv2.setUint8(ptr2+ offset, v, true);
9066
9533
  offset += 1;
9067
9534
  }
9068
9535
  } else {
9069
9536
  // TypedArray / ArrayBuffer-like, direct copy
9070
9537
  valData2 = new Uint8Array(val2.buffer || val2, val2.byteOffset, valLenBytes2);
9071
- const out2 = new Uint8Array(memory0.buffer, ptr2,valLenBytes2);
9538
+ const out2 = new Uint8Array(memory0.buffer, ptr2, valLenBytes2);
9072
9539
  out2.set(valData2);
9073
9540
  }
9074
9541
 
@@ -9331,13 +9798,14 @@ function metadataShow(arg0) {
9331
9798
  let offset = 0;
9332
9799
  const dv0 = new DataView(memory0.buffer);
9333
9800
  for (const v of val0) {
9801
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
9334
9802
  dv0.setUint8(ptr0+ offset, v, true);
9335
9803
  offset += 1;
9336
9804
  }
9337
9805
  } else {
9338
9806
  // TypedArray / ArrayBuffer-like, direct copy
9339
9807
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
9340
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
9808
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
9341
9809
  out0.set(valData0);
9342
9810
  }
9343
9811
 
@@ -9516,13 +9984,14 @@ function metadataAdd(arg0, arg1) {
9516
9984
  let offset = 0;
9517
9985
  const dv0 = new DataView(memory0.buffer);
9518
9986
  for (const v of val0) {
9987
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
9519
9988
  dv0.setUint8(ptr0+ offset, v, true);
9520
9989
  offset += 1;
9521
9990
  }
9522
9991
  } else {
9523
9992
  // TypedArray / ArrayBuffer-like, direct copy
9524
9993
  valData0 = new Uint8Array(val0.buffer || val0, val0.byteOffset, valLenBytes0);
9525
- const out0 = new Uint8Array(memory0.buffer, ptr0,valLenBytes0);
9994
+ const out0 = new Uint8Array(memory0.buffer, ptr0, valLenBytes0);
9526
9995
  out0.set(valData0);
9527
9996
  }
9528
9997
 
@@ -9713,12 +10182,16 @@ null,
9713
10182
  isAsync: false,
9714
10183
  isManualAsync: _trampoline5.manuallyAsync,
9715
10184
  paramLiftFns: [],
9716
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
10185
+ resultLowerFns: [_lowerFlatOwn({
10186
+ componentIdx: 0,
10187
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10188
+ })],
9717
10189
  funcTypeIsAsync: false,
9718
10190
  getCallbackFn: () => null,
9719
10191
  getPostReturnFn: () => null,
9720
10192
  isCancellable: false,
9721
10193
  memoryIdx: null,
10194
+ stringEncoding: 'utf8',
9722
10195
  getMemoryFn: () => null,
9723
10196
  getReallocFn: () => null,
9724
10197
  importFn: _trampoline5,
@@ -9731,12 +10204,16 @@ null,
9731
10204
  isAsync: false,
9732
10205
  isManualAsync: _trampoline5.manuallyAsync,
9733
10206
  paramLiftFns: [],
9734
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
10207
+ resultLowerFns: [_lowerFlatOwn({
10208
+ componentIdx: 0,
10209
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10210
+ })],
9735
10211
  funcTypeIsAsync: false,
9736
10212
  getCallbackFn: () => null,
9737
10213
  getPostReturnFn: () => null,
9738
10214
  isCancellable: false,
9739
10215
  memoryIdx: null,
10216
+ stringEncoding: 'utf8',
9740
10217
  getMemoryFn: () => null,
9741
10218
  getReallocFn: () => null,
9742
10219
  importFn: _trampoline5,
@@ -9776,12 +10253,16 @@ null,
9776
10253
  isAsync: false,
9777
10254
  isManualAsync: _trampoline8.manuallyAsync,
9778
10255
  paramLiftFns: [],
9779
- resultLowerFns: [_lowerFlatOwn.bind(null, 1)],
10256
+ resultLowerFns: [_lowerFlatOwn({
10257
+ componentIdx: 0,
10258
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10259
+ })],
9780
10260
  funcTypeIsAsync: false,
9781
10261
  getCallbackFn: () => null,
9782
10262
  getPostReturnFn: () => null,
9783
10263
  isCancellable: false,
9784
10264
  memoryIdx: null,
10265
+ stringEncoding: 'utf8',
9785
10266
  getMemoryFn: () => null,
9786
10267
  getReallocFn: () => null,
9787
10268
  importFn: _trampoline8,
@@ -9794,12 +10275,16 @@ null,
9794
10275
  isAsync: false,
9795
10276
  isManualAsync: _trampoline8.manuallyAsync,
9796
10277
  paramLiftFns: [],
9797
- resultLowerFns: [_lowerFlatOwn.bind(null, 1)],
10278
+ resultLowerFns: [_lowerFlatOwn({
10279
+ componentIdx: 0,
10280
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10281
+ })],
9798
10282
  funcTypeIsAsync: false,
9799
10283
  getCallbackFn: () => null,
9800
10284
  getPostReturnFn: () => null,
9801
10285
  isCancellable: false,
9802
10286
  memoryIdx: null,
10287
+ stringEncoding: 'utf8',
9803
10288
  getMemoryFn: () => null,
9804
10289
  getReallocFn: () => null,
9805
10290
  importFn: _trampoline8,
@@ -9813,12 +10298,16 @@ null,
9813
10298
  isAsync: false,
9814
10299
  isManualAsync: _trampoline9.manuallyAsync,
9815
10300
  paramLiftFns: [],
9816
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
10301
+ resultLowerFns: [_lowerFlatOwn({
10302
+ componentIdx: 0,
10303
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10304
+ })],
9817
10305
  funcTypeIsAsync: false,
9818
10306
  getCallbackFn: () => null,
9819
10307
  getPostReturnFn: () => null,
9820
10308
  isCancellable: false,
9821
10309
  memoryIdx: null,
10310
+ stringEncoding: 'utf8',
9822
10311
  getMemoryFn: () => null,
9823
10312
  getReallocFn: () => null,
9824
10313
  importFn: _trampoline9,
@@ -9831,12 +10320,16 @@ null,
9831
10320
  isAsync: false,
9832
10321
  isManualAsync: _trampoline9.manuallyAsync,
9833
10322
  paramLiftFns: [],
9834
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
10323
+ resultLowerFns: [_lowerFlatOwn({
10324
+ componentIdx: 0,
10325
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10326
+ })],
9835
10327
  funcTypeIsAsync: false,
9836
10328
  getCallbackFn: () => null,
9837
10329
  getPostReturnFn: () => null,
9838
10330
  isCancellable: false,
9839
10331
  memoryIdx: null,
10332
+ stringEncoding: 'utf8',
9840
10333
  getMemoryFn: () => null,
9841
10334
  getReallocFn: () => null,
9842
10335
  importFn: _trampoline9,
@@ -9856,6 +10349,7 @@ null,
9856
10349
  getPostReturnFn: () => null,
9857
10350
  isCancellable: false,
9858
10351
  memoryIdx: null,
10352
+ stringEncoding: 'utf8',
9859
10353
  getMemoryFn: () => null,
9860
10354
  getReallocFn: () => null,
9861
10355
  importFn: _trampoline10,
@@ -9874,6 +10368,7 @@ null,
9874
10368
  getPostReturnFn: () => null,
9875
10369
  isCancellable: false,
9876
10370
  memoryIdx: null,
10371
+ stringEncoding: 'utf8',
9877
10372
  getMemoryFn: () => null,
9878
10373
  getReallocFn: () => null,
9879
10374
  importFn: _trampoline10,
@@ -9887,12 +10382,17 @@ null,
9887
10382
  isAsync: false,
9888
10383
  isManualAsync: _trampoline11.manuallyAsync,
9889
10384
  paramLiftFns: [],
9890
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 0), typeIdx: 0 })],
10385
+ resultLowerFns: [_lowerFlatList({
10386
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatStringAny, 16, 4],[_lowerFlatStringAny, 16, 4],]),
10387
+ elemSize32: 16,
10388
+ elemAlign32: 4,
10389
+ })],
9891
10390
  funcTypeIsAsync: false,
9892
10391
  getCallbackFn: () => null,
9893
10392
  getPostReturnFn: () => null,
9894
10393
  isCancellable: false,
9895
10394
  memoryIdx: 0,
10395
+ stringEncoding: 'utf8',
9896
10396
  getMemoryFn: () => memory0,
9897
10397
  getReallocFn: () => realloc0,
9898
10398
  importFn: _trampoline11,
@@ -9905,12 +10405,17 @@ null,
9905
10405
  isAsync: false,
9906
10406
  isManualAsync: _trampoline11.manuallyAsync,
9907
10407
  paramLiftFns: [],
9908
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 0), typeIdx: 0 })],
10408
+ resultLowerFns: [_lowerFlatList({
10409
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatStringAny, 16, 4],[_lowerFlatStringAny, 16, 4],]),
10410
+ elemSize32: 16,
10411
+ elemAlign32: 4,
10412
+ })],
9909
10413
  funcTypeIsAsync: false,
9910
10414
  getCallbackFn: () => null,
9911
10415
  getPostReturnFn: () => null,
9912
10416
  isCancellable: false,
9913
10417
  memoryIdx: 0,
10418
+ stringEncoding: 'utf8',
9914
10419
  getMemoryFn: () => memory0,
9915
10420
  getReallocFn: () => realloc0,
9916
10421
  importFn: _trampoline11,
@@ -9924,12 +10429,17 @@ null,
9924
10429
  isAsync: false,
9925
10430
  isManualAsync: _trampoline12.manuallyAsync,
9926
10431
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9927
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatFlags.bind(null, 0), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10432
+ resultLowerFns: [_lowerFlatResult([
10433
+ [ '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 ],
10434
+ [ '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 ],
10435
+ ])
10436
+ ],
9928
10437
  funcTypeIsAsync: false,
9929
10438
  getCallbackFn: () => null,
9930
10439
  getPostReturnFn: () => null,
9931
10440
  isCancellable: false,
9932
10441
  memoryIdx: 0,
10442
+ stringEncoding: 'utf8',
9933
10443
  getMemoryFn: () => memory0,
9934
10444
  getReallocFn: () => null,
9935
10445
  importFn: _trampoline12,
@@ -9942,12 +10452,17 @@ null,
9942
10452
  isAsync: false,
9943
10453
  isManualAsync: _trampoline12.manuallyAsync,
9944
10454
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9945
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatFlags.bind(null, 0), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10455
+ resultLowerFns: [_lowerFlatResult([
10456
+ [ '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 ],
10457
+ [ '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 ],
10458
+ ])
10459
+ ],
9946
10460
  funcTypeIsAsync: false,
9947
10461
  getCallbackFn: () => null,
9948
10462
  getPostReturnFn: () => null,
9949
10463
  isCancellable: false,
9950
10464
  memoryIdx: 0,
10465
+ stringEncoding: 'utf8',
9951
10466
  getMemoryFn: () => memory0,
9952
10467
  getReallocFn: () => null,
9953
10468
  importFn: _trampoline12,
@@ -9961,12 +10476,17 @@ null,
9961
10476
  isAsync: false,
9962
10477
  isManualAsync: _trampoline13.manuallyAsync,
9963
10478
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9964
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatEnum.bind(null, 1), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10479
+ resultLowerFns: [_lowerFlatResult([
10480
+ [ '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 ],
10481
+ [ '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 ],
10482
+ ])
10483
+ ],
9965
10484
  funcTypeIsAsync: false,
9966
10485
  getCallbackFn: () => null,
9967
10486
  getPostReturnFn: () => null,
9968
10487
  isCancellable: false,
9969
10488
  memoryIdx: 0,
10489
+ stringEncoding: 'utf8',
9970
10490
  getMemoryFn: () => memory0,
9971
10491
  getReallocFn: () => null,
9972
10492
  importFn: _trampoline13,
@@ -9979,12 +10499,17 @@ null,
9979
10499
  isAsync: false,
9980
10500
  isManualAsync: _trampoline13.manuallyAsync,
9981
10501
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9982
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatEnum.bind(null, 1), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10502
+ resultLowerFns: [_lowerFlatResult([
10503
+ [ '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 ],
10504
+ [ '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 ],
10505
+ ])
10506
+ ],
9983
10507
  funcTypeIsAsync: false,
9984
10508
  getCallbackFn: () => null,
9985
10509
  getPostReturnFn: () => null,
9986
10510
  isCancellable: false,
9987
10511
  memoryIdx: 0,
10512
+ stringEncoding: 'utf8',
9988
10513
  getMemoryFn: () => memory0,
9989
10514
  getReallocFn: () => null,
9990
10515
  importFn: _trampoline13,
@@ -9998,12 +10523,17 @@ null,
9998
10523
  isAsync: false,
9999
10524
  isManualAsync: _trampoline14.manuallyAsync,
10000
10525
  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 ],])],
10526
+ resultLowerFns: [_lowerFlatResult([
10527
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10528
+ [ '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 ],
10529
+ ])
10530
+ ],
10002
10531
  funcTypeIsAsync: false,
10003
10532
  getCallbackFn: () => null,
10004
10533
  getPostReturnFn: () => null,
10005
10534
  isCancellable: false,
10006
10535
  memoryIdx: 0,
10536
+ stringEncoding: 'utf8',
10007
10537
  getMemoryFn: () => memory0,
10008
10538
  getReallocFn: () => null,
10009
10539
  importFn: _trampoline14,
@@ -10016,12 +10546,17 @@ null,
10016
10546
  isAsync: false,
10017
10547
  isManualAsync: _trampoline14.manuallyAsync,
10018
10548
  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 ],])],
10549
+ resultLowerFns: [_lowerFlatResult([
10550
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10551
+ [ '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 ],
10552
+ ])
10553
+ ],
10020
10554
  funcTypeIsAsync: false,
10021
10555
  getCallbackFn: () => null,
10022
10556
  getPostReturnFn: () => null,
10023
10557
  isCancellable: false,
10024
10558
  memoryIdx: 0,
10559
+ stringEncoding: 'utf8',
10025
10560
  getMemoryFn: () => memory0,
10026
10561
  getReallocFn: () => null,
10027
10562
  importFn: _trampoline14,
@@ -10035,12 +10570,17 @@ null,
10035
10570
  isAsync: false,
10036
10571
  isManualAsync: _trampoline15.manuallyAsync,
10037
10572
  paramLiftFns: [_liftFlatBorrow.bind(null, 0)],
10038
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],[ 'none', null, 2, 1, 1 ],])],
10573
+ resultLowerFns: [_lowerFlatOption([
10574
+ [ 'none', null, 2, 1, 1 ],
10575
+ [ '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 ],
10576
+ ])
10577
+ ],
10039
10578
  funcTypeIsAsync: false,
10040
10579
  getCallbackFn: () => null,
10041
10580
  getPostReturnFn: () => null,
10042
10581
  isCancellable: false,
10043
10582
  memoryIdx: 0,
10583
+ stringEncoding: 'utf8',
10044
10584
  getMemoryFn: () => memory0,
10045
10585
  getReallocFn: () => null,
10046
10586
  importFn: _trampoline15,
@@ -10053,12 +10593,17 @@ null,
10053
10593
  isAsync: false,
10054
10594
  isManualAsync: _trampoline15.manuallyAsync,
10055
10595
  paramLiftFns: [_liftFlatBorrow.bind(null, 0)],
10056
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],[ 'none', null, 2, 1, 1 ],])],
10596
+ resultLowerFns: [_lowerFlatOption([
10597
+ [ 'none', null, 2, 1, 1 ],
10598
+ [ '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 ],
10599
+ ])
10600
+ ],
10057
10601
  funcTypeIsAsync: false,
10058
10602
  getCallbackFn: () => null,
10059
10603
  getPostReturnFn: () => null,
10060
10604
  isCancellable: false,
10061
10605
  memoryIdx: 0,
10606
+ stringEncoding: 'utf8',
10062
10607
  getMemoryFn: () => memory0,
10063
10608
  getReallocFn: () => null,
10064
10609
  importFn: _trampoline15,
@@ -10071,13 +10616,18 @@ null,
10071
10616
  componentIdx: 0,
10072
10617
  isAsync: false,
10073
10618
  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 ],])],
10619
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10620
+ resultLowerFns: [_lowerFlatResult([
10621
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10622
+ [ '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 ],
10623
+ ])
10624
+ ],
10076
10625
  funcTypeIsAsync: false,
10077
10626
  getCallbackFn: () => null,
10078
10627
  getPostReturnFn: () => null,
10079
10628
  isCancellable: false,
10080
10629
  memoryIdx: 0,
10630
+ stringEncoding: 'utf8',
10081
10631
  getMemoryFn: () => memory0,
10082
10632
  getReallocFn: () => null,
10083
10633
  importFn: _trampoline16,
@@ -10089,13 +10639,18 @@ null,
10089
10639
  componentIdx: 0,
10090
10640
  isAsync: false,
10091
10641
  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 ],])],
10642
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10643
+ resultLowerFns: [_lowerFlatResult([
10644
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10645
+ [ '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 ],
10646
+ ])
10647
+ ],
10094
10648
  funcTypeIsAsync: false,
10095
10649
  getCallbackFn: () => null,
10096
10650
  getPostReturnFn: () => null,
10097
10651
  isCancellable: false,
10098
10652
  memoryIdx: 0,
10653
+ stringEncoding: 'utf8',
10099
10654
  getMemoryFn: () => memory0,
10100
10655
  getReallocFn: () => null,
10101
10656
  importFn: _trampoline16,
@@ -10109,12 +10664,20 @@ null,
10109
10664
  isAsync: false,
10110
10665
  isManualAsync: _trampoline17.manuallyAsync,
10111
10666
  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 ],])],
10667
+ resultLowerFns: [_lowerFlatResult([
10668
+ [ 'ok', _lowerFlatOwn({
10669
+ componentIdx: 0,
10670
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10671
+ }), 8, 4, 4 ],
10672
+ [ '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 ],
10673
+ ])
10674
+ ],
10113
10675
  funcTypeIsAsync: false,
10114
10676
  getCallbackFn: () => null,
10115
10677
  getPostReturnFn: () => null,
10116
10678
  isCancellable: false,
10117
10679
  memoryIdx: 0,
10680
+ stringEncoding: 'utf8',
10118
10681
  getMemoryFn: () => memory0,
10119
10682
  getReallocFn: () => null,
10120
10683
  importFn: _trampoline17,
@@ -10127,12 +10690,20 @@ null,
10127
10690
  isAsync: false,
10128
10691
  isManualAsync: _trampoline17.manuallyAsync,
10129
10692
  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 ],])],
10693
+ resultLowerFns: [_lowerFlatResult([
10694
+ [ 'ok', _lowerFlatOwn({
10695
+ componentIdx: 0,
10696
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10697
+ }), 8, 4, 4 ],
10698
+ [ '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 ],
10699
+ ])
10700
+ ],
10131
10701
  funcTypeIsAsync: false,
10132
10702
  getCallbackFn: () => null,
10133
10703
  getPostReturnFn: () => null,
10134
10704
  isCancellable: false,
10135
10705
  memoryIdx: 0,
10706
+ stringEncoding: 'utf8',
10136
10707
  getMemoryFn: () => memory0,
10137
10708
  getReallocFn: () => null,
10138
10709
  importFn: _trampoline17,
@@ -10146,12 +10717,20 @@ null,
10146
10717
  isAsync: false,
10147
10718
  isManualAsync: _trampoline18.manuallyAsync,
10148
10719
  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 ],])],
10720
+ resultLowerFns: [_lowerFlatResult([
10721
+ [ 'ok', _lowerFlatOwn({
10722
+ componentIdx: 0,
10723
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10724
+ }), 8, 4, 4 ],
10725
+ [ '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 ],
10726
+ ])
10727
+ ],
10150
10728
  funcTypeIsAsync: false,
10151
10729
  getCallbackFn: () => null,
10152
10730
  getPostReturnFn: () => null,
10153
10731
  isCancellable: false,
10154
10732
  memoryIdx: 0,
10733
+ stringEncoding: 'utf8',
10155
10734
  getMemoryFn: () => memory0,
10156
10735
  getReallocFn: () => null,
10157
10736
  importFn: _trampoline18,
@@ -10164,12 +10743,20 @@ null,
10164
10743
  isAsync: false,
10165
10744
  isManualAsync: _trampoline18.manuallyAsync,
10166
10745
  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 ],])],
10746
+ resultLowerFns: [_lowerFlatResult([
10747
+ [ 'ok', _lowerFlatOwn({
10748
+ componentIdx: 0,
10749
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10750
+ }), 8, 4, 4 ],
10751
+ [ '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 ],
10752
+ ])
10753
+ ],
10168
10754
  funcTypeIsAsync: false,
10169
10755
  getCallbackFn: () => null,
10170
10756
  getPostReturnFn: () => null,
10171
10757
  isCancellable: false,
10172
10758
  memoryIdx: 0,
10759
+ stringEncoding: 'utf8',
10173
10760
  getMemoryFn: () => memory0,
10174
10761
  getReallocFn: () => null,
10175
10762
  importFn: _trampoline18,
@@ -10183,12 +10770,20 @@ null,
10183
10770
  isAsync: false,
10184
10771
  isManualAsync: _trampoline19.manuallyAsync,
10185
10772
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10186
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10773
+ resultLowerFns: [_lowerFlatResult([
10774
+ [ 'ok', _lowerFlatOwn({
10775
+ componentIdx: 0,
10776
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10777
+ }), 8, 4, 4 ],
10778
+ [ '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 ],
10779
+ ])
10780
+ ],
10187
10781
  funcTypeIsAsync: false,
10188
10782
  getCallbackFn: () => null,
10189
10783
  getPostReturnFn: () => null,
10190
10784
  isCancellable: false,
10191
10785
  memoryIdx: 0,
10786
+ stringEncoding: 'utf8',
10192
10787
  getMemoryFn: () => memory0,
10193
10788
  getReallocFn: () => null,
10194
10789
  importFn: _trampoline19,
@@ -10201,12 +10796,20 @@ null,
10201
10796
  isAsync: false,
10202
10797
  isManualAsync: _trampoline19.manuallyAsync,
10203
10798
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10204
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10799
+ resultLowerFns: [_lowerFlatResult([
10800
+ [ 'ok', _lowerFlatOwn({
10801
+ componentIdx: 0,
10802
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10803
+ }), 8, 4, 4 ],
10804
+ [ '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 ],
10805
+ ])
10806
+ ],
10205
10807
  funcTypeIsAsync: false,
10206
10808
  getCallbackFn: () => null,
10207
10809
  getPostReturnFn: () => null,
10208
10810
  isCancellable: false,
10209
10811
  memoryIdx: 0,
10812
+ stringEncoding: 'utf8',
10210
10813
  getMemoryFn: () => memory0,
10211
10814
  getReallocFn: () => null,
10212
10815
  importFn: _trampoline19,
@@ -10220,12 +10823,20 @@ null,
10220
10823
  isAsync: false,
10221
10824
  isManualAsync: _trampoline20.manuallyAsync,
10222
10825
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10223
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 5), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10826
+ resultLowerFns: [_lowerFlatResult([
10827
+ [ 'ok', _lowerFlatOwn({
10828
+ componentIdx: 0,
10829
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10830
+ }), 8, 4, 4 ],
10831
+ [ '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 ],
10832
+ ])
10833
+ ],
10224
10834
  funcTypeIsAsync: false,
10225
10835
  getCallbackFn: () => null,
10226
10836
  getPostReturnFn: () => null,
10227
10837
  isCancellable: false,
10228
10838
  memoryIdx: 0,
10839
+ stringEncoding: 'utf8',
10229
10840
  getMemoryFn: () => memory0,
10230
10841
  getReallocFn: () => null,
10231
10842
  importFn: _trampoline20,
@@ -10238,12 +10849,20 @@ null,
10238
10849
  isAsync: false,
10239
10850
  isManualAsync: _trampoline20.manuallyAsync,
10240
10851
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
10241
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 5), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10852
+ resultLowerFns: [_lowerFlatResult([
10853
+ [ 'ok', _lowerFlatOwn({
10854
+ componentIdx: 0,
10855
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10856
+ }), 8, 4, 4 ],
10857
+ [ '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 ],
10858
+ ])
10859
+ ],
10242
10860
  funcTypeIsAsync: false,
10243
10861
  getCallbackFn: () => null,
10244
10862
  getPostReturnFn: () => null,
10245
10863
  isCancellable: false,
10246
10864
  memoryIdx: 0,
10865
+ stringEncoding: 'utf8',
10247
10866
  getMemoryFn: () => memory0,
10248
10867
  getReallocFn: () => null,
10249
10868
  importFn: _trampoline20,
@@ -10257,12 +10876,29 @@ null,
10257
10876
  isAsync: false,
10258
10877
  isManualAsync: _trampoline21.manuallyAsync,
10259
10878
  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 ],])],
10879
+ resultLowerFns: [_lowerFlatResult([
10880
+ [ '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([
10881
+ [ 'none', null, 24, 8, 8 ],
10882
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10883
+ ])
10884
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10885
+ [ 'none', null, 24, 8, 8 ],
10886
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10887
+ ])
10888
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10889
+ [ 'none', null, 24, 8, 8 ],
10890
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10891
+ ])
10892
+ , 96, 8 ],]), 104, 8, 8 ],
10893
+ [ '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 ],
10894
+ ])
10895
+ ],
10261
10896
  funcTypeIsAsync: false,
10262
10897
  getCallbackFn: () => null,
10263
10898
  getPostReturnFn: () => null,
10264
10899
  isCancellable: false,
10265
10900
  memoryIdx: 0,
10901
+ stringEncoding: 'utf8',
10266
10902
  getMemoryFn: () => memory0,
10267
10903
  getReallocFn: () => null,
10268
10904
  importFn: _trampoline21,
@@ -10275,12 +10911,29 @@ null,
10275
10911
  isAsync: false,
10276
10912
  isManualAsync: _trampoline21.manuallyAsync,
10277
10913
  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 ],])],
10914
+ resultLowerFns: [_lowerFlatResult([
10915
+ [ '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([
10916
+ [ 'none', null, 24, 8, 8 ],
10917
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10918
+ ])
10919
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10920
+ [ 'none', null, 24, 8, 8 ],
10921
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10922
+ ])
10923
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10924
+ [ 'none', null, 24, 8, 8 ],
10925
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10926
+ ])
10927
+ , 96, 8 ],]), 104, 8, 8 ],
10928
+ [ '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 ],
10929
+ ])
10930
+ ],
10279
10931
  funcTypeIsAsync: false,
10280
10932
  getCallbackFn: () => null,
10281
10933
  getPostReturnFn: () => null,
10282
10934
  isCancellable: false,
10283
10935
  memoryIdx: 0,
10936
+ stringEncoding: 'utf8',
10284
10937
  getMemoryFn: () => memory0,
10285
10938
  getReallocFn: () => null,
10286
10939
  importFn: _trampoline21,
@@ -10293,13 +10946,30 @@ null,
10293
10946
  componentIdx: 0,
10294
10947
  isAsync: false,
10295
10948
  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 ],])],
10949
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10950
+ resultLowerFns: [_lowerFlatResult([
10951
+ [ '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([
10952
+ [ 'none', null, 24, 8, 8 ],
10953
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10954
+ ])
10955
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10956
+ [ 'none', null, 24, 8, 8 ],
10957
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10958
+ ])
10959
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10960
+ [ 'none', null, 24, 8, 8 ],
10961
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10962
+ ])
10963
+ , 96, 8 ],]), 104, 8, 8 ],
10964
+ [ '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 ],
10965
+ ])
10966
+ ],
10298
10967
  funcTypeIsAsync: false,
10299
10968
  getCallbackFn: () => null,
10300
10969
  getPostReturnFn: () => null,
10301
10970
  isCancellable: false,
10302
10971
  memoryIdx: 0,
10972
+ stringEncoding: 'utf8',
10303
10973
  getMemoryFn: () => memory0,
10304
10974
  getReallocFn: () => null,
10305
10975
  importFn: _trampoline22,
@@ -10311,13 +10981,30 @@ null,
10311
10981
  componentIdx: 0,
10312
10982
  isAsync: false,
10313
10983
  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 ],])],
10984
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10985
+ resultLowerFns: [_lowerFlatResult([
10986
+ [ '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([
10987
+ [ 'none', null, 24, 8, 8 ],
10988
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10989
+ ])
10990
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10991
+ [ 'none', null, 24, 8, 8 ],
10992
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10993
+ ])
10994
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10995
+ [ 'none', null, 24, 8, 8 ],
10996
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10997
+ ])
10998
+ , 96, 8 ],]), 104, 8, 8 ],
10999
+ [ '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 ],
11000
+ ])
11001
+ ],
10316
11002
  funcTypeIsAsync: false,
10317
11003
  getCallbackFn: () => null,
10318
11004
  getPostReturnFn: () => null,
10319
11005
  isCancellable: false,
10320
11006
  memoryIdx: 0,
11007
+ stringEncoding: 'utf8',
10321
11008
  getMemoryFn: () => memory0,
10322
11009
  getReallocFn: () => null,
10323
11010
  importFn: _trampoline22,
@@ -10330,13 +11017,21 @@ null,
10330
11017
  componentIdx: 0,
10331
11018
  isAsync: false,
10332
11019
  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 ],])],
11020
+ 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 })],
11021
+ resultLowerFns: [_lowerFlatResult([
11022
+ [ 'ok', _lowerFlatOwn({
11023
+ componentIdx: 0,
11024
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11025
+ }), 8, 4, 4 ],
11026
+ [ '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 ],
11027
+ ])
11028
+ ],
10335
11029
  funcTypeIsAsync: false,
10336
11030
  getCallbackFn: () => null,
10337
11031
  getPostReturnFn: () => null,
10338
11032
  isCancellable: false,
10339
11033
  memoryIdx: 0,
11034
+ stringEncoding: 'utf8',
10340
11035
  getMemoryFn: () => memory0,
10341
11036
  getReallocFn: () => null,
10342
11037
  importFn: _trampoline23,
@@ -10348,13 +11043,21 @@ null,
10348
11043
  componentIdx: 0,
10349
11044
  isAsync: false,
10350
11045
  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 ],])],
11046
+ 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 })],
11047
+ resultLowerFns: [_lowerFlatResult([
11048
+ [ 'ok', _lowerFlatOwn({
11049
+ componentIdx: 0,
11050
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11051
+ }), 8, 4, 4 ],
11052
+ [ '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 ],
11053
+ ])
11054
+ ],
10353
11055
  funcTypeIsAsync: false,
10354
11056
  getCallbackFn: () => null,
10355
11057
  getPostReturnFn: () => null,
10356
11058
  isCancellable: false,
10357
11059
  memoryIdx: 0,
11060
+ stringEncoding: 'utf8',
10358
11061
  getMemoryFn: () => memory0,
10359
11062
  getReallocFn: () => null,
10360
11063
  importFn: _trampoline23,
@@ -10368,12 +11071,21 @@ null,
10368
11071
  isAsync: false,
10369
11072
  isManualAsync: _trampoline24.manuallyAsync,
10370
11073
  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 ],])],
11074
+ resultLowerFns: [_lowerFlatResult([
11075
+ [ 'ok', _lowerFlatOption([
11076
+ [ 'none', null, 16, 4, 4 ],
11077
+ [ '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 ],
11078
+ ])
11079
+ , 20, 4, 4 ],
11080
+ [ '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 ],
11081
+ ])
11082
+ ],
10372
11083
  funcTypeIsAsync: false,
10373
11084
  getCallbackFn: () => null,
10374
11085
  getPostReturnFn: () => null,
10375
11086
  isCancellable: false,
10376
11087
  memoryIdx: 0,
11088
+ stringEncoding: 'utf8',
10377
11089
  getMemoryFn: () => memory0,
10378
11090
  getReallocFn: () => realloc0,
10379
11091
  importFn: _trampoline24,
@@ -10386,12 +11098,21 @@ null,
10386
11098
  isAsync: false,
10387
11099
  isManualAsync: _trampoline24.manuallyAsync,
10388
11100
  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 ],])],
11101
+ resultLowerFns: [_lowerFlatResult([
11102
+ [ 'ok', _lowerFlatOption([
11103
+ [ 'none', null, 16, 4, 4 ],
11104
+ [ '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 ],
11105
+ ])
11106
+ , 20, 4, 4 ],
11107
+ [ '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 ],
11108
+ ])
11109
+ ],
10390
11110
  funcTypeIsAsync: false,
10391
11111
  getCallbackFn: () => null,
10392
11112
  getPostReturnFn: () => null,
10393
11113
  isCancellable: false,
10394
11114
  memoryIdx: 0,
11115
+ stringEncoding: 'utf8',
10395
11116
  getMemoryFn: () => memory0,
10396
11117
  getReallocFn: () => realloc0,
10397
11118
  importFn: _trampoline24,
@@ -10405,12 +11126,24 @@ null,
10405
11126
  isAsync: false,
10406
11127
  isManualAsync: _trampoline25.manuallyAsync,
10407
11128
  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 ],])],
11129
+ resultLowerFns: [_lowerFlatResult([
11130
+ [ 'ok', _lowerFlatList({
11131
+ elemLowerFn: _lowerFlatU8,
11132
+ elemSize32: 1,
11133
+ elemAlign32: 1,
11134
+ }), 12, 4, 4 ],
11135
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11136
+ componentIdx: 0,
11137
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11138
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11139
+ ])
11140
+ ],
10409
11141
  funcTypeIsAsync: false,
10410
11142
  getCallbackFn: () => null,
10411
11143
  getPostReturnFn: () => null,
10412
11144
  isCancellable: false,
10413
11145
  memoryIdx: 0,
11146
+ stringEncoding: 'utf8',
10414
11147
  getMemoryFn: () => memory0,
10415
11148
  getReallocFn: () => realloc0,
10416
11149
  importFn: _trampoline25,
@@ -10423,12 +11156,24 @@ null,
10423
11156
  isAsync: false,
10424
11157
  isManualAsync: _trampoline25.manuallyAsync,
10425
11158
  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 ],])],
11159
+ resultLowerFns: [_lowerFlatResult([
11160
+ [ 'ok', _lowerFlatList({
11161
+ elemLowerFn: _lowerFlatU8,
11162
+ elemSize32: 1,
11163
+ elemAlign32: 1,
11164
+ }), 12, 4, 4 ],
11165
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11166
+ componentIdx: 0,
11167
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11168
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11169
+ ])
11170
+ ],
10427
11171
  funcTypeIsAsync: false,
10428
11172
  getCallbackFn: () => null,
10429
11173
  getPostReturnFn: () => null,
10430
11174
  isCancellable: false,
10431
11175
  memoryIdx: 0,
11176
+ stringEncoding: 'utf8',
10432
11177
  getMemoryFn: () => memory0,
10433
11178
  getReallocFn: () => realloc0,
10434
11179
  importFn: _trampoline25,
@@ -10442,12 +11187,24 @@ null,
10442
11187
  isAsync: false,
10443
11188
  isManualAsync: _trampoline26.manuallyAsync,
10444
11189
  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 ],])],
11190
+ resultLowerFns: [_lowerFlatResult([
11191
+ [ 'ok', _lowerFlatList({
11192
+ elemLowerFn: _lowerFlatU8,
11193
+ elemSize32: 1,
11194
+ elemAlign32: 1,
11195
+ }), 12, 4, 4 ],
11196
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11197
+ componentIdx: 0,
11198
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11199
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11200
+ ])
11201
+ ],
10446
11202
  funcTypeIsAsync: false,
10447
11203
  getCallbackFn: () => null,
10448
11204
  getPostReturnFn: () => null,
10449
11205
  isCancellable: false,
10450
11206
  memoryIdx: 0,
11207
+ stringEncoding: 'utf8',
10451
11208
  getMemoryFn: () => memory0,
10452
11209
  getReallocFn: () => realloc0,
10453
11210
  importFn: _trampoline26,
@@ -10460,12 +11217,24 @@ null,
10460
11217
  isAsync: false,
10461
11218
  isManualAsync: _trampoline26.manuallyAsync,
10462
11219
  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 ],])],
11220
+ resultLowerFns: [_lowerFlatResult([
11221
+ [ 'ok', _lowerFlatList({
11222
+ elemLowerFn: _lowerFlatU8,
11223
+ elemSize32: 1,
11224
+ elemAlign32: 1,
11225
+ }), 12, 4, 4 ],
11226
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11227
+ componentIdx: 0,
11228
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11229
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11230
+ ])
11231
+ ],
10464
11232
  funcTypeIsAsync: false,
10465
11233
  getCallbackFn: () => null,
10466
11234
  getPostReturnFn: () => null,
10467
11235
  isCancellable: false,
10468
11236
  memoryIdx: 0,
11237
+ stringEncoding: 'utf8',
10469
11238
  getMemoryFn: () => memory0,
10470
11239
  getReallocFn: () => realloc0,
10471
11240
  importFn: _trampoline26,
@@ -10479,12 +11248,20 @@ null,
10479
11248
  isAsync: false,
10480
11249
  isManualAsync: _trampoline27.manuallyAsync,
10481
11250
  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 ],])],
11251
+ resultLowerFns: [_lowerFlatResult([
11252
+ [ 'ok', _lowerFlatU64, 16, 8, 8 ],
11253
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11254
+ componentIdx: 0,
11255
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11256
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],
11257
+ ])
11258
+ ],
10483
11259
  funcTypeIsAsync: false,
10484
11260
  getCallbackFn: () => null,
10485
11261
  getPostReturnFn: () => null,
10486
11262
  isCancellable: false,
10487
11263
  memoryIdx: 0,
11264
+ stringEncoding: 'utf8',
10488
11265
  getMemoryFn: () => memory0,
10489
11266
  getReallocFn: () => null,
10490
11267
  importFn: _trampoline27,
@@ -10497,12 +11274,20 @@ null,
10497
11274
  isAsync: false,
10498
11275
  isManualAsync: _trampoline27.manuallyAsync,
10499
11276
  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 ],])],
11277
+ resultLowerFns: [_lowerFlatResult([
11278
+ [ 'ok', _lowerFlatU64, 16, 8, 8 ],
11279
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11280
+ componentIdx: 0,
11281
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11282
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],
11283
+ ])
11284
+ ],
10501
11285
  funcTypeIsAsync: false,
10502
11286
  getCallbackFn: () => null,
10503
11287
  getPostReturnFn: () => null,
10504
11288
  isCancellable: false,
10505
11289
  memoryIdx: 0,
11290
+ stringEncoding: 'utf8',
10506
11291
  getMemoryFn: () => memory0,
10507
11292
  getReallocFn: () => null,
10508
11293
  importFn: _trampoline27,
@@ -10515,13 +11300,25 @@ null,
10515
11300
  componentIdx: 0,
10516
11301
  isAsync: false,
10517
11302
  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 ],])],
11303
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11304
+ elemLiftFn: _liftFlatU8,
11305
+ elemAlign32: 1,
11306
+ elemSize32: 1,
11307
+ })],
11308
+ resultLowerFns: [_lowerFlatResult([
11309
+ [ 'ok', null, 12, 4, 4 ],
11310
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11311
+ componentIdx: 0,
11312
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11313
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11314
+ ])
11315
+ ],
10520
11316
  funcTypeIsAsync: false,
10521
11317
  getCallbackFn: () => null,
10522
11318
  getPostReturnFn: () => null,
10523
11319
  isCancellable: false,
10524
11320
  memoryIdx: 0,
11321
+ stringEncoding: 'utf8',
10525
11322
  getMemoryFn: () => memory0,
10526
11323
  getReallocFn: () => null,
10527
11324
  importFn: _trampoline28,
@@ -10533,13 +11330,25 @@ null,
10533
11330
  componentIdx: 0,
10534
11331
  isAsync: false,
10535
11332
  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 ],])],
11333
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11334
+ elemLiftFn: _liftFlatU8,
11335
+ elemAlign32: 1,
11336
+ elemSize32: 1,
11337
+ })],
11338
+ resultLowerFns: [_lowerFlatResult([
11339
+ [ 'ok', null, 12, 4, 4 ],
11340
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11341
+ componentIdx: 0,
11342
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11343
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11344
+ ])
11345
+ ],
10538
11346
  funcTypeIsAsync: false,
10539
11347
  getCallbackFn: () => null,
10540
11348
  getPostReturnFn: () => null,
10541
11349
  isCancellable: false,
10542
11350
  memoryIdx: 0,
11351
+ stringEncoding: 'utf8',
10543
11352
  getMemoryFn: () => memory0,
10544
11353
  getReallocFn: () => null,
10545
11354
  importFn: _trampoline28,
@@ -10552,13 +11361,25 @@ null,
10552
11361
  componentIdx: 0,
10553
11362
  isAsync: false,
10554
11363
  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 ],])],
11364
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11365
+ elemLiftFn: _liftFlatU8,
11366
+ elemAlign32: 1,
11367
+ elemSize32: 1,
11368
+ })],
11369
+ resultLowerFns: [_lowerFlatResult([
11370
+ [ 'ok', null, 12, 4, 4 ],
11371
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11372
+ componentIdx: 0,
11373
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11374
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11375
+ ])
11376
+ ],
10557
11377
  funcTypeIsAsync: false,
10558
11378
  getCallbackFn: () => null,
10559
11379
  getPostReturnFn: () => null,
10560
11380
  isCancellable: false,
10561
11381
  memoryIdx: 0,
11382
+ stringEncoding: 'utf8',
10562
11383
  getMemoryFn: () => memory0,
10563
11384
  getReallocFn: () => null,
10564
11385
  importFn: _trampoline29,
@@ -10570,13 +11391,25 @@ null,
10570
11391
  componentIdx: 0,
10571
11392
  isAsync: false,
10572
11393
  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 ],])],
11394
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11395
+ elemLiftFn: _liftFlatU8,
11396
+ elemAlign32: 1,
11397
+ elemSize32: 1,
11398
+ })],
11399
+ resultLowerFns: [_lowerFlatResult([
11400
+ [ 'ok', null, 12, 4, 4 ],
11401
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11402
+ componentIdx: 0,
11403
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11404
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11405
+ ])
11406
+ ],
10575
11407
  funcTypeIsAsync: false,
10576
11408
  getCallbackFn: () => null,
10577
11409
  getPostReturnFn: () => null,
10578
11410
  isCancellable: false,
10579
11411
  memoryIdx: 0,
11412
+ stringEncoding: 'utf8',
10580
11413
  getMemoryFn: () => memory0,
10581
11414
  getReallocFn: () => null,
10582
11415
  importFn: _trampoline29,
@@ -10590,12 +11423,20 @@ null,
10590
11423
  isAsync: false,
10591
11424
  isManualAsync: _trampoline30.manuallyAsync,
10592
11425
  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 ],])],
11426
+ resultLowerFns: [_lowerFlatResult([
11427
+ [ 'ok', null, 12, 4, 4 ],
11428
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11429
+ componentIdx: 0,
11430
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11431
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11432
+ ])
11433
+ ],
10594
11434
  funcTypeIsAsync: false,
10595
11435
  getCallbackFn: () => null,
10596
11436
  getPostReturnFn: () => null,
10597
11437
  isCancellable: false,
10598
11438
  memoryIdx: 0,
11439
+ stringEncoding: 'utf8',
10599
11440
  getMemoryFn: () => memory0,
10600
11441
  getReallocFn: () => null,
10601
11442
  importFn: _trampoline30,
@@ -10608,12 +11449,20 @@ null,
10608
11449
  isAsync: false,
10609
11450
  isManualAsync: _trampoline30.manuallyAsync,
10610
11451
  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 ],])],
11452
+ resultLowerFns: [_lowerFlatResult([
11453
+ [ 'ok', null, 12, 4, 4 ],
11454
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11455
+ componentIdx: 0,
11456
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11457
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11458
+ ])
11459
+ ],
10612
11460
  funcTypeIsAsync: false,
10613
11461
  getCallbackFn: () => null,
10614
11462
  getPostReturnFn: () => null,
10615
11463
  isCancellable: false,
10616
11464
  memoryIdx: 0,
11465
+ stringEncoding: 'utf8',
10617
11466
  getMemoryFn: () => memory0,
10618
11467
  getReallocFn: () => null,
10619
11468
  importFn: _trampoline30,
@@ -10627,12 +11476,17 @@ null,
10627
11476
  isAsync: false,
10628
11477
  isManualAsync: _trampoline31.manuallyAsync,
10629
11478
  paramLiftFns: [_liftFlatU64],
10630
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 })],
11479
+ resultLowerFns: [_lowerFlatList({
11480
+ elemLowerFn: _lowerFlatU8,
11481
+ elemSize32: 1,
11482
+ elemAlign32: 1,
11483
+ })],
10631
11484
  funcTypeIsAsync: false,
10632
11485
  getCallbackFn: () => null,
10633
11486
  getPostReturnFn: () => null,
10634
11487
  isCancellable: false,
10635
11488
  memoryIdx: 0,
11489
+ stringEncoding: 'utf8',
10636
11490
  getMemoryFn: () => memory0,
10637
11491
  getReallocFn: () => realloc0,
10638
11492
  importFn: _trampoline31,
@@ -10645,12 +11499,17 @@ null,
10645
11499
  isAsync: false,
10646
11500
  isManualAsync: _trampoline31.manuallyAsync,
10647
11501
  paramLiftFns: [_liftFlatU64],
10648
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 })],
11502
+ resultLowerFns: [_lowerFlatList({
11503
+ elemLowerFn: _lowerFlatU8,
11504
+ elemSize32: 1,
11505
+ elemAlign32: 1,
11506
+ })],
10649
11507
  funcTypeIsAsync: false,
10650
11508
  getCallbackFn: () => null,
10651
11509
  getPostReturnFn: () => null,
10652
11510
  isCancellable: false,
10653
11511
  memoryIdx: 0,
11512
+ stringEncoding: 'utf8',
10654
11513
  getMemoryFn: () => memory0,
10655
11514
  getReallocFn: () => realloc0,
10656
11515
  importFn: _trampoline31,
@@ -10664,12 +11523,20 @@ null,
10664
11523
  isAsync: false,
10665
11524
  isManualAsync: _trampoline32.manuallyAsync,
10666
11525
  paramLiftFns: [],
10667
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 30), typeIdx: 2 })],
11526
+ resultLowerFns: [_lowerFlatList({
11527
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatOwn({
11528
+ componentIdx: 0,
11529
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11530
+ }), 12, 4],[_lowerFlatStringAny, 12, 4],]),
11531
+ elemSize32: 12,
11532
+ elemAlign32: 4,
11533
+ })],
10668
11534
  funcTypeIsAsync: false,
10669
11535
  getCallbackFn: () => null,
10670
11536
  getPostReturnFn: () => null,
10671
11537
  isCancellable: false,
10672
11538
  memoryIdx: 0,
11539
+ stringEncoding: 'utf8',
10673
11540
  getMemoryFn: () => memory0,
10674
11541
  getReallocFn: () => realloc0,
10675
11542
  importFn: _trampoline32,
@@ -10682,12 +11549,20 @@ null,
10682
11549
  isAsync: false,
10683
11550
  isManualAsync: _trampoline32.manuallyAsync,
10684
11551
  paramLiftFns: [],
10685
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 30), typeIdx: 2 })],
11552
+ resultLowerFns: [_lowerFlatList({
11553
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatOwn({
11554
+ componentIdx: 0,
11555
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11556
+ }), 12, 4],[_lowerFlatStringAny, 12, 4],]),
11557
+ elemSize32: 12,
11558
+ elemAlign32: 4,
11559
+ })],
10686
11560
  funcTypeIsAsync: false,
10687
11561
  getCallbackFn: () => null,
10688
11562
  getPostReturnFn: () => null,
10689
11563
  isCancellable: false,
10690
11564
  memoryIdx: 0,
11565
+ stringEncoding: 'utf8',
10691
11566
  getMemoryFn: () => memory0,
10692
11567
  getReallocFn: () => realloc0,
10693
11568
  importFn: _trampoline32,
@@ -10701,12 +11576,20 @@ null,
10701
11576
  isAsync: false,
10702
11577
  isManualAsync: _trampoline33.manuallyAsync,
10703
11578
  paramLiftFns: [],
10704
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 3), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11579
+ resultLowerFns: [_lowerFlatOption([
11580
+ [ 'none', null, 8, 4, 4 ],
11581
+ [ 'some', _lowerFlatOwn({
11582
+ componentIdx: 0,
11583
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11584
+ }), 8, 4, 4 ],
11585
+ ])
11586
+ ],
10705
11587
  funcTypeIsAsync: false,
10706
11588
  getCallbackFn: () => null,
10707
11589
  getPostReturnFn: () => null,
10708
11590
  isCancellable: false,
10709
11591
  memoryIdx: 0,
11592
+ stringEncoding: 'utf8',
10710
11593
  getMemoryFn: () => memory0,
10711
11594
  getReallocFn: () => null,
10712
11595
  importFn: _trampoline33,
@@ -10719,12 +11602,20 @@ null,
10719
11602
  isAsync: false,
10720
11603
  isManualAsync: _trampoline33.manuallyAsync,
10721
11604
  paramLiftFns: [],
10722
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 3), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11605
+ resultLowerFns: [_lowerFlatOption([
11606
+ [ 'none', null, 8, 4, 4 ],
11607
+ [ 'some', _lowerFlatOwn({
11608
+ componentIdx: 0,
11609
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11610
+ }), 8, 4, 4 ],
11611
+ ])
11612
+ ],
10723
11613
  funcTypeIsAsync: false,
10724
11614
  getCallbackFn: () => null,
10725
11615
  getPostReturnFn: () => null,
10726
11616
  isCancellable: false,
10727
11617
  memoryIdx: 0,
11618
+ stringEncoding: 'utf8',
10728
11619
  getMemoryFn: () => memory0,
10729
11620
  getReallocFn: () => null,
10730
11621
  importFn: _trampoline33,
@@ -10738,12 +11629,20 @@ null,
10738
11629
  isAsync: false,
10739
11630
  isManualAsync: _trampoline34.manuallyAsync,
10740
11631
  paramLiftFns: [],
10741
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11632
+ resultLowerFns: [_lowerFlatOption([
11633
+ [ 'none', null, 8, 4, 4 ],
11634
+ [ 'some', _lowerFlatOwn({
11635
+ componentIdx: 0,
11636
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11637
+ }), 8, 4, 4 ],
11638
+ ])
11639
+ ],
10742
11640
  funcTypeIsAsync: false,
10743
11641
  getCallbackFn: () => null,
10744
11642
  getPostReturnFn: () => null,
10745
11643
  isCancellable: false,
10746
11644
  memoryIdx: 0,
11645
+ stringEncoding: 'utf8',
10747
11646
  getMemoryFn: () => memory0,
10748
11647
  getReallocFn: () => null,
10749
11648
  importFn: _trampoline34,
@@ -10756,12 +11655,20 @@ null,
10756
11655
  isAsync: false,
10757
11656
  isManualAsync: _trampoline34.manuallyAsync,
10758
11657
  paramLiftFns: [],
10759
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11658
+ resultLowerFns: [_lowerFlatOption([
11659
+ [ 'none', null, 8, 4, 4 ],
11660
+ [ 'some', _lowerFlatOwn({
11661
+ componentIdx: 0,
11662
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11663
+ }), 8, 4, 4 ],
11664
+ ])
11665
+ ],
10760
11666
  funcTypeIsAsync: false,
10761
11667
  getCallbackFn: () => null,
10762
11668
  getPostReturnFn: () => null,
10763
11669
  isCancellable: false,
10764
11670
  memoryIdx: 0,
11671
+ stringEncoding: 'utf8',
10765
11672
  getMemoryFn: () => memory0,
10766
11673
  getReallocFn: () => null,
10767
11674
  importFn: _trampoline34,
@@ -10775,12 +11682,20 @@ null,
10775
11682
  isAsync: false,
10776
11683
  isManualAsync: _trampoline35.manuallyAsync,
10777
11684
  paramLiftFns: [],
10778
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11685
+ resultLowerFns: [_lowerFlatOption([
11686
+ [ 'none', null, 8, 4, 4 ],
11687
+ [ 'some', _lowerFlatOwn({
11688
+ componentIdx: 0,
11689
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11690
+ }), 8, 4, 4 ],
11691
+ ])
11692
+ ],
10779
11693
  funcTypeIsAsync: false,
10780
11694
  getCallbackFn: () => null,
10781
11695
  getPostReturnFn: () => null,
10782
11696
  isCancellable: false,
10783
11697
  memoryIdx: 0,
11698
+ stringEncoding: 'utf8',
10784
11699
  getMemoryFn: () => memory0,
10785
11700
  getReallocFn: () => null,
10786
11701
  importFn: _trampoline35,
@@ -10793,12 +11708,20 @@ null,
10793
11708
  isAsync: false,
10794
11709
  isManualAsync: _trampoline35.manuallyAsync,
10795
11710
  paramLiftFns: [],
10796
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11711
+ resultLowerFns: [_lowerFlatOption([
11712
+ [ 'none', null, 8, 4, 4 ],
11713
+ [ 'some', _lowerFlatOwn({
11714
+ componentIdx: 0,
11715
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11716
+ }), 8, 4, 4 ],
11717
+ ])
11718
+ ],
10797
11719
  funcTypeIsAsync: false,
10798
11720
  getCallbackFn: () => null,
10799
11721
  getPostReturnFn: () => null,
10800
11722
  isCancellable: false,
10801
11723
  memoryIdx: 0,
11724
+ stringEncoding: 'utf8',
10802
11725
  getMemoryFn: () => memory0,
10803
11726
  getReallocFn: () => null,
10804
11727
  importFn: _trampoline35,