@bytecodealliance/jco 0.10.1 → 0.10.2

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.
@@ -99,38 +99,38 @@ function utf8Encode(s, realloc, memory) {
99
99
  let exports0;
100
100
  let exports1;
101
101
 
102
- function lowering0(arg0) {
102
+ function trampoline0(arg0) {
103
103
  dropDirectoryEntryStream(arg0 >>> 0);
104
104
  }
105
105
 
106
- function lowering1(arg0) {
106
+ function trampoline1(arg0) {
107
107
  dropInputStream(arg0 >>> 0);
108
108
  }
109
109
 
110
- function lowering2(arg0) {
110
+ function trampoline2(arg0) {
111
111
  dropOutputStream(arg0 >>> 0);
112
112
  }
113
113
 
114
- function lowering3(arg0) {
114
+ function trampoline3(arg0) {
115
115
  dropDescriptor(arg0 >>> 0);
116
116
  }
117
117
 
118
- function lowering4() {
118
+ function trampoline4() {
119
119
  const ret = getStdin();
120
120
  return toUint32(ret);
121
121
  }
122
122
 
123
- function lowering5() {
123
+ function trampoline5() {
124
124
  const ret = getStdout();
125
125
  return toUint32(ret);
126
126
  }
127
127
 
128
- function lowering6() {
128
+ function trampoline6() {
129
129
  const ret = getStderr();
130
130
  return toUint32(ret);
131
131
  }
132
132
 
133
- function lowering7(arg0) {
133
+ function trampoline7(arg0) {
134
134
  let variant0;
135
135
  switch (arg0) {
136
136
  case 0: {
@@ -154,10 +154,8 @@ function lowering7(arg0) {
154
154
  exit(variant0);
155
155
  }
156
156
  let exports2;
157
- let memory0;
158
- let realloc0;
159
157
 
160
- function lowering8(arg0) {
158
+ function trampoline8(arg0) {
161
159
  const ret = getDirectories();
162
160
  const vec2 = ret;
163
161
  const len2 = vec2.length;
@@ -174,8 +172,10 @@ function lowering8(arg0) {
174
172
  dataView(memory0).setInt32(arg0 + 4, len2, true);
175
173
  dataView(memory0).setInt32(arg0 + 0, result2, true);
176
174
  }
175
+ let memory0;
176
+ let realloc0;
177
177
 
178
- function lowering9(arg0, arg1, arg2) {
178
+ function trampoline9(arg0, arg1, arg2) {
179
179
  let ret;
180
180
  try {
181
181
  ret = { tag: 'ok', val: readViaStream(arg0 >>> 0, BigInt.asUintN(64, arg1)) };
@@ -361,7 +361,7 @@ function lowering9(arg0, arg1, arg2) {
361
361
  }
362
362
  }
363
363
 
364
- function lowering10(arg0, arg1, arg2) {
364
+ function trampoline10(arg0, arg1, arg2) {
365
365
  let ret;
366
366
  try {
367
367
  ret = { tag: 'ok', val: writeViaStream(arg0 >>> 0, BigInt.asUintN(64, arg1)) };
@@ -547,7 +547,7 @@ function lowering10(arg0, arg1, arg2) {
547
547
  }
548
548
  }
549
549
 
550
- function lowering11(arg0, arg1) {
550
+ function trampoline11(arg0, arg1) {
551
551
  let ret;
552
552
  try {
553
553
  ret = { tag: 'ok', val: appendViaStream(arg0 >>> 0) };
@@ -733,7 +733,7 @@ function lowering11(arg0, arg1) {
733
733
  }
734
734
  }
735
735
 
736
- function lowering12(arg0, arg1) {
736
+ function trampoline12(arg0, arg1) {
737
737
  let ret;
738
738
  try {
739
739
  ret = { tag: 'ok', val: getType(arg0 >>> 0) };
@@ -962,7 +962,7 @@ function lowering12(arg0, arg1) {
962
962
  }
963
963
  }
964
964
 
965
- function lowering13(arg0, arg1) {
965
+ function trampoline13(arg0, arg1) {
966
966
  let ret;
967
967
  try {
968
968
  ret = { tag: 'ok', val: stat(arg0 >>> 0) };
@@ -1205,7 +1205,7 @@ function lowering13(arg0, arg1) {
1205
1205
  }
1206
1206
  }
1207
1207
 
1208
- function lowering14(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1208
+ function trampoline14(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1209
1209
  if ((arg1 & 4294967294) !== 0) {
1210
1210
  throw new TypeError('flags have extraneous bits set');
1211
1211
  }
@@ -1428,7 +1428,7 @@ function lowering14(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1428
1428
  }
1429
1429
  }
1430
1430
 
1431
- function lowering15(arg0, arg1) {
1431
+ function trampoline15(arg0, arg1) {
1432
1432
  const ret = getRandomBytes(BigInt.asUintN(64, arg0));
1433
1433
  const val0 = ret;
1434
1434
  const len0 = val0.byteLength;
@@ -1439,7 +1439,7 @@ function lowering15(arg0, arg1) {
1439
1439
  dataView(memory0).setInt32(arg1 + 0, ptr0, true);
1440
1440
  }
1441
1441
 
1442
- function lowering16(arg0) {
1442
+ function trampoline16(arg0) {
1443
1443
  const ret = getEnvironment();
1444
1444
  const vec3 = ret;
1445
1445
  const len3 = vec3.length;
@@ -1460,7 +1460,7 @@ function lowering16(arg0) {
1460
1460
  dataView(memory0).setInt32(arg0 + 0, result3, true);
1461
1461
  }
1462
1462
 
1463
- function lowering17(arg0, arg1, arg2) {
1463
+ function trampoline17(arg0, arg1, arg2) {
1464
1464
  let ret;
1465
1465
  try {
1466
1466
  ret = { tag: 'ok', val: read(arg0 >>> 0, BigInt.asUintN(64, arg1)) };
@@ -1515,7 +1515,7 @@ function lowering17(arg0, arg1, arg2) {
1515
1515
  }
1516
1516
  }
1517
1517
 
1518
- function lowering18(arg0, arg1, arg2) {
1518
+ function trampoline18(arg0, arg1, arg2) {
1519
1519
  let ret;
1520
1520
  try {
1521
1521
  ret = { tag: 'ok', val: blockingRead(arg0 >>> 0, BigInt.asUintN(64, arg1)) };
@@ -1570,7 +1570,7 @@ function lowering18(arg0, arg1, arg2) {
1570
1570
  }
1571
1571
  }
1572
1572
 
1573
- function lowering19(arg0, arg1, arg2, arg3) {
1573
+ function trampoline19(arg0, arg1, arg2, arg3) {
1574
1574
  const ptr0 = arg1;
1575
1575
  const len0 = arg2;
1576
1576
  const result0 = new Uint8Array(memory0.buffer.slice(ptr0, ptr0 + len0 * 1));
@@ -1622,7 +1622,7 @@ function lowering19(arg0, arg1, arg2, arg3) {
1622
1622
  }
1623
1623
  }
1624
1624
 
1625
- function lowering20(arg0, arg1, arg2, arg3) {
1625
+ function trampoline20(arg0, arg1, arg2, arg3) {
1626
1626
  const ptr0 = arg1;
1627
1627
  const len0 = arg2;
1628
1628
  const result0 = new Uint8Array(memory0.buffer.slice(ptr0, ptr0 + len0 * 1));
@@ -2045,24 +2045,24 @@ export const $init = (async() => {
2045
2045
  'get-environment': exports0['8'],
2046
2046
  },
2047
2047
  'wasi:cli-base/exit': {
2048
- exit: lowering7,
2048
+ exit: trampoline7,
2049
2049
  },
2050
2050
  'wasi:cli-base/preopens': {
2051
2051
  'get-directories': exports0['0'],
2052
2052
  },
2053
2053
  'wasi:cli-base/stderr': {
2054
- 'get-stderr': lowering6,
2054
+ 'get-stderr': trampoline6,
2055
2055
  },
2056
2056
  'wasi:cli-base/stdin': {
2057
- 'get-stdin': lowering4,
2057
+ 'get-stdin': trampoline4,
2058
2058
  },
2059
2059
  'wasi:cli-base/stdout': {
2060
- 'get-stdout': lowering5,
2060
+ 'get-stdout': trampoline5,
2061
2061
  },
2062
2062
  'wasi:filesystem/filesystem': {
2063
2063
  'append-via-stream': exports0['3'],
2064
- 'drop-descriptor': lowering3,
2065
- 'drop-directory-entry-stream': lowering0,
2064
+ 'drop-descriptor': trampoline3,
2065
+ 'drop-directory-entry-stream': trampoline0,
2066
2066
  'get-type': exports0['4'],
2067
2067
  'open-at': exports0['6'],
2068
2068
  'read-via-stream': exports0['1'],
@@ -2072,8 +2072,8 @@ export const $init = (async() => {
2072
2072
  'wasi:io/streams': {
2073
2073
  'blocking-read': exports0['10'],
2074
2074
  'blocking-write': exports0['12'],
2075
- 'drop-input-stream': lowering1,
2076
- 'drop-output-stream': lowering2,
2075
+ 'drop-input-stream': trampoline1,
2076
+ 'drop-output-stream': trampoline2,
2077
2077
  read: exports0['9'],
2078
2078
  write: exports0['11'],
2079
2079
  },
@@ -2086,11 +2086,11 @@ export const $init = (async() => {
2086
2086
  ({ exports: exports3 } = await instantiateCore(await module3, {
2087
2087
  '': {
2088
2088
  $imports: exports0.$imports,
2089
- '0': lowering8,
2090
- '1': lowering9,
2091
- '10': lowering18,
2092
- '11': lowering19,
2093
- '12': lowering20,
2089
+ '0': trampoline8,
2090
+ '1': trampoline9,
2091
+ '10': trampoline18,
2092
+ '11': trampoline19,
2093
+ '12': trampoline20,
2094
2094
  '13': exports2.fd_filestat_get,
2095
2095
  '14': exports2.fd_read,
2096
2096
  '15': exports2.fd_write,
@@ -2098,18 +2098,18 @@ export const $init = (async() => {
2098
2098
  '17': exports2.random_get,
2099
2099
  '18': exports2.environ_get,
2100
2100
  '19': exports2.environ_sizes_get,
2101
- '2': lowering10,
2101
+ '2': trampoline10,
2102
2102
  '20': exports2.fd_close,
2103
2103
  '21': exports2.fd_prestat_get,
2104
2104
  '22': exports2.fd_prestat_dir_name,
2105
2105
  '23': exports2.proc_exit,
2106
- '3': lowering11,
2107
- '4': lowering12,
2108
- '5': lowering13,
2109
- '6': lowering14,
2110
- '7': lowering15,
2111
- '8': lowering16,
2112
- '9': lowering17,
2106
+ '3': trampoline11,
2107
+ '4': trampoline12,
2108
+ '5': trampoline13,
2109
+ '6': trampoline14,
2110
+ '7': trampoline15,
2111
+ '8': trampoline16,
2112
+ '9': trampoline17,
2113
2113
  },
2114
2114
  }));
2115
2115
  realloc1 = exports1.cabi_realloc;
Binary file
package/obj/wasm-tools.js CHANGED
@@ -99,38 +99,38 @@ function utf8Encode(s, realloc, memory) {
99
99
  let exports0;
100
100
  let exports1;
101
101
 
102
- function lowering0(arg0) {
102
+ function trampoline0(arg0) {
103
103
  dropDirectoryEntryStream(arg0 >>> 0);
104
104
  }
105
105
 
106
- function lowering1(arg0) {
106
+ function trampoline1(arg0) {
107
107
  dropInputStream(arg0 >>> 0);
108
108
  }
109
109
 
110
- function lowering2(arg0) {
110
+ function trampoline2(arg0) {
111
111
  dropOutputStream(arg0 >>> 0);
112
112
  }
113
113
 
114
- function lowering3(arg0) {
114
+ function trampoline3(arg0) {
115
115
  dropDescriptor(arg0 >>> 0);
116
116
  }
117
117
 
118
- function lowering4() {
118
+ function trampoline4() {
119
119
  const ret = getStdin();
120
120
  return toUint32(ret);
121
121
  }
122
122
 
123
- function lowering5() {
123
+ function trampoline5() {
124
124
  const ret = getStdout();
125
125
  return toUint32(ret);
126
126
  }
127
127
 
128
- function lowering6() {
128
+ function trampoline6() {
129
129
  const ret = getStderr();
130
130
  return toUint32(ret);
131
131
  }
132
132
 
133
- function lowering7(arg0) {
133
+ function trampoline7(arg0) {
134
134
  let variant0;
135
135
  switch (arg0) {
136
136
  case 0: {
@@ -154,10 +154,8 @@ function lowering7(arg0) {
154
154
  exit(variant0);
155
155
  }
156
156
  let exports2;
157
- let memory0;
158
- let realloc0;
159
157
 
160
- function lowering8(arg0) {
158
+ function trampoline8(arg0) {
161
159
  const ret = getDirectories();
162
160
  const vec2 = ret;
163
161
  const len2 = vec2.length;
@@ -174,8 +172,10 @@ function lowering8(arg0) {
174
172
  dataView(memory0).setInt32(arg0 + 4, len2, true);
175
173
  dataView(memory0).setInt32(arg0 + 0, result2, true);
176
174
  }
175
+ let memory0;
176
+ let realloc0;
177
177
 
178
- function lowering9(arg0, arg1, arg2) {
178
+ function trampoline9(arg0, arg1, arg2) {
179
179
  let ret;
180
180
  try {
181
181
  ret = { tag: 'ok', val: readViaStream(arg0 >>> 0, BigInt.asUintN(64, arg1)) };
@@ -361,7 +361,7 @@ function lowering9(arg0, arg1, arg2) {
361
361
  }
362
362
  }
363
363
 
364
- function lowering10(arg0, arg1, arg2) {
364
+ function trampoline10(arg0, arg1, arg2) {
365
365
  let ret;
366
366
  try {
367
367
  ret = { tag: 'ok', val: writeViaStream(arg0 >>> 0, BigInt.asUintN(64, arg1)) };
@@ -547,7 +547,7 @@ function lowering10(arg0, arg1, arg2) {
547
547
  }
548
548
  }
549
549
 
550
- function lowering11(arg0, arg1) {
550
+ function trampoline11(arg0, arg1) {
551
551
  let ret;
552
552
  try {
553
553
  ret = { tag: 'ok', val: appendViaStream(arg0 >>> 0) };
@@ -733,7 +733,7 @@ function lowering11(arg0, arg1) {
733
733
  }
734
734
  }
735
735
 
736
- function lowering12(arg0, arg1) {
736
+ function trampoline12(arg0, arg1) {
737
737
  let ret;
738
738
  try {
739
739
  ret = { tag: 'ok', val: getType(arg0 >>> 0) };
@@ -962,7 +962,7 @@ function lowering12(arg0, arg1) {
962
962
  }
963
963
  }
964
964
 
965
- function lowering13(arg0, arg1) {
965
+ function trampoline13(arg0, arg1) {
966
966
  let ret;
967
967
  try {
968
968
  ret = { tag: 'ok', val: stat(arg0 >>> 0) };
@@ -1205,7 +1205,7 @@ function lowering13(arg0, arg1) {
1205
1205
  }
1206
1206
  }
1207
1207
 
1208
- function lowering14(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1208
+ function trampoline14(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1209
1209
  if ((arg1 & 4294967294) !== 0) {
1210
1210
  throw new TypeError('flags have extraneous bits set');
1211
1211
  }
@@ -1428,7 +1428,7 @@ function lowering14(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7) {
1428
1428
  }
1429
1429
  }
1430
1430
 
1431
- function lowering15(arg0, arg1) {
1431
+ function trampoline15(arg0, arg1) {
1432
1432
  const ret = getRandomBytes(BigInt.asUintN(64, arg0));
1433
1433
  const val0 = ret;
1434
1434
  const len0 = val0.byteLength;
@@ -1439,7 +1439,7 @@ function lowering15(arg0, arg1) {
1439
1439
  dataView(memory0).setInt32(arg1 + 0, ptr0, true);
1440
1440
  }
1441
1441
 
1442
- function lowering16(arg0) {
1442
+ function trampoline16(arg0) {
1443
1443
  const ret = getEnvironment();
1444
1444
  const vec3 = ret;
1445
1445
  const len3 = vec3.length;
@@ -1460,7 +1460,7 @@ function lowering16(arg0) {
1460
1460
  dataView(memory0).setInt32(arg0 + 0, result3, true);
1461
1461
  }
1462
1462
 
1463
- function lowering17(arg0, arg1, arg2) {
1463
+ function trampoline17(arg0, arg1, arg2) {
1464
1464
  let ret;
1465
1465
  try {
1466
1466
  ret = { tag: 'ok', val: read(arg0 >>> 0, BigInt.asUintN(64, arg1)) };
@@ -1515,7 +1515,7 @@ function lowering17(arg0, arg1, arg2) {
1515
1515
  }
1516
1516
  }
1517
1517
 
1518
- function lowering18(arg0, arg1, arg2) {
1518
+ function trampoline18(arg0, arg1, arg2) {
1519
1519
  let ret;
1520
1520
  try {
1521
1521
  ret = { tag: 'ok', val: blockingRead(arg0 >>> 0, BigInt.asUintN(64, arg1)) };
@@ -1570,7 +1570,7 @@ function lowering18(arg0, arg1, arg2) {
1570
1570
  }
1571
1571
  }
1572
1572
 
1573
- function lowering19(arg0, arg1, arg2, arg3) {
1573
+ function trampoline19(arg0, arg1, arg2, arg3) {
1574
1574
  const ptr0 = arg1;
1575
1575
  const len0 = arg2;
1576
1576
  const result0 = new Uint8Array(memory0.buffer.slice(ptr0, ptr0 + len0 * 1));
@@ -1622,7 +1622,7 @@ function lowering19(arg0, arg1, arg2, arg3) {
1622
1622
  }
1623
1623
  }
1624
1624
 
1625
- function lowering20(arg0, arg1, arg2, arg3) {
1625
+ function trampoline20(arg0, arg1, arg2, arg3) {
1626
1626
  const ptr0 = arg1;
1627
1627
  const len0 = arg2;
1628
1628
  const result0 = new Uint8Array(memory0.buffer.slice(ptr0, ptr0 + len0 * 1));
@@ -2245,24 +2245,24 @@ export const $init = (async() => {
2245
2245
  'get-environment': exports0['8'],
2246
2246
  },
2247
2247
  'wasi:cli-base/exit': {
2248
- exit: lowering7,
2248
+ exit: trampoline7,
2249
2249
  },
2250
2250
  'wasi:cli-base/preopens': {
2251
2251
  'get-directories': exports0['0'],
2252
2252
  },
2253
2253
  'wasi:cli-base/stderr': {
2254
- 'get-stderr': lowering6,
2254
+ 'get-stderr': trampoline6,
2255
2255
  },
2256
2256
  'wasi:cli-base/stdin': {
2257
- 'get-stdin': lowering4,
2257
+ 'get-stdin': trampoline4,
2258
2258
  },
2259
2259
  'wasi:cli-base/stdout': {
2260
- 'get-stdout': lowering5,
2260
+ 'get-stdout': trampoline5,
2261
2261
  },
2262
2262
  'wasi:filesystem/filesystem': {
2263
2263
  'append-via-stream': exports0['3'],
2264
- 'drop-descriptor': lowering3,
2265
- 'drop-directory-entry-stream': lowering0,
2264
+ 'drop-descriptor': trampoline3,
2265
+ 'drop-directory-entry-stream': trampoline0,
2266
2266
  'get-type': exports0['4'],
2267
2267
  'open-at': exports0['6'],
2268
2268
  'read-via-stream': exports0['1'],
@@ -2272,8 +2272,8 @@ export const $init = (async() => {
2272
2272
  'wasi:io/streams': {
2273
2273
  'blocking-read': exports0['10'],
2274
2274
  'blocking-write': exports0['12'],
2275
- 'drop-input-stream': lowering1,
2276
- 'drop-output-stream': lowering2,
2275
+ 'drop-input-stream': trampoline1,
2276
+ 'drop-output-stream': trampoline2,
2277
2277
  read: exports0['9'],
2278
2278
  write: exports0['11'],
2279
2279
  },
@@ -2286,11 +2286,11 @@ export const $init = (async() => {
2286
2286
  ({ exports: exports3 } = await instantiateCore(await module3, {
2287
2287
  '': {
2288
2288
  $imports: exports0.$imports,
2289
- '0': lowering8,
2290
- '1': lowering9,
2291
- '10': lowering18,
2292
- '11': lowering19,
2293
- '12': lowering20,
2289
+ '0': trampoline8,
2290
+ '1': trampoline9,
2291
+ '10': trampoline18,
2292
+ '11': trampoline19,
2293
+ '12': trampoline20,
2294
2294
  '13': exports2.fd_filestat_get,
2295
2295
  '14': exports2.fd_read,
2296
2296
  '15': exports2.fd_write,
@@ -2298,18 +2298,18 @@ export const $init = (async() => {
2298
2298
  '17': exports2.random_get,
2299
2299
  '18': exports2.environ_get,
2300
2300
  '19': exports2.environ_sizes_get,
2301
- '2': lowering10,
2301
+ '2': trampoline10,
2302
2302
  '20': exports2.fd_close,
2303
2303
  '21': exports2.fd_prestat_get,
2304
2304
  '22': exports2.fd_prestat_dir_name,
2305
2305
  '23': exports2.proc_exit,
2306
- '3': lowering11,
2307
- '4': lowering12,
2308
- '5': lowering13,
2309
- '6': lowering14,
2310
- '7': lowering15,
2311
- '8': lowering16,
2312
- '9': lowering17,
2306
+ '3': trampoline11,
2307
+ '4': trampoline12,
2308
+ '5': trampoline13,
2309
+ '6': trampoline14,
2310
+ '7': trampoline15,
2311
+ '8': trampoline16,
2312
+ '9': trampoline17,
2313
2313
  },
2314
2314
  }));
2315
2315
  realloc1 = exports1.cabi_realloc;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytecodealliance/jco",
3
- "version": "0.10.1",
3
+ "version": "0.10.2",
4
4
  "description": "JavaScript tooling for working with WebAssembly Components",
5
5
  "author": "Guy Bedford",
6
6
  "bin": {
package/src/jco.js CHANGED
@@ -10,7 +10,7 @@ program
10
10
  .name('jco')
11
11
  .description(c`{bold jco - WebAssembly JS Component Tools}\n JS Component Transpilation Bindgen & Wasm Tools for JS`)
12
12
  .usage('<command> [options]')
13
- .version('0.10.1');
13
+ .version('0.10.2');
14
14
 
15
15
  function myParseInt(value) {
16
16
  return parseInt(value, 10);