@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.
@@ -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'); }
2594
2716
 
2595
- return 4;
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);
2722
+
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'); }
2740
+
2741
+ const s = ctx.vals[0];
2742
+ const { ptr, codepoints } = _utf8AllocateAndEncode(ctx.vals[0], ctx.realloc, ctx.memory);
2743
+
2744
+ const view = new DataView(ctx.memory.buffer);
2745
+ view.setUint32(ctx.storagePtr, ptr, true);
2746
+ view.setUint32(ctx.storagePtr + 4, codepoints, true);
2747
+
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'); }
2608
2754
 
2609
- const { memory, realloc, vals, storagePtr, storageLen } = ctx;
2755
+ const s = ctx.vals[0];
2756
+ const { ptr, len, codepoints } = _utf16AllocateAndEncode(ctx.vals[0], ctx.realloc, ctx.memory);
2610
2757
 
2611
- const s = vals[0];
2612
- const { ptr, len, codepoints } = _utf8AllocateAndEncode(vals[0], realloc, memory);
2758
+ const view = new DataView(ctx.memory.buffer);
2759
+ view.setUint32(ctx.storagePtr, ptr, true);
2760
+ view.setUint32(ctx.storagePtr + 4, codepoints, true);
2613
2761
 
2614
- const view = new DataView(memory.buffer);
2615
- view.setUint32(storagePtr, ptr, true);
2616
- view.setUint32(storagePtr + 4, codepoints, true);
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);
2617
2770
 
2618
- return len;
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]', {
@@ -8600,7 +9062,7 @@ let exports1Generate;
8600
9062
 
8601
9063
  function generate(arg0, arg1) {
8602
9064
  if (!_initialized) throwUninitialized();
8603
- var ptr0 = realloc1(0, 0, 4, 84);
9065
+ var ptr0 = realloc1(0, 0, 4, 88);
8604
9066
  var val1 = arg0;
8605
9067
  var len1 = Array.isArray(val1) ? val1.length : val1.byteLength;
8606
9068
  var ptr1 = realloc1(0, 0, 1, len1 * 1);
@@ -8612,19 +9074,20 @@ function generate(arg0, arg1) {
8612
9074
  let offset = 0;
8613
9075
  const dv1 = new DataView(memory0.buffer);
8614
9076
  for (const v of val1) {
9077
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
8615
9078
  dv1.setUint8(ptr1+ offset, v, true);
8616
9079
  offset += 1;
8617
9080
  }
8618
9081
  } else {
8619
9082
  // TypedArray / ArrayBuffer-like, direct copy
8620
9083
  valData1 = new Uint8Array(val1.buffer || val1, val1.byteOffset, valLenBytes1);
8621
- const out1 = new Uint8Array(memory0.buffer, ptr1,valLenBytes1);
9084
+ const out1 = new Uint8Array(memory0.buffer, ptr1, valLenBytes1);
8622
9085
  out1.set(valData1);
8623
9086
  }
8624
9087
 
8625
9088
  dataView(memory0).setUint32(ptr0 + 4, len1, true);
8626
9089
  dataView(memory0).setUint32(ptr0 + 0, ptr1, true);
8627
- var {name: v2_0, noTypescript: v2_1, instantiation: v2_2, importBindings: v2_3, map: v2_4, compat: v2_5, noNodejsCompat: v2_6, base64Cutoff: v2_7, tlaCompat: v2_8, validLiftingOptimization: v2_9, tracing: v2_10, noNamespacedExports: v2_11, guest: v2_12, multiMemory: v2_13, asyncMode: v2_14 } = arg1;
9090
+ var {name: v2_0, noTypescript: v2_1, instantiation: v2_2, importBindings: v2_3, map: v2_4, compat: v2_5, noNodejsCompat: v2_6, base64Cutoff: v2_7, tlaCompat: v2_8, validLiftingOptimization: v2_9, tracing: v2_10, noNamespacedExports: v2_11, guest: v2_12, multiMemory: v2_13, asyncMode: v2_14, strict: v2_15 } = arg1;
8628
9091
 
8629
9092
  var encodeRes = _utf8AllocateAndEncode(v2_0, realloc1, memory0);
8630
9093
  var ptr3= encodeRes.ptr;
@@ -8845,6 +9308,14 @@ function generate(arg0, arg1) {
8845
9308
  }
8846
9309
  }
8847
9310
  }
9311
+ var variant30 = v2_15;
9312
+ if (variant30 === null || variant30=== undefined) {
9313
+ dataView(memory0).setInt8(ptr0 + 84, 0, true);
9314
+ } else {
9315
+ const e = variant30;
9316
+ dataView(memory0).setInt8(ptr0 + 84, 1, true);
9317
+ dataView(memory0).setInt8(ptr0 + 85, e ? 1 : 0, true);
9318
+ }
8848
9319
  _debugLog('[iface="generate", function="generate"][Instruction::CallWasm] enter', {
8849
9320
  funcName: 'generate',
8850
9321
  paramCount: 1,
@@ -8873,73 +9344,73 @@ function generate(arg0, arg1) {
8873
9344
  fn: () => exports1Generate(ptr0),
8874
9345
  });
8875
9346
 
8876
- let variant39;
9347
+ let variant40;
8877
9348
  switch (dataView(memory0).getUint8(ret + 0, true)) {
8878
9349
  case 0: {
8879
- var len32 = dataView(memory0).getUint32(ret + 8, true);
8880
- var base32 = dataView(memory0).getUint32(ret + 4, true);
8881
- var result32 = [];
8882
- for (let i = 0; i < len32; i++) {
8883
- const base = base32 + i * 16;
8884
- var ptr30 = dataView(memory0).getUint32(base + 0, true);
8885
- var len30 = dataView(memory0).getUint32(base + 4, true);
8886
- var result30 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr30, len30));
8887
- var ptr31 = dataView(memory0).getUint32(base + 8, true);
8888
- var len31 = dataView(memory0).getUint32(base + 12, true);
8889
- var result31 = new Uint8Array(memory0.buffer.slice(ptr31, ptr31 + len31 * 1));
8890
- result32.push([result30, result31]);
8891
- }
8892
- var len34 = dataView(memory0).getUint32(ret + 16, true);
8893
- var base34 = dataView(memory0).getUint32(ret + 12, true);
8894
- var result34 = [];
8895
- for (let i = 0; i < len34; i++) {
8896
- const base = base34 + i * 8;
8897
- var ptr33 = dataView(memory0).getUint32(base + 0, true);
8898
- var len33 = dataView(memory0).getUint32(base + 4, true);
8899
- var result33 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr33, len33));
8900
- result34.push(result33);
8901
- }
8902
- var len37 = dataView(memory0).getUint32(ret + 24, true);
8903
- var base37 = dataView(memory0).getUint32(ret + 20, true);
8904
- var result37 = [];
8905
- for (let i = 0; i < len37; i++) {
8906
- const base = base37 + i * 12;
8907
- var ptr35 = dataView(memory0).getUint32(base + 0, true);
8908
- var len35 = dataView(memory0).getUint32(base + 4, true);
8909
- var result35 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr35, len35));
8910
- let enum36;
9350
+ var len33 = dataView(memory0).getUint32(ret + 8, true);
9351
+ var base33 = dataView(memory0).getUint32(ret + 4, true);
9352
+ var result33 = [];
9353
+ for (let i = 0; i < len33; i++) {
9354
+ const base = base33 + i * 16;
9355
+ var ptr31 = dataView(memory0).getUint32(base + 0, true);
9356
+ var len31 = dataView(memory0).getUint32(base + 4, true);
9357
+ var result31 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr31, len31));
9358
+ var ptr32 = dataView(memory0).getUint32(base + 8, true);
9359
+ var len32 = dataView(memory0).getUint32(base + 12, true);
9360
+ var result32 = new Uint8Array(memory0.buffer.slice(ptr32, ptr32 + len32 * 1));
9361
+ result33.push([result31, result32]);
9362
+ }
9363
+ var len35 = dataView(memory0).getUint32(ret + 16, true);
9364
+ var base35 = dataView(memory0).getUint32(ret + 12, true);
9365
+ var result35 = [];
9366
+ for (let i = 0; i < len35; i++) {
9367
+ const base = base35 + i * 8;
9368
+ var ptr34 = dataView(memory0).getUint32(base + 0, true);
9369
+ var len34 = dataView(memory0).getUint32(base + 4, true);
9370
+ var result34 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr34, len34));
9371
+ result35.push(result34);
9372
+ }
9373
+ var len38 = dataView(memory0).getUint32(ret + 24, true);
9374
+ var base38 = dataView(memory0).getUint32(ret + 20, true);
9375
+ var result38 = [];
9376
+ for (let i = 0; i < len38; i++) {
9377
+ const base = base38 + i * 12;
9378
+ var ptr36 = dataView(memory0).getUint32(base + 0, true);
9379
+ var len36 = dataView(memory0).getUint32(base + 4, true);
9380
+ var result36 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr36, len36));
9381
+ let enum37;
8911
9382
  switch (dataView(memory0).getUint8(base + 8, true)) {
8912
9383
  case 0: {
8913
- enum36 = 'function';
9384
+ enum37 = 'function';
8914
9385
  break;
8915
9386
  }
8916
9387
  case 1: {
8917
- enum36 = 'instance';
9388
+ enum37 = 'instance';
8918
9389
  break;
8919
9390
  }
8920
9391
  default: {
8921
9392
  throw new TypeError('invalid discriminant specified for ExportType');
8922
9393
  }
8923
9394
  }
8924
- result37.push([result35, enum36]);
9395
+ result38.push([result36, enum37]);
8925
9396
  }
8926
- variant39= {
9397
+ variant40= {
8927
9398
  tag: 'ok',
8928
9399
  val: {
8929
- files: result32,
8930
- imports: result34,
8931
- exports: result37,
9400
+ files: result33,
9401
+ imports: result35,
9402
+ exports: result38,
8932
9403
  }
8933
9404
  };
8934
9405
  break;
8935
9406
  }
8936
9407
  case 1: {
8937
- var ptr38 = dataView(memory0).getUint32(ret + 4, true);
8938
- var len38 = dataView(memory0).getUint32(ret + 8, true);
8939
- var result38 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr38, len38));
8940
- variant39= {
9408
+ var ptr39 = dataView(memory0).getUint32(ret + 4, true);
9409
+ var len39 = dataView(memory0).getUint32(ret + 8, true);
9410
+ var result39 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr39, len39));
9411
+ variant40= {
8941
9412
  tag: 'err',
8942
- val: result38
9413
+ val: result39
8943
9414
  };
8944
9415
  break;
8945
9416
  }
@@ -8953,7 +9424,7 @@ function generate(arg0, arg1) {
8953
9424
  async: false,
8954
9425
  postReturn: true
8955
9426
  });
8956
- const retCopy = variant39;
9427
+ const retCopy = variant40;
8957
9428
  task.resolve([retCopy.val]);
8958
9429
 
8959
9430
  let cstate = getOrCreateAsyncState(0);
@@ -8974,7 +9445,7 @@ let exports1GenerateTypes;
8974
9445
 
8975
9446
  function generateTypes(arg0, arg1) {
8976
9447
  if (!_initialized) throwUninitialized();
8977
- var ptr0 = realloc1(0, 0, 4, 92);
9448
+ var ptr0 = realloc1(0, 0, 4, 96);
8978
9449
 
8979
9450
  var encodeRes = _utf8AllocateAndEncode(arg0, realloc1, memory0);
8980
9451
  var ptr1= encodeRes.ptr;
@@ -8982,7 +9453,7 @@ function generateTypes(arg0, arg1) {
8982
9453
 
8983
9454
  dataView(memory0).setUint32(ptr0 + 4, len1, true);
8984
9455
  dataView(memory0).setUint32(ptr0 + 0, ptr1, true);
8985
- var {wit: v2_0, world: v2_1, tlaCompat: v2_2, instantiation: v2_3, map: v2_4, features: v2_5, guest: v2_6, asyncMode: v2_7 } = arg1;
9456
+ var {wit: v2_0, world: v2_1, tlaCompat: v2_2, instantiation: v2_3, map: v2_4, features: v2_5, guest: v2_6, asyncMode: v2_7, strict: v2_8 } = arg1;
8986
9457
  var variant6 = v2_0;
8987
9458
  switch (variant6.tag) {
8988
9459
  case 'source': {
@@ -9011,13 +9482,14 @@ function generateTypes(arg0, arg1) {
9011
9482
  let offset = 0;
9012
9483
  const dv4 = new DataView(memory0.buffer);
9013
9484
  for (const v of val4) {
9485
+ _requireValidNumericPrimitive.bind(null, 'u8')(v);
9014
9486
  dv4.setUint8(ptr4+ offset, v, true);
9015
9487
  offset += 1;
9016
9488
  }
9017
9489
  } else {
9018
9490
  // TypedArray / ArrayBuffer-like, direct copy
9019
9491
  valData4 = new Uint8Array(val4.buffer || val4, val4.byteOffset, valLenBytes4);
9020
- const out4 = new Uint8Array(memory0.buffer, ptr4,valLenBytes4);
9492
+ const out4 = new Uint8Array(memory0.buffer, ptr4, valLenBytes4);
9021
9493
  out4.set(valData4);
9022
9494
  }
9023
9495
 
@@ -9212,6 +9684,14 @@ function generateTypes(arg0, arg1) {
9212
9684
  }
9213
9685
  }
9214
9686
  }
9687
+ var variant29 = v2_8;
9688
+ if (variant29 === null || variant29=== undefined) {
9689
+ dataView(memory0).setInt8(ptr0 + 92, 0, true);
9690
+ } else {
9691
+ const e = variant29;
9692
+ dataView(memory0).setInt8(ptr0 + 92, 1, true);
9693
+ dataView(memory0).setInt8(ptr0 + 93, e ? 1 : 0, true);
9694
+ }
9215
9695
  _debugLog('[iface="generate-types", function="generate-types"][Instruction::CallWasm] enter', {
9216
9696
  funcName: 'generate-types',
9217
9697
  paramCount: 1,
@@ -9240,35 +9720,35 @@ function generateTypes(arg0, arg1) {
9240
9720
  fn: () => exports1GenerateTypes(ptr0),
9241
9721
  });
9242
9722
 
9243
- let variant33;
9723
+ let variant34;
9244
9724
  switch (dataView(memory0).getUint8(ret + 0, true)) {
9245
9725
  case 0: {
9246
- var len31 = dataView(memory0).getUint32(ret + 8, true);
9247
- var base31 = dataView(memory0).getUint32(ret + 4, true);
9248
- var result31 = [];
9249
- for (let i = 0; i < len31; i++) {
9250
- const base = base31 + i * 16;
9251
- var ptr29 = dataView(memory0).getUint32(base + 0, true);
9252
- var len29 = dataView(memory0).getUint32(base + 4, true);
9253
- var result29 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr29, len29));
9254
- var ptr30 = dataView(memory0).getUint32(base + 8, true);
9255
- var len30 = dataView(memory0).getUint32(base + 12, true);
9256
- var result30 = new Uint8Array(memory0.buffer.slice(ptr30, ptr30 + len30 * 1));
9257
- result31.push([result29, result30]);
9258
- }
9259
- variant33= {
9726
+ var len32 = dataView(memory0).getUint32(ret + 8, true);
9727
+ var base32 = dataView(memory0).getUint32(ret + 4, true);
9728
+ var result32 = [];
9729
+ for (let i = 0; i < len32; i++) {
9730
+ const base = base32 + i * 16;
9731
+ var ptr30 = dataView(memory0).getUint32(base + 0, true);
9732
+ var len30 = dataView(memory0).getUint32(base + 4, true);
9733
+ var result30 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr30, len30));
9734
+ var ptr31 = dataView(memory0).getUint32(base + 8, true);
9735
+ var len31 = dataView(memory0).getUint32(base + 12, true);
9736
+ var result31 = new Uint8Array(memory0.buffer.slice(ptr31, ptr31 + len31 * 1));
9737
+ result32.push([result30, result31]);
9738
+ }
9739
+ variant34= {
9260
9740
  tag: 'ok',
9261
- val: result31
9741
+ val: result32
9262
9742
  };
9263
9743
  break;
9264
9744
  }
9265
9745
  case 1: {
9266
- var ptr32 = dataView(memory0).getUint32(ret + 4, true);
9267
- var len32 = dataView(memory0).getUint32(ret + 8, true);
9268
- var result32 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr32, len32));
9269
- variant33= {
9746
+ var ptr33 = dataView(memory0).getUint32(ret + 4, true);
9747
+ var len33 = dataView(memory0).getUint32(ret + 8, true);
9748
+ var result33 = TEXT_DECODER_UTF8.decode(new Uint8Array(memory0.buffer, ptr33, len33));
9749
+ variant34= {
9270
9750
  tag: 'err',
9271
- val: result32
9751
+ val: result33
9272
9752
  };
9273
9753
  break;
9274
9754
  }
@@ -9282,7 +9762,7 @@ function generateTypes(arg0, arg1) {
9282
9762
  async: false,
9283
9763
  postReturn: true
9284
9764
  });
9285
- const retCopy = variant33;
9765
+ const retCopy = variant34;
9286
9766
  task.resolve([retCopy.val]);
9287
9767
 
9288
9768
  let cstate = getOrCreateAsyncState(0);
@@ -9372,12 +9852,16 @@ null,
9372
9852
  isAsync: false,
9373
9853
  isManualAsync: _trampoline5.manuallyAsync,
9374
9854
  paramLiftFns: [],
9375
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
9855
+ resultLowerFns: [_lowerFlatOwn({
9856
+ componentIdx: 0,
9857
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9858
+ })],
9376
9859
  funcTypeIsAsync: false,
9377
9860
  getCallbackFn: () => null,
9378
9861
  getPostReturnFn: () => null,
9379
9862
  isCancellable: false,
9380
9863
  memoryIdx: null,
9864
+ stringEncoding: 'utf8',
9381
9865
  getMemoryFn: () => null,
9382
9866
  getReallocFn: () => null,
9383
9867
  importFn: _trampoline5,
@@ -9390,12 +9874,16 @@ null,
9390
9874
  isAsync: false,
9391
9875
  isManualAsync: _trampoline5.manuallyAsync,
9392
9876
  paramLiftFns: [],
9393
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
9877
+ resultLowerFns: [_lowerFlatOwn({
9878
+ componentIdx: 0,
9879
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9880
+ })],
9394
9881
  funcTypeIsAsync: false,
9395
9882
  getCallbackFn: () => null,
9396
9883
  getPostReturnFn: () => null,
9397
9884
  isCancellable: false,
9398
9885
  memoryIdx: null,
9886
+ stringEncoding: 'utf8',
9399
9887
  getMemoryFn: () => null,
9400
9888
  getReallocFn: () => null,
9401
9889
  importFn: _trampoline5,
@@ -9435,12 +9923,16 @@ null,
9435
9923
  isAsync: false,
9436
9924
  isManualAsync: _trampoline8.manuallyAsync,
9437
9925
  paramLiftFns: [],
9438
- resultLowerFns: [_lowerFlatOwn.bind(null, 1)],
9926
+ resultLowerFns: [_lowerFlatOwn({
9927
+ componentIdx: 0,
9928
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9929
+ })],
9439
9930
  funcTypeIsAsync: false,
9440
9931
  getCallbackFn: () => null,
9441
9932
  getPostReturnFn: () => null,
9442
9933
  isCancellable: false,
9443
9934
  memoryIdx: null,
9935
+ stringEncoding: 'utf8',
9444
9936
  getMemoryFn: () => null,
9445
9937
  getReallocFn: () => null,
9446
9938
  importFn: _trampoline8,
@@ -9453,12 +9945,16 @@ null,
9453
9945
  isAsync: false,
9454
9946
  isManualAsync: _trampoline8.manuallyAsync,
9455
9947
  paramLiftFns: [],
9456
- resultLowerFns: [_lowerFlatOwn.bind(null, 1)],
9948
+ resultLowerFns: [_lowerFlatOwn({
9949
+ componentIdx: 0,
9950
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9951
+ })],
9457
9952
  funcTypeIsAsync: false,
9458
9953
  getCallbackFn: () => null,
9459
9954
  getPostReturnFn: () => null,
9460
9955
  isCancellable: false,
9461
9956
  memoryIdx: null,
9957
+ stringEncoding: 'utf8',
9462
9958
  getMemoryFn: () => null,
9463
9959
  getReallocFn: () => null,
9464
9960
  importFn: _trampoline8,
@@ -9472,12 +9968,16 @@ null,
9472
9968
  isAsync: false,
9473
9969
  isManualAsync: _trampoline9.manuallyAsync,
9474
9970
  paramLiftFns: [],
9475
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
9971
+ resultLowerFns: [_lowerFlatOwn({
9972
+ componentIdx: 0,
9973
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9974
+ })],
9476
9975
  funcTypeIsAsync: false,
9477
9976
  getCallbackFn: () => null,
9478
9977
  getPostReturnFn: () => null,
9479
9978
  isCancellable: false,
9480
9979
  memoryIdx: null,
9980
+ stringEncoding: 'utf8',
9481
9981
  getMemoryFn: () => null,
9482
9982
  getReallocFn: () => null,
9483
9983
  importFn: _trampoline9,
@@ -9490,12 +9990,16 @@ null,
9490
9990
  isAsync: false,
9491
9991
  isManualAsync: _trampoline9.manuallyAsync,
9492
9992
  paramLiftFns: [],
9493
- resultLowerFns: [_lowerFlatOwn.bind(null, 2)],
9993
+ resultLowerFns: [_lowerFlatOwn({
9994
+ componentIdx: 0,
9995
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
9996
+ })],
9494
9997
  funcTypeIsAsync: false,
9495
9998
  getCallbackFn: () => null,
9496
9999
  getPostReturnFn: () => null,
9497
10000
  isCancellable: false,
9498
10001
  memoryIdx: null,
10002
+ stringEncoding: 'utf8',
9499
10003
  getMemoryFn: () => null,
9500
10004
  getReallocFn: () => null,
9501
10005
  importFn: _trampoline9,
@@ -9515,6 +10019,7 @@ null,
9515
10019
  getPostReturnFn: () => null,
9516
10020
  isCancellable: false,
9517
10021
  memoryIdx: null,
10022
+ stringEncoding: 'utf8',
9518
10023
  getMemoryFn: () => null,
9519
10024
  getReallocFn: () => null,
9520
10025
  importFn: _trampoline10,
@@ -9533,6 +10038,7 @@ null,
9533
10038
  getPostReturnFn: () => null,
9534
10039
  isCancellable: false,
9535
10040
  memoryIdx: null,
10041
+ stringEncoding: 'utf8',
9536
10042
  getMemoryFn: () => null,
9537
10043
  getReallocFn: () => null,
9538
10044
  importFn: _trampoline10,
@@ -9546,12 +10052,17 @@ null,
9546
10052
  isAsync: false,
9547
10053
  isManualAsync: _trampoline11.manuallyAsync,
9548
10054
  paramLiftFns: [],
9549
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 0), typeIdx: 0 })],
10055
+ resultLowerFns: [_lowerFlatList({
10056
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatStringAny, 16, 4],[_lowerFlatStringAny, 16, 4],]),
10057
+ elemSize32: 16,
10058
+ elemAlign32: 4,
10059
+ })],
9550
10060
  funcTypeIsAsync: false,
9551
10061
  getCallbackFn: () => null,
9552
10062
  getPostReturnFn: () => null,
9553
10063
  isCancellable: false,
9554
10064
  memoryIdx: 0,
10065
+ stringEncoding: 'utf8',
9555
10066
  getMemoryFn: () => memory0,
9556
10067
  getReallocFn: () => realloc0,
9557
10068
  importFn: _trampoline11,
@@ -9564,12 +10075,17 @@ null,
9564
10075
  isAsync: false,
9565
10076
  isManualAsync: _trampoline11.manuallyAsync,
9566
10077
  paramLiftFns: [],
9567
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 0), typeIdx: 0 })],
10078
+ resultLowerFns: [_lowerFlatList({
10079
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatStringAny, 16, 4],[_lowerFlatStringAny, 16, 4],]),
10080
+ elemSize32: 16,
10081
+ elemAlign32: 4,
10082
+ })],
9568
10083
  funcTypeIsAsync: false,
9569
10084
  getCallbackFn: () => null,
9570
10085
  getPostReturnFn: () => null,
9571
10086
  isCancellable: false,
9572
10087
  memoryIdx: 0,
10088
+ stringEncoding: 'utf8',
9573
10089
  getMemoryFn: () => memory0,
9574
10090
  getReallocFn: () => realloc0,
9575
10091
  importFn: _trampoline11,
@@ -9583,12 +10099,17 @@ null,
9583
10099
  isAsync: false,
9584
10100
  isManualAsync: _trampoline12.manuallyAsync,
9585
10101
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9586
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatFlags.bind(null, 0), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10102
+ resultLowerFns: [_lowerFlatResult([
10103
+ [ '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 ],
10104
+ [ '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 ],
10105
+ ])
10106
+ ],
9587
10107
  funcTypeIsAsync: false,
9588
10108
  getCallbackFn: () => null,
9589
10109
  getPostReturnFn: () => null,
9590
10110
  isCancellable: false,
9591
10111
  memoryIdx: 0,
10112
+ stringEncoding: 'utf8',
9592
10113
  getMemoryFn: () => memory0,
9593
10114
  getReallocFn: () => null,
9594
10115
  importFn: _trampoline12,
@@ -9601,12 +10122,17 @@ null,
9601
10122
  isAsync: false,
9602
10123
  isManualAsync: _trampoline12.manuallyAsync,
9603
10124
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9604
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatFlags.bind(null, 0), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10125
+ resultLowerFns: [_lowerFlatResult([
10126
+ [ '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 ],
10127
+ [ '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 ],
10128
+ ])
10129
+ ],
9605
10130
  funcTypeIsAsync: false,
9606
10131
  getCallbackFn: () => null,
9607
10132
  getPostReturnFn: () => null,
9608
10133
  isCancellable: false,
9609
10134
  memoryIdx: 0,
10135
+ stringEncoding: 'utf8',
9610
10136
  getMemoryFn: () => memory0,
9611
10137
  getReallocFn: () => null,
9612
10138
  importFn: _trampoline12,
@@ -9620,12 +10146,17 @@ null,
9620
10146
  isAsync: false,
9621
10147
  isManualAsync: _trampoline13.manuallyAsync,
9622
10148
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9623
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatEnum.bind(null, 1), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10149
+ resultLowerFns: [_lowerFlatResult([
10150
+ [ '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 ],
10151
+ [ '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 ],
10152
+ ])
10153
+ ],
9624
10154
  funcTypeIsAsync: false,
9625
10155
  getCallbackFn: () => null,
9626
10156
  getPostReturnFn: () => null,
9627
10157
  isCancellable: false,
9628
10158
  memoryIdx: 0,
10159
+ stringEncoding: 'utf8',
9629
10160
  getMemoryFn: () => memory0,
9630
10161
  getReallocFn: () => null,
9631
10162
  importFn: _trampoline13,
@@ -9638,12 +10169,17 @@ null,
9638
10169
  isAsync: false,
9639
10170
  isManualAsync: _trampoline13.manuallyAsync,
9640
10171
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9641
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatEnum.bind(null, 1), 2, 1, 1 ],[ 'err', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],])],
10172
+ resultLowerFns: [_lowerFlatResult([
10173
+ [ '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 ],
10174
+ [ '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 ],
10175
+ ])
10176
+ ],
9642
10177
  funcTypeIsAsync: false,
9643
10178
  getCallbackFn: () => null,
9644
10179
  getPostReturnFn: () => null,
9645
10180
  isCancellable: false,
9646
10181
  memoryIdx: 0,
10182
+ stringEncoding: 'utf8',
9647
10183
  getMemoryFn: () => memory0,
9648
10184
  getReallocFn: () => null,
9649
10185
  importFn: _trampoline13,
@@ -9657,12 +10193,17 @@ null,
9657
10193
  isAsync: false,
9658
10194
  isManualAsync: _trampoline14.manuallyAsync,
9659
10195
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9660
- 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 ],])],
10196
+ resultLowerFns: [_lowerFlatResult([
10197
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10198
+ [ '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 ],
10199
+ ])
10200
+ ],
9661
10201
  funcTypeIsAsync: false,
9662
10202
  getCallbackFn: () => null,
9663
10203
  getPostReturnFn: () => null,
9664
10204
  isCancellable: false,
9665
10205
  memoryIdx: 0,
10206
+ stringEncoding: 'utf8',
9666
10207
  getMemoryFn: () => memory0,
9667
10208
  getReallocFn: () => null,
9668
10209
  importFn: _trampoline14,
@@ -9675,12 +10216,17 @@ null,
9675
10216
  isAsync: false,
9676
10217
  isManualAsync: _trampoline14.manuallyAsync,
9677
10218
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9678
- 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 ],])],
10219
+ resultLowerFns: [_lowerFlatResult([
10220
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10221
+ [ '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 ],
10222
+ ])
10223
+ ],
9679
10224
  funcTypeIsAsync: false,
9680
10225
  getCallbackFn: () => null,
9681
10226
  getPostReturnFn: () => null,
9682
10227
  isCancellable: false,
9683
10228
  memoryIdx: 0,
10229
+ stringEncoding: 'utf8',
9684
10230
  getMemoryFn: () => memory0,
9685
10231
  getReallocFn: () => null,
9686
10232
  importFn: _trampoline14,
@@ -9694,12 +10240,17 @@ null,
9694
10240
  isAsync: false,
9695
10241
  isManualAsync: _trampoline15.manuallyAsync,
9696
10242
  paramLiftFns: [_liftFlatBorrow.bind(null, 0)],
9697
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],[ 'none', null, 2, 1, 1 ],])],
10243
+ resultLowerFns: [_lowerFlatOption([
10244
+ [ 'none', null, 2, 1, 1 ],
10245
+ [ '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 ],
10246
+ ])
10247
+ ],
9698
10248
  funcTypeIsAsync: false,
9699
10249
  getCallbackFn: () => null,
9700
10250
  getPostReturnFn: () => null,
9701
10251
  isCancellable: false,
9702
10252
  memoryIdx: 0,
10253
+ stringEncoding: 'utf8',
9703
10254
  getMemoryFn: () => memory0,
9704
10255
  getReallocFn: () => null,
9705
10256
  importFn: _trampoline15,
@@ -9712,12 +10263,17 @@ null,
9712
10263
  isAsync: false,
9713
10264
  isManualAsync: _trampoline15.manuallyAsync,
9714
10265
  paramLiftFns: [_liftFlatBorrow.bind(null, 0)],
9715
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatEnum.bind(null, 0), 2, 1, 1 ],[ 'none', null, 2, 1, 1 ],])],
10266
+ resultLowerFns: [_lowerFlatOption([
10267
+ [ 'none', null, 2, 1, 1 ],
10268
+ [ '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 ],
10269
+ ])
10270
+ ],
9716
10271
  funcTypeIsAsync: false,
9717
10272
  getCallbackFn: () => null,
9718
10273
  getPostReturnFn: () => null,
9719
10274
  isCancellable: false,
9720
10275
  memoryIdx: 0,
10276
+ stringEncoding: 'utf8',
9721
10277
  getMemoryFn: () => memory0,
9722
10278
  getReallocFn: () => null,
9723
10279
  importFn: _trampoline15,
@@ -9730,13 +10286,18 @@ null,
9730
10286
  componentIdx: 0,
9731
10287
  isAsync: false,
9732
10288
  isManualAsync: _trampoline16.manuallyAsync,
9733
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
9734
- 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 ],])],
10289
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10290
+ resultLowerFns: [_lowerFlatResult([
10291
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10292
+ [ '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 ],
10293
+ ])
10294
+ ],
9735
10295
  funcTypeIsAsync: false,
9736
10296
  getCallbackFn: () => null,
9737
10297
  getPostReturnFn: () => null,
9738
10298
  isCancellable: false,
9739
10299
  memoryIdx: 0,
10300
+ stringEncoding: 'utf8',
9740
10301
  getMemoryFn: () => memory0,
9741
10302
  getReallocFn: () => null,
9742
10303
  importFn: _trampoline16,
@@ -9748,13 +10309,18 @@ null,
9748
10309
  componentIdx: 0,
9749
10310
  isAsync: false,
9750
10311
  isManualAsync: _trampoline16.manuallyAsync,
9751
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
9752
- 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 ],])],
10312
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10313
+ resultLowerFns: [_lowerFlatResult([
10314
+ [ 'ok', _lowerFlatRecord([['lower', _lowerFlatU64, 16, 8 ],['upper', _lowerFlatU64, 16, 8 ],]), 24, 8, 8 ],
10315
+ [ '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 ],
10316
+ ])
10317
+ ],
9753
10318
  funcTypeIsAsync: false,
9754
10319
  getCallbackFn: () => null,
9755
10320
  getPostReturnFn: () => null,
9756
10321
  isCancellable: false,
9757
10322
  memoryIdx: 0,
10323
+ stringEncoding: 'utf8',
9758
10324
  getMemoryFn: () => memory0,
9759
10325
  getReallocFn: () => null,
9760
10326
  importFn: _trampoline16,
@@ -9768,12 +10334,20 @@ null,
9768
10334
  isAsync: false,
9769
10335
  isManualAsync: _trampoline17.manuallyAsync,
9770
10336
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
9771
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 1), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10337
+ resultLowerFns: [_lowerFlatResult([
10338
+ [ 'ok', _lowerFlatOwn({
10339
+ componentIdx: 0,
10340
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10341
+ }), 8, 4, 4 ],
10342
+ [ '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 ],
10343
+ ])
10344
+ ],
9772
10345
  funcTypeIsAsync: false,
9773
10346
  getCallbackFn: () => null,
9774
10347
  getPostReturnFn: () => null,
9775
10348
  isCancellable: false,
9776
10349
  memoryIdx: 0,
10350
+ stringEncoding: 'utf8',
9777
10351
  getMemoryFn: () => memory0,
9778
10352
  getReallocFn: () => null,
9779
10353
  importFn: _trampoline17,
@@ -9786,12 +10360,20 @@ null,
9786
10360
  isAsync: false,
9787
10361
  isManualAsync: _trampoline17.manuallyAsync,
9788
10362
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
9789
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 1), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10363
+ resultLowerFns: [_lowerFlatResult([
10364
+ [ 'ok', _lowerFlatOwn({
10365
+ componentIdx: 0,
10366
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10367
+ }), 8, 4, 4 ],
10368
+ [ '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 ],
10369
+ ])
10370
+ ],
9790
10371
  funcTypeIsAsync: false,
9791
10372
  getCallbackFn: () => null,
9792
10373
  getPostReturnFn: () => null,
9793
10374
  isCancellable: false,
9794
10375
  memoryIdx: 0,
10376
+ stringEncoding: 'utf8',
9795
10377
  getMemoryFn: () => memory0,
9796
10378
  getReallocFn: () => null,
9797
10379
  importFn: _trampoline17,
@@ -9805,12 +10387,20 @@ null,
9805
10387
  isAsync: false,
9806
10388
  isManualAsync: _trampoline18.manuallyAsync,
9807
10389
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
9808
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10390
+ resultLowerFns: [_lowerFlatResult([
10391
+ [ 'ok', _lowerFlatOwn({
10392
+ componentIdx: 0,
10393
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10394
+ }), 8, 4, 4 ],
10395
+ [ '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 ],
10396
+ ])
10397
+ ],
9809
10398
  funcTypeIsAsync: false,
9810
10399
  getCallbackFn: () => null,
9811
10400
  getPostReturnFn: () => null,
9812
10401
  isCancellable: false,
9813
10402
  memoryIdx: 0,
10403
+ stringEncoding: 'utf8',
9814
10404
  getMemoryFn: () => memory0,
9815
10405
  getReallocFn: () => null,
9816
10406
  importFn: _trampoline18,
@@ -9823,12 +10413,20 @@ null,
9823
10413
  isAsync: false,
9824
10414
  isManualAsync: _trampoline18.manuallyAsync,
9825
10415
  paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatU64],
9826
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10416
+ resultLowerFns: [_lowerFlatResult([
10417
+ [ 'ok', _lowerFlatOwn({
10418
+ componentIdx: 0,
10419
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10420
+ }), 8, 4, 4 ],
10421
+ [ '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 ],
10422
+ ])
10423
+ ],
9827
10424
  funcTypeIsAsync: false,
9828
10425
  getCallbackFn: () => null,
9829
10426
  getPostReturnFn: () => null,
9830
10427
  isCancellable: false,
9831
10428
  memoryIdx: 0,
10429
+ stringEncoding: 'utf8',
9832
10430
  getMemoryFn: () => memory0,
9833
10431
  getReallocFn: () => null,
9834
10432
  importFn: _trampoline18,
@@ -9842,12 +10440,20 @@ null,
9842
10440
  isAsync: false,
9843
10441
  isManualAsync: _trampoline19.manuallyAsync,
9844
10442
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9845
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10443
+ resultLowerFns: [_lowerFlatResult([
10444
+ [ 'ok', _lowerFlatOwn({
10445
+ componentIdx: 0,
10446
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10447
+ }), 8, 4, 4 ],
10448
+ [ '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 ],
10449
+ ])
10450
+ ],
9846
10451
  funcTypeIsAsync: false,
9847
10452
  getCallbackFn: () => null,
9848
10453
  getPostReturnFn: () => null,
9849
10454
  isCancellable: false,
9850
10455
  memoryIdx: 0,
10456
+ stringEncoding: 'utf8',
9851
10457
  getMemoryFn: () => memory0,
9852
10458
  getReallocFn: () => null,
9853
10459
  importFn: _trampoline19,
@@ -9860,12 +10466,20 @@ null,
9860
10466
  isAsync: false,
9861
10467
  isManualAsync: _trampoline19.manuallyAsync,
9862
10468
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9863
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 2), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10469
+ resultLowerFns: [_lowerFlatResult([
10470
+ [ 'ok', _lowerFlatOwn({
10471
+ componentIdx: 0,
10472
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10473
+ }), 8, 4, 4 ],
10474
+ [ '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 ],
10475
+ ])
10476
+ ],
9864
10477
  funcTypeIsAsync: false,
9865
10478
  getCallbackFn: () => null,
9866
10479
  getPostReturnFn: () => null,
9867
10480
  isCancellable: false,
9868
10481
  memoryIdx: 0,
10482
+ stringEncoding: 'utf8',
9869
10483
  getMemoryFn: () => memory0,
9870
10484
  getReallocFn: () => null,
9871
10485
  importFn: _trampoline19,
@@ -9879,12 +10493,20 @@ null,
9879
10493
  isAsync: false,
9880
10494
  isManualAsync: _trampoline20.manuallyAsync,
9881
10495
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9882
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 5), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10496
+ resultLowerFns: [_lowerFlatResult([
10497
+ [ 'ok', _lowerFlatOwn({
10498
+ componentIdx: 0,
10499
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10500
+ }), 8, 4, 4 ],
10501
+ [ '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 ],
10502
+ ])
10503
+ ],
9883
10504
  funcTypeIsAsync: false,
9884
10505
  getCallbackFn: () => null,
9885
10506
  getPostReturnFn: () => null,
9886
10507
  isCancellable: false,
9887
10508
  memoryIdx: 0,
10509
+ stringEncoding: 'utf8',
9888
10510
  getMemoryFn: () => memory0,
9889
10511
  getReallocFn: () => null,
9890
10512
  importFn: _trampoline20,
@@ -9897,12 +10519,20 @@ null,
9897
10519
  isAsync: false,
9898
10520
  isManualAsync: _trampoline20.manuallyAsync,
9899
10521
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9900
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 5), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10522
+ resultLowerFns: [_lowerFlatResult([
10523
+ [ 'ok', _lowerFlatOwn({
10524
+ componentIdx: 0,
10525
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10526
+ }), 8, 4, 4 ],
10527
+ [ '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 ],
10528
+ ])
10529
+ ],
9901
10530
  funcTypeIsAsync: false,
9902
10531
  getCallbackFn: () => null,
9903
10532
  getPostReturnFn: () => null,
9904
10533
  isCancellable: false,
9905
10534
  memoryIdx: 0,
10535
+ stringEncoding: 'utf8',
9906
10536
  getMemoryFn: () => memory0,
9907
10537
  getReallocFn: () => null,
9908
10538
  importFn: _trampoline20,
@@ -9916,12 +10546,29 @@ null,
9916
10546
  isAsync: false,
9917
10547
  isManualAsync: _trampoline21.manuallyAsync,
9918
10548
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9919
- 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 ],])],
10549
+ resultLowerFns: [_lowerFlatResult([
10550
+ [ '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([
10551
+ [ 'none', null, 24, 8, 8 ],
10552
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10553
+ ])
10554
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10555
+ [ 'none', null, 24, 8, 8 ],
10556
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10557
+ ])
10558
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10559
+ [ 'none', null, 24, 8, 8 ],
10560
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10561
+ ])
10562
+ , 96, 8 ],]), 104, 8, 8 ],
10563
+ [ '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 ],
10564
+ ])
10565
+ ],
9920
10566
  funcTypeIsAsync: false,
9921
10567
  getCallbackFn: () => null,
9922
10568
  getPostReturnFn: () => null,
9923
10569
  isCancellable: false,
9924
10570
  memoryIdx: 0,
10571
+ stringEncoding: 'utf8',
9925
10572
  getMemoryFn: () => memory0,
9926
10573
  getReallocFn: () => null,
9927
10574
  importFn: _trampoline21,
@@ -9934,12 +10581,29 @@ null,
9934
10581
  isAsync: false,
9935
10582
  isManualAsync: _trampoline21.manuallyAsync,
9936
10583
  paramLiftFns: [_liftFlatBorrow.bind(null, 6)],
9937
- 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 ],])],
10584
+ resultLowerFns: [_lowerFlatResult([
10585
+ [ '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([
10586
+ [ 'none', null, 24, 8, 8 ],
10587
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10588
+ ])
10589
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10590
+ [ 'none', null, 24, 8, 8 ],
10591
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10592
+ ])
10593
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10594
+ [ 'none', null, 24, 8, 8 ],
10595
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10596
+ ])
10597
+ , 96, 8 ],]), 104, 8, 8 ],
10598
+ [ '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 ],
10599
+ ])
10600
+ ],
9938
10601
  funcTypeIsAsync: false,
9939
10602
  getCallbackFn: () => null,
9940
10603
  getPostReturnFn: () => null,
9941
10604
  isCancellable: false,
9942
10605
  memoryIdx: 0,
10606
+ stringEncoding: 'utf8',
9943
10607
  getMemoryFn: () => memory0,
9944
10608
  getReallocFn: () => null,
9945
10609
  importFn: _trampoline21,
@@ -9952,13 +10616,30 @@ null,
9952
10616
  componentIdx: 0,
9953
10617
  isAsync: false,
9954
10618
  isManualAsync: _trampoline22.manuallyAsync,
9955
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
9956
- 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 ],])],
10619
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10620
+ resultLowerFns: [_lowerFlatResult([
10621
+ [ '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([
10622
+ [ 'none', null, 24, 8, 8 ],
10623
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10624
+ ])
10625
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10626
+ [ 'none', null, 24, 8, 8 ],
10627
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10628
+ ])
10629
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10630
+ [ 'none', null, 24, 8, 8 ],
10631
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10632
+ ])
10633
+ , 96, 8 ],]), 104, 8, 8 ],
10634
+ [ '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 ],
10635
+ ])
10636
+ ],
9957
10637
  funcTypeIsAsync: false,
9958
10638
  getCallbackFn: () => null,
9959
10639
  getPostReturnFn: () => null,
9960
10640
  isCancellable: false,
9961
10641
  memoryIdx: 0,
10642
+ stringEncoding: 'utf8',
9962
10643
  getMemoryFn: () => memory0,
9963
10644
  getReallocFn: () => null,
9964
10645
  importFn: _trampoline22,
@@ -9970,13 +10651,30 @@ null,
9970
10651
  componentIdx: 0,
9971
10652
  isAsync: false,
9972
10653
  isManualAsync: _trampoline22.manuallyAsync,
9973
- paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSize: 1 }),_liftFlatStringUTF8],
9974
- 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 ],])],
10654
+ paramLiftFns: [_liftFlatBorrow.bind(null, 6),_liftFlatFlags({ names: ['symlink-follow'], size32: 1, align32: 1, intSizeBytes: 1 }),_liftFlatStringAny],
10655
+ resultLowerFns: [_lowerFlatResult([
10656
+ [ '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([
10657
+ [ 'none', null, 24, 8, 8 ],
10658
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10659
+ ])
10660
+ , 96, 8 ],['dataModificationTimestamp', _lowerFlatOption([
10661
+ [ 'none', null, 24, 8, 8 ],
10662
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10663
+ ])
10664
+ , 96, 8 ],['statusChangeTimestamp', _lowerFlatOption([
10665
+ [ 'none', null, 24, 8, 8 ],
10666
+ [ 'some', _lowerFlatRecord([['seconds', _lowerFlatU64, 16, 8 ],['nanoseconds', _lowerFlatU32, 16, 8 ],]), 24, 8, 8 ],
10667
+ ])
10668
+ , 96, 8 ],]), 104, 8, 8 ],
10669
+ [ '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 ],
10670
+ ])
10671
+ ],
9975
10672
  funcTypeIsAsync: false,
9976
10673
  getCallbackFn: () => null,
9977
10674
  getPostReturnFn: () => null,
9978
10675
  isCancellable: false,
9979
10676
  memoryIdx: 0,
10677
+ stringEncoding: 'utf8',
9980
10678
  getMemoryFn: () => memory0,
9981
10679
  getReallocFn: () => null,
9982
10680
  importFn: _trampoline22,
@@ -9989,13 +10687,21 @@ null,
9989
10687
  componentIdx: 0,
9990
10688
  isAsync: false,
9991
10689
  isManualAsync: _trampoline23.manuallyAsync,
9992
- 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 })],
9993
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 6), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10690
+ 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 })],
10691
+ resultLowerFns: [_lowerFlatResult([
10692
+ [ 'ok', _lowerFlatOwn({
10693
+ componentIdx: 0,
10694
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10695
+ }), 8, 4, 4 ],
10696
+ [ '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 ],
10697
+ ])
10698
+ ],
9994
10699
  funcTypeIsAsync: false,
9995
10700
  getCallbackFn: () => null,
9996
10701
  getPostReturnFn: () => null,
9997
10702
  isCancellable: false,
9998
10703
  memoryIdx: 0,
10704
+ stringEncoding: 'utf8',
9999
10705
  getMemoryFn: () => memory0,
10000
10706
  getReallocFn: () => null,
10001
10707
  importFn: _trampoline23,
@@ -10007,13 +10713,21 @@ null,
10007
10713
  componentIdx: 0,
10008
10714
  isAsync: false,
10009
10715
  isManualAsync: _trampoline23.manuallyAsync,
10010
- 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 })],
10011
- resultLowerFns: [_lowerFlatResult([[ 'ok', _lowerFlatOwn.bind(null, 6), 8, 4, 4 ],[ 'err', _lowerFlatEnum.bind(null, 0), 8, 4, 4 ],])],
10716
+ 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 })],
10717
+ resultLowerFns: [_lowerFlatResult([
10718
+ [ 'ok', _lowerFlatOwn({
10719
+ componentIdx: 0,
10720
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10721
+ }), 8, 4, 4 ],
10722
+ [ '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 ],
10723
+ ])
10724
+ ],
10012
10725
  funcTypeIsAsync: false,
10013
10726
  getCallbackFn: () => null,
10014
10727
  getPostReturnFn: () => null,
10015
10728
  isCancellable: false,
10016
10729
  memoryIdx: 0,
10730
+ stringEncoding: 'utf8',
10017
10731
  getMemoryFn: () => memory0,
10018
10732
  getReallocFn: () => null,
10019
10733
  importFn: _trampoline23,
@@ -10027,12 +10741,21 @@ null,
10027
10741
  isAsync: false,
10028
10742
  isManualAsync: _trampoline24.manuallyAsync,
10029
10743
  paramLiftFns: [_liftFlatBorrow.bind(null, 5)],
10030
- 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 ],])],
10744
+ resultLowerFns: [_lowerFlatResult([
10745
+ [ 'ok', _lowerFlatOption([
10746
+ [ 'none', null, 16, 4, 4 ],
10747
+ [ '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 ],
10748
+ ])
10749
+ , 20, 4, 4 ],
10750
+ [ '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 ],
10751
+ ])
10752
+ ],
10031
10753
  funcTypeIsAsync: false,
10032
10754
  getCallbackFn: () => null,
10033
10755
  getPostReturnFn: () => null,
10034
10756
  isCancellable: false,
10035
10757
  memoryIdx: 0,
10758
+ stringEncoding: 'utf8',
10036
10759
  getMemoryFn: () => memory0,
10037
10760
  getReallocFn: () => realloc0,
10038
10761
  importFn: _trampoline24,
@@ -10045,12 +10768,21 @@ null,
10045
10768
  isAsync: false,
10046
10769
  isManualAsync: _trampoline24.manuallyAsync,
10047
10770
  paramLiftFns: [_liftFlatBorrow.bind(null, 5)],
10048
- 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 ],])],
10771
+ resultLowerFns: [_lowerFlatResult([
10772
+ [ 'ok', _lowerFlatOption([
10773
+ [ 'none', null, 16, 4, 4 ],
10774
+ [ '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 ],
10775
+ ])
10776
+ , 20, 4, 4 ],
10777
+ [ '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 ],
10778
+ ])
10779
+ ],
10049
10780
  funcTypeIsAsync: false,
10050
10781
  getCallbackFn: () => null,
10051
10782
  getPostReturnFn: () => null,
10052
10783
  isCancellable: false,
10053
10784
  memoryIdx: 0,
10785
+ stringEncoding: 'utf8',
10054
10786
  getMemoryFn: () => memory0,
10055
10787
  getReallocFn: () => realloc0,
10056
10788
  importFn: _trampoline24,
@@ -10064,12 +10796,24 @@ null,
10064
10796
  isAsync: false,
10065
10797
  isManualAsync: _trampoline25.manuallyAsync,
10066
10798
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10067
- 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 ],])],
10799
+ resultLowerFns: [_lowerFlatResult([
10800
+ [ 'ok', _lowerFlatList({
10801
+ elemLowerFn: _lowerFlatU8,
10802
+ elemSize32: 1,
10803
+ elemAlign32: 1,
10804
+ }), 12, 4, 4 ],
10805
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10806
+ componentIdx: 0,
10807
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10808
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10809
+ ])
10810
+ ],
10068
10811
  funcTypeIsAsync: false,
10069
10812
  getCallbackFn: () => null,
10070
10813
  getPostReturnFn: () => null,
10071
10814
  isCancellable: false,
10072
10815
  memoryIdx: 0,
10816
+ stringEncoding: 'utf8',
10073
10817
  getMemoryFn: () => memory0,
10074
10818
  getReallocFn: () => realloc0,
10075
10819
  importFn: _trampoline25,
@@ -10082,12 +10826,24 @@ null,
10082
10826
  isAsync: false,
10083
10827
  isManualAsync: _trampoline25.manuallyAsync,
10084
10828
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10085
- 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 ],])],
10829
+ resultLowerFns: [_lowerFlatResult([
10830
+ [ 'ok', _lowerFlatList({
10831
+ elemLowerFn: _lowerFlatU8,
10832
+ elemSize32: 1,
10833
+ elemAlign32: 1,
10834
+ }), 12, 4, 4 ],
10835
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10836
+ componentIdx: 0,
10837
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10838
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10839
+ ])
10840
+ ],
10086
10841
  funcTypeIsAsync: false,
10087
10842
  getCallbackFn: () => null,
10088
10843
  getPostReturnFn: () => null,
10089
10844
  isCancellable: false,
10090
10845
  memoryIdx: 0,
10846
+ stringEncoding: 'utf8',
10091
10847
  getMemoryFn: () => memory0,
10092
10848
  getReallocFn: () => realloc0,
10093
10849
  importFn: _trampoline25,
@@ -10101,12 +10857,24 @@ null,
10101
10857
  isAsync: false,
10102
10858
  isManualAsync: _trampoline26.manuallyAsync,
10103
10859
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10104
- 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 ],])],
10860
+ resultLowerFns: [_lowerFlatResult([
10861
+ [ 'ok', _lowerFlatList({
10862
+ elemLowerFn: _lowerFlatU8,
10863
+ elemSize32: 1,
10864
+ elemAlign32: 1,
10865
+ }), 12, 4, 4 ],
10866
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10867
+ componentIdx: 0,
10868
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10869
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10870
+ ])
10871
+ ],
10105
10872
  funcTypeIsAsync: false,
10106
10873
  getCallbackFn: () => null,
10107
10874
  getPostReturnFn: () => null,
10108
10875
  isCancellable: false,
10109
10876
  memoryIdx: 0,
10877
+ stringEncoding: 'utf8',
10110
10878
  getMemoryFn: () => memory0,
10111
10879
  getReallocFn: () => realloc0,
10112
10880
  importFn: _trampoline26,
@@ -10119,12 +10887,24 @@ null,
10119
10887
  isAsync: false,
10120
10888
  isManualAsync: _trampoline26.manuallyAsync,
10121
10889
  paramLiftFns: [_liftFlatBorrow.bind(null, 1),_liftFlatU64],
10122
- 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 ],])],
10890
+ resultLowerFns: [_lowerFlatResult([
10891
+ [ 'ok', _lowerFlatList({
10892
+ elemLowerFn: _lowerFlatU8,
10893
+ elemSize32: 1,
10894
+ elemAlign32: 1,
10895
+ }), 12, 4, 4 ],
10896
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10897
+ componentIdx: 0,
10898
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10899
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10900
+ ])
10901
+ ],
10123
10902
  funcTypeIsAsync: false,
10124
10903
  getCallbackFn: () => null,
10125
10904
  getPostReturnFn: () => null,
10126
10905
  isCancellable: false,
10127
10906
  memoryIdx: 0,
10907
+ stringEncoding: 'utf8',
10128
10908
  getMemoryFn: () => memory0,
10129
10909
  getReallocFn: () => realloc0,
10130
10910
  importFn: _trampoline26,
@@ -10138,12 +10918,20 @@ null,
10138
10918
  isAsync: false,
10139
10919
  isManualAsync: _trampoline27.manuallyAsync,
10140
10920
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10141
- 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 ],])],
10921
+ resultLowerFns: [_lowerFlatResult([
10922
+ [ 'ok', _lowerFlatU64, 16, 8, 8 ],
10923
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10924
+ componentIdx: 0,
10925
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10926
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],
10927
+ ])
10928
+ ],
10142
10929
  funcTypeIsAsync: false,
10143
10930
  getCallbackFn: () => null,
10144
10931
  getPostReturnFn: () => null,
10145
10932
  isCancellable: false,
10146
10933
  memoryIdx: 0,
10934
+ stringEncoding: 'utf8',
10147
10935
  getMemoryFn: () => memory0,
10148
10936
  getReallocFn: () => null,
10149
10937
  importFn: _trampoline27,
@@ -10156,12 +10944,20 @@ null,
10156
10944
  isAsync: false,
10157
10945
  isManualAsync: _trampoline27.manuallyAsync,
10158
10946
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10159
- 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 ],])],
10947
+ resultLowerFns: [_lowerFlatResult([
10948
+ [ 'ok', _lowerFlatU64, 16, 8, 8 ],
10949
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10950
+ componentIdx: 0,
10951
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10952
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 16, 8, 8 ],
10953
+ ])
10954
+ ],
10160
10955
  funcTypeIsAsync: false,
10161
10956
  getCallbackFn: () => null,
10162
10957
  getPostReturnFn: () => null,
10163
10958
  isCancellable: false,
10164
10959
  memoryIdx: 0,
10960
+ stringEncoding: 'utf8',
10165
10961
  getMemoryFn: () => memory0,
10166
10962
  getReallocFn: () => null,
10167
10963
  importFn: _trampoline27,
@@ -10174,13 +10970,25 @@ null,
10174
10970
  componentIdx: 0,
10175
10971
  isAsync: false,
10176
10972
  isManualAsync: _trampoline28.manuallyAsync,
10177
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10178
- 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 ],])],
10973
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
10974
+ elemLiftFn: _liftFlatU8,
10975
+ elemAlign32: 1,
10976
+ elemSize32: 1,
10977
+ })],
10978
+ resultLowerFns: [_lowerFlatResult([
10979
+ [ 'ok', null, 12, 4, 4 ],
10980
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
10981
+ componentIdx: 0,
10982
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
10983
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
10984
+ ])
10985
+ ],
10179
10986
  funcTypeIsAsync: false,
10180
10987
  getCallbackFn: () => null,
10181
10988
  getPostReturnFn: () => null,
10182
10989
  isCancellable: false,
10183
10990
  memoryIdx: 0,
10991
+ stringEncoding: 'utf8',
10184
10992
  getMemoryFn: () => memory0,
10185
10993
  getReallocFn: () => null,
10186
10994
  importFn: _trampoline28,
@@ -10192,13 +11000,25 @@ null,
10192
11000
  componentIdx: 0,
10193
11001
  isAsync: false,
10194
11002
  isManualAsync: _trampoline28.manuallyAsync,
10195
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10196
- 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 ],])],
11003
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11004
+ elemLiftFn: _liftFlatU8,
11005
+ elemAlign32: 1,
11006
+ elemSize32: 1,
11007
+ })],
11008
+ resultLowerFns: [_lowerFlatResult([
11009
+ [ 'ok', null, 12, 4, 4 ],
11010
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11011
+ componentIdx: 0,
11012
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11013
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11014
+ ])
11015
+ ],
10197
11016
  funcTypeIsAsync: false,
10198
11017
  getCallbackFn: () => null,
10199
11018
  getPostReturnFn: () => null,
10200
11019
  isCancellable: false,
10201
11020
  memoryIdx: 0,
11021
+ stringEncoding: 'utf8',
10202
11022
  getMemoryFn: () => memory0,
10203
11023
  getReallocFn: () => null,
10204
11024
  importFn: _trampoline28,
@@ -10211,13 +11031,25 @@ null,
10211
11031
  componentIdx: 0,
10212
11032
  isAsync: false,
10213
11033
  isManualAsync: _trampoline29.manuallyAsync,
10214
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10215
- 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 ],])],
11034
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11035
+ elemLiftFn: _liftFlatU8,
11036
+ elemAlign32: 1,
11037
+ elemSize32: 1,
11038
+ })],
11039
+ resultLowerFns: [_lowerFlatResult([
11040
+ [ 'ok', null, 12, 4, 4 ],
11041
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11042
+ componentIdx: 0,
11043
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11044
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11045
+ ])
11046
+ ],
10216
11047
  funcTypeIsAsync: false,
10217
11048
  getCallbackFn: () => null,
10218
11049
  getPostReturnFn: () => null,
10219
11050
  isCancellable: false,
10220
11051
  memoryIdx: 0,
11052
+ stringEncoding: 'utf8',
10221
11053
  getMemoryFn: () => memory0,
10222
11054
  getReallocFn: () => null,
10223
11055
  importFn: _trampoline29,
@@ -10229,13 +11061,25 @@ null,
10229
11061
  componentIdx: 0,
10230
11062
  isAsync: false,
10231
11063
  isManualAsync: _trampoline29.manuallyAsync,
10232
- paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({ elemLiftFn: _liftFlatU8, align32: 1, size32: 1 })],
10233
- 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 ],])],
11064
+ paramLiftFns: [_liftFlatBorrow.bind(null, 2),_liftFlatList({
11065
+ elemLiftFn: _liftFlatU8,
11066
+ elemAlign32: 1,
11067
+ elemSize32: 1,
11068
+ })],
11069
+ resultLowerFns: [_lowerFlatResult([
11070
+ [ 'ok', null, 12, 4, 4 ],
11071
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11072
+ componentIdx: 0,
11073
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11074
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11075
+ ])
11076
+ ],
10234
11077
  funcTypeIsAsync: false,
10235
11078
  getCallbackFn: () => null,
10236
11079
  getPostReturnFn: () => null,
10237
11080
  isCancellable: false,
10238
11081
  memoryIdx: 0,
11082
+ stringEncoding: 'utf8',
10239
11083
  getMemoryFn: () => memory0,
10240
11084
  getReallocFn: () => null,
10241
11085
  importFn: _trampoline29,
@@ -10249,12 +11093,20 @@ null,
10249
11093
  isAsync: false,
10250
11094
  isManualAsync: _trampoline30.manuallyAsync,
10251
11095
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10252
- 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 ],])],
11096
+ resultLowerFns: [_lowerFlatResult([
11097
+ [ 'ok', null, 12, 4, 4 ],
11098
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11099
+ componentIdx: 0,
11100
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11101
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11102
+ ])
11103
+ ],
10253
11104
  funcTypeIsAsync: false,
10254
11105
  getCallbackFn: () => null,
10255
11106
  getPostReturnFn: () => null,
10256
11107
  isCancellable: false,
10257
11108
  memoryIdx: 0,
11109
+ stringEncoding: 'utf8',
10258
11110
  getMemoryFn: () => memory0,
10259
11111
  getReallocFn: () => null,
10260
11112
  importFn: _trampoline30,
@@ -10267,12 +11119,20 @@ null,
10267
11119
  isAsync: false,
10268
11120
  isManualAsync: _trampoline30.manuallyAsync,
10269
11121
  paramLiftFns: [_liftFlatBorrow.bind(null, 2)],
10270
- 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 ],])],
11122
+ resultLowerFns: [_lowerFlatResult([
11123
+ [ 'ok', null, 12, 4, 4 ],
11124
+ [ 'err', _lowerFlatVariant([[ 'last-operation-failed', _lowerFlatOwn({
11125
+ componentIdx: 0,
11126
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11127
+ }), 8, 4, 4 ],[ 'closed', null, 8, 4, 4 ],]), 12, 4, 4 ],
11128
+ ])
11129
+ ],
10271
11130
  funcTypeIsAsync: false,
10272
11131
  getCallbackFn: () => null,
10273
11132
  getPostReturnFn: () => null,
10274
11133
  isCancellable: false,
10275
11134
  memoryIdx: 0,
11135
+ stringEncoding: 'utf8',
10276
11136
  getMemoryFn: () => memory0,
10277
11137
  getReallocFn: () => null,
10278
11138
  importFn: _trampoline30,
@@ -10286,12 +11146,17 @@ null,
10286
11146
  isAsync: false,
10287
11147
  isManualAsync: _trampoline31.manuallyAsync,
10288
11148
  paramLiftFns: [_liftFlatU64],
10289
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 })],
11149
+ resultLowerFns: [_lowerFlatList({
11150
+ elemLowerFn: _lowerFlatU8,
11151
+ elemSize32: 1,
11152
+ elemAlign32: 1,
11153
+ })],
10290
11154
  funcTypeIsAsync: false,
10291
11155
  getCallbackFn: () => null,
10292
11156
  getPostReturnFn: () => null,
10293
11157
  isCancellable: false,
10294
11158
  memoryIdx: 0,
11159
+ stringEncoding: 'utf8',
10295
11160
  getMemoryFn: () => memory0,
10296
11161
  getReallocFn: () => realloc0,
10297
11162
  importFn: _trampoline31,
@@ -10304,12 +11169,17 @@ null,
10304
11169
  isAsync: false,
10305
11170
  isManualAsync: _trampoline31.manuallyAsync,
10306
11171
  paramLiftFns: [_liftFlatU64],
10307
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatU8, typeIdx: 1 })],
11172
+ resultLowerFns: [_lowerFlatList({
11173
+ elemLowerFn: _lowerFlatU8,
11174
+ elemSize32: 1,
11175
+ elemAlign32: 1,
11176
+ })],
10308
11177
  funcTypeIsAsync: false,
10309
11178
  getCallbackFn: () => null,
10310
11179
  getPostReturnFn: () => null,
10311
11180
  isCancellable: false,
10312
11181
  memoryIdx: 0,
11182
+ stringEncoding: 'utf8',
10313
11183
  getMemoryFn: () => memory0,
10314
11184
  getReallocFn: () => realloc0,
10315
11185
  importFn: _trampoline31,
@@ -10323,12 +11193,20 @@ null,
10323
11193
  isAsync: false,
10324
11194
  isManualAsync: _trampoline32.manuallyAsync,
10325
11195
  paramLiftFns: [],
10326
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 30), typeIdx: 2 })],
11196
+ resultLowerFns: [_lowerFlatList({
11197
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatOwn({
11198
+ componentIdx: 0,
11199
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11200
+ }), 12, 4],[_lowerFlatStringAny, 12, 4],]),
11201
+ elemSize32: 12,
11202
+ elemAlign32: 4,
11203
+ })],
10327
11204
  funcTypeIsAsync: false,
10328
11205
  getCallbackFn: () => null,
10329
11206
  getPostReturnFn: () => null,
10330
11207
  isCancellable: false,
10331
11208
  memoryIdx: 0,
11209
+ stringEncoding: 'utf8',
10332
11210
  getMemoryFn: () => memory0,
10333
11211
  getReallocFn: () => realloc0,
10334
11212
  importFn: _trampoline32,
@@ -10341,12 +11219,20 @@ null,
10341
11219
  isAsync: false,
10342
11220
  isManualAsync: _trampoline32.manuallyAsync,
10343
11221
  paramLiftFns: [],
10344
- resultLowerFns: [_lowerFlatList({ elemLowerFn: _lowerFlatTuple.bind(null, 30), typeIdx: 2 })],
11222
+ resultLowerFns: [_lowerFlatList({
11223
+ elemLowerFn: _lowerFlatTuple([[_lowerFlatOwn({
11224
+ componentIdx: 0,
11225
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11226
+ }), 12, 4],[_lowerFlatStringAny, 12, 4],]),
11227
+ elemSize32: 12,
11228
+ elemAlign32: 4,
11229
+ })],
10345
11230
  funcTypeIsAsync: false,
10346
11231
  getCallbackFn: () => null,
10347
11232
  getPostReturnFn: () => null,
10348
11233
  isCancellable: false,
10349
11234
  memoryIdx: 0,
11235
+ stringEncoding: 'utf8',
10350
11236
  getMemoryFn: () => memory0,
10351
11237
  getReallocFn: () => realloc0,
10352
11238
  importFn: _trampoline32,
@@ -10360,12 +11246,20 @@ null,
10360
11246
  isAsync: false,
10361
11247
  isManualAsync: _trampoline33.manuallyAsync,
10362
11248
  paramLiftFns: [],
10363
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 3), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11249
+ resultLowerFns: [_lowerFlatOption([
11250
+ [ 'none', null, 8, 4, 4 ],
11251
+ [ 'some', _lowerFlatOwn({
11252
+ componentIdx: 0,
11253
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11254
+ }), 8, 4, 4 ],
11255
+ ])
11256
+ ],
10364
11257
  funcTypeIsAsync: false,
10365
11258
  getCallbackFn: () => null,
10366
11259
  getPostReturnFn: () => null,
10367
11260
  isCancellable: false,
10368
11261
  memoryIdx: 0,
11262
+ stringEncoding: 'utf8',
10369
11263
  getMemoryFn: () => memory0,
10370
11264
  getReallocFn: () => null,
10371
11265
  importFn: _trampoline33,
@@ -10378,12 +11272,20 @@ null,
10378
11272
  isAsync: false,
10379
11273
  isManualAsync: _trampoline33.manuallyAsync,
10380
11274
  paramLiftFns: [],
10381
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 3), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11275
+ resultLowerFns: [_lowerFlatOption([
11276
+ [ 'none', null, 8, 4, 4 ],
11277
+ [ 'some', _lowerFlatOwn({
11278
+ componentIdx: 0,
11279
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11280
+ }), 8, 4, 4 ],
11281
+ ])
11282
+ ],
10382
11283
  funcTypeIsAsync: false,
10383
11284
  getCallbackFn: () => null,
10384
11285
  getPostReturnFn: () => null,
10385
11286
  isCancellable: false,
10386
11287
  memoryIdx: 0,
11288
+ stringEncoding: 'utf8',
10387
11289
  getMemoryFn: () => memory0,
10388
11290
  getReallocFn: () => null,
10389
11291
  importFn: _trampoline33,
@@ -10397,12 +11299,20 @@ null,
10397
11299
  isAsync: false,
10398
11300
  isManualAsync: _trampoline34.manuallyAsync,
10399
11301
  paramLiftFns: [],
10400
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11302
+ resultLowerFns: [_lowerFlatOption([
11303
+ [ 'none', null, 8, 4, 4 ],
11304
+ [ 'some', _lowerFlatOwn({
11305
+ componentIdx: 0,
11306
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11307
+ }), 8, 4, 4 ],
11308
+ ])
11309
+ ],
10401
11310
  funcTypeIsAsync: false,
10402
11311
  getCallbackFn: () => null,
10403
11312
  getPostReturnFn: () => null,
10404
11313
  isCancellable: false,
10405
11314
  memoryIdx: 0,
11315
+ stringEncoding: 'utf8',
10406
11316
  getMemoryFn: () => memory0,
10407
11317
  getReallocFn: () => null,
10408
11318
  importFn: _trampoline34,
@@ -10415,12 +11325,20 @@ null,
10415
11325
  isAsync: false,
10416
11326
  isManualAsync: _trampoline34.manuallyAsync,
10417
11327
  paramLiftFns: [],
10418
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11328
+ resultLowerFns: [_lowerFlatOption([
11329
+ [ 'none', null, 8, 4, 4 ],
11330
+ [ 'some', _lowerFlatOwn({
11331
+ componentIdx: 0,
11332
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11333
+ }), 8, 4, 4 ],
11334
+ ])
11335
+ ],
10419
11336
  funcTypeIsAsync: false,
10420
11337
  getCallbackFn: () => null,
10421
11338
  getPostReturnFn: () => null,
10422
11339
  isCancellable: false,
10423
11340
  memoryIdx: 0,
11341
+ stringEncoding: 'utf8',
10424
11342
  getMemoryFn: () => memory0,
10425
11343
  getReallocFn: () => null,
10426
11344
  importFn: _trampoline34,
@@ -10434,12 +11352,20 @@ null,
10434
11352
  isAsync: false,
10435
11353
  isManualAsync: _trampoline35.manuallyAsync,
10436
11354
  paramLiftFns: [],
10437
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11355
+ resultLowerFns: [_lowerFlatOption([
11356
+ [ 'none', null, 8, 4, 4 ],
11357
+ [ 'some', _lowerFlatOwn({
11358
+ componentIdx: 0,
11359
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11360
+ }), 8, 4, 4 ],
11361
+ ])
11362
+ ],
10438
11363
  funcTypeIsAsync: false,
10439
11364
  getCallbackFn: () => null,
10440
11365
  getPostReturnFn: () => null,
10441
11366
  isCancellable: false,
10442
11367
  memoryIdx: 0,
11368
+ stringEncoding: 'utf8',
10443
11369
  getMemoryFn: () => memory0,
10444
11370
  getReallocFn: () => null,
10445
11371
  importFn: _trampoline35,
@@ -10452,12 +11378,20 @@ null,
10452
11378
  isAsync: false,
10453
11379
  isManualAsync: _trampoline35.manuallyAsync,
10454
11380
  paramLiftFns: [],
10455
- resultLowerFns: [_lowerFlatOption([[ 'some', _lowerFlatOwn.bind(null, 4), 8, 4, 4 ],[ 'none', null, 8, 4, 4 ],])],
11381
+ resultLowerFns: [_lowerFlatOption([
11382
+ [ 'none', null, 8, 4, 4 ],
11383
+ [ 'some', _lowerFlatOwn({
11384
+ componentIdx: 0,
11385
+ lowerFn: () => { throw new Error('missing/invalid resource metadata'); }
11386
+ }), 8, 4, 4 ],
11387
+ ])
11388
+ ],
10456
11389
  funcTypeIsAsync: false,
10457
11390
  getCallbackFn: () => null,
10458
11391
  getPostReturnFn: () => null,
10459
11392
  isCancellable: false,
10460
11393
  memoryIdx: 0,
11394
+ stringEncoding: 'utf8',
10461
11395
  getMemoryFn: () => memory0,
10462
11396
  getReallocFn: () => null,
10463
11397
  importFn: _trampoline35,