porffor 0.21.3 → 0.21.4
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.
@@ -279,6 +279,20 @@ export const __Object_is = (x: any, y: any): boolean => {
|
|
279
279
|
return false;
|
280
280
|
};
|
281
281
|
|
282
|
+
export const __Object_create = (proto: any, props: any) => {
|
283
|
+
if (!Porffor.object.isObject(proto)) {
|
284
|
+
if (proto !== null) throw new TypeError('Prototype should be an object or null');
|
285
|
+
}
|
286
|
+
|
287
|
+
const out: object = {};
|
288
|
+
|
289
|
+
// todo: set prototype when supported
|
290
|
+
|
291
|
+
if (props !== undefined) __Object_defineProperties(out, props);
|
292
|
+
|
293
|
+
return out;
|
294
|
+
};
|
295
|
+
|
282
296
|
|
283
297
|
export const __Object_prototype_toString = (_this: object) => {
|
284
298
|
let out: bytestring = '[object Object]';
|
@@ -1713,6 +1713,12 @@ export const BuiltinFuncs = function() {
|
|
1713
1713
|
returns: [124,127], typedReturns: 1,
|
1714
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
1715
|
};
|
1716
|
+
this.__Object_create = {
|
1717
|
+
wasm: (scope, {builtin,internalThrow}) => [[32,0],[252,2],[32,1],[16, ...builtin('__Porffor_object_isObject')],[33,4],[183],[33,5],[32,4],[33,6],[2,124],[32,6],[65,195,0],[70],[4,64,"TYPESWITCH|String"],[32,5],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,6],[65,195,1],[70],[4,64,"TYPESWITCH|ByteString"],[32,5],[252,3],[40,1,0],[69],[184],[12,1],[11],[32,5],[68,0,0,0,0,0,0,0,0],[97],[184],[11,"TYPESWITCH_end"],[252,3],[4,64],[32,0],[68,0,0,0,0,0,0,0,0],[98],[32,1],[65,128,1],[114],[65,7],[65,128,1],[114],[71],[114],[4,64],...internalThrow(scope, 'TypeError', `Prototype should be an object or null`),[11],[11],[16, ...builtin('__Porffor_allocate')],[184],[33,7],[32,2],[68,0,0,0,0,0,0,0,0],[98],[32,3],[65,128,1],[114],[65,128,1],[65,128,1],[114],[71],[114],[4,64],[32,7],[65,7],[32,2],[32,3],[16, ...builtin('__Object_defineProperties')],[33,4],[26],[11],[32,7],[65,7],[15]],
|
1718
|
+
params: [124,127,124,127], typedParams: 1,
|
1719
|
+
returns: [124,127], typedReturns: 1,
|
1720
|
+
locals: [127,124,127,124], localNames: ["proto","proto#type","props","props#type","#last_type","#logicinner_tmp","#typeswitch_tmp","out"],
|
1721
|
+
};
|
1716
1722
|
this.__Object_prototype_toString = {
|
1717
1723
|
wasm: (scope, {allocPage}) => [...number(allocPage(scope, 'bytestring: __Object_prototype_toString/out', 'i8') * pageSize, 124),[34,2],[65,195,1],[15]],
|
1718
1724
|
params: [124,127], typedParams: 1,
|
package/package.json
CHANGED