porffor 0.22.11 → 0.24.1
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_objects.js +10 -7
- package/compiler/builtins_precompiled.js +23 -23
- package/compiler/codegen.js +4 -0
- package/package.json +1 -1
- package/runner/index.js +1 -1
@@ -104,7 +104,12 @@ export default function({ builtinFuncs }, Prefs) {
|
|
104
104
|
};
|
105
105
|
|
106
106
|
const builtinFuncKeys = Object.keys(builtinFuncs);
|
107
|
-
const
|
107
|
+
const autoFuncKeys = name => builtinFuncKeys.filter(x => x.startsWith('__' + name + '_')).map(x => x.slice(name.length + 3));
|
108
|
+
const autoFuncs = name => props({
|
109
|
+
writable: true,
|
110
|
+
enumerable: false,
|
111
|
+
configurable: true
|
112
|
+
}, autoFuncKeys(name));
|
108
113
|
|
109
114
|
object('Math', {
|
110
115
|
...props({
|
@@ -126,13 +131,11 @@ export default function({ builtinFuncs }, Prefs) {
|
|
126
131
|
DEG_PER_RAD: 180 / Math.PI
|
127
132
|
}),
|
128
133
|
|
129
|
-
...
|
130
|
-
writable: true,
|
131
|
-
enumerable: false,
|
132
|
-
configurable: true
|
133
|
-
}, autoFuncs('Math'))
|
134
|
+
...autoFuncs('Math')
|
134
135
|
});
|
135
136
|
|
137
|
+
object('Reflect', autoFuncs('Reflect'));
|
138
|
+
|
136
139
|
|
137
140
|
// todo: support when existing func
|
138
141
|
// object('Number', {
|
@@ -174,7 +177,7 @@ export default function({ builtinFuncs }, Prefs) {
|
|
174
177
|
if (!t) continue;
|
175
178
|
|
176
179
|
if (!done.has(name)) {
|
177
|
-
console.log(name);
|
180
|
+
console.log(name, !!builtinFuncs[name]);
|
178
181
|
done.add(name);
|
179
182
|
}
|
180
183
|
}
|