@wasmgroundup/emit 0.2.12 → 0.2.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +7 -3
- package/dist/index.js +18 -2
- package/index.ts +21 -3
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -95,10 +95,14 @@ declare function locals(n: number, type: valtype): BytecodeFragment;
|
|
|
95
95
|
declare function import_(mod: string, nm: string, d: BytecodeFragment): BytecodeFragment;
|
|
96
96
|
declare function importsec(ims: BytecodeFragment): BytecodeFragment;
|
|
97
97
|
declare const importdesc: {
|
|
98
|
-
func(x:
|
|
98
|
+
func(x: BytecodeFragment): BytecodeFragment;
|
|
99
|
+
table(tt: BytecodeFragment): BytecodeFragment;
|
|
100
|
+
mem(mt: BytecodeFragment): BytecodeFragment;
|
|
101
|
+
global(gt: BytecodeFragment): BytecodeFragment;
|
|
99
102
|
};
|
|
100
|
-
declare function mem(memtype:
|
|
103
|
+
declare function mem(memtype: BytecodeFragment): BytecodeFragment;
|
|
101
104
|
declare function memsec(mems: BytecodeFragment[]): (number | BytecodeFragment)[];
|
|
105
|
+
declare function memtype(limits: BytecodeFragment): BytecodeFragment;
|
|
102
106
|
declare const limits: {
|
|
103
107
|
min(n: number): (number | number[])[];
|
|
104
108
|
minmax(n: number, m: number): (number | number[])[];
|
|
@@ -123,4 +127,4 @@ declare function data(x: BytecodeFragment, e: BytecodeFragment, bs: BytecodeFrag
|
|
|
123
127
|
declare function datasec(segs: BytecodeFragment[]): (number | BytecodeFragment)[];
|
|
124
128
|
declare function elem(x: BytecodeFragment, e: BytecodeFragment, ys: BytecodeFragment[]): BytecodeFragment[];
|
|
125
129
|
declare function elemsec(segs: BytecodeFragment[]): (number | BytecodeFragment)[];
|
|
126
|
-
export { blocktype, BytecodeFragment, code, codesec, data, datasec, elem, elemsec, elemtype, export_, exportdesc, exportsec, f64, func, funcidx, funcsec, functype, global, globalsec, globaltype, i32, import_, importdesc, importsec, instr, limits, locals, mem, memsec, module, mut, name, section, start, startsec, table, tableidx, tablesec, tabletype, typeidx, typesec, u32, valtype, vec, };
|
|
130
|
+
export { blocktype, BytecodeFragment, code, codesec, data, datasec, elem, elemsec, elemtype, export_, exportdesc, exportsec, f64, func, funcidx, funcsec, functype, global, globalsec, globaltype, i32, import_, importdesc, importsec, instr, limits, locals, mem, memsec, memtype, module, mut, name, section, start, startsec, table, tableidx, tablesec, tabletype, typeidx, typesec, u32, valtype, vec, };
|
package/dist/index.js
CHANGED
|
@@ -214,7 +214,19 @@ function importsec(ims) {
|
|
|
214
214
|
const importdesc = {
|
|
215
215
|
// x:typeidx
|
|
216
216
|
func(x) {
|
|
217
|
-
return [0x00,
|
|
217
|
+
return [0x00, x];
|
|
218
|
+
},
|
|
219
|
+
// tt:tabletype
|
|
220
|
+
table(tt) {
|
|
221
|
+
return [0x01, tt];
|
|
222
|
+
},
|
|
223
|
+
// mt:memtype
|
|
224
|
+
mem(mt) {
|
|
225
|
+
return [0x02, mt];
|
|
226
|
+
},
|
|
227
|
+
// gt:globaltype
|
|
228
|
+
global(gt) {
|
|
229
|
+
return [0x03, gt];
|
|
218
230
|
},
|
|
219
231
|
};
|
|
220
232
|
const memidx = u32;
|
|
@@ -224,6 +236,10 @@ function mem(memtype) {
|
|
|
224
236
|
function memsec(mems) {
|
|
225
237
|
return section(SECTION_ID_MEMORY, vec(mems));
|
|
226
238
|
}
|
|
239
|
+
// lim:limits
|
|
240
|
+
function memtype(limits) {
|
|
241
|
+
return limits;
|
|
242
|
+
}
|
|
227
243
|
const limits = {
|
|
228
244
|
min(n) {
|
|
229
245
|
return [0x00, u32(n)];
|
|
@@ -279,4 +295,4 @@ function elem(x, e, ys) {
|
|
|
279
295
|
function elemsec(segs) {
|
|
280
296
|
return section(SECTION_ID_ELEMENT, vec(segs));
|
|
281
297
|
}
|
|
282
|
-
export { blocktype, code, codesec, data, datasec, elem, elemsec, elemtype, export_, exportdesc, exportsec, f64, func, funcidx, funcsec, functype, global, globalsec, globaltype, i32, import_, importdesc, importsec, instr, limits, locals, mem, memsec, module, mut, name, section, start, startsec, table, tableidx, tablesec, tabletype, typeidx, typesec, u32, valtype, vec, };
|
|
298
|
+
export { blocktype, code, codesec, data, datasec, elem, elemsec, elemtype, export_, exportdesc, exportsec, f64, func, funcidx, funcsec, functype, global, globalsec, globaltype, i32, import_, importdesc, importsec, instr, limits, locals, mem, memsec, memtype, module, mut, name, section, start, startsec, table, tableidx, tablesec, tabletype, typeidx, typesec, u32, valtype, vec, };
|
package/index.ts
CHANGED
|
@@ -260,14 +260,26 @@ function importsec(ims: BytecodeFragment): BytecodeFragment {
|
|
|
260
260
|
|
|
261
261
|
const importdesc = {
|
|
262
262
|
// x:typeidx
|
|
263
|
-
func(x:
|
|
264
|
-
return [0x00,
|
|
263
|
+
func(x: BytecodeFragment): BytecodeFragment {
|
|
264
|
+
return [0x00, x];
|
|
265
|
+
},
|
|
266
|
+
// tt:tabletype
|
|
267
|
+
table(tt: BytecodeFragment): BytecodeFragment {
|
|
268
|
+
return [0x01, tt];
|
|
269
|
+
},
|
|
270
|
+
// mt:memtype
|
|
271
|
+
mem(mt: BytecodeFragment): BytecodeFragment {
|
|
272
|
+
return [0x02, mt];
|
|
273
|
+
},
|
|
274
|
+
// gt:globaltype
|
|
275
|
+
global(gt: BytecodeFragment): BytecodeFragment {
|
|
276
|
+
return [0x03, gt];
|
|
265
277
|
},
|
|
266
278
|
};
|
|
267
279
|
|
|
268
280
|
const memidx = u32;
|
|
269
281
|
|
|
270
|
-
function mem(memtype) {
|
|
282
|
+
function mem(memtype: BytecodeFragment) {
|
|
271
283
|
return memtype;
|
|
272
284
|
}
|
|
273
285
|
|
|
@@ -275,6 +287,11 @@ function memsec(mems: BytecodeFragment[]) {
|
|
|
275
287
|
return section(SECTION_ID_MEMORY, vec(mems));
|
|
276
288
|
}
|
|
277
289
|
|
|
290
|
+
// lim:limits
|
|
291
|
+
function memtype(limits: BytecodeFragment) {
|
|
292
|
+
return limits;
|
|
293
|
+
}
|
|
294
|
+
|
|
278
295
|
const limits = {
|
|
279
296
|
min(n: number) {
|
|
280
297
|
return [0x00, u32(n)];
|
|
@@ -385,6 +402,7 @@ export {
|
|
|
385
402
|
locals,
|
|
386
403
|
mem,
|
|
387
404
|
memsec,
|
|
405
|
+
memtype,
|
|
388
406
|
module,
|
|
389
407
|
mut,
|
|
390
408
|
name,
|