porffor 0.18.22 → 0.18.24

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.
@@ -21,6 +21,36 @@ const chHint = (topTier, baselineTier, strategy) => {
21
21
  return (strategy | (baselineTier << 2) | (topTier << 4));
22
22
  };
23
23
 
24
+ const encodeNames = (funcs) => {
25
+ const encodeSection = (id, section) => [
26
+ id,
27
+ ...unsignedLEB128(section.length),
28
+ ...section
29
+ ];
30
+
31
+ const moduleSection = encodeString('js'); // TODO: filename?
32
+ const functionsSection = encodeVector(
33
+ funcs.map((x) => unsignedLEB128(x.index).concat(encodeString(x.name))),
34
+ );
35
+ const localsSection = encodeVector(
36
+ funcs.map((x) =>
37
+ unsignedLEB128(x.index).concat(
38
+ encodeVector(
39
+ Object.entries(x.locals).map(([name, local]) =>
40
+ unsignedLEB128(local.idx).concat(encodeString(name)),
41
+ ),
42
+ ),
43
+ ),
44
+ ),
45
+ );
46
+
47
+ return [
48
+ ...encodeSection(0, moduleSection),
49
+ ...encodeSection(1, functionsSection),
50
+ ...encodeSection(2, localsSection),
51
+ ];
52
+ }
53
+
24
54
  export default (funcs, globals, tags, pages, data, flags, noTreeshake = false) => {
25
55
  const types = [], typeCache = {};
26
56
 
@@ -112,6 +142,8 @@ export default (funcs, globals, tags, pages, data, flags, noTreeshake = false) =
112
142
  encodeVector(funcs.map(x => getType(x.params, x.returns))) // type indexes
113
143
  );
114
144
 
145
+ const nameSection = Prefs.d ? customSection('name', encodeNames(funcs)) : [];
146
+
115
147
  const tableSection = !funcs.table ? [] : createSection(
116
148
  Section.table,
117
149
  encodeVector([ [ Reftype.funcref, 0x00, funcs.length ] ])
@@ -302,6 +334,7 @@ export default (funcs, globals, tags, pages, data, flags, noTreeshake = false) =
302
334
  ...elementSection,
303
335
  ...dataCountSection,
304
336
  ...codeSection,
305
- ...dataSection
337
+ ...dataSection,
338
+ ...nameSection
306
339
  ]);
307
340
  };
@@ -1,9 +1,40 @@
1
1
  import type {} from './porffor.d.ts';
2
2
 
3
3
  export const __Array_isArray = (x: unknown): boolean =>
4
- // Porffor.wasm`local.get ${x+1}` == Porffor.TYPES.array;
5
4
  Porffor.rawType(x) == Porffor.TYPES.array;
6
5
 
6
+ export const __Array_from = (arg: any, mapFn: any): any[] => {
7
+ let out: any[] = Porffor.allocate();
8
+ let len: i32 = 0;
9
+
10
+ const type = Porffor.rawType(arg);
11
+ if (Porffor.fastOr(
12
+ type == Porffor.TYPES.array,
13
+ type == Porffor.TYPES.string, type == Porffor.TYPES.bytestring,
14
+ type == Porffor.TYPES.set,
15
+ Porffor.fastAnd(type >= Porffor.TYPES.uint8array, type <= Porffor.TYPES.float64array)
16
+ )) {
17
+ const hasMapFn = Porffor.rawType(mapFn) != Porffor.TYPES.undefined;
18
+
19
+ let i: i32 = 0;
20
+ if (hasMapFn) {
21
+ if (Porffor.rawType(mapFn) != Porffor.TYPES.function) throw new TypeError('Called Array.from with a non-function mapFn');
22
+
23
+ for (const x of arg) {
24
+ out[i] = mapFn(x, i);
25
+ i++;
26
+ }
27
+ } else {
28
+ for (const x of arg) {
29
+ out[i++] = x;
30
+ }
31
+ }
32
+ len = i;
33
+ }
34
+
35
+ out.length = len;
36
+ return out;
37
+ };
7
38
 
8
39
  export const __Array_prototype_slice = (_this: any[], start: number, end: number) => {
9
40
  const len: i32 = _this.length;
@@ -9,7 +9,7 @@ export const ArrayBuffer = function (length: number): ArrayBuffer {
9
9
  if (!new.target) throw new TypeError("Constructor ArrayBuffer requires 'new'");
10
10
 
11
11
  if (length < 0) throw new RangeError('Invalid ArrayBuffer length (negative)');
12
- if (length > 34359738368) throw new RangeError('Invalid ArrayBuffer length (>32GiB)');
12
+ if (length > 4294967295) throw new RangeError('Invalid ArrayBuffer length (over 32 bit address space)');
13
13
 
14
14
  length |= 0;
15
15
 
@@ -20,5 +20,230 @@ export const ArrayBuffer = function (length: number): ArrayBuffer {
20
20
  };
21
21
 
22
22
  export const __ArrayBuffer_prototype_byteLength$get = (_this: ArrayBuffer) => {
23
+ Porffor.wasm`
24
+ local read i32
25
+ local.get ${_this}
26
+ i32.to_u
27
+ i32.load 0 0
28
+ local.tee read
29
+ i32.const 0
30
+ local.get read
31
+ i32.const 0
32
+ i32.ge_s
33
+ select
34
+ i32.from_u
35
+ i32.const 0
36
+ return`;
37
+ };
38
+
39
+ export const __ArrayBuffer_prototype_maxByteLength$get = (_this: ArrayBuffer) => {
40
+ Porffor.wasm`
41
+ local read i32
42
+ local.get ${_this}
43
+ i32.to_u
44
+ i32.load 0 0
45
+ local.tee read
46
+ i32.const 0
47
+ local.get read
48
+ i32.const 0
49
+ i32.ge_s
50
+ select
51
+ i32.from_u
52
+ i32.const 0
53
+ return`;
54
+ };
55
+
56
+ export const __ArrayBuffer_prototype_detached$get = (_this: ArrayBuffer) => {
57
+ Porffor.wasm`
58
+ local.get ${_this}
59
+ i32.to_u
60
+ i32.load 0 0
61
+ i32.const 4294967295
62
+ i32.eq
63
+ i32.from_u
64
+ i32.const 1
65
+ return`;
66
+ };
67
+
68
+ export const __ArrayBuffer_prototype_resizable$get = (_this: ArrayBuffer) => {
69
+ return false;
70
+ };
71
+
72
+ export const __ArrayBuffer_prototype_slice = (_this: ArrayBuffer, start: number, end: any) => {
73
+ if (_this.detached) throw new TypeError('Called ArrayBuffer.prototype.slice on a detached ArrayBuffer');
74
+
75
+ const len: i32 = Porffor.wasm.i32.load(_this, 0, 0);
76
+ if (Porffor.rawType(end) == Porffor.TYPES.undefined) end = len;
77
+
78
+ start |= 0;
79
+ end |= 0;
80
+
81
+ if (start < 0) {
82
+ start = len + start;
83
+ if (start < 0) start = 0;
84
+ }
85
+ if (start > len) start = len;
86
+ if (end < 0) {
87
+ end = len + end;
88
+ if (end < 0) end = 0;
89
+ }
90
+ if (end > len) end = len;
91
+
92
+ const out: ArrayBuffer = Porffor.allocateBytes(4 + (end - start));
93
+ Porffor.wasm.i32.store(out, end - start, 0, 0);
94
+
95
+ Porffor.wasm`
96
+ ;; dst = out + 4
97
+ local.get ${out}
98
+ i32.to_u
99
+ i32.const 4
100
+ i32.add
101
+
102
+ ;; src = this + 4 + start
103
+ local.get ${_this}
104
+ i32.to_u
105
+ i32.const 4
106
+ i32.add
107
+ local.get ${start}
108
+ i32.to_u
109
+ i32.add
110
+
111
+ ;; size = end - start
112
+ local.get ${end}
113
+ i32.to_u
114
+ local.get ${start}
115
+ i32.to_u
116
+ i32.sub
117
+
118
+ memory.copy 0 0`;
119
+
120
+ return out;
121
+ };
122
+
123
+
124
+ export const __ArrayBuffer_prototype_transfer = (_this: ArrayBuffer, newLength: any) => {
125
+ if (_this.detached) throw new TypeError('Called ArrayBuffer.prototype.transfer on a detached ArrayBuffer');
126
+
127
+ const len: i32 = Porffor.wasm.i32.load(_this, 0, 0);
128
+ if (Porffor.rawType(newLength) == Porffor.TYPES.undefined) newLength = len;
129
+
130
+ // make new arraybuffer
131
+ const out: ArrayBuffer = new ArrayBuffer(newLength);
132
+ Porffor.wasm.i32.store(out, newLength, 0, 0);
133
+
134
+ // copy data to it
135
+ Porffor.wasm`
136
+ ;; dst = out + 4
137
+ local.get ${out}
138
+ i32.to_u
139
+ i32.const 4
140
+ i32.add
141
+
142
+ ;; src = this + 4
143
+ local.get ${_this}
144
+ i32.to_u
145
+ i32.const 4
146
+ i32.add
147
+
148
+ ;; size = min(newLength, len)
149
+ local.get ${newLength}
150
+ local.get ${len}
151
+ f64.min
152
+ i32.to_u
153
+
154
+ memory.copy 0 0`;
155
+
156
+ // mark as detached by setting length = "-1"
157
+ Porffor.wasm.i32.store(_this, 4294967295, 0, 0);
158
+
159
+ return out;
160
+ };
161
+
162
+ export const __ArrayBuffer_prototype_transferToFixedLength = (_this: ArrayBuffer, newLength: any) => __ArrayBuffer_prototype_transfer(_this, newLength);
163
+
164
+ export const __ArrayBuffer_prototype_resize = (_this: ArrayBuffer, newLength: any) => {
165
+ // todo: resizable not implemented yet so just always fail
166
+ throw new TypeError('Called ArrayBuffer.prototype.resize on a non-resizable ArrayBuffer');
167
+ };
168
+
169
+
170
+ export const SharedArrayBuffer = function (length: number): SharedArrayBuffer {
171
+ if (!new.target) throw new TypeError("Constructor SharedArrayBuffer requires 'new'");
172
+
173
+ if (length < 0) throw new RangeError('Invalid SharedArrayBuffer length (negative)');
174
+ if (length > 4294967295) throw new RangeError('Invalid SharedArrayBuffer length (over 32 bit address space)');
175
+
176
+ length |= 0;
177
+
178
+ const out: SharedArrayBuffer = Porffor.allocateBytes(length + 4);
179
+ Porffor.wasm.i32.store(out, length, 0, 0);
180
+
181
+ return out;
182
+ };
183
+
184
+ export const __SharedArrayBuffer_prototype_byteLength$get = (_this: SharedArrayBuffer) => {
23
185
  return Porffor.wasm.i32.load(_this, 0, 0);
186
+ };
187
+
188
+ export const __SharedArrayBuffer_prototype_maxByteLength$get = (_this: SharedArrayBuffer) => {
189
+ return Porffor.wasm.i32.load(_this, 0, 0);
190
+ };
191
+
192
+ export const __SharedArrayBuffer_prototype_growable$get = (_this: SharedArrayBuffer) => {
193
+ return false;
194
+ };
195
+
196
+
197
+ export const __SharedArrayBuffer_prototype_slice = (_this: SharedArrayBuffer, start: number, end: any) => {
198
+ const len: i32 = Porffor.wasm.i32.load(_this, 0, 0);
199
+ if (Porffor.rawType(end) == Porffor.TYPES.undefined) end = len;
200
+
201
+ start |= 0;
202
+ end |= 0;
203
+
204
+ if (start < 0) {
205
+ start = len + start;
206
+ if (start < 0) start = 0;
207
+ }
208
+ if (start > len) start = len;
209
+ if (end < 0) {
210
+ end = len + end;
211
+ if (end < 0) end = 0;
212
+ }
213
+ if (end > len) end = len;
214
+
215
+ const out: SharedArrayBuffer = Porffor.allocateBytes(4 + (end - start));
216
+ Porffor.wasm.i32.store(out, end - start, 0, 0);
217
+
218
+ Porffor.wasm`
219
+ ;; dst = out + 4
220
+ local.get ${out}
221
+ i32.to_u
222
+ i32.const 4
223
+ i32.add
224
+
225
+ ;; src = this + 4 + start
226
+ local.get ${_this}
227
+ i32.to_u
228
+ i32.const 4
229
+ i32.add
230
+ local.get ${start}
231
+ i32.to_u
232
+ i32.add
233
+
234
+ ;; size = end - start
235
+ local.get ${end}
236
+ i32.to_u
237
+ local.get ${start}
238
+ i32.to_u
239
+ i32.sub
240
+
241
+ memory.copy 0 0`;
242
+
243
+ return out;
244
+ };
245
+
246
+ export const __SharedArrayBuffer_prototype_grow = (_this: SharedArrayBuffer, newLength: any) => {
247
+ // todo: growable not implemented yet so just always fail
248
+ throw new TypeError('Called SharedArrayBuffer.prototype.grow on a non-growable SharedArrayBuffer');
24
249
  };
@@ -0,0 +1,261 @@
1
+ import type {} from './porffor.d.ts';
2
+
3
+ export const DataView = function (arg: any, byteOffset: any, length: any): DataView {
4
+ if (!new.target) throw new TypeError("Constructor DataView requires 'new'");
5
+
6
+ const out: DataView = Porffor.allocateBytes(12);
7
+ const outPtr: i32 = Porffor.wasm`local.get ${out}`;
8
+
9
+ let len: i32 = 0;
10
+ let bufferPtr: i32;
11
+
12
+ const type: i32 = Porffor.rawType(arg);
13
+ if (Porffor.fastOr(
14
+ type == Porffor.TYPES.arraybuffer,
15
+ type == Porffor.TYPES.sharedarraybuffer
16
+ )) {
17
+ bufferPtr = Porffor.wasm`local.get ${arg}`;
18
+
19
+ if (arg.detached) throw new TypeError('Constructed DataView with a detached ArrayBuffer');
20
+
21
+ let offset: i32 = 0;
22
+ if (Porffor.rawType(byteOffset) != Porffor.TYPES.undefined) offset = Math.trunc(byteOffset);
23
+ if (offset < 0) throw new RangeError('Invalid DataView byte offset (negative)');
24
+
25
+ Porffor.wasm.i32.store(outPtr, offset, 0, 8);
26
+ Porffor.wasm.i32.store(outPtr, bufferPtr + offset, 0, 4);
27
+
28
+ if (Porffor.rawType(length) == Porffor.TYPES.undefined) {
29
+ const bufferLen: i32 = Porffor.wasm.i32.load(bufferPtr, 0, 0);
30
+ len = bufferLen - byteOffset;
31
+ } else len = Math.trunc(length);
32
+ } else {
33
+ throw new TypeError('First argument to DataView constructor must be an ArrayBuffer');
34
+ }
35
+
36
+ if (len < 0) throw new RangeError('Invalid DataView length (negative)');
37
+ if (len > 4294967295) throw new RangeError('Invalid DataView length (over 32 bit address space)');
38
+
39
+ Porffor.wasm.i32.store(outPtr, len, 0, 0);
40
+ return out;
41
+ };
42
+
43
+ export const __DataView_prototype_buffer$get = (_this: DataView) => {
44
+ const out: ArrayBuffer = Porffor.wasm.i32.load(_this, 0, 4) - Porffor.wasm.i32.load(_this, 0, 8);
45
+ return out;
46
+ };
47
+
48
+ export const __DataView_prototype_byteLength$get = (_this: DataView) => {
49
+ return Porffor.wasm.i32.load(_this, 0, 0);
50
+ };
51
+
52
+ export const __DataView_prototype_byteOffset$get = (_this: DataView) => {
53
+ return Porffor.wasm.i32.load(_this, 0, 8);
54
+ };
55
+
56
+
57
+ export const __DataView_prototype_getUint8 = (_this: DataView, byteOffset: number) => {
58
+ const len: i32 = Porffor.wasm.i32.load(_this, 0, 0);
59
+ if (Porffor.fastOr(byteOffset < 0, byteOffset >= len)) throw new RangeError('Byte offset is out of bounds of the DataView');
60
+
61
+ Porffor.wasm`
62
+ local.get ${_this}
63
+ i32.to_u
64
+ i32.load 0 4
65
+ local.get ${byteOffset}
66
+ i32.to_u
67
+ i32.add
68
+ i32.load8_u 0 4
69
+ i32.from_u
70
+ i32.const 0
71
+ return`;
72
+ };
73
+
74
+ export const __DataView_prototype_setUint8 = (_this: DataView, byteOffset: number, value: number) => {
75
+ const len: i32 = Porffor.wasm.i32.load(_this, 0, 0);
76
+ if (Porffor.fastOr(byteOffset < 0, byteOffset >= len)) throw new RangeError('Byte offset is out of bounds of the DataView');
77
+
78
+ Porffor.wasm`
79
+ local.get ${_this}
80
+ i32.to_u
81
+ i32.load 0 4
82
+ local.get ${byteOffset}
83
+ i32.to_u
84
+ i32.add
85
+ local.get ${value}
86
+ i32.to_u
87
+ i32.store8 0 4`;
88
+
89
+ return undefined;
90
+ };
91
+
92
+ export const __DataView_prototype_getInt8 = (_this: DataView, byteOffset: number) => {
93
+ const n: i32 = __DataView_prototype_getUint8(_this, byteOffset);
94
+ return n & 0x80 ? n ^ -0x100 : n;
95
+ };
96
+
97
+ export const __DataView_prototype_setInt8 = (_this: DataView, byteOffset: number, value: number) => {
98
+ return __DataView_prototype_setUint8(_this, byteOffset, value < 0 ? value | 0x100 : value);
99
+ };
100
+
101
+
102
+ export const __DataView_prototype_getUint16 = (_this: DataView, byteOffset: number, littleEndian: any) => {
103
+ const len: i32 = Porffor.wasm.i32.load(_this, 0, 0);
104
+ if (Porffor.fastOr(byteOffset < 0, byteOffset + 1 >= len)) throw new RangeError('Byte offset is out of bounds of the DataView');
105
+
106
+ let byte1: i32 = 0, byte2: i32 = 0;
107
+ Porffor.wasm`local ptr i32
108
+ local.get ${_this}
109
+ i32.to_u
110
+ i32.load 0 4
111
+ local.get ${byteOffset}
112
+ i32.to_u
113
+ i32.add
114
+ local.set ptr
115
+
116
+ local.get ptr
117
+ i32.load8_u 0 4
118
+ i32.from_u
119
+ local.set ${byte1}
120
+ local.get ptr
121
+ i32.load8_u 0 5
122
+ i32.from_u
123
+ local.set ${byte2}`;
124
+
125
+ if (Boolean(littleEndian)) return byte1 | (byte2 << 8);
126
+ return (byte1 << 8) | byte2;
127
+ };
128
+
129
+ export const __DataView_prototype_setUint16 = (_this: DataView, byteOffset: number, value: number, littleEndian: any) => {
130
+ const len: i32 = Porffor.wasm.i32.load(_this, 0, 0);
131
+ if (Porffor.fastOr(byteOffset < 0, byteOffset + 1 >= len)) throw new RangeError('Byte offset is out of bounds of the DataView');
132
+
133
+ let byte1: i32 = 0, byte2: i32 = 0;
134
+ if (littleEndian) {
135
+ byte1 = value & 0xff;
136
+ byte2 = (value >>> 8) & 0xff;
137
+ } else {
138
+ byte1 = (value >>> 8) & 0xff;
139
+ byte2 = value & 0xff;
140
+ }
141
+
142
+ Porffor.wasm`local ptr i32
143
+ local.get ${_this}
144
+ i32.to_u
145
+ i32.load 0 4
146
+ local.get ${byteOffset}
147
+ i32.to_u
148
+ i32.add
149
+ local.set ptr
150
+
151
+ local.get ptr
152
+ local.get ${byte1}
153
+ i32.to_u
154
+ i32.store8 0 4
155
+ local.get ptr
156
+ local.get ${byte2}
157
+ i32.to_u
158
+ i32.store8 0 5`;
159
+
160
+ return undefined;
161
+ };
162
+
163
+ export const __DataView_prototype_getInt16 = (_this: DataView, byteOffset: number, littleEndian: any) => {
164
+ const n: i32 = __DataView_prototype_getUint16(_this, byteOffset, littleEndian);
165
+ return n & 0x8000 ? n ^ -0x10000 : n;
166
+ };
167
+
168
+ export const __DataView_prototype_setInt16 = (_this: DataView, byteOffset: number, value: number, littleEndian: any) => {
169
+ return __DataView_prototype_setUint16(_this, byteOffset, value < 0 ? value | 0x10000 : value, littleEndian);
170
+ };
171
+
172
+
173
+ export const __DataView_prototype_getUint32 = (_this: DataView, byteOffset: number, littleEndian: any) => {
174
+ const len: i32 = Porffor.wasm.i32.load(_this, 0, 0);
175
+ if (Porffor.fastOr(byteOffset < 0, byteOffset + 3 >= len)) throw new RangeError('Byte offset is out of bounds of the DataView');
176
+
177
+ let byte1: i32 = 0, byte2: i32 = 0, byte3: i32 = 0, byte4: i32 = 0;
178
+ Porffor.wasm`local ptr i32
179
+ local.get ${_this}
180
+ i32.to_u
181
+ i32.load 0 4
182
+ local.get ${byteOffset}
183
+ i32.to_u
184
+ i32.add
185
+ local.set ptr
186
+
187
+ local.get ptr
188
+ i32.load8_u 0 4
189
+ i32.from_u
190
+ local.set ${byte1}
191
+ local.get ptr
192
+ i32.load8_u 0 5
193
+ i32.from_u
194
+ local.set ${byte2}
195
+ local.get ptr
196
+ i32.load8_u 0 6
197
+ i32.from_u
198
+ local.set ${byte3}
199
+ local.get ptr
200
+ i32.load8_u 0 7
201
+ i32.from_u
202
+ local.set ${byte4}`;
203
+
204
+ if (Boolean(littleEndian)) return byte1 | (byte2 << 8) | (byte3 << 16) | (byte4 << 24);
205
+ return (byte1 << 24) | (byte2 << 16) | (byte3 << 8) | byte4;
206
+ };
207
+
208
+ export const __DataView_prototype_setUint32 = (_this: DataView, byteOffset: number, value: number, littleEndian: any) => {
209
+ const len: i32 = Porffor.wasm.i32.load(_this, 0, 0);
210
+ if (Porffor.fastOr(byteOffset < 0, byteOffset + 3 >= len)) throw new RangeError('Byte offset is out of bounds of the DataView');
211
+
212
+ let byte1: i32 = 0, byte2: i32 = 0, byte3: i32 = 0, byte4: i32 = 0;
213
+ if (littleEndian) {
214
+ byte1 = value & 0xff;
215
+ byte2 = (value >>> 8) & 0xff;
216
+ byte3 = (value >>> 16) & 0xff;
217
+ byte4 = (value >>> 24) & 0xff;
218
+ } else {
219
+ byte1 = (value >>> 24) & 0xff;
220
+ byte2 = (value >>> 16) & 0xff;
221
+ byte3 = (value >>> 8) & 0xff;
222
+ byte4 = value & 0xff;
223
+ }
224
+
225
+ Porffor.wasm`local ptr i32
226
+ local.get ${_this}
227
+ i32.to_u
228
+ i32.load 0 4
229
+ local.get ${byteOffset}
230
+ i32.to_u
231
+ i32.add
232
+ local.set ptr
233
+
234
+ local.get ptr
235
+ local.get ${byte1}
236
+ i32.to_u
237
+ i32.store8 0 4
238
+ local.get ptr
239
+ local.get ${byte2}
240
+ i32.to_u
241
+ i32.store8 0 5
242
+ local.get ptr
243
+ local.get ${byte3}
244
+ i32.to_u
245
+ i32.store8 0 6
246
+ local.get ptr
247
+ local.get ${byte4}
248
+ i32.to_u
249
+ i32.store8 0 7`;
250
+
251
+ return undefined;
252
+ };
253
+
254
+ export const __DataView_prototype_getInt32 = (_this: DataView, byteOffset: number, littleEndian: any) => {
255
+ const n: i32 = __DataView_prototype_getUint32(_this, byteOffset, littleEndian);
256
+ return n & 0x80000000 ? n ^ -0x100000000 : n;
257
+ };
258
+
259
+ export const __DataView_prototype_setInt32 = (_this: DataView, byteOffset: number, value: number, littleEndian: any) => {
260
+ return __DataView_prototype_setUint32(_this, byteOffset, value < 0 ? value | 0x100000000 : value, littleEndian);
261
+ };
@@ -58,6 +58,8 @@ type PorfforGlobal = {
58
58
  bytestring: i32;
59
59
  date: i32;
60
60
  set: i32;
61
+
62
+ [key: string]: i32;
61
63
  }
62
64
 
63
65
  clone(source: any, destination: any): void;