porffor 0.57.13 → 0.57.14
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.
- package/compiler/builtins/map.ts +18 -1
- package/compiler/builtins/weakmap.ts +18 -1
- package/compiler/builtins_precompiled.js +435 -411
- package/package.json +1 -1
- package/runtime/index.js +1 -1
package/compiler/builtins/map.ts
CHANGED
@@ -126,4 +126,21 @@ export const __Map_prototype_values = (_this: Map) => {
|
|
126
126
|
};
|
127
127
|
|
128
128
|
export const __Map_prototype_toString = (_this: Map) => '[object Map]';
|
129
|
-
export const __Map_prototype_toLocaleString = (_this: Map) => __Map_prototype_toString(_this);
|
129
|
+
export const __Map_prototype_toLocaleString = (_this: Map) => __Map_prototype_toString(_this);
|
130
|
+
|
131
|
+
// https://github.com/tc39/proposal-upsert
|
132
|
+
export const __Map_prototype_getOrInsert = (_this: Map, key: any, value: any) => {
|
133
|
+
if (!__Map_prototype_has(_this, key)) {
|
134
|
+
__Map_prototype_set(_this, key, value);
|
135
|
+
}
|
136
|
+
|
137
|
+
return __Map_prototype_get(_this, key);
|
138
|
+
};
|
139
|
+
|
140
|
+
export const __Map_prototype_getOrInsertComputed = (_this: Map, key: any, callbackFn: any) => {
|
141
|
+
if (!__Map_prototype_has(_this, key)) {
|
142
|
+
__Map_prototype_set(_this, key, callbackFn(key));
|
143
|
+
}
|
144
|
+
|
145
|
+
return __Map_prototype_get(_this, key);
|
146
|
+
};
|
@@ -34,4 +34,21 @@ export const WeakMap = function (iterable: any): WeakMap {
|
|
34
34
|
};
|
35
35
|
|
36
36
|
export const __WeakMap_prototype_toString = (_this: WeakMap) => '[object WeakMap]';
|
37
|
-
export const __WeakMap_prototype_toLocaleString = (_this: WeakMap) => __WeakMap_prototype_toString(_this);
|
37
|
+
export const __WeakMap_prototype_toLocaleString = (_this: WeakMap) => __WeakMap_prototype_toString(_this);
|
38
|
+
|
39
|
+
// https://github.com/tc39/proposal-upsert
|
40
|
+
export const __WeakMap_prototype_getOrInsert = (_this: WeakMap, key: any, value: any) => {
|
41
|
+
if (!__WeakMap_prototype_has(_this, key)) {
|
42
|
+
__WeakMap_prototype_set(_this, key, value);
|
43
|
+
}
|
44
|
+
|
45
|
+
return __WeakMap_prototype_get(_this, key);
|
46
|
+
};
|
47
|
+
|
48
|
+
export const __WeakMap_prototype_getOrInsertComputed = (_this: WeakMap, key: any, callbackFn: any) => {
|
49
|
+
if (!__WeakMap_prototype_has(_this, key)) {
|
50
|
+
__WeakMap_prototype_set(_this, key, callbackFn(key));
|
51
|
+
}
|
52
|
+
|
53
|
+
return __WeakMap_prototype_get(_this, key);
|
54
|
+
};
|