efront 3.34.4 → 3.34.6

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.
Binary file
@@ -1,4 +1,4 @@
1
- var page = div();
1
+ var page = document.createElement("page");
2
2
  page.initialStyle = 'transform:scale(.9);opacity:0;';
3
3
  var tags = "新歌:song/list:音乐总有新玩法,排行:rank/list:排行榜 - 酷狗音乐,歌单:plist/list:歌单 - 酷狗音乐,歌手:singer/keywords:歌手分类 - 酷狗音乐".split(",").map(function (tag, cx) {
4
4
  var [str, url, title] = tag.split(":");
@@ -0,0 +1,93 @@
1
+ document.createElement = function (document, createElement, defineProperty) {
2
+ var setHTML = function (v) {
3
+ v = String(v);
4
+ var nodePath = [this], currentNode = this;
5
+ v.replace(/<\!\-\-[\s\S]*?(?:\-\-\!?>|$)|<(?:[^>'"]+|(["'])(?:\\[\s\S]|[\s\S])*?\1)*>|[^<]+/g, function (m, q, index) {
6
+ var tagCloseIndex = index + m.length + 3;
7
+ var isComment = /^<\!\-\-/.test(m);
8
+ var tag = /^<([^\s]+)([\s\S]*)\/?>/.exec(m);
9
+ var isTextNode = !tag;
10
+ if (isComment || isTextNode) {
11
+ if (v.charAt(tagCloseIndex - 1) !== '/' || v.slice(tagCloseIndex, tagCloseIndex + currentNode.tagName.length).toUpperCase() !== currentNode.tagName.toUpperCase()) {
12
+ currentNode = nodePath[nodePath.length - 1];
13
+ }
14
+ }
15
+ if (isComment) {
16
+ var comment = document.createComment(m.replace(/^<\!\-\-|\-\-\!?>$/g, ''));
17
+ currentNode.appendChild(comment);
18
+ return;
19
+ }
20
+ if (isTextNode) {
21
+ var textNode = document.createTextNode(m);
22
+ currentNode.appendChild(textNode);
23
+ return;
24
+ }
25
+ var tagName = tag[1];
26
+ if (/^[!?]/.test(tagName)) return;
27
+ if (tagName.charAt(0) === "/") {
28
+ tagName = tagName.slice(1).toUpperCase();
29
+ while (currentNode && currentNode.tagName.toUpperCase() !== tagName) currentNode = nodePath.pop();
30
+ if (currentNode === nodePath[nodePath.length - 1]) nodePath.pop();
31
+ return;
32
+ }
33
+ currentNode = nodePath[nodePath.length - 1];
34
+ tagName = tagName.replace(/\/$/, '');
35
+ var element = createElement.call(document, tagName);
36
+ var attributes = tag[2].trim();
37
+ if (attributes) attributes.replace(/([^\s\'\"\=\/]+)(?:\s*\=\s*((['"])(?:\\[\s\S]|[\s\S])*?\3|\S+))?/g, function (_, name, value) {
38
+ if (value) value = value.replace(/^['"]|["']$/g, '').replace(/\\([\s\S])/, '$1');
39
+ else value = '';
40
+ element.setAttribute(name, value);
41
+ })
42
+ currentNode.appendChild(element);
43
+ if (!/^(input|meta|link|img)$/i.test(tagName) && !/\/\>$/.test(tag)) {
44
+ nodePath.push(element);
45
+ };
46
+ currentNode = element;
47
+ });
48
+ };
49
+ var getHTML = function () {
50
+ /**
51
+ * @type {NodeList}
52
+ */
53
+ var childNodes = this.childNodes;
54
+ var text = [];
55
+ for (var cx = 0, dx = childNodes.length; cx < dx; cx++) {
56
+ var c = childNodes[cx];
57
+ switch (c.nodeType === 8) {
58
+ case 8: text.push("<!", "-", "-", c.nodeValue, "-", "-", ">"); continue;
59
+ case 3: text.push('"', c.nodeValue.replace(/[\\"]/g, "\\$&"), '"'); continue;
60
+ case 1:
61
+ var attributes = c.attributes;
62
+ text.push("<", c.nodeName);
63
+ for (var cy = 0, dy = attributes.length; cy < dy; cy++) {
64
+ var a = attributes[cy];
65
+ text.push(" ", a.name)
66
+ if (a.value) text.push("=\"", a.value.replace(/[\\"]/g, "\\$&"), "\"");
67
+ }
68
+ var innerHTML = c.innerHTML;
69
+ if (!innerHTML && /^(input|meta|link)$/i.test(c.nodeName)) {
70
+ text.push('>');
71
+ continue;
72
+ }
73
+ text.push(">", innerHTML, "</", c.nodeName, ">");
74
+ }
75
+ }
76
+ return text.join('');
77
+ };
78
+ var descriptor = { set: setHTML, get: getHTML };
79
+ return function (tagName) {
80
+ var element = createElement.call(document, tagName);
81
+ if (/^(style|script)$/i.test(element.tagName)) return element;
82
+ defineProperty(element, "innerHTML", descriptor);
83
+ return element;
84
+ };
85
+ }(document, document.createElement, Object.defineProperty);
86
+ Object.defineProperty = function (Object, defineProperty) {
87
+ return function (o, k, v) {
88
+ if (o.nodeType) return defineProperty.call(Object, o, k, v);
89
+ if ("value" in v) {
90
+ return o[k] = v.value;
91
+ }
92
+ }
93
+ }(Object, Object.defineProperty);
@@ -8,9 +8,12 @@
8
8
  <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
9
9
  <meta charset="utf-8" />
10
10
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
11
- <link rel="Shortcut Icon" href="data:image/x-icon;base64,AAABAAEAICAAAAEAIACoEAAAFgAAACgAAAAgAAAAQAAAAAEAIAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAuLi4CMDAwAy4uLgYvLy8JMDAwCzMzMw0zMzMNMzMzDTAwMAwvLy8KLi4uCDAwMAQuLi4CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDAwBC4uLgsuLi4YMDAwKS8vLzwxMTFQMTExYTExMHAxMC57MS8sgTEvK4MxLyuCMS8sfzEwLncxMTBpLy8vWTAwMEYwMDAzLy8vIC8vLxEwMDAGLi4uAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMDAwBC4uLhAvLy8mMTExRDExMWQxMTGEMTExojEvLbsyLinPMi4q3ik3S+khPmrvG0N88RtDf/IfP2/uKDhR5zEvLdsyLijKMS8stTExMJsxMTF7MTExWjExMTouLi4eLi4uDDAwMAIAAAAAAAAAAAAAAAAAAAAAAAAAAC4uLgUwMDAVLy8vKzExMUcxMTFnMTExiDEwLaQyLSW9JTtd3hBOrfUAWuP+AF7t/h9y7v42gu/+OYPw/iR17v4CYe3+AF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WePWPobr/8jl+/7X7v3+0Or9/s/o/f7P6P3+z+j9/s7o/f7O6v3+z+j9/s/o/f7P6P3+0Or9/tbt/f7S7Pz+Vpfu/wBV4uszgOksAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAATZ+SNAFrj/2Od7//I4fv+5/b//uLz/v7g8f7+3vH+/t7x/v7f8f7+4fL+/ub1//7T6fz+c6ny/wdg5f8IX+OpQIbqCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAzfukgCWHjnwBV4/sicuf/Xpru/4W08/+cwvX/ncP1/4u29P9mnu//LXno/wBX4v8IYOSyLnroMgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMn3pBCRz6EcVaOWCC2LjqwBZ4sEAWeLDC2LksRZp5okicedTNH3pCwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA/4AD//gAAB/gAAAHwAAAA8AAAAPAAAAD4AAAB/gAAB/wAAAP4AAAB+AAAAfAAAADwAAAA8AAAAPAAAABgAAAAYAAAAGAAAABgAAAAYAAAAHAAAABwAAAA8AAAAPgAAAD4AAAB/AAAA/wAAAP+AAAH/wAAD//AAB//4AB///gB/8=" type="image/x-icon" />
11
+ <link rel="Shortcut Icon" href="favicon.ico" type="image/x-icon" />
12
12
  <meta name="viewport" content="initial-scale=1,maximum-scale=1,width=device-width" />
13
- <title>酷狗酷你尊享版</title><!-- 这个名字怎么听怎么像骂狗的,你和狗怎么可以放在相同的位置,真是太抬举你了 -->
13
+ <title>酷酷千百易云音乐</title>
14
+ <!--[if IE 8]>
15
+ <script src="ie8.js"></script>
16
+ <![endif]-->
14
17
  <script deleteoncompile efrontloader>
15
18
  // 若要在开发环境使用内置组件,请保留此script标签中的代码,在编译发布时,这里的代码会自动删除
16
19
  </script>
@@ -1,3 +1,4 @@
1
+ var String = window.String;
1
2
  var uncode = function (text) {
2
3
  var ratio = 1;
3
4
  var sum = 0;
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  var window = this;
3
+ var isProduction = true;
4
+ // <!-- isProduction = false -->
5
+
3
6
  var {
4
7
  parseInt,
5
8
  XMLHttpRequest,
6
9
  ActiveXObject,
7
- isProduction = function develop() { return develop.name !== 'develop'; }(),
8
10
  Error,
9
11
  Function,
10
12
  Array,
@@ -18,7 +20,6 @@ var {
18
20
  top,
19
21
  location,
20
22
  Object,
21
- String,
22
23
  console,
23
24
  efrontURI,
24
25
  parseFloat,
@@ -137,9 +138,11 @@ var readFile = function (names, then) {
137
138
  clearTimeout(flush_to_storage_timer);
138
139
  flush_to_storage_timer = setTimeout(saveResponseTreeToStorage, 200);
139
140
  readingCount--;
141
+ // <!--
140
142
  if (readingCount === 0) {
141
143
  killCircle();
142
144
  }
145
+ // -->
143
146
  };
144
147
  var oh = function (e) {
145
148
  if (isProduction) {
@@ -164,7 +167,12 @@ var createFunction = function (name, body, args, isAsync, isYield) {
164
167
 
165
168
  var FILE_NAME_REG = /^https?\:|\.(html?|css|asp|jsp|php)$/i;
166
169
  var loadedModules = {};
170
+ // <!--
171
+ var undefinedModules = {};
167
172
  var killCircle = function () {
173
+ var undefinedkeys = Object.keys(undefinedModules);
174
+ if (undefinedkeys.length) console.warn("已使用 undefined 代替", undefinedkeys.join(", "));
175
+ undefinedModules = {};
168
176
  var penddings = {}, circle = [], module_keys = [];
169
177
  for (var k in loadedModules) {
170
178
  if (k.slice(0, keyprefix.length) === keyprefix && loadedModules[k] instanceof Array) {
@@ -233,10 +241,11 @@ var killCircle = function () {
233
241
  });
234
242
  }
235
243
  };
244
+ // -->
236
245
  var hasOwnProperty = {}.hasOwnProperty;
237
246
  var loadModule = function (name, then, prebuilds = {}) {
238
247
  if (/^(?:module|exports|define|require|window|global|undefined|__dirname|__filename)$/.test(name)) return then();
239
- if ((name in prebuilds) || hasOwnProperty.call(modules, name) || (!/^on/.test(name) && window[name] !== null && window[name] !== void 0 && !hasOwnProperty.call(forceRequest, name))
248
+ if ((hasOwnProperty.call(prebuilds, name)) || hasOwnProperty.call(modules, name) || (!/^on/.test(name) && window[name] !== null && window[name] !== void 0 && !hasOwnProperty.call(forceRequest, name))
240
249
  ) return then();
241
250
  preLoad(name);
242
251
  var key = keyprefix + name;
@@ -276,7 +285,9 @@ var loadModule = function (name, then, prebuilds = {}) {
276
285
  flushTree(loadedModules, key);
277
286
  return;
278
287
  }
279
- if (!data) console.log(name, data);
288
+ // <!--
289
+ if (!data) undefinedModules[name] = true;
290
+ // -->
280
291
  var [argNames, body, args, required, strs, isAsync, isYield] = getArgs(data);
281
292
  if (isProduction) {
282
293
  strs = strs.map ? strs.map(toRem) : strs;
@@ -412,7 +423,7 @@ var createModule = function (exec, originNames, compiledNames, prebuilds = {}) {
412
423
  var required = exec.required;
413
424
  if (required) required = required.map(a => loadedModules[keyprefix + a]);
414
425
  var argsList = originNames.map(function (argName) {
415
- if (argName in prebuilds) {
426
+ if (hasOwnProperty.call(prebuilds, argName)) {
416
427
  return prebuilds[argName];
417
428
  }
418
429
  if (argName === "module") {
@@ -459,7 +470,7 @@ var createModule = function (exec, originNames, compiledNames, prebuilds = {}) {
459
470
  var result, created;
460
471
  if (prebuilds.init) {
461
472
  var prebuilds2 = Object.create(null);
462
- for (var k in prebuilds) prebuilds2[k] = prebuilds[k];
473
+ for (var k in prebuilds) if (hasOwnProperty.call(prebuilds, k)) prebuilds2[k] = prebuilds[k];
463
474
  prebuilds = prebuilds2;
464
475
  delete prebuilds.popup;
465
476
  delete prebuilds.action;
@@ -489,7 +500,7 @@ var init = function (name, then, prebuilds) {
489
500
  // then = bindthen(then);
490
501
  var key = keyprefix + name;
491
502
  if (prebuilds) {
492
- if (name in prebuilds) {
503
+ if (hasOwnProperty.call(prebuilds, name)) {
493
504
  if (then) then(prebuilds[name]);
494
505
  return prebuilds[name];
495
506
  }
@@ -585,7 +596,7 @@ var init = function (name, then, prebuilds) {
585
596
  then(module.created = modules[name] = created);
586
597
  return;
587
598
  }
588
- var filteredArgs = prebuilds ? args.filter(a => !(a in prebuilds)) : args;
599
+ var filteredArgs = prebuilds ? args.filter(a => !hasOwnProperty.call(prebuilds, a)) : args;
589
600
 
590
601
  var saveAsModule = filteredArgs.length === args.length;
591
602
  if (!filteredArgs.length) {
@@ -794,6 +805,7 @@ var loadResponseTreeFromStorage = function () {
794
805
  var preLoad = function () { };
795
806
  var start_time = efront_time / 1000 | 0;
796
807
  var errored = {};
808
+ // modules 的代码不可出现多层
797
809
  var modules = {
798
810
  isProduction,
799
811
  undefined: void 0,
@@ -810,12 +822,12 @@ var modules = {
810
822
  devicePixelRatio,
811
823
  renderPixelRatio,
812
824
  efrontsign: "",
813
- debug() {
814
- document.addEventListener("blur", e => e.stopPropagation(), true);
815
- },
816
- put(name, module) {
817
- modules[name] = module;
818
- },
825
+ };
826
+ modules.debug = function () {
827
+ document.addEventListener("blur", e => e.stopPropagation(), true);
828
+ };
829
+ modules.put = function (name, module) {
830
+ modules[name] = module;
819
831
  };
820
832
  var penddings = {};
821
833
 
@@ -1,4 +1,4 @@
1
- function ArrayFillApply(size, item) {
1
+ function ArrayFill(size, item) {
2
2
  var result = Array(size);
3
3
  for (var cx = 0; cx < size; cx++)result[cx] = item;
4
4
  return result;
@@ -1,5 +1,6 @@
1
1
  var isEmpty = require("./isEmpty");
2
2
  var convertReg = /^(?:object|function)$/;
3
+ var hasOwnProperty = Object.prototype.hasOwnProperty;
3
4
  var check = function (o) {
4
5
  return o === null || typeof o === 'bigint' || o instanceof BigInt || typeof o === 'number' || typeof o === "boolean";
5
6
  };
@@ -260,6 +261,7 @@ function parse(string, preload) {
260
261
  if (!isEmpty(preload)) dist = dist.concat(preload);
261
262
  var preloads_length = dist.length - 1;
262
263
  dist = dist.concat(trimed.slice(1, trimed.length));
264
+
263
265
  for (var cx = 0, dx = marked.length; cx < dx; cx++) {
264
266
  var index = marked[cx];
265
267
  var o = trimed[index];
@@ -276,11 +278,13 @@ function parse(string, preload) {
276
278
  delete o[""];
277
279
  delete o._;
278
280
  if (arr) for (var k in arr) {
279
- t[k] = dist[arr[k]];
281
+ if (hasOwnProperty.call(arr, k)) t[k] = dist[arr[k]];
280
282
  }
281
283
  for (var k in o) {
282
- var v = o[k];
283
- t[dist[k]] = dist[v];
284
+ if (hasOwnProperty.call(o, k)) {
285
+ var v = o[k];
286
+ t[dist[k]] = dist[v];
287
+ }
284
288
  }
285
289
  }
286
290
  if (trimed.length > 1 && typeof trimed[0] === 'number') {
@@ -1,4 +1,4 @@
1
- // 下图来自 https://nodejs.org/dist/latest-v16.x/docs/api/url.html#urlobjectauth
1
+ // 下图来自 https://nodejs.org/dist/latest-v16.x/docs/api/html#urlobjectauth
2
2
  // ┌────────────────────────────────────────────────────────────────────────────────────────────────┐
3
3
  // │ href │
4
4
  // ├──────────┬──┬─────────────────────┬────────────────────────┬───────────────────────────┬───────┤
@@ -19,8 +19,46 @@
19
19
 
20
20
  // -------/// ---------------1---------------------------------///////////////////2-----3--------//////// ------4----2/////5---------------------------------------------------6------------------------------------------------------------------------------------//////////////-7--5///8-------9----------//10--11---10/8/--12----////
21
21
  var reg = /^([^\:\/\\\?#\[]+\:(?![^\:\/\\\?\#]*@|[\/\\][^\/\\]))?(?:\/\/|\\\\)?(?:(([^\:\/\\\?#]+)?(?:\:([^\/\\\?#]+))?)@)?(([^\/\\@\?\#\.]*?[^\/\\@\:\?\#\.\d][^\/\\@\:\?\#\.]*?|[^\/\\@\:\?\#\.]+(?:\:[^\@\/\\\?#\.]*[^\d\@\:\/\\\?#\.]+|(?:\.[^\/\\@\:\?\#\.]+)+))?(?:(?:\:|^)(\d+))?)(((?:\/|\\|^)[^\?#]*)?(\?([^#]*))?)(#[\s\S]*)?$/;
22
- var hrefDescriptor = {
23
- get() {
22
+ class URL {
23
+ locate(url) {
24
+ if (url === undefined || url === null) url = '';
25
+ var [__, protocol, auth, username, password, host, hostname, port, path, pathname, search, query, hash] = reg.exec(url);
26
+ if (protocol) {
27
+ this.protocol = protocol;
28
+ }
29
+ if (host) {
30
+ this.auth = auth;
31
+ this.username = username;
32
+ this.password = password;
33
+ this.host = host;
34
+ this.hostname = hostname;
35
+ this.port = port;
36
+ this.path = path;
37
+ this.pathname = pathname;
38
+ this.search = search;
39
+ this.query = query;
40
+ this.hash = hash;
41
+ }
42
+ else if (pathname) {
43
+ this.path = path;
44
+ this.pathname = pathname;
45
+ this.search = search;
46
+ this.query = query;
47
+ this.hash = hash;
48
+ }
49
+ else if (search) {
50
+ this.search = search;
51
+ this.path = (this.pathname || '') + search;
52
+ this.query = query;
53
+ this.hash = hash;
54
+ }
55
+ else if (hash) {
56
+ this.hash = hash;
57
+ }
58
+ this.href = this.toString();
59
+ return this;
60
+ }
61
+ toString() {
24
62
  var href = '';
25
63
  if (this.protocol) href += this.protocol;
26
64
  if (this.auth) href += "//" + this.auth + "@" + this.host;
@@ -28,19 +66,17 @@ var hrefDescriptor = {
28
66
  if (this.path) href += this.path;
29
67
  if (this.hash) href += this.hash;
30
68
  return href;
31
- },
32
- set(href) {
33
- Object.assign(this, parseURL(href));
34
69
  }
35
- };
36
- function parse(url) {
37
- if (url === undefined || url === null) url = '';
38
- var [__, protocol, auth, username, password, host, hostname, port, path, pathname, search, query, hash] = reg.exec(url);
39
- return { protocol, auth, username, password, host, hostname, port, path, pathname, search, query, hash };
40
70
  }
71
+ // function parse(url) {
72
+ // if (url === undefined || url === null) url = '';
73
+ // var [__, protocol, auth, username, password, host, hostname, port, path, pathname, search, query, hash] = reg.exec(url);
74
+ // return { protocol, auth, username, password, host, hostname, port, path, pathname, search, query, hash };
75
+ // }
41
76
  function parseURL(url) {
42
- var obj = parse(url);
43
- Object.defineProperty(obj, "href", hrefDescriptor);
77
+ var obj = new URL;
78
+ obj.locate(url);
44
79
  return obj;
45
80
  }
81
+ // mdn说__proto__这玩意在deno上不支持,吓我一跳,2023-01-04亲测支持
46
82
  module.exports = parseURL;
@@ -6,15 +6,19 @@ var test = function (url, key, value) {
6
6
  else console.pass(`url:${url}, key:${key}, expect:${value}, result:${parsed[key]}`);
7
7
  };
8
8
 
9
+ test('//efront.cc/kugou', 'pathname', '/kugou')
10
+ test('//efront.cc/kugou', 'host', 'efront.cc')
11
+ test('//efront.cc/kugou', 'href', '//efront.cc/kugou')
9
12
  test('http://efront.cc/kugou', 'pathname', '/kugou')
10
13
  test('http://efront.cc/kugou?a', 'path', '/kugou?a')
14
+ test('http://efront.cc/kugou?a', 'href', 'http://efront.cc/kugou?a')
11
15
  test('http://yunxu1019@live.cn@github.com/?a', 'username', 'yunxu1019@live.cn')
12
16
  test('localhost', 'host', 'localhost')
13
17
  test('localhost:80', 'port', '80')
14
18
  test('localhost:80/', 'port', '80')
15
19
  test('magnet:?xt=::', 'search', '?xt=::')
16
20
  test('magnet:?xt=::', 'protocol', 'magnet:')
17
- test('magnet:?xt=::', 'host', '')
21
+ test('magnet:?xt=::', 'host', undefined)
18
22
  test('magnet:?xt=::', 'pathname', undefined)
19
23
  test('efront.cc', 'host', 'efront.cc')
20
24
  test('127.0.0.1', 'host', '127.0.0.1')
@@ -35,6 +39,7 @@ test('efront.', 'pathname', "efront.")
35
39
  test('http//:80', 'hostname', 'http')
36
40
  test('http//:80', 'pathname', '//:80')
37
41
  test('//h:80', 'host', 'h:80')
42
+ test('//h:80', 'href', '//h:80')
38
43
  test('?80', 'path', '?80')
39
44
  test('?80', 'search', '?80')
40
45
  test('?80', 'query', '80')
@@ -81,7 +81,7 @@ function main(express) {
81
81
  add_exp(str);
82
82
  }
83
83
  lastIndex = match.index + m.length;
84
- if (match[1] !== undefined) {
84
+ if (match[1]) {
85
85
  exp.push(match[1]);
86
86
  }
87
87
  else if (/[\[\{\(]/.test(m)) {
@@ -1,6 +1,6 @@
1
1
  var setPrototypeOf = Object.setPrototypeOf || function (obj, proto) {
2
2
  var hasOwnProperty = Object.prototype.hasOwnProperty;
3
- for (var p in proto) if (!hasOwnProperty.call(obj)) obj[p] = proto[p];
3
+ for (var p in proto) if (hasOwnProperty.call(proto, p) && !(p in obj)) obj[p] = proto[p];
4
4
  return obj;
5
5
  }
6
6
  function Array2() {
@@ -20,11 +20,18 @@ if (window.Promise) {
20
20
  for (var t of threads) {
21
21
  if (t.oked) {
22
22
  for (var r of t.PromiseFulfillReactions) {
23
- r.apply(null, t.oked);
23
+ r.call(null, t.oked[0]);
24
24
  }
25
25
  }
26
26
  if (t.ohed) {
27
- if (!t.PromiseRejectReactions.length) throw t.ohed[0];
27
+ var throwed = t.throwed;
28
+ t.throwed = true;
29
+ if (!throwed && !t.PromiseRejectReactions.length) {
30
+ // <!--
31
+ console.warn("在异步过程中发现未处理的异常:", t.ohed[0], t.ohed[1], t.ohed[2]);
32
+ // -->
33
+ throw t.ohed[0];
34
+ }
28
35
  for (var r of t.PromiseRejectReactions) {
29
36
  r.apply(null, t.ohed);
30
37
  }
@@ -42,21 +49,21 @@ if (window.Promise) {
42
49
  this.PromiseFulfillReactions = []; //thens
43
50
  this.PromiseRejectReactions = []; //catches
44
51
  this.oked = this.ohed = null;
45
-
46
- var ResolvingFunctions_resolve = (result) => { //ok
47
- if (this.oked || this.ohed) return;
52
+ var p = this;
53
+ var ResolvingFunctions_resolve = function (result) { //ok
54
+ if (p.oked || p.ohed) return;
48
55
  if (isThenable(result)) {
49
56
  result.then(ResolvingFunctions_resolve, ResolvingFunctions_reject);
50
57
  } else {
51
- this.oked = arguments;
52
- fire(this);
58
+ p.oked = arguments;
59
+ fire(p);
53
60
  }
54
61
  };
55
62
 
56
- var ResolvingFunctions_reject = (e) => { //oh
57
- if (this.oked || this.ohed) return;
58
- this.ohed = arguments;
59
- fire(this);
63
+ var ResolvingFunctions_reject = function (e) { //oh
64
+ if (p.oked || p.ohed) return;
65
+ p.ohed = arguments;
66
+ fire(p);
60
67
  };
61
68
  executor(ResolvingFunctions_resolve, ResolvingFunctions_reject);
62
69
  };
@@ -69,15 +76,15 @@ if (window.Promise) {
69
76
  a = onok(a);
70
77
  ok(a);
71
78
  } catch (e) {
72
- oh(e);
79
+ oh(e, onok, onoh);
73
80
  }
74
81
  };
75
82
  if (onoh) reject = function (a) {
76
83
  try {
77
- a = onoh(a);
84
+ a = onoh.apply(null, arguments);
78
85
  ok(a);
79
86
  } catch (e) {
80
- oh(e);
87
+ oh(e, onok, onoh);
81
88
  }
82
89
  };
83
90
  })
@@ -5,6 +5,7 @@ var {
5
5
  String,
6
6
  Object,
7
7
  isFinite,
8
+ document,
8
9
  console
9
10
  } = this;
10
11
 
@@ -33,7 +34,7 @@ function forEach(f, o) {
33
34
  }
34
35
  function filter(f, o) {
35
36
  if (!(f instanceof Function)) return;
36
- var result = new this.constructor;
37
+ var result = Object.create(this.constructor.prototype);
37
38
  if (this instanceof String) {
38
39
  result = this.split("").filter(f, o);
39
40
  }
@@ -73,14 +74,37 @@ if (!ArrayProto.filter) ArrayProto.filter = filter;
73
74
  if (!"".trim) String.prototype.trim = trim;
74
75
  if (!Object.keys) Object.keys = keys;
75
76
  if (!Object.create) Object.create = function (object) {
76
- return { __proto__: object };
77
+ if (object === null) {
78
+ // 参考 https://github.com/tarruda/object-create
79
+ var iframe = document.createElement('iframe');
80
+ var parent = document.body || document.documentElement;
81
+ iframe.style.display = 'none';
82
+ parent.appendChild(iframe);
83
+ iframe.src = 'javascript:';
84
+ var empty = iframe.contentWindow.Object.prototype;
85
+ parent.removeChild(iframe);
86
+ iframe = null;
87
+ delete empty.constructor;
88
+ delete empty.hasOwnProperty;
89
+ delete empty.propertyIsEnumerable;
90
+ delete empty.isPrototypeOf;
91
+ delete empty.toLocaleString;
92
+ delete empty.toString;
93
+ delete empty.valueOf;
94
+ return empty;
95
+ };
96
+ var f = function () { };
97
+ f.prototype = object;
98
+ return new f;
77
99
  };
78
100
  if (!Function.prototype.bind) Function.prototype.bind = function (context) {
79
101
  var args = [].slice.call(arguments, 1);
80
102
  var f = this;
81
- return function () {
103
+ var c = function () {
82
104
  var _args = args.slice.call(arguments, 0, arguments.length);
83
105
  args.unshift.apply(_args, args);
84
106
  return f.apply(context === void 0 || context === null ? this : context, _args);
85
107
  };
108
+ c.prototype = this.prototype;
109
+ return c;
86
110
  };
@@ -0,0 +1,83 @@
1
+ # efront 兼容性说明
2
+ * `coms/basic_`目录的代码均为非标准实现,如果你要兼容低版本的运行环境,尽量避免使用高级的功能
3
+ * 已知在转换成低版本代码后与高级版本有区别的语法如下:
4
+ 1. ```javascript
5
+ class ... extends Array {...}
6
+ ```
7
+ 因为如果增加一级原型,数组的特性便会消失,`efront`暂时并没有实现完美的降级方案,未来实现的可能性也不大。类似语句经`typescript`转换后新定义的方法会丢失, `efront` 在降级编译期使用 `class ... extends Array2 {...}` 进行替换,`Array2`会将定义的方法挂载到新生成的对象上。
8
+
9
+ 2. ```javascript
10
+ async function () {
11
+ await ...;
12
+ arguments; // typescript 转换后arguments对象的内容有误
13
+ }
14
+ // 或
15
+ function* (){
16
+ yield ...;
17
+ arguments;
18
+ }
19
+ ```
20
+ 这不是一个难解决的问题,应该只是`typescript`已发现但不愿解决的问题。`efront`在降级编译时临时使用变量重命名的方法对代码中的`arguments`进行替换使其内容与原生高级代码一致。
21
+
22
+ 3. ```javascript
23
+ Object.keys
24
+ Object.create
25
+ Array.prototype.map
26
+ Array.prototype.forEach
27
+ Array.prototype.filter
28
+ Array.prototype.indexOf
29
+ String.prototype.trim// 不同的支持环境实现不一致,大厂对空格的理解不一致
30
+ Function.prototype.bind
31
+ ```
32
+ 以上几个方法`ie9+`系列浏览器已支持,但`ie8`及以下版本不支持,如果没有指定`--no-polyfill`参数`efront`在降级编译期会使用`[]map.js`中提供的方法进行修补,这些方法会在加载器检测到浏览器不支持`[].map`时进行初始化
33
+ 4. ```javascript
34
+ Object.assign
35
+ Array.prototype.fill
36
+ ```
37
+ 以上两个原生方法`ie`系列浏览器均不支持,由于经常被`efront`开发者使用,在降级编译期,如果没有指定`--no-polyfill`参数,将由`efront`处理成替代品,当前的处理方案如下:
38
+ ```javascript
39
+ Object.assign // 由 extend 替代,见 ../basic/extend.js
40
+ Array.prototype.fill //..将按使用的目的进行不同的替换
41
+ Array(3).fill(0) // 类似这种的将变成[0,0,0]一个常量数组
42
+ var [a,b,c]=Array(3).fill(0).map((_,i)=>i+1) // 类似这种用于生成常量并赋值的,将直接变成赋值语句 var a=1,b=2,c=3
43
+ Array(3).fill(a)// 类似这种非常量的,将由类似 ArrayFill(3,a) 的语句替换
44
+ ```
45
+ 5. ```javascript
46
+ Promise
47
+ Promise.prototype.then
48
+ Promise.prototype.catch
49
+ Promise.all
50
+ Promise.race
51
+ Promise.reject
52
+ Promise.resolve
53
+ ```
54
+ `Promise`对象也是`ie`系列浏览器均不支持的。`efront`实现的`Promise`与原生的特性并不一致,仅在运行环境不支持的时候进行替代。比如由`.then`触发的方法与`setTimeout`触发的方法执行的先后顺序会与高级的运行环境有所区别,但也会保持在当前语境执行后再执行相关的语句。以上没有提到的`Promise`相关的方法均不支持,如`Promise.prototype.finally`,如果您使用了这些缺失的特性,就只能自己实现或找类似[core-js](https://github.com/zloirock/core-js)的库填充了
55
+ 6. ```javascript
56
+ obj.if
57
+ obj.catch
58
+ obj.for
59
+ ```
60
+ 类似这种用`.`取属性的语句,由于属性名与`js`的保留字一样,`ie6`等浏览器会报错,但您可以在`efront`提供的环境中放心使用。因为`efront`本身就会把取属性的语句处理掉。
61
+ 7. `ie8`及以下浏览器中存在的一些与现代`js`标准不同的特性,`efront`提供的组件可能不兼容,在处理为这类环境进行应用开发时,应避免使用。
62
+ ```javascript
63
+ Object.defineProperty(...);
64
+ ({
65
+ get a(){},
66
+ set a(){}
67
+ });
68
+ class {
69
+ get a(){}
70
+ set a(){}
71
+ }
72
+ ```
73
+ `ie8`及以下浏览器对`Object.defineProperty`支持的不好或根本不支持,`efront`暂时没有实现这类功能的兼容方案。如果您要兼容相应的环境,请暂时避免使用相关的语句,也不要使用使用了这些特性的库。
74
+ ```javascript
75
+ Array.prototype.slice.call(objNodeList,...)
76
+ ```
77
+ `ie8`及以下浏览器不支持`this`指向`NodeList`等dom对象,而当前`efront`和内部使用的`typescript`转换的代码都没有处理这一细节,所以暂时不要在dom操作相关的语句中使用高级语法,以避免转换后的代码出问题。
78
+ ```javascript
79
+ var div = document.createElement("div");
80
+ div.innerHTML = `<abcd><span></span></abcd>`;
81
+ console.log(div.innerHTML); // <SPAN></SPAN>
82
+ ```
83
+ `ie8`及以下浏览器无法正确地通过`innerHTML`属性设置自定义标签,`efront`提供的大部分组件都使用了这一特性,`efront`示例项目中[ie8.js](../../apps/kugou/ie8.js)可以实现`ie8`上设置`innerHTML`的适配,但不能保证样式正常,对于`ie7`及以下的浏览器,就暂时别用`efront`提供的与元素相关的组件了。