porffor 0.60.13 → 0.60.15
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/date.ts +33 -44
- package/compiler/builtins/object.ts +15 -16
- package/compiler/builtins_precompiled.js +460 -455
- package/compiler/codegen.js +7 -5
- package/foo.js +26 -1
- package/package.json +1 -1
- package/runtime/index.js +1 -1
package/compiler/codegen.js
CHANGED
@@ -2197,20 +2197,22 @@ const createThisArg = (scope, decl) => {
|
|
2197
2197
|
if (name && name.startsWith('__')) {
|
2198
2198
|
let node = null;
|
2199
2199
|
|
2200
|
-
|
2200
|
+
// hack: default this value for primitives, do here instead of inside funcs via ToObject/etc
|
2201
|
+
// todo: Object should not be included
|
2202
|
+
const obj = name.slice(2, name.indexOf('_', 2));
|
2203
|
+
if (name.includes('_prototype_') && ['Object', 'String', 'Boolean', 'Number'].includes(obj)) {
|
2201
2204
|
node = {
|
2202
2205
|
type: 'NewExpression',
|
2203
2206
|
callee: {
|
2204
2207
|
type: 'Identifier',
|
2205
|
-
name:
|
2208
|
+
name: obj
|
2206
2209
|
},
|
2207
|
-
arguments: []
|
2208
|
-
_new: true
|
2210
|
+
arguments: []
|
2209
2211
|
};
|
2210
2212
|
} else {
|
2211
2213
|
node = {
|
2212
2214
|
type: 'Identifier',
|
2213
|
-
name:
|
2215
|
+
name: obj
|
2214
2216
|
};
|
2215
2217
|
|
2216
2218
|
if (ifIdentifierErrors(scope, node)) node = null;
|
package/foo.js
CHANGED
@@ -1 +1,26 @@
|
|
1
|
-
|
1
|
+
const foo = {
|
2
|
+
get x() {
|
3
|
+
console.log('get x');
|
4
|
+
return 42;
|
5
|
+
}
|
6
|
+
};
|
7
|
+
|
8
|
+
const bar = { ...foo };
|
9
|
+
console.log(bar);
|
10
|
+
|
11
|
+
// const foo = {};
|
12
|
+
// Object.defineProperty(foo, 'wow', {
|
13
|
+
// value: 2,
|
14
|
+
// writable: false,
|
15
|
+
// enumerable: true,
|
16
|
+
// configurable: true,
|
17
|
+
// });
|
18
|
+
|
19
|
+
// const bar = {
|
20
|
+
// set wow(v) {
|
21
|
+
// console.log('set wow', v);
|
22
|
+
// },
|
23
|
+
// ...foo,
|
24
|
+
// };
|
25
|
+
|
26
|
+
// console.log(bar);
|
package/package.json
CHANGED