efront 2.42.2 → 2.43.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.
package/.editorconfig ADDED
@@ -0,0 +1,5 @@
1
+ # EditorConfig is awesome: https://EditorConfig.org
2
+ root = true
3
+ [*]
4
+ indent_style = space
5
+ indent_size = 4
@@ -0,0 +1 @@
1
+ console.log('regexp',RegExp)
@@ -5,4 +5,5 @@ function isEmpty(value) {
5
5
  return true;
6
6
  }
7
7
  return false;
8
- }
8
+ }
9
+ module.exports = isEmpty;
@@ -1,5 +1,5 @@
1
- // -----///////// -1 ----------////////////2---3-----/////// --4------2//////5------6-----////////-7--5///8--9----//10--11---10///--12-----8//
2
- var reg = /^([^\/\:@\?#]+\:)?(?:\/\/)?(?:(([^\/@\:]+)?(?:\:([^\/@\:]+))?)@)?(([^\/\:\?\#]+)?(?:\:(\d+))?)(([^\?#]+)?(\?([^#]*))?(#[\s\S]*)?)$/;
1
+ // -------/// ---------------1-------------//////////////2---3--------//////// ----4----2/////5-----------------------6------------------------//////////////-7--5///8----9----//10--11---10///--12-----8//
2
+ var reg = /^([^\:\/\?#]+\:(?![^\:\/\?\#]*@))?(?:\/\/)?(?:(([^\:\/\?#]+)?(?:\:([^\/\?#]+))?)@)?(([^\/@\:\?\#]*(?:[^\d\@\:\/\?#]|\.)[^\/@\:\?\#]*)?(?:(?:\:|^)(\d+))?)((\/[^\?#]*)?(\?([^#]*))?(#[\s\S]*)?)$/;
3
3
  function parseURL(url) {
4
4
  if (url === undefined || url === null) url = '';
5
5
  var [__, protocol, auth, username, password, host, hostname, port, path, pathname, search, query, hash] = reg.exec(url);
@@ -1,5 +1,6 @@
1
1
  var scanner = require("./scanner");
2
2
  var keywords = require("./keywords");
3
+ var strings = require("../basic/strings");
3
4
  var hasOwnProperty = {}.hasOwnProperty;
4
5
  var getReadableKey = function ($key, value) {
5
6
  value = value.replace(/-->/g, '--\\>');
@@ -21,9 +22,8 @@ var setMatchedConstString = function (k) {
21
22
 
22
23
  if (/^(['"])user?\s+strict\1$/i.test(k)) return `"use strict"`;
23
24
  if (k.length < 3) return k;
24
- k = k.replace(/^(['"])(.*?)\1$/, function (match, quote, string) {
25
- return "\"" + string.replace(/\\([\s\S])/g, (a, b) => b === "'" ? b : a).replace(/"/g, "\\\"") + "\"";
26
- });
25
+ k = strings.decode(k);
26
+ k = strings.encode(k);
27
27
  var $key = "str_" + k.replace(/^(['"])([\s\S]*)\1$/g, '$2');
28
28
  var key = getReadableKey($key, k);
29
29
  return " " + key + " ";
@@ -36,9 +36,7 @@ var setMatchedConstRegExp = function (k) {
36
36
  var trimStringLiteral = function (block) {
37
37
  var block_string = module_string.slice(block.start, block.end);
38
38
  if (block.type === block.single_quote_scanner || block.type === block.double_quote_scanner) {
39
- requireReg.lastIndex = block.start;
40
- var isRequire = requireReg.exec(module_string);
41
- return setMatchedConstString(block_string, isRequire);
39
+ return setMatchedConstString(block_string);
42
40
  }
43
41
  if (block.type === block.regexp_quote_scanner) {
44
42
  return setMatchedConstRegExp(block_string);
@@ -46,7 +44,6 @@ var trimStringLiteral = function (block) {
46
44
  return block_string;
47
45
  };
48
46
  var paramsMap = Object.create(null);
49
- var requireReg = /(?<=\brequire\s*\(\s*)['"`]/gy;
50
47
  var module_string = '';
51
48
  function breakcode(data, args) {
52
49
  if (!args) return [data];
@@ -267,7 +267,7 @@ var detour = function (o, ie) {
267
267
  break;
268
268
  case EXPRESS:
269
269
  if (!/^\.\.\.|\.\.\.$/.test(o.text)) {
270
- o.text = o.text.replace(/\.([^\.]+)/g, (_, a) => !ie || program.strap_reg.test(a) ? `[${strings.encode(strings.decode(a))}]` : _);
270
+ o.text = o.text.replace(/\.([^\.\[]+)/g, (_, a) => !ie || program.strap_reg.test(a) ? `[${strings.encode(strings.decode(a))}]` : _);
271
271
  }
272
272
  break;
273
273
  case QUOTED:
@@ -406,7 +406,6 @@ class Program extends Array {
406
406
  if (this._scoped) return this._scoped;
407
407
  var used = Object.create(null); var vars = Object.create(null), lets = vars;
408
408
  var scoped = this._scoped = [];
409
- scoped.code = this;
410
409
  var run = function (o, id) {
411
410
  loop: while (o) {
412
411
  var isCatch = false;
@@ -712,10 +711,18 @@ class Javascript {
712
711
  queue.__proto__ = Program.prototype;
713
712
  var origin = queue;
714
713
  var queue_push = function (scope) {
715
- if (~[VALUE, QUOTED, SCOPED, EXPRESS, PROPERTY].indexOf(scope.type)) {
714
+ var last = queue.lastUncomment;
715
+ if (~[VALUE, QUOTED].indexOf(scope.type)) {
716
716
  scope.isprop = isProperty();
717
717
  }
718
- var last = queue.lastUncomment;
718
+ else if (scope.type === SCOPED && scope.entry === '[') {
719
+ if (queue.isObject) {
720
+ scope.isprop = !last || last.type === STAMP && /^(\+\+|\-\-|;)$/.test(last.text)
721
+ }
722
+ else if (queue.isClass) {
723
+ scope.isprop = !last || last.type === STAMP && last.text === ','
724
+ }
725
+ }
719
726
  if (scope.type !== COMMENT && scope.type !== SPACE) {
720
727
  if (last) {
721
728
  scope.prev = last;
@@ -890,7 +897,9 @@ class Javascript {
890
897
  return !prev || prev.type === STAMP && prev.text === "," || prev.type === PROPERTY && /^(get|set|async)$/.test(prev.text);
891
898
  }
892
899
  if (queue.isClass) {
893
- return !prev || prev.type === EXPRESS && !/\.$/.test(prev.text) || ~[SCOPED, VALUE, QUOTED, PROPERTY].indexOf(prev.type) || prev.type === STAMP && /^(\+\+|\-\-|;)$/.test(prev.text);
900
+ if (!prev) return true;
901
+ if (prev.type === STAMP) return /^(\+\+|\-\-|;)$/.test(prev.text);
902
+ return prev.type === EXPRESS && !/\.$/.test(prev.text) || ~[SCOPED, VALUE, QUOTED, PROPERTY].indexOf(prev.type);
894
903
  }
895
904
  return false;
896
905
  };
@@ -1,7 +1,6 @@
1
1
  function anchor2(label, href) {
2
2
  var a = document.createElement("a");
3
3
  a.href = href || "";
4
- a.href = "";
5
4
  if (isString(label)) {
6
5
  a.innerHTML = label;
7
6
  } else {
@@ -114,7 +114,7 @@ function transpile(src, trans, apiMap, delTransMap) {
114
114
  }
115
115
  return res;
116
116
  }
117
- data = extend({}, src && src.querySelector ? null : src);
117
+ var data = extend({}, src && src.querySelector ? null : src);
118
118
  for (var k in trans) {
119
119
  var v = trans[k];
120
120
  if (!(k in data)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "2.42.2",
3
+ "version": "2.43.6",
4
4
  "description": "一个开发工具,开放源代码,自带组件库和编译环境,可以用来开发web组件,web应用或nodejs模块,或做为已有代码的加密工具,也可以做为静态页面服务器或跨域中转服务器使用",
5
5
  "main": "public/efront.js",
6
6
  "directories": {