porffor 0.21.2 → 0.21.3
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.
@@ -261,6 +261,25 @@ export const __Object_prototype_propertyIsEnumerable = (_this: any, prop: any) =
|
|
261
261
|
};
|
262
262
|
|
263
263
|
|
264
|
+
export const __Object_is = (x: any, y: any): boolean => {
|
265
|
+
if (x === y) {
|
266
|
+
if (x == 0) {
|
267
|
+
// check +0 vs -0
|
268
|
+
return 1 / x == 1 / y;
|
269
|
+
}
|
270
|
+
|
271
|
+
return true;
|
272
|
+
}
|
273
|
+
|
274
|
+
// check NaN
|
275
|
+
if (Porffor.rawType(x) == Porffor.TYPES.number && Number.isNaN(x)) {
|
276
|
+
return Number.isNaN(y);
|
277
|
+
}
|
278
|
+
|
279
|
+
return false;
|
280
|
+
};
|
281
|
+
|
282
|
+
|
264
283
|
export const __Object_prototype_toString = (_this: object) => {
|
265
284
|
let out: bytestring = '[object Object]';
|
266
285
|
return out;
|
@@ -1707,6 +1707,12 @@ export const BuiltinFuncs = function() {
|
|
1707
1707
|
returns: [124,127], typedReturns: 1,
|
1708
1708
|
locals: [124,127,127,124,124,124], localNames: ["_this","_this#type","prop","prop#type","p","p#type","#last_type","t","entryPtr","keys"],
|
1709
1709
|
};
|
1710
|
+
this.__Object_is = {
|
1711
|
+
wasm: (scope, {builtin}) => [[2,127,"string_only"],[32,0],[34,4,"string_only"],[32,2],[34,5,"string_only"],[32,1,"string_only|start"],[65,195,1],[70],[32,3],[65,195,1],[70],[113],[4,64],[32,4],[252,3],[34,6],[32,5],[252,3],[34,8],[71],[4,127],[32,6],[40,0,0],[34,7],[32,8],[40,0,0],[71],[4,64],[65,0],[12,1],[11],[65,0],[33,9],[32,7],[33,10],[3,64],[32,9],[32,6],[106],[45,0,4],[32,9],[32,8],[106],[45,0,4],[71],[4,64],[65,0],[12,2],[11],[32,9],[65,1],[106],[34,9],[32,10],[72],[13,0],[11],[65,1],[5],[65,1],[11],[12,1],[11],[32,1],[65,195,0],[70],[32,1],[65,195,1],[70],[114],[32,3],[65,195,0],[70],[32,3],[65,195,1],[70],[114],[114],[4,64],[32,4],[252,3],[34,6],[32,5],[252,3],[34,8],[71],[4,127],[32,6],[40,0,0],[34,7],[32,8],[40,0,0],[32,1],[65,195,1],[70],[4,64],[32,6],[32,7],[16, ...builtin('__Porffor_bytestringToString')],[33,6],[11],[32,3],[65,195,1],[70],[4,64],[32,8],[32,8],[40,0,0],[16, ...builtin('__Porffor_bytestringToString')],[33,8],[11],[71],[4,64],[65,0],[12,1],[11],[65,0],[33,9],[32,7],[65,2],[108],[33,10],[3,64],[32,9],[32,6],[106],[47,0,4],[32,9],[32,8],[106],[47,0,4],[71],[4,64],[65,0],[12,2],[11],[32,9],[65,2],[106],[34,9],[32,10],[72],[13,0],[11],[65,1],[5],[65,1],[11],[12,1],[11,"string_only|end"],[97],[11,"string_only"],[32,1],[65,128,1],[114],[32,3],[65,128,1],[114],[70],[113],[4,64],[32,0],[68,0,0,0,0,0,0,0,0],[97],[4,64],[68,0,0,0,0,0,0,240,63],[32,0],[163],[68,0,0,0,0,0,0,240,63],[32,2],[163],[97],[184],[65,2],[15],[11],[68,0,0,0,0,0,0,240,63],[65,2],[15],[11],[32,0],[32,1],[16, ...builtin('__Porffor_rawType')],[68,0,0,0,0,0,0,240,63],[97],[184],[34,11],[252,3],[4,124],[32,0],[16, ...builtin('__Number_isNaN')],[65,2],[33,12],[5],[32,11],[65,2],[33,12],[11],[33,13],[32,12],[33,14],[2,127],[32,14],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,13],[252,3],[40,1,0],[12,1],[11],[32,14],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,13],[252,3],[40,1,0],[12,1],[11],[32,13],[252,3],[11,"TYPESWITCH_end"],[4,64],[32,2],[16, ...builtin('__Number_isNaN')],[65,2],[15],[11],[68,0,0,0,0,0,0,0,0],[65,2],[15]],
|
1712
|
+
params: [124,127,124,127], typedParams: 1,
|
1713
|
+
returns: [124,127], typedReturns: 1,
|
1714
|
+
locals: [124,124,127,127,127,127,127,124,127,124,127], localNames: ["x","x#type","y","y#type","__tmpop_left","__tmpop_right","compare_left_pointer","compare_left_length","compare_right_pointer","compare_index","compare_index_end","logictmp","#last_type","#logicinner_tmp","#typeswitch_tmp"],
|
1715
|
+
};
|
1710
1716
|
this.__Object_prototype_toString = {
|
1711
1717
|
wasm: (scope, {allocPage}) => [...number(allocPage(scope, 'bytestring: __Object_prototype_toString/out', 'i8') * pageSize, 124),[34,2],[65,195,1],[15]],
|
1712
1718
|
params: [124,127], typedParams: 1,
|
package/package.json
CHANGED