porffor 0.37.17 → 0.37.19
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.
@@ -489,36 +489,37 @@ export const __Porffor_object_define = (obj: any, key: any, value: any, flags: i
|
|
489
489
|
|
490
490
|
if ((tail & 0b0010) == 0) {
|
491
491
|
// not already configurable, check to see if we can redefine
|
492
|
-
|
493
|
-
|
494
|
-
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
Porffor.wasm`
|
492
|
+
let err: boolean = false;
|
493
|
+
|
494
|
+
// descriptor type (accessor/data) and/or flags (other than writable) have changed
|
495
|
+
if ((tail & 0b0111) != (flags & 0b0111)) err = true;
|
496
|
+
|
497
|
+
if (!err && (tail & 0b1001) == 0) {
|
498
|
+
// data descriptor and already non-writable only checks
|
499
|
+
// trying to change writable false -> true
|
500
|
+
if (flags & 0b1000) {
|
501
|
+
err = true;
|
502
|
+
} else {
|
503
|
+
// if already non-writable, check value isn't being changed
|
504
|
+
Porffor.wasm`
|
506
505
|
local.get ${entryPtr}
|
507
506
|
f64.load 0 4
|
508
|
-
local.get ${value}
|
509
|
-
f64.ne
|
510
|
-
|
511
507
|
local.get ${entryPtr}
|
512
508
|
i32.load8_u 0 13
|
509
|
+
|
510
|
+
local.get ${value}
|
513
511
|
local.get ${value+1}
|
514
|
-
|
515
|
-
|
512
|
+
|
513
|
+
call __Object_is
|
514
|
+
drop
|
515
|
+
|
516
|
+
i32.trunc_sat_f64_u
|
517
|
+
i32.eqz
|
516
518
|
local.set ${err}`;
|
517
|
-
}
|
518
519
|
}
|
519
|
-
|
520
|
-
if (err) throw new TypeError('Cannot redefine property');
|
521
520
|
}
|
521
|
+
|
522
|
+
if (err) throw new TypeError('Cannot redefine property');
|
522
523
|
}
|
523
524
|
}
|
524
525
|
|
@@ -91,7 +91,7 @@ params:[127,127,127,127,124,127],typedParams:1,returns:[124,127],typedReturns:1,
|
|
91
91
|
locals:[127,127,127,127,127,127,127,127,127],localNames:["obj","obj#type","key","key#type","value","value#type","#last_type","entryPtr","flags","#logicinner_tmp","#typeswitch_tmp1","size","tail","set","funcFlags"],
|
92
92
|
};
|
93
93
|
this.__Porffor_object_define = {
|
94
|
-
wasm:(_,{t,builtin,internalThrow})=>[[32,1],[65,7],[71],[4,64],[32,0],[184],[32,1],[16,builtin('__Porffor_object_makeObject')],[33,8],[252,2],[34,0],[32,8],[33,1],[26],[32,1],[65,7],[71],[4,64],[65,0],[65,128,1],[15],[11],[11],[32,0],[32,1],[32,2],[32,3],[16,builtin('__Porffor_object_lookup')],[33,8],[34,9],[65,127],[70],[4,64],[32,0],[32,1],[16,builtin('__Porffor_object_isInextensible')],[33,8],[33,10],[32,8],[33,11],[2,127],...t([67,195],()=>[[32,11],[65,195,0],[70],[32,11],[65,195,1],[70],[114],[4,64],[32,10],[40,1,0],[12,1],[11]]),[32,10],[11],[4,64],...internalThrow(_,'TypeError',`Cannot define property, object is inextensible`),[11],[32,0],[40,0,0],[33,12],[32,0],[32,12],[65,1],[106],[54,0,0],[32,0],[65,5],[106],[32,12],[65,14],[108],[106],[34,9],[65,1],[32,2],[32,3],[16,builtin('__Porffor_object_writeKey')],[33,8],[26],[5],[32,9],[47,0,12],[34,13],[65,2],[113],[69],[4,64],[
|
94
|
+
wasm:(_,{t,builtin,internalThrow})=>[[32,1],[65,7],[71],[4,64],[32,0],[184],[32,1],[16,builtin('__Porffor_object_makeObject')],[33,8],[252,2],[34,0],[32,8],[33,1],[26],[32,1],[65,7],[71],[4,64],[65,0],[65,128,1],[15],[11],[11],[32,0],[32,1],[32,2],[32,3],[16,builtin('__Porffor_object_lookup')],[33,8],[34,9],[65,127],[70],[4,64],[32,0],[32,1],[16,builtin('__Porffor_object_isInextensible')],[33,8],[33,10],[32,8],[33,11],[2,127],...t([67,195],()=>[[32,11],[65,195,0],[70],[32,11],[65,195,1],[70],[114],[4,64],[32,10],[40,1,0],[12,1],[11]]),[32,10],[11],[4,64],...internalThrow(_,'TypeError',`Cannot define property, object is inextensible`),[11],[32,0],[40,0,0],[33,12],[32,0],[32,12],[65,1],[106],[54,0,0],[32,0],[65,5],[106],[32,12],[65,14],[108],[106],[34,9],[65,1],[32,2],[32,3],[16,builtin('__Porffor_object_writeKey')],[33,8],[26],[5],[32,9],[47,0,12],[34,13],[65,2],[113],[69],[4,64],[65,0],[33,14],[32,13],[65,7],[113],[32,6],[65,7],[113],[71],[4,64],[65,1],[33,14],[11],[32,14],[69],[34,15],[4,127],[32,13],[65,9],[113],[69],[65,2],[33,8],[5],[32,15],[65,2],[33,8],[11],[33,10],[32,8],[33,11],[2,127],...t([67,195],()=>[[32,11],[65,195,0],[70],[32,11],[65,195,1],[70],[114],[4,64],[32,10],[40,1,0],[12,1],[11]]),[32,10],[11],[4,64],[32,6],[65,8],[113],[4,64],[65,1],[33,14],[5],[32,9],[43,0,4],[32,9],[45,0,13],[32,4],[32,5],[16,builtin('__Object_is')],[26],[252,3],[69],[33,14],[11],[11],[32,14],[4,64],...internalThrow(_,'TypeError',`Cannot redefine property`),[11],[11],[11],[32,9],[32,4],[57,0,4],[32,9],[32,6],[32,5],[65,8],[116],[106],[59,0,12],[65,0],[65,128,1],[15]],
|
95
95
|
params:[127,127,127,127,124,127,127,127],typedParams:1,returns:[127,127],typedReturns:1,
|
96
96
|
locals:[127,127,127,127,127,127,127,127],localNames:["obj","obj#type","key","key#type","value","value#type","flags","flags#type","#last_type","entryPtr","#logicinner_tmp","#typeswitch_tmp1","size","tail","err","logictmp"],
|
97
97
|
};
|
package/compiler/codegen.js
CHANGED
@@ -2955,12 +2955,12 @@ const generateVarDstr = (scope, kind, pattern, init, defaultValue, global) => {
|
|
2955
2955
|
let symbols = {};
|
2956
2956
|
|
2957
2957
|
for (const x of init.arguments[1].properties) {
|
2958
|
-
const name = x.key.name;
|
2958
|
+
const name = x.key.name || x.key.value;
|
2959
2959
|
if (!usedNames.includes(name)) continue;
|
2960
2960
|
|
2961
2961
|
let parameters, result;
|
2962
2962
|
for (const y of x.value.properties) {
|
2963
|
-
switch (y.key.name) {
|
2963
|
+
switch (y.key.name || y.key.value) {
|
2964
2964
|
case 'parameters':
|
2965
2965
|
parameters = y.value.elements.map(z => z.value);
|
2966
2966
|
break;
|
@@ -6399,4 +6399,4 @@ export default program => {
|
|
6399
6399
|
// console.log([...usedTypes].map(x => TYPE_NAMES[x]));
|
6400
6400
|
|
6401
6401
|
return { funcs, globals, tags, exceptions, pages, data };
|
6402
|
-
};
|
6402
|
+
};
|
package/compiler/pgo.js
CHANGED
@@ -197,7 +197,7 @@ export const run = obj => {
|
|
197
197
|
}
|
198
198
|
}
|
199
199
|
|
200
|
-
log += ` ${func.name}: identified ${counts[2]}/${total}
|
200
|
+
log += ` ${func.name}: identified ${counts[2]}/${total} non-consistent locals domains${Prefs.verbosePgo ? ':' : ''}\n`;
|
201
201
|
if (Prefs.verbosePgo) {
|
202
202
|
for (let j = func.params.length; j < localData[i].length; j++) {
|
203
203
|
if (domains[j] === false) continue;
|
package/package.json
CHANGED