efront 4.7.3 → 4.8.2
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 +30 -0
- package/apps/pay/alipay-query.jsp +2 -2
- package/apps/pivot/cert/main.xht +1 -1
- package/apps/pivot/cert/orders.xht +7 -1
- package/apps/pivot/home/welcome.js +1 -1
- package/apps/pivot/main.js +1 -0
- package/apps/pivot/wow/root.js +8 -32
- package/coms/basic/Speed.js +0 -1
- package/coms/basic/Timer.js +15 -0
- package/coms/basic/compile_test.js +2 -2
- package/coms/basic/cookie.js +2 -2
- package/coms/basic/lazy_test.js +2 -2
- package/coms/compile/Html.js +23 -6
- package/coms/compile/Html_test.js +9 -1
- package/coms/compile/Javascript.js +48 -30
- package/coms/compile/Program.js +30 -7
- package/coms/compile/audit.js +106 -4
- package/coms/compile/audit_test.js +8 -1
- package/coms/compile/autoenum.js +15 -0
- package/coms/compile/common.js +134 -19
- package/coms/compile/downLevel.js +11 -3
- package/coms/compile/downLevel_test.js +9 -1
- package/coms/compile/prefunc.js +38 -0
- package/coms/compile/scanner.js +4 -4
- package/coms/compile/translate.js +2 -2
- package/coms/compile/unstruct.js +1 -33
- package/coms/compile/unstruct_test.js +8 -8
- package/coms/crypt/encode62.js +1 -1
- package/coms/docs/codetext.xht +2 -0
- package/coms/frame/chat.js +1 -1
- package/coms/kugou/qqjc.js +1 -1
- package/coms/pivot/acme2.js +8 -4
- package/coms/random//350/272/253/344/273/275/350/257/201.js +1 -1
- package/coms/third-party/html2canvas.js +3 -3
- package/coms/zimoli/alert.js +3 -0
- package/coms/zimoli/lazySwap.js +1 -1
- package/coms/zimoli/loading.html +1 -1
- package/coms/zimoli/menuList.js +2 -2
- package/coms/zimoli/remove.js +1 -0
- package/coms/zimoli/sessionStorage.js +1 -1
- package/coms/zimoli/speed_test.js +2 -2
- package/coms/zimoli/zimoli.js +1 -4
- package/docs//345/267/245/345/205/267//345/233/275/351/231/205/345/214/226.xht +19 -9
- package/docs//347/273/204/344/273/266.xht +38 -12
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/apps/pivot/wow/root.less +0 -2
|
@@ -1,3 +1,33 @@
|
|
|
1
|
+
- zh-CN: 这个文件内的测试代码暂不支持
|
|
2
|
+
en: The test code in this file is currently not supported
|
|
3
|
+
|
|
4
|
+
- zh-CN: onback中阻止跳转的功能在新老版本的chrome上及其他不同浏览器上的表现均不一致,建议更换实现方式!
|
|
5
|
+
en: "The function of preventing redirection in onback performs differently on both new and old versions of Chrome, as well as on different browsers. It is recommended to change the implementation method!"
|
|
6
|
+
|
|
7
|
+
- zh-CN: 加载中..
|
|
8
|
+
en: Loading..
|
|
9
|
+
|
|
10
|
+
- zh-CN: 查看
|
|
11
|
+
en: check
|
|
12
|
+
|
|
13
|
+
- zh-CN: 单击生成
|
|
14
|
+
en: Click to generate
|
|
15
|
+
|
|
16
|
+
- zh-CN: 同意
|
|
17
|
+
en: agree
|
|
18
|
+
|
|
19
|
+
- zh-CN: 每行一个,不支持泛域名
|
|
20
|
+
en: "One per line, does not support generic domain names"
|
|
21
|
+
|
|
22
|
+
- zh-CN: 订单状态已更新
|
|
23
|
+
en: Order status updated
|
|
24
|
+
|
|
25
|
+
- zh-CN: 无法通过http服务完成审核
|
|
26
|
+
en: Unable to complete audit through HTTP service
|
|
27
|
+
|
|
28
|
+
- zh-CN: 下载
|
|
29
|
+
en: download
|
|
30
|
+
|
|
1
31
|
- zh-CN: 以后不会再测试是否兼容vue了,也不准备增加对vue3及后续版本的支持,望知悉。
|
|
2
32
|
en: "We will no longer test whether it is compatible with Vue in the future, and we are not planning to add support for Vue3 and subsequent versions. Please be informed."
|
|
3
33
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script serverside>
|
|
2
|
-
var time = Date
|
|
2
|
+
var time = +new Date;
|
|
3
3
|
var out_trade_no = encode62.timedecode(request.id);
|
|
4
4
|
var payed = /^(TRADE_FINISHED|TRADE_SUCCESS)$/i;
|
|
5
5
|
for (var cx = 0, dx = 10; cx < dx; cx++) {
|
|
6
|
-
if (Date
|
|
6
|
+
if (+new Date - time > 30000) return;
|
|
7
7
|
var data = await _runtask("couchdb", 'get', `alipay-log/${out_trade_no}`);
|
|
8
8
|
if (data.return_time || data.notify_time || payed.test(data.trade_status)) return JSON.stringify(data);
|
|
9
9
|
var data1 = await _runtask("alipay-query", out_trade_no);
|
package/apps/pivot/cert/main.xht
CHANGED
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
o.removable = true;
|
|
138
138
|
}
|
|
139
139
|
else {
|
|
140
|
-
if (o.certificate && +o.expires < Date
|
|
140
|
+
if (o.certificate && +o.expires < +new Date) {
|
|
141
141
|
o.removable = true;
|
|
142
142
|
}
|
|
143
143
|
}
|
|
@@ -146,6 +146,12 @@
|
|
|
146
146
|
async auditOrder(o) {
|
|
147
147
|
await acme2.auditOrder(o, setauth);
|
|
148
148
|
if (this.order === o) await this.openOrder(this.order);
|
|
149
|
+
if (this.order.status !== 'pendding') {
|
|
150
|
+
alert(i18n`订单状态已更新`);
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
alert(i18n`无法通过http服务完成审核`, "warn");
|
|
154
|
+
}
|
|
149
155
|
},
|
|
150
156
|
|
|
151
157
|
async finalize(o) {
|
|
@@ -4,7 +4,7 @@ function main() {
|
|
|
4
4
|
renderWithDefaults(page, {
|
|
5
5
|
status: [],
|
|
6
6
|
version: data.from("version"),
|
|
7
|
-
hrtime: data.from("uptime", a => Date
|
|
7
|
+
hrtime: data.from("uptime", a => new Date - a * 1000),
|
|
8
8
|
filterTime,
|
|
9
9
|
async run(id) {
|
|
10
10
|
await new Promise(ok => setTimeout(ok, 2000));
|
package/apps/pivot/main.js
CHANGED
package/apps/pivot/wow/root.js
CHANGED
|
@@ -73,40 +73,12 @@ class File {
|
|
|
73
73
|
p.abort();
|
|
74
74
|
}
|
|
75
75
|
}
|
|
76
|
-
function main() {
|
|
76
|
+
function main(path) {
|
|
77
|
+
var loaded = false;
|
|
77
78
|
var page = explorer$main();
|
|
78
|
-
var backtime = 0;
|
|
79
|
-
page.onback = function () {
|
|
80
|
-
var $scope = this.$scope;
|
|
81
|
-
if (!$scope.pathlist.length) {
|
|
82
|
-
if (Date.now() - backtime < 2022) alert("已是根目录!");
|
|
83
|
-
backtime = Date.now();
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
if ($scope.pathlist) {
|
|
87
|
-
var name = $scope.pathlist.pop();
|
|
88
|
-
var base = data.getInstance("base").base;
|
|
89
|
-
var p = $scope.pathlist.join("/").replace(/^\/+|\/+$/g, '');
|
|
90
|
-
var bp = p ? base + p + '/' : base;
|
|
91
|
-
p = p + '/';
|
|
92
|
-
data.setInstance("pathlist", $scope.pathlist);
|
|
93
|
-
name = name.replace(/^\/+|\/+$/g, '');
|
|
94
|
-
$scope.selected = [{
|
|
95
|
-
name,
|
|
96
|
-
isfolder: true,
|
|
97
|
-
where: p,
|
|
98
|
-
host: base,
|
|
99
|
-
url: bp + name + "/",
|
|
100
|
-
fullpath: p + name + "/",
|
|
101
|
-
type: 'folder'
|
|
102
|
-
}];
|
|
103
|
-
}
|
|
104
|
-
$scope.open();
|
|
105
|
-
return false;
|
|
106
|
-
}
|
|
107
79
|
|
|
108
80
|
extend(page.$scope, {
|
|
109
|
-
pathlist:
|
|
81
|
+
pathlist: path ? path.split('/') : [],
|
|
110
82
|
read(from, start, size) {
|
|
111
83
|
var authorization = data.getSource(data.getInstance("base").base);
|
|
112
84
|
var xhr = cross("get", from.url, { authorization: authorization });
|
|
@@ -116,7 +88,11 @@ function main() {
|
|
|
116
88
|
return xhr;
|
|
117
89
|
},
|
|
118
90
|
load(p) {
|
|
119
|
-
|
|
91
|
+
if (loaded) {
|
|
92
|
+
location.href = "#/wow/root" + p;
|
|
93
|
+
return { then() { } };
|
|
94
|
+
}
|
|
95
|
+
loaded = true;
|
|
120
96
|
var base = data.getInstance("base").base;
|
|
121
97
|
var p = p.replace(/^\/+|\/+$/g, '');
|
|
122
98
|
var bp = p ? base + p + "/" : base;
|
package/coms/basic/Speed.js
CHANGED
|
@@ -105,7 +105,6 @@ inertia.REBOUNDING = 回弹;
|
|
|
105
105
|
inertia.DOCKING = 停靠;
|
|
106
106
|
var performance = this.performance;
|
|
107
107
|
if (!performance || !performance.now) performance = Date;
|
|
108
|
-
var now = performance.now;
|
|
109
108
|
if (!performance.now) performance.now = function () {
|
|
110
109
|
return +new Date;
|
|
111
110
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
class Timer {
|
|
2
|
+
capture = +new Date;
|
|
3
|
+
value = 0;
|
|
4
|
+
pause() {
|
|
5
|
+
this.value += new Date - this.capture;
|
|
6
|
+
this.capture = null;
|
|
7
|
+
}
|
|
8
|
+
resume() {
|
|
9
|
+
this.capture = +new Date;
|
|
10
|
+
}
|
|
11
|
+
valueOf() {
|
|
12
|
+
return this.capture !== null ? this.value + +new Date - this.capture : this.value;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
module.exports = Timer;
|
|
@@ -69,13 +69,13 @@ var assert = require("./assert");
|
|
|
69
69
|
|
|
70
70
|
|
|
71
71
|
function test(test, count) {
|
|
72
|
-
var time = Date
|
|
72
|
+
var time = +new Date;
|
|
73
73
|
if (test instanceof Function) {
|
|
74
74
|
while (count-- > 0) {
|
|
75
75
|
test();
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
return Date
|
|
78
|
+
return new Date - time;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
|
package/coms/basic/cookie.js
CHANGED
|
@@ -12,7 +12,7 @@ var parseCookieFromText = function (cookie) {
|
|
|
12
12
|
break;
|
|
13
13
|
case "max-age":
|
|
14
14
|
k = "expires";
|
|
15
|
-
v = Date
|
|
15
|
+
v = +new Date + v * 1000;
|
|
16
16
|
break;
|
|
17
17
|
}
|
|
18
18
|
info[k] = v;
|
|
@@ -67,7 +67,7 @@ CookieProto.getCookies = function getCookies(domainPath) {
|
|
|
67
67
|
var cookieObject = {};
|
|
68
68
|
var splited = domainPath.split("/");
|
|
69
69
|
var domain = splited[0];
|
|
70
|
-
var now = Date
|
|
70
|
+
var now = +new Date;
|
|
71
71
|
do {
|
|
72
72
|
var copy = splited.slice(0);
|
|
73
73
|
do {
|
package/coms/basic/lazy_test.js
CHANGED
|
@@ -5,10 +5,10 @@ async function test(sch, pending, callsch) {
|
|
|
5
5
|
var wait = t => new Promise(a => setTimeout(a, t));
|
|
6
6
|
var waits = t => wait(t * Math.abs(sch));
|
|
7
7
|
var waite = async (t) => (await waits(t), await wait(pending));
|
|
8
|
-
var count = 0, start = Date
|
|
8
|
+
var count = 0, start = +new Date, time = start;
|
|
9
9
|
var f = lazy(function () {
|
|
10
10
|
count++;
|
|
11
|
-
var now = Date
|
|
11
|
+
var now = +new Date;
|
|
12
12
|
var delta = now - time;
|
|
13
13
|
time = now;
|
|
14
14
|
if (count > 1) assert(delta >= Math.abs(sch), true, '触发间隔' + delta);
|
package/coms/compile/Html.js
CHANGED
|
@@ -46,9 +46,22 @@ var fixElement = function (o) {
|
|
|
46
46
|
}
|
|
47
47
|
o.attributes.forEach(a => {
|
|
48
48
|
if (a.type === PIECE) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
49
|
+
a.text.split(/\s+/).forEach(text => {
|
|
50
|
+
var ps = parseProperty(text);
|
|
51
|
+
for (var cx = 0, dx = ps.length; cx < dx; cx++) {
|
|
52
|
+
if (needValue) break;
|
|
53
|
+
push(ps[cx]);
|
|
54
|
+
}
|
|
55
|
+
ps = ps.slice(cx);
|
|
56
|
+
if (!ps.length);
|
|
57
|
+
else if (ps.length === 1) push(ps[0]);
|
|
58
|
+
else {
|
|
59
|
+
ps.type = QUOTED;
|
|
60
|
+
ps.entry = '"';
|
|
61
|
+
ps.leave = '"';
|
|
62
|
+
push(ps);
|
|
63
|
+
}
|
|
64
|
+
})
|
|
52
65
|
}
|
|
53
66
|
else {
|
|
54
67
|
push(a);
|
|
@@ -66,6 +79,7 @@ class Html extends Javascript {
|
|
|
66
79
|
// inTag = false;
|
|
67
80
|
scriptTags = [];
|
|
68
81
|
ignoreTags = ["SCRIPT", "STYLE"];
|
|
82
|
+
type = ELEMENT;
|
|
69
83
|
}
|
|
70
84
|
var property = new Program;
|
|
71
85
|
property.stamps = "=".split('');
|
|
@@ -93,6 +107,7 @@ Html.prototype.createScoped = function (code) {
|
|
|
93
107
|
var vars = Object.create(null);
|
|
94
108
|
var scriptNodes = [], styleNodes = [], tempNodes = [];
|
|
95
109
|
var inScript = false;
|
|
110
|
+
var noTag = true;
|
|
96
111
|
var run = function (c) {
|
|
97
112
|
switch (c.type) {
|
|
98
113
|
case ELEMENT:
|
|
@@ -100,7 +115,9 @@ Html.prototype.createScoped = function (code) {
|
|
|
100
115
|
c.tagName = c.tag.toUpperCase();
|
|
101
116
|
if (!/^(script|style|template)$/i.test(c.tagName)) {
|
|
102
117
|
fixElement(c);
|
|
118
|
+
noTag = false;
|
|
103
119
|
if (c.attributes) c.attributes.forEach(run);
|
|
120
|
+
noTag = true;
|
|
104
121
|
if (!used[v]) used[v] = [];
|
|
105
122
|
used[v].push(c);
|
|
106
123
|
c.forEach(run);
|
|
@@ -142,7 +159,7 @@ Html.prototype.createScoped = function (code) {
|
|
|
142
159
|
c.forEach(run);
|
|
143
160
|
break;
|
|
144
161
|
}
|
|
145
|
-
if (!c.text) break;
|
|
162
|
+
if (noTag || !c.text) break;
|
|
146
163
|
var t = strings.decode(c.text);
|
|
147
164
|
var p = t.prev;
|
|
148
165
|
var pp = p && p.prev;
|
|
@@ -154,7 +171,7 @@ Html.prototype.createScoped = function (code) {
|
|
|
154
171
|
}
|
|
155
172
|
break;
|
|
156
173
|
case EXPRESS:
|
|
157
|
-
if (inScript)
|
|
174
|
+
if (inScript || noTag) break;
|
|
158
175
|
var t = c.text;
|
|
159
176
|
t = parseExpress(t);
|
|
160
177
|
var envs = createScoped(t).envs;
|
|
@@ -181,7 +198,7 @@ Html.prototype.createScoped = function (code) {
|
|
|
181
198
|
scoped.scripts = scripts;
|
|
182
199
|
scoped.styles = styles;
|
|
183
200
|
var rootNodes = code.filter(a => !/^(script|style)$/i.test(a.tagName) && !(a.type & (SPACE | COMMENT)));
|
|
184
|
-
if (rootNodes.length === 1) {
|
|
201
|
+
if (rootNodes.length === 1 && rootNodes[0].type === ELEMENT) {
|
|
185
202
|
scoped.outerHTML = this.createString(rootNodes);
|
|
186
203
|
var root = rootNodes[0];
|
|
187
204
|
scoped.tagName = root.tagName;
|
|
@@ -2,8 +2,9 @@ var Html = require("./Html");
|
|
|
2
2
|
var test = function (source, pick, value) {
|
|
3
3
|
var h = new Html;
|
|
4
4
|
var b = h.exec(source);
|
|
5
|
+
if (arguments.length === 2) source = pick;
|
|
5
6
|
assert(h.createString(b), source);
|
|
6
|
-
if (
|
|
7
|
+
if (arguments.length === 3) {
|
|
7
8
|
assert(seek(b, pick), value);
|
|
8
9
|
}
|
|
9
10
|
};
|
|
@@ -12,3 +13,10 @@ test("<a>Let's Encrypt</a>");
|
|
|
12
13
|
test("<style>{a-b:2}</style>");
|
|
13
14
|
assert(scanner2("<a>Let's Encrypt</a>", Html).length, 1);
|
|
14
15
|
test('<a href="${i18n``}">Let\'s Encrypt</a>');
|
|
16
|
+
test('加载中..<a class="loading"></a>');
|
|
17
|
+
test('<input ng-model=data.name />');
|
|
18
|
+
test('<input ng-model=data.name/>', '<input ng-model=data.name />');
|
|
19
|
+
test('<!--<input ng-model=data.name/>-->');
|
|
20
|
+
test('<div><!--<input ng-model=data.name/>--></div>');
|
|
21
|
+
test('<div><div>{</div><div>}</div></div>');
|
|
22
|
+
test('<div>${`<div></div>`}</div>');
|
|
@@ -81,25 +81,45 @@ Javascript.prototype.isProperty = function (o) {
|
|
|
81
81
|
return false;
|
|
82
82
|
};
|
|
83
83
|
var setStrapExpress = function (mark_type, mark_text, prop, o, default_type) {
|
|
84
|
-
var temp = o.queue;
|
|
85
|
-
var type = o.type;
|
|
86
84
|
var prev = o.prev;
|
|
87
85
|
if (prev && prev.type === STRAP && /^(?:function|class|let|const|var)$/.test(prev.text)) {
|
|
88
86
|
o.type = EXPRESS;
|
|
89
87
|
return;
|
|
90
88
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
89
|
+
var type = o.type;
|
|
90
|
+
if (type !== STRAP) return;
|
|
91
|
+
var h = snapExpressHead(o);
|
|
92
|
+
var isfunc = h?.prev?.type === STAMP && h.prev.text === '=>';
|
|
93
|
+
var q = o.queue;
|
|
94
|
+
if (isfunc) var pp = h.prev.prev;
|
|
95
|
+
else while (q) {
|
|
96
|
+
h = snapExpressHead(q);
|
|
97
|
+
isfunc = h?.prev?.type === STAMP && h.prev.text === '=>';
|
|
98
|
+
if (isfunc) {
|
|
99
|
+
pp = h.prev.prev;
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
if (q.entry === '(') {
|
|
103
|
+
var pp = q.prev;
|
|
104
|
+
}
|
|
105
|
+
else if (q.entry === "{") a: {
|
|
106
|
+
var p = q.prev;
|
|
107
|
+
if (p) {
|
|
108
|
+
if (p.type === STAMP && p.text === "=>") {
|
|
109
|
+
isfunc = true;
|
|
110
|
+
pp = p.prev;
|
|
111
|
+
break;
|
|
112
|
+
}
|
|
113
|
+
if (p.type === SCOPED && p.entry === "(") {
|
|
114
|
+
pp = p.prev;
|
|
115
|
+
break a;
|
|
116
|
+
}
|
|
97
117
|
}
|
|
98
|
-
|
|
99
|
-
|
|
118
|
+
q = q.queue;
|
|
119
|
+
continue;
|
|
100
120
|
}
|
|
101
121
|
else {
|
|
102
|
-
|
|
122
|
+
q = q.queue;
|
|
103
123
|
continue;
|
|
104
124
|
}
|
|
105
125
|
if (pp && pp.isprop) {
|
|
@@ -112,27 +132,24 @@ var setStrapExpress = function (mark_type, mark_text, prop, o, default_type) {
|
|
|
112
132
|
type = pp && pp.type === mark_type && pp.text === mark_text ? STRAP : EXPRESS;
|
|
113
133
|
break;
|
|
114
134
|
}
|
|
115
|
-
var tn =
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
if (pp && pp.type === EXPRESS) pp = pp.prev;
|
|
120
|
-
if (pp && pp.prev && pp.prev.type === STRAP && pp.prev.text === "function") {
|
|
121
|
-
pp = pp.prev;
|
|
122
|
-
isfunc = true;
|
|
123
|
-
}
|
|
124
|
-
else {
|
|
125
|
-
isfunc = pp && pp.type === STRAP && pp.text === 'function';
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
if (isfunc) {
|
|
129
|
-
var chk = pp[prop];
|
|
130
|
-
type = (chk && chk.type === mark_type && chk.text === mark_text) ? STRAP : EXPRESS;
|
|
135
|
+
var tn = q.next;
|
|
136
|
+
if (tn && tn.type === STAMP && tn.text === '=>') {
|
|
137
|
+
pp = q;
|
|
138
|
+
isfunc = true;
|
|
131
139
|
break;
|
|
132
140
|
}
|
|
133
|
-
|
|
141
|
+
if (pp && pp.type === EXPRESS) pp = pp.prev;
|
|
142
|
+
if (pp && pp.type === STAMP && pp.text === "*") pp = pp.prev;
|
|
143
|
+
isfunc = pp && pp.type === STRAP && pp.text === 'function';
|
|
144
|
+
if (isfunc) break;
|
|
145
|
+
|
|
146
|
+
q = q.queue;
|
|
147
|
+
}
|
|
148
|
+
if (isfunc) {
|
|
149
|
+
var chk = pp[prop];
|
|
150
|
+
type = (chk && chk.type === mark_type && chk.text === mark_text) ? STRAP : EXPRESS;
|
|
134
151
|
}
|
|
135
|
-
if (!
|
|
152
|
+
if (!q) type = default_type;
|
|
136
153
|
o.type = type;
|
|
137
154
|
}
|
|
138
155
|
var setYieldExpress = setStrapExpress.bind(null, STAMP, "*", 'next');
|
|
@@ -338,7 +355,6 @@ Javascript.prototype.detectLabel = function (o) {
|
|
|
338
355
|
}
|
|
339
356
|
if (inExpress !== queue.inExpress) {
|
|
340
357
|
o.isExpress = queue.inExpress = inExpress;
|
|
341
|
-
if (o.text === 'async') console.log(o.isExpress, queue.isExpress, 'label');
|
|
342
358
|
}
|
|
343
359
|
}
|
|
344
360
|
|
|
@@ -347,6 +363,8 @@ Javascript.prototype.setType = function (o) {
|
|
|
347
363
|
var last = o.prev;
|
|
348
364
|
if (o.type === EXPRESS && /^\.[^\.]|^\.$/.test(o.text) && last && last.type === STAMP && last.text === "?") {
|
|
349
365
|
last.type = EXPRESS;
|
|
366
|
+
var q = o.queue;
|
|
367
|
+
q.question--;
|
|
350
368
|
return false;
|
|
351
369
|
}
|
|
352
370
|
if (last) {
|
package/coms/compile/Program.js
CHANGED
|
@@ -15,7 +15,6 @@ const {
|
|
|
15
15
|
number_reg,
|
|
16
16
|
} = require("./common");
|
|
17
17
|
var combine = require("../basic/combine");
|
|
18
|
-
|
|
19
18
|
var sortRegExpSource = function (a, b) {
|
|
20
19
|
if (a.indexOf(b) >= 0) return -1;
|
|
21
20
|
if (b.indexOf(a) >= 0) return 1;
|
|
@@ -24,8 +23,9 @@ var sortRegExpSource = function (a, b) {
|
|
|
24
23
|
var createQuotedMap = function (entry) {
|
|
25
24
|
var map = {};
|
|
26
25
|
var end = {};
|
|
27
|
-
entry.forEach(
|
|
28
|
-
|
|
26
|
+
entry.forEach(e => {
|
|
27
|
+
if (!(e instanceof Array)) return;
|
|
28
|
+
var [a, b] = e.slice(-2);
|
|
29
29
|
if (a instanceof RegExp) a = stringsFromRegExp(a);
|
|
30
30
|
if (b instanceof RegExp) b = stringsFromRegExp(b);
|
|
31
31
|
combine([].concat(a), [].concat(b)).forEach(([a, b]) => {
|
|
@@ -91,7 +91,7 @@ class Program {
|
|
|
91
91
|
["`", "`", /\\[\s\S]/, ["${", "}"]],
|
|
92
92
|
]
|
|
93
93
|
tags = [
|
|
94
|
-
[["<", "</"], /\/?>/, null,
|
|
94
|
+
[["<", "</"], /\/?>/, null, "'", '"', "<!--", ["${", "}"]]
|
|
95
95
|
];
|
|
96
96
|
scriptTags = [];
|
|
97
97
|
ignoreTags = ["STYLE", "SCRIPT"];
|
|
@@ -149,6 +149,7 @@ class Program {
|
|
|
149
149
|
var lasttype;
|
|
150
150
|
var Code = this.Code;
|
|
151
151
|
var queue = new Code();
|
|
152
|
+
queue.type = this.type;
|
|
152
153
|
var origin = queue;
|
|
153
154
|
var forceend_reg = this.forceend_reg;
|
|
154
155
|
var program = this;
|
|
@@ -343,6 +344,7 @@ class Program {
|
|
|
343
344
|
break loop;
|
|
344
345
|
}
|
|
345
346
|
var m = match[0];
|
|
347
|
+
|
|
346
348
|
index = match.index + m.length;
|
|
347
349
|
if (quote.tag && queue.inTag === 0) {
|
|
348
350
|
if (openTag()) {
|
|
@@ -373,6 +375,7 @@ class Program {
|
|
|
373
375
|
}
|
|
374
376
|
break;
|
|
375
377
|
}
|
|
378
|
+
if (!quote.entry) continue;
|
|
376
379
|
a: if (quote.tag) {
|
|
377
380
|
var mi = quote.tag.indexOf(m);
|
|
378
381
|
if (mi < 0) {
|
|
@@ -405,6 +408,19 @@ class Program {
|
|
|
405
408
|
continue loop;
|
|
406
409
|
}
|
|
407
410
|
if (m in this.quote_map) {
|
|
411
|
+
if (this.comment_entry.test(m)) {
|
|
412
|
+
push_piece();
|
|
413
|
+
var start = match.index;
|
|
414
|
+
var comment = this.quote_map[m];
|
|
415
|
+
comment.lastIndex = index;
|
|
416
|
+
do {
|
|
417
|
+
var match = comment.reg.exec(text);
|
|
418
|
+
} while (match && !comment.end.test(match[0]));
|
|
419
|
+
if (match) end = index = match.index + match[0].length;
|
|
420
|
+
m = text.slice(start, index);
|
|
421
|
+
save(COMMENT);
|
|
422
|
+
continue loop;
|
|
423
|
+
}
|
|
408
424
|
if (queue.tag && !queue.inTag) continue;
|
|
409
425
|
push_piece();
|
|
410
426
|
var scope = [];
|
|
@@ -441,7 +457,14 @@ class Program {
|
|
|
441
457
|
}
|
|
442
458
|
}
|
|
443
459
|
if (this.stamp_reg.test(m) && last) {
|
|
444
|
-
if ((VALUE | EXPRESS) & last.type)
|
|
460
|
+
if ((VALUE | EXPRESS) & last.type) {
|
|
461
|
+
if (queue.type !== ELEMENT) break test;
|
|
462
|
+
var lp = last.prev;
|
|
463
|
+
if (lp) {
|
|
464
|
+
if (lp.type === STAMP && lp.text !== ';') break test;
|
|
465
|
+
if (lp.type === STRAP && lp.transive) break test;
|
|
466
|
+
}
|
|
467
|
+
}
|
|
445
468
|
if (last.type === QUOTED && !last.tag) break test;
|
|
446
469
|
if (last.type === SCOPED && queue.inExpress) break test;
|
|
447
470
|
if (lasttype === STAMP && m === last.text) break test;
|
|
@@ -685,8 +708,8 @@ class Program {
|
|
|
685
708
|
}
|
|
686
709
|
return this.compile(q);
|
|
687
710
|
});
|
|
688
|
-
if (q.tag) r = r.concat(q.tag
|
|
689
|
-
r = r.concat(ts.map(this.compile)).join("|");
|
|
711
|
+
if (q.tag) r = r.concat(q.tag);
|
|
712
|
+
r = r.concat(ts.map(this.compile)).sort(sortRegExpSource).join("|");
|
|
690
713
|
q.reg = new RegExp(r, 'g');
|
|
691
714
|
q.end = this.createRegExp([q[1]]);
|
|
692
715
|
if (q.length >= 4) {
|