efront 4.36.6 → 4.37.0
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/#/345/233/275/351/231/205/345/214/226.yml +9 -0
- package/apps/pivot/db/config.xht +1 -0
- package/apps/pivot/main.js +1 -0
- package/apps/pivot/todo/edit.xht +0 -1
- package/apps/pivot/todo/list.xht +12 -8
- package/coms/basic/#loader.js +0 -1
- package/coms/basic/SAFE_CIRCLE_DEPTH.js +1 -0
- package/coms/basic/cross_.js +6 -4
- package/coms/basic/encode62.js +3 -3
- package/coms/basic/math.md +1 -1
- package/coms/basic/randomUUID.js +17 -0
- package/coms/basic/verifyUUID.js +18 -0
- package/coms/basic_/&power.js +1 -1
- package/coms/basic_/JSON.js +4 -3
- package/coms/basic_/JSON_test.js +19 -11
- package/coms/compile/Javascript.js +16 -12
- package/coms/compile/auto-const.js +55 -16
- package/coms/compile/autoprop.js +274 -0
- package/coms/compile/common.js +81 -8
- package/coms/compile/const_test.js +2 -1
- package/coms/compile/downLevel.js +2 -2
- package/coms/compile/getMaped.js +25 -21
- package/coms/compile/namelist.js +4 -0
- package/coms/compile/scanner.js +21 -13
- package/coms/compile/scanner_test.js +11 -10
- package/coms/compile/translate.js +1 -1
- package/coms/crypt/encode62.js +3 -3
- package/coms/pivot/DB.js +9 -0
- package/coms/pivot/todo.xht +2 -1
- package/coms/reptile/cross.js +8 -1
- package/coms/zimoli/popup.js +8 -1
- package/coms/zimoli/scrollbar.js +5 -2
- package/coms/zimoli/scrollbar.less +26 -2
- package/coms/zimoli/table.less +3 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/public//346/226/207/344/273/266/347/263/273/347/273/237//344/270/273/351/241/265.jsp +2 -2
|
@@ -40,6 +40,15 @@
|
|
|
40
40
|
- zh-CN: 禁用
|
|
41
41
|
en: Disable
|
|
42
42
|
|
|
43
|
+
- zh-CN: $1数据库不存在!
|
|
44
|
+
en: The $1 database does not exist!
|
|
45
|
+
|
|
46
|
+
- zh-CN: 数据已过期!
|
|
47
|
+
en: The data has expired!
|
|
48
|
+
|
|
49
|
+
- zh-CN: 未登录脚本可写
|
|
50
|
+
en: Unregistered script can be written
|
|
51
|
+
|
|
43
52
|
- zh-CN: 加载$1失败,引用队列为
|
|
44
53
|
en: "Loading $1 failed, reference queue is"
|
|
45
54
|
|
package/apps/pivot/db/config.xht
CHANGED
package/apps/pivot/main.js
CHANGED
package/apps/pivot/todo/edit.xht
CHANGED
package/apps/pivot/todo/list.xht
CHANGED
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
icon: "fa-plus",
|
|
104
104
|
sign: "+",
|
|
105
105
|
do() {
|
|
106
|
-
|
|
106
|
+
edit();
|
|
107
107
|
},
|
|
108
108
|
}
|
|
109
109
|
]);
|
|
@@ -112,16 +112,20 @@
|
|
|
112
112
|
var target = getTargetIn(a => a.tagName === 'TODO', event.target);
|
|
113
113
|
if (!target) return;
|
|
114
114
|
var obj = $scoped.get(target).m;
|
|
115
|
-
autodragchildren.hook(target, event, true, function (index, targetBox) {
|
|
115
|
+
autodragchildren.hook(target, event, true, async function (index, targetBox) {
|
|
116
116
|
var state = targetBox.state;
|
|
117
117
|
if (obj.state === state) return;
|
|
118
|
+
var state_ = obj.state;
|
|
118
119
|
obj.state = state;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
120
|
+
try {
|
|
121
|
+
await DB.update("待办", {
|
|
122
|
+
name: obj.name,
|
|
123
|
+
id: obj.id,
|
|
124
|
+
state: state
|
|
125
|
+
});
|
|
126
|
+
} catch {
|
|
127
|
+
obj.state = state_;
|
|
128
|
+
}
|
|
125
129
|
});
|
|
126
130
|
})
|
|
127
131
|
var edit = function (m) {
|
package/coms/basic/#loader.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
300
|
package/coms/basic/cross_.js
CHANGED
|
@@ -180,12 +180,14 @@ function cross_(jsonp, digest = noop, method, url, headers) {
|
|
|
180
180
|
var flush = function () {
|
|
181
181
|
var then = xhr.then;
|
|
182
182
|
delete xhr.then;
|
|
183
|
-
if (loaded)
|
|
184
|
-
|
|
185
|
-
if (loaded || errored) {
|
|
186
|
-
onloads.splice(0, onloads.length);
|
|
183
|
+
if (loaded) {
|
|
184
|
+
onloads.splice(0, onloads.length).forEach(e => e instanceof Function && e.call(xhr, xhr));
|
|
187
185
|
onerrors.splice(0, onerrors.length);
|
|
188
186
|
}
|
|
187
|
+
if (errored) {
|
|
188
|
+
onerrors.splice(0, onerrors.length).forEach(e => e instanceof Function && e.call(xhr, errored));
|
|
189
|
+
onloads.splice(0, onloads.length);
|
|
190
|
+
}
|
|
189
191
|
xhr.then = then;
|
|
190
192
|
};
|
|
191
193
|
if (/^jsonp/i.test(method)) {
|
package/coms/basic/encode62.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var src = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
|
|
1
|
+
var src = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789".split('');
|
|
2
2
|
var map = {};
|
|
3
|
-
src.
|
|
3
|
+
src.forEach((s, i) => map[s] = i);
|
|
4
4
|
var encode62 = {
|
|
5
5
|
src,
|
|
6
6
|
map,
|
|
@@ -19,7 +19,7 @@ var encode62 = {
|
|
|
19
19
|
geta(string) {
|
|
20
20
|
string = String(string)
|
|
21
21
|
string = string.length + string + "2017-08-19";
|
|
22
|
-
var buff = src.
|
|
22
|
+
var buff = src.slice();
|
|
23
23
|
for (var cx = 0, dx = buff.length + src.length, sl = string.length, cl = buff.length; cx < dx; cx++) {
|
|
24
24
|
var s1 = string.charCodeAt(cx % sl) % cl;
|
|
25
25
|
var s2 = cx % cl;
|
package/coms/basic/math.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# 数学公式生成工具
|
|
2
|
-
在2023年及以后的浏览器(Chrome109, Firefox1, Safari5.1, ...)
|
|
2
|
+
在2023年及以后的浏览器(Chrome109, Firefox1, Safari5.1, ...)中可用,但最终展示效果在所有浏览器上均不一致。截止至2026年6月17日,安卓手机及苹果手机上复杂公式会洋相百出,桌面浏览器chrome以及同核心的其他套壳浏览器可以无异常展示,Firefox上求和公式的块级样式异常,Safari上方程组样式异常。
|
|
3
3
|
受支持的浏览器参考 [https://developer.mozilla.org/zh-CN/docs/Web/MathML](https://developer.mozilla.org/zh-CN/docs/Web/MathML)
|
|
4
4
|
使用方法有如下两种:
|
|
5
5
|
1. 直接传入解析结构
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
function randomUUID(sign) {
|
|
2
|
+
var random = crypto.getRandomValues(new Uint16Array(6));
|
|
3
|
+
var mask = 0;
|
|
4
|
+
for (var cx = 0, dx = sign.length + random.length; cx < dx; cx++) {
|
|
5
|
+
mask = (mask << 5 | mask >>> 27) ^ sign.charCodeAt((cx + random[cx % 6]) % dx);
|
|
6
|
+
}
|
|
7
|
+
mask = mask >>> 0;
|
|
8
|
+
return [
|
|
9
|
+
(0x100000000 + mask).toString(16).slice(1),
|
|
10
|
+
(0x10000 | random[0]).toString(16).slice(1),
|
|
11
|
+
(0x10000 | random[1]).toString(16).slice(1),
|
|
12
|
+
(0x10000 | random[2]).toString(16).slice(1),
|
|
13
|
+
(0x10000 | 0xffff & (random[3] ^ mask)).toString(16).slice(1) +
|
|
14
|
+
(0x10000 | 0xffff & (random[4] ^ mask)).toString(16).slice(1) +
|
|
15
|
+
(0x10000 | 0xffff & (random[5] ^ mask)).toString(16).slice(1),
|
|
16
|
+
].join("-");
|
|
17
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
function validUUID(uuid, sign) {
|
|
2
|
+
var match = /^([0-9a-f]{8})\-([0-9a-f]{4})\-([0-9a-f]{4})\-([0-9a-f]{4})\-([0-9a-f]{4})([0-9a-f]{4})([0-9a-f]{4})$/i.exec(uuid);
|
|
3
|
+
if (!match) return false;
|
|
4
|
+
var random = new Uint16Array(6);
|
|
5
|
+
var mask = parseInt(match[1], 16);
|
|
6
|
+
random[0] = parseInt(match[2], 16);
|
|
7
|
+
random[1] = parseInt(match[3], 16);
|
|
8
|
+
random[2] = parseInt(match[4], 16);
|
|
9
|
+
random[3] = parseInt(match[5], 16) ^ mask & 0xffff;
|
|
10
|
+
random[4] = parseInt(match[6], 16) ^ mask & 0xffff;
|
|
11
|
+
random[5] = parseInt(match[7], 16) ^ mask & 0xffff;
|
|
12
|
+
var mask1 = 0;
|
|
13
|
+
for (var cx = 0, dx = random.length + sign.length; cx < dx; cx++) {
|
|
14
|
+
mask1 = (mask1 << 5 | mask1 >>> 27) ^ sign.charCodeAt((cx + random[cx % 6]) % dx);
|
|
15
|
+
}
|
|
16
|
+
mask1 = mask1 >>> 0;
|
|
17
|
+
return mask === mask1;
|
|
18
|
+
}
|
package/coms/basic_/&power.js
CHANGED
package/coms/basic_/JSON.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var stringify_failed_error_message = "stringify json failed!";
|
|
2
2
|
var parse_failed_error_message = "parse json failed!";
|
|
3
|
+
var strings_decode = strings?.decode;
|
|
3
4
|
var scan_string = function (str, start) {
|
|
4
5
|
if (str.charAt(start) !== "\"")
|
|
5
6
|
return false;
|
|
@@ -11,7 +12,7 @@ var scan_string = function (str, start) {
|
|
|
11
12
|
return false;
|
|
12
13
|
if (match[0] === "\"") break;
|
|
13
14
|
}
|
|
14
|
-
data =
|
|
15
|
+
data = strings_decode(str.slice(start, reg.lastIndex));
|
|
15
16
|
return reg.lastIndex;
|
|
16
17
|
};
|
|
17
18
|
var scan_number = function (str, start) {
|
|
@@ -155,7 +156,7 @@ var parse = function (string) {
|
|
|
155
156
|
data = null;
|
|
156
157
|
return result;
|
|
157
158
|
} else {
|
|
158
|
-
throw parse_failed_error_message;
|
|
159
|
+
throw new Error(parse_failed_error_message);
|
|
159
160
|
}
|
|
160
161
|
};
|
|
161
162
|
|
|
@@ -247,7 +248,7 @@ var getString = function (object, filter, space) {
|
|
|
247
248
|
var v = get(object[key]);
|
|
248
249
|
if (isObject(v)) {
|
|
249
250
|
key1[0] = cx + 1;
|
|
250
|
-
if (objects.indexOf(v) >= 0) throw stringify_failed_error_message;
|
|
251
|
+
if (objects.indexOf(v) >= 0) throw new Error(stringify_failed_error_message);
|
|
251
252
|
objects.push(v);
|
|
252
253
|
keys.push([0]);
|
|
253
254
|
break;
|
package/coms/basic_/JSON_test.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var JSON0 =
|
|
1
|
+
var JSON0 = this.JSON;
|
|
2
2
|
var test = function (JSON) {
|
|
3
3
|
var parse = function (s) {
|
|
4
4
|
try {
|
|
@@ -171,8 +171,7 @@ var test2 = function (JSON) {
|
|
|
171
171
|
assert(JSON.parse(`{/*a*/"1":\r\n2}`), { "1": 2 })
|
|
172
172
|
assert(JSON.parse(`{"1/*a*/":\r\n2}`), { "1/*a*/": 2 })
|
|
173
173
|
}
|
|
174
|
-
var test3 = function (JSON) {
|
|
175
|
-
console.log(JSON, JSON0, JSON === JSON0);
|
|
174
|
+
var test3 = function (JSON, name) {
|
|
176
175
|
var start_time = performance.now();
|
|
177
176
|
for (var cx = 0, dx = 0xffff; cx < dx; cx++) {
|
|
178
177
|
var str = String.fromCodePoint(cx);
|
|
@@ -191,13 +190,22 @@ var test3 = function (JSON) {
|
|
|
191
190
|
process.exit(1);
|
|
192
191
|
}
|
|
193
192
|
}
|
|
194
|
-
console.log(performance.now() - start_time);
|
|
193
|
+
console.log(performance.now() - start_time, name);
|
|
194
|
+
};
|
|
195
|
+
var test4 = function (JSON) {
|
|
196
|
+
var data = {};
|
|
197
|
+
assert(JSON.stringify({ a() { } }), "{}");
|
|
198
|
+
data.refund_amount = data;
|
|
199
|
+
JSON.stringify(data);
|
|
200
|
+
}
|
|
201
|
+
try {
|
|
202
|
+
var JSON1 = require("./JSON.js");
|
|
203
|
+
test2(JSON1);
|
|
204
|
+
test3(JSON1, '替补JSON, basic_/JSON.js');
|
|
205
|
+
test3(JSON0, '原生JSON');
|
|
206
|
+
test3(JSAM, 'JSAM, basic/JSAM');
|
|
207
|
+
test4(JSON1);
|
|
195
208
|
}
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
window.JSON = void 0;
|
|
199
|
-
delete modules.JSON;
|
|
200
|
-
modules.init("JSON", test2);
|
|
201
|
-
modules.init("JSON", test3);
|
|
202
|
-
window.JSON = JSON0;
|
|
209
|
+
catch (e) {
|
|
210
|
+
console.log(e)
|
|
203
211
|
}
|
|
@@ -6,6 +6,7 @@ var backEach = require("../basic/backEach");
|
|
|
6
6
|
var parseNumber = require('../basic/parseNumber');
|
|
7
7
|
var removeFromList = require("../basic/removeFromList");
|
|
8
8
|
var patchname = require("./patchname");
|
|
9
|
+
var autoprop = require("./autoprop");
|
|
9
10
|
const {
|
|
10
11
|
/* 1 */COMMENT,
|
|
11
12
|
/* 2 */SPACE,
|
|
@@ -490,7 +491,7 @@ function detour(o, ie) {
|
|
|
490
491
|
var [, varname] = match;
|
|
491
492
|
o.hidden = varname;
|
|
492
493
|
}
|
|
493
|
-
text = text.replace(/\.([^\.\[\!\=\:]+)/g, (_, a) => ie === undefined || context.strap_reg.test(a) || /#/.test(a) ? `[${
|
|
494
|
+
text = text.replace(/\.([^\.\[\!\=\:]+)/g, (_, a) => ie === undefined || context.strap_reg.test(a) || /#/.test(a) ? `[${autoprop(a)}]` : _);
|
|
494
495
|
if (hasdot) text = "..." + text;
|
|
495
496
|
o.text = text;
|
|
496
497
|
break;
|
|
@@ -582,25 +583,27 @@ function detour(o, ie) {
|
|
|
582
583
|
if (o.text === 'static' && o.next && o.next.type === SCOPED && o.next.entry === '{') break;
|
|
583
584
|
if (/^\[/.test(o.text)) break;
|
|
584
585
|
if (o.queue.isObject) {
|
|
585
|
-
var text =
|
|
586
|
+
var text = null;
|
|
586
587
|
if (ie === undefined || o.prev && (o.prev.type !== STAMP || o.prev.text !== ",") || context.strap_reg.test(o.text)) {
|
|
587
|
-
text = `[${text}]
|
|
588
|
+
text = scan(`[${autoprop(o.text)}]`)[0];
|
|
589
|
+
text.isprop = true;
|
|
588
590
|
}
|
|
589
591
|
else if (ie !== false) {
|
|
590
|
-
collectProperty(o, text);
|
|
592
|
+
collectProperty(o, o.text = strings.recode(o.text));
|
|
591
593
|
}
|
|
592
|
-
if (
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
594
|
+
if (text) {
|
|
595
|
+
if (o.short) {
|
|
596
|
+
unshort(o, text);
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
replace(o, o = text);
|
|
600
|
+
}
|
|
597
601
|
}
|
|
598
602
|
}
|
|
599
603
|
else if (o.queue.isClass) {
|
|
600
604
|
if (o.text === 'constructor') break;
|
|
601
605
|
var hidden = /^#/.test(o.text);
|
|
602
606
|
if (hidden) o.hidden = true;
|
|
603
|
-
var text = strings.recode(o.text);
|
|
604
607
|
if (o.prev) {
|
|
605
608
|
var prev = o.prev;
|
|
606
609
|
if (prev && prev.isprop && !prev.isend && propresolve_reg.test(prev.text)) {
|
|
@@ -609,7 +612,8 @@ function detour(o, ie) {
|
|
|
609
612
|
if (prev && prev.type === STAMP && prev.isprop) prev = prev.prev;
|
|
610
613
|
if (prev && (prev.type !== STAMP || prev.text !== ';')) insertAfter(prev, { text: ';', type: STAMP });
|
|
611
614
|
}
|
|
612
|
-
o
|
|
615
|
+
replace(o, o = scan(`[${autoprop(o.text)}]`)[0]);
|
|
616
|
+
o.isprop = true;
|
|
613
617
|
if (o.next && o.next.type === SCOPED && o.next.entry === "(") { }
|
|
614
618
|
else if (!o.next || o.next.type !== STAMP || o.next.text !== "=") {
|
|
615
619
|
insertAfter(o, { text: "=", type: STAMP }, { text: "undefined", type: VALUE, isExpress: true });
|
|
@@ -700,7 +704,7 @@ var removeImport = function (c, i, code) {
|
|
|
700
704
|
var da = d.attributes[i][0];
|
|
701
705
|
if (used[dn]) used[dn].forEach(u => {
|
|
702
706
|
if (used[name].indexOf(u) >= 0) return;
|
|
703
|
-
patchname(name, u, da);
|
|
707
|
+
patchname(name, u, "." + da);
|
|
704
708
|
if (u.kind !== 'remove') used[name].push(u);
|
|
705
709
|
});
|
|
706
710
|
delete used[dn];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var isConst = a => a.kind === 'const';
|
|
2
2
|
var autoiota = require("./autoiota");
|
|
3
|
+
var autoprop = require("./autoprop");
|
|
3
4
|
var removeFromList = require("../basic/removeFromList");
|
|
4
5
|
var scanner2 = require("./scanner2");
|
|
5
6
|
var strings = require("../basic/strings");
|
|
@@ -29,6 +30,9 @@ var getExported = function (code) {
|
|
|
29
30
|
a.name = a.origin;
|
|
30
31
|
consts.push(a);
|
|
31
32
|
}
|
|
33
|
+
else {
|
|
34
|
+
autoprop.addHideExp(a);
|
|
35
|
+
}
|
|
32
36
|
}
|
|
33
37
|
return consts;
|
|
34
38
|
};
|
|
@@ -54,7 +58,7 @@ var getAssignedConst = function (a, used) {
|
|
|
54
58
|
}
|
|
55
59
|
var findConsts = function (code) {
|
|
56
60
|
var consts = getExported(code);
|
|
57
|
-
if (!consts) return;
|
|
61
|
+
if (!consts || !consts.length) return;
|
|
58
62
|
autoiota(code);
|
|
59
63
|
var used = code.used;
|
|
60
64
|
var vmap = Object.create(null);
|
|
@@ -62,7 +66,7 @@ var findConsts = function (code) {
|
|
|
62
66
|
var name = a.name;
|
|
63
67
|
if (/[\.\[]/.test(name)) continue;
|
|
64
68
|
var c = getAssignedConst(a, used);
|
|
65
|
-
if (c) vmap[name] = c;
|
|
69
|
+
if (c) vmap[name] = [c.type, c.text, c.isdigit];
|
|
66
70
|
}
|
|
67
71
|
return vmap;
|
|
68
72
|
};
|
|
@@ -80,8 +84,9 @@ var setEnvDefinedConsts = function (used, k, v) {
|
|
|
80
84
|
else {
|
|
81
85
|
insertBefore(a, comment);
|
|
82
86
|
}
|
|
83
|
-
a.type = v
|
|
84
|
-
a.text = v
|
|
87
|
+
a.type = v[0];
|
|
88
|
+
a.text = v[1];
|
|
89
|
+
if (v[2]) a.isdigit = true;
|
|
85
90
|
}
|
|
86
91
|
};
|
|
87
92
|
var setMapDefinedConsts = function (used, k, consts) {
|
|
@@ -109,9 +114,9 @@ var setMapDefinedConsts = function (used, k, consts) {
|
|
|
109
114
|
}
|
|
110
115
|
if (!t || !(t in consts)) continue;
|
|
111
116
|
var c = consts[t];
|
|
112
|
-
o.type = c
|
|
113
|
-
o.text = c
|
|
114
|
-
if (c
|
|
117
|
+
o.type = c[0];
|
|
118
|
+
o.text = c[1];
|
|
119
|
+
if (c[2]) o.isdigit = true;
|
|
115
120
|
remove(e);
|
|
116
121
|
continue;
|
|
117
122
|
}
|
|
@@ -120,6 +125,7 @@ var setMapDefinedConsts = function (used, k, consts) {
|
|
|
120
125
|
};
|
|
121
126
|
var getMaped = require("./getMaped");
|
|
122
127
|
var maped = Object.create(null);
|
|
128
|
+
var simples = Object.create(null);
|
|
123
129
|
var loadConsts = function (fullpath, commap) {
|
|
124
130
|
if (fullpath in maped) return maped[fullpath];
|
|
125
131
|
maped[fullpath] = null;
|
|
@@ -129,6 +135,17 @@ var loadConsts = function (fullpath, commap) {
|
|
|
129
135
|
autoConst.call(commap, code, fullpath);
|
|
130
136
|
var consts = findConsts(code);
|
|
131
137
|
maped[fullpath] = consts;
|
|
138
|
+
if (!consts) {
|
|
139
|
+
if (code.isExpressQueue()) {
|
|
140
|
+
var last = code.last;
|
|
141
|
+
while (last?.type === STAMP && last.text === ';') last = last.prev;
|
|
142
|
+
if (!last) return;
|
|
143
|
+
var lp = last.prev;
|
|
144
|
+
if (last.isdigit && (!lp || lp.type === STAMP && /^[,\=]$/.test(lp.text))) {
|
|
145
|
+
simples[fullpath] = [last.type, last.text, last.isdigit];
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
132
149
|
return consts;
|
|
133
150
|
};
|
|
134
151
|
|
|
@@ -140,8 +157,8 @@ var getOnlyString = function (q) {
|
|
|
140
157
|
return t;
|
|
141
158
|
};
|
|
142
159
|
var getCopy = function (o) {
|
|
143
|
-
var a = { type: o
|
|
144
|
-
if (o
|
|
160
|
+
var a = { type: o[0], text: o[1] };
|
|
161
|
+
if (o[2]) a.isdigit = true;
|
|
145
162
|
return a;
|
|
146
163
|
}
|
|
147
164
|
|
|
@@ -181,7 +198,7 @@ var isSimpleEqual = function (exp, o) {
|
|
|
181
198
|
var eq = f.equal;
|
|
182
199
|
return eq === f.next && eq?.next === o;
|
|
183
200
|
}
|
|
184
|
-
var setRequiredConsts = function (code, upath, commap) {
|
|
201
|
+
var setRequiredConsts = function (code, upath, commap, propable) {
|
|
185
202
|
var requires = code.used.require;
|
|
186
203
|
if (!requires) return code;
|
|
187
204
|
var used = code.used;
|
|
@@ -191,7 +208,13 @@ var setRequiredConsts = function (code, upath, commap) {
|
|
|
191
208
|
var t = getOnlyString(q);
|
|
192
209
|
if (!t) continue;
|
|
193
210
|
var p = getMaped(upath, commap, t);
|
|
194
|
-
if (!p)
|
|
211
|
+
if (!p) {
|
|
212
|
+
if (propable) {
|
|
213
|
+
r._debug = code._debug;
|
|
214
|
+
autoprop.addKeepEnv(r);
|
|
215
|
+
}
|
|
216
|
+
continue;
|
|
217
|
+
}
|
|
195
218
|
var consts = loadConsts(p, commap);
|
|
196
219
|
if (!consts) continue;
|
|
197
220
|
var exp = pickAssignment(r);
|
|
@@ -225,7 +248,7 @@ var setRequiredConsts = function (code, upath, commap) {
|
|
|
225
248
|
}
|
|
226
249
|
return code;
|
|
227
250
|
}
|
|
228
|
-
|
|
251
|
+
var proped = new Set();
|
|
229
252
|
var autoConst = function (code, fullpath, ignoreImported) {
|
|
230
253
|
var vmap = this?.["&"];
|
|
231
254
|
var { envs, used, envs } = code;
|
|
@@ -239,22 +262,38 @@ var autoConst = function (code, fullpath, ignoreImported) {
|
|
|
239
262
|
continue;
|
|
240
263
|
}
|
|
241
264
|
}
|
|
242
|
-
var mmap = this?.["
|
|
265
|
+
var mmap = this?.[":"];
|
|
243
266
|
if (!mmap) return code;
|
|
244
267
|
var url = mmap[fullpath];
|
|
245
268
|
var upath = split(url);
|
|
246
269
|
if (ignoreImported) return code;
|
|
270
|
+
var propable = !proped.has(fullpath);
|
|
271
|
+
if (propable) proped.add(fullpath);
|
|
247
272
|
for (var k in envs) {
|
|
248
273
|
if (k === 'require') {
|
|
249
|
-
setRequiredConsts(code, upath, this);
|
|
274
|
+
setRequiredConsts(code, upath, this, propable);
|
|
250
275
|
continue;
|
|
251
276
|
}
|
|
252
277
|
p = getMaped(upath, this, k);
|
|
253
|
-
if (!p)
|
|
278
|
+
if (!p) {
|
|
279
|
+
if (propable) {
|
|
280
|
+
code._debug = /color\.js$/.test(fullpath);
|
|
281
|
+
if (k !== 'exports') for (var o of used[k]) {
|
|
282
|
+
o._debug = code._debug;
|
|
283
|
+
autoprop.addKeepEnv(o);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
continue;
|
|
287
|
+
}
|
|
254
288
|
var consts = loadConsts(p, this);
|
|
255
|
-
if (!consts)
|
|
289
|
+
if (!consts) {
|
|
290
|
+
var s = simples[p];
|
|
291
|
+
if (s) setEnvDefinedConsts(used, k, s);
|
|
292
|
+
continue;
|
|
293
|
+
}
|
|
256
294
|
setMapDefinedConsts(used, k, consts)
|
|
257
295
|
}
|
|
296
|
+
if (propable) autoprop.addKeepBody(code);
|
|
258
297
|
return code;
|
|
259
298
|
};
|
|
260
299
|
autoConst.loadConsts = loadConsts;
|