porffor 0.18.6 → 0.18.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.
@@ -5,7 +5,7 @@ export const __String_prototype_trimLeft = (_this: string) => {
|
|
5
5
|
return __String_prototype_trimStart(_this);
|
6
6
|
};
|
7
7
|
|
8
|
-
export const __ByteString_prototype_trimLeft = (_this:
|
8
|
+
export const __ByteString_prototype_trimLeft = (_this: bytestring) => {
|
9
9
|
return __ByteString_prototype_trimStart(_this);
|
10
10
|
};
|
11
11
|
|
@@ -14,6 +14,6 @@ export const __String_prototype_trimRight = (_this: string) => {
|
|
14
14
|
return __String_prototype_trimEnd(_this);
|
15
15
|
};
|
16
16
|
|
17
|
-
export const __ByteString_prototype_trimRight = (_this:
|
17
|
+
export const __ByteString_prototype_trimRight = (_this: bytestring) => {
|
18
18
|
return __ByteString_prototype_trimEnd(_this);
|
19
19
|
};
|
@@ -46,8 +46,6 @@ export const __Array_prototype_slice = (_this: any[], start: number, end: number
|
|
46
46
|
return out;
|
47
47
|
};
|
48
48
|
|
49
|
-
// todo: splice
|
50
|
-
|
51
49
|
// @porf-typed-array
|
52
50
|
export const __Array_prototype_fill = (_this: any[], value: any, start: any, end: any) => {
|
53
51
|
const len: i32 = _this.length;
|
package/compiler/codegen.js
CHANGED
@@ -199,14 +199,8 @@ const generate = (scope, decl, global = false, name = undefined, valueUnused = f
|
|
199
199
|
return out;
|
200
200
|
},
|
201
201
|
|
202
|
-
__Porffor_bs: str =>
|
203
|
-
|
204
|
-
...(name ? setType(scope, name, TYPES.bytestring) : setLastType(scope, TYPES.bytestring))
|
205
|
-
],
|
206
|
-
__Porffor_s: str => [
|
207
|
-
...makeString(scope, str, global, name, false),
|
208
|
-
...(name ? setType(scope, name, TYPES.string) : setLastType(scope, TYPES.string))
|
209
|
-
],
|
202
|
+
__Porffor_bs: str => makeString(scope, str, global, name, true),
|
203
|
+
__Porffor_s: str => makeString(scope, str, global, name, false)
|
210
204
|
};
|
211
205
|
|
212
206
|
const func = decl.tag.name;
|
@@ -1383,7 +1377,11 @@ const getNodeType = (scope, node) => {
|
|
1383
1377
|
|
1384
1378
|
if (node.type === 'TaggedTemplateExpression') {
|
1385
1379
|
// hack
|
1386
|
-
|
1380
|
+
switch (node.tag.name) {
|
1381
|
+
case '__Porffor_wasm': return TYPES.number;
|
1382
|
+
case '__Porffor_bs': return TYPES.bytestring;
|
1383
|
+
case '__Porffor_s': return TYPES.string;
|
1384
|
+
}
|
1387
1385
|
}
|
1388
1386
|
|
1389
1387
|
if (scope.locals['#last_type']) return getLastType(scope);
|
@@ -192,7 +192,7 @@ export const BuiltinFuncs = function() {
|
|
192
192
|
localNames: ["_this","_this#type","#last_type"],
|
193
193
|
};
|
194
194
|
this.__ByteString_prototype_trimLeft = {
|
195
|
-
wasm: (scope, {builtin,}) => [[32,0],[65,
|
195
|
+
wasm: (scope, {builtin,}) => [[32,0],[65,210,0],[16, builtin('__ByteString_prototype_trimStart')],[34,2],[15]],
|
196
196
|
params: [127,127],
|
197
197
|
typedParams: true,
|
198
198
|
returns: [127,127],
|
@@ -210,7 +210,7 @@ export const BuiltinFuncs = function() {
|
|
210
210
|
localNames: ["_this","_this#type","#last_type"],
|
211
211
|
};
|
212
212
|
this.__ByteString_prototype_trimRight = {
|
213
|
-
wasm: (scope, {builtin,}) => [[32,0],[65,
|
213
|
+
wasm: (scope, {builtin,}) => [[32,0],[65,210,0],[16, builtin('__ByteString_prototype_trimEnd')],[34,2],[15]],
|
214
214
|
params: [127,127],
|
215
215
|
typedParams: true,
|
216
216
|
returns: [127,127],
|
package/package.json
CHANGED