efront 4.9.3 → 4.10.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.
@@ -15,7 +15,6 @@ class Item extends Array {
15
15
  extended = false;
16
16
  constructor(value) {
17
17
  super();
18
- this.children = this;
19
18
  this.count = 0;//子项中的叶子节点数
20
19
  this.total = 0;//子项中的节点数
21
20
  this.crack = 0;
@@ -29,6 +28,7 @@ class Item extends Array {
29
28
  if (value && value.children instanceof Array) {
30
29
  var children = value.children.map(item => new Item(item));
31
30
  children.forEach(item => item.parent = item);
31
+ this.children = this;
32
32
  this.push.apply(this, children);
33
33
  }
34
34
  if (isObject(value)) {
@@ -82,6 +82,11 @@ class Item extends Array {
82
82
  setClosed(value) {
83
83
  if (isObject(this.value)) this.value.closed = value;
84
84
  else this.closed = value;
85
+ var c = this;
86
+ while (c.joined) {
87
+ c = c[0];
88
+ c.setClosed(value);
89
+ }
85
90
  }
86
91
  isActive() {
87
92
  if (isObject(this.value)) {
@@ -110,10 +110,13 @@ class Tree extends Array {
110
110
  }
111
111
  return root;
112
112
  }
113
- static toArray(root, skipClosed = true) {
113
+ static toArray(root, skipClosed = 1) {
114
+ var autoJoin = typeof skipClosed === 'number' && skipClosed === skipClosed;
115
+ if (autoJoin) autoJoin = skipClosed < 0 ? -skipClosed : skipClosed;
114
116
  var path = [root], pathcx = [0];
115
117
  var result = [];
116
118
  var max_deep = 1;
119
+ var joined = 0;
117
120
  loop: while (pathcx.length) {
118
121
  var pathindex = pathcx.length - 1;
119
122
  var cx = pathcx[pathindex];
@@ -127,6 +130,17 @@ class Tree extends Array {
127
130
  elem.parent = item;
128
131
  result.push(elem);
129
132
  pathcx[pathindex] = ++cx;
133
+ if (autoJoin && elem.length === 1) {
134
+ joined = 1;
135
+ while (joined < autoJoin && elem.length === 1) {
136
+ if (!elem[0].children) break;
137
+ item = elem;
138
+ elem = elem[0];
139
+ elem.parent = item;
140
+ item.joined = true;
141
+ joined++;
142
+ }
143
+ }
130
144
  if (!skipClosed || !elem.isClosed()) {
131
145
  if (elem.length) {
132
146
  path.push(elem);
@@ -145,11 +145,7 @@ var getString = function (object, filter, space) {
145
145
  object = object.toISOString();
146
146
  }
147
147
  if (hasFilter) {
148
- var object1 = filter(key, object);
149
- if (isObject(object1) && object !== object1) {
150
- object1 = getString(object1, filter, space);
151
- }
152
- object = object1;
148
+ object = filter(key, object);
153
149
  }
154
150
  switch (typeof object) {
155
151
  case "object":
@@ -155,7 +155,13 @@ var test2 = function (JSON) {
155
155
  "ratio": 1,
156
156
  "readonly": true
157
157
  }];
158
- assert(JSON.stringify(data, null, 4), JSON0.stringify(data, null, 4))
158
+ var unicode = a => a.replace(/\\u([a-f\d]{4})/g, (_, a) => String.fromCharCode(parseInt(a, 16)));
159
+ assert(unicode(JSON.stringify(data, null, 4)), JSON0.stringify(data, null, 4))
160
+ var filter = function (k, o) {
161
+ if (typeof o !== 'object' || o.length) return o;
162
+ return { name: o.name };
163
+ }
164
+ assert(unicode(JSON.stringify(data, filter, 4)), JSON0.stringify(data, filter, 4));
159
165
  }
160
166
  function JSON_test() {
161
167
  window.JSON0 = JSON0;
@@ -1,4 +1,6 @@
1
1
  var Html = require("./Html");
2
+ var fs = require("fs");
3
+ var path = require("path");
2
4
  var test = function (source, pick, value) {
3
5
  var h = new Html;
4
6
  var b = h.exec(source);
@@ -8,6 +10,10 @@ var test = function (source, pick, value) {
8
10
  assert(seek(b, pick), value);
9
11
  }
10
12
  };
13
+ var test2 = function (source) {
14
+ var s = scanner2(source, 'html');
15
+ assert(s.toString(), source);
16
+ }
11
17
  test("<h><a #c>b</a><c b=x>d</c><d/><e>2px</e></h>");
12
18
  test("<a>Let's Encrypt</a>");
13
19
  test("<style>{a-b:2}</style>");
@@ -23,4 +29,4 @@ test('<div>${`<div></div>`}</div>');
23
29
  test('<div>\\${${`<div></div>`}</div>');
24
30
  test('<div>$\\{${`<div></div>`}</div>');
25
31
  test('<div>$\\{${typeof `<div></div>`}</div>');
26
- test('<div>$\\{${\\a+typeof`<div></div>`}</div>','<div>$\\{${\\a + typeof `<div></div>`}</div>');
32
+ test('<div>$\\{${\\a+typeof`<div></div>`}</div>', '<div>$\\{${\\a + typeof `<div></div>`}</div>');
@@ -415,11 +415,11 @@ class Program {
415
415
  if (this.comment_entry.test(m)) {
416
416
  push_piece();
417
417
  var start = match.index;
418
- var comment = this.quote_map[m];
419
- comment.lastIndex = index;
418
+ var { reg: comment_reg,end:comment_end } = this.quote_map[m];
419
+ comment_reg.lastIndex = index;
420
420
  do {
421
- var match = comment.reg.exec(text);
422
- } while (match && !comment.end.test(match[0]));
421
+ var match = comment_reg.exec(text);
422
+ } while (match && !comment_end.test(match[0]));
423
423
  if (match) end = index = match.index + match[0].length;
424
424
  m = text.slice(start, index);
425
425
  save(COMMENT);
@@ -558,8 +558,13 @@ class Program {
558
558
  }
559
559
  var isdigit = number_reg.exec(m);
560
560
  if (isdigit) {
561
- m = isdigit[0];
562
- index = match.index + m.length;
561
+ var m1 = isdigit[0];
562
+ if (m1.length < m.length) {
563
+ if (m.charAt(m1.length) === ".") {
564
+ m = m1;
565
+ index = match.index + m.length;
566
+ }
567
+ }
563
568
  isdigit = true;
564
569
  }
565
570
  if (this.value_reg.test(m) || isdigit) {
@@ -14,7 +14,7 @@ const [
14
14
  /*2048 */ELEMENT,
15
15
  ] = new Array(20).fill(0).map((_, a) => 1 << a);
16
16
  // --------------//1//2/////////////////////////22/////////////2//2//3//4/////4////////3/////3//////3//3//////3///////211/////////////2//////2//////1///
17
- var number_reg = /^(?:(?:0x[0-9a-f]+|0b\d+|0o\d+|0[0-7]+)(?:_[0-9a-f]+)*|(?:(?:(?:\d+_)*\d+|\d*)\.\d+(?:_\d+)*|(?:\d+_)*\d+\.?))(?:e[\+\-]?\d+(?:_\d+)*|[ijklmnu]+)?/i;
17
+ var number_reg = /^(?:(?:0x[0-9a-f]+|0b[01]+|0o?[0-7]+)(?:_[0-9a-f]+)*|(?:(?:(?:\d+_)*\d+|\d*)\.\d+(?:_\d+)*|(?:\d+_)*\d+\.?))(?:e[\+\-]?\d+(?:_\d+)*|[hijklmnu]+)?/i;
18
18
  var equal_reg = /^(?:[\+\-\*\/~\^&\|%]|\*\*|>>>?|<<)?\=$|^(?:\+\+|\-\-)$/;
19
19
  var needhead_reg = /^\?\.|^\.(?:[^\.]|$)|^\[/;
20
20
  var skipAssignment = function (o, cx) {
@@ -320,7 +320,7 @@ function snapSentenceHead(o) {
320
320
  o = p;
321
321
  continue;
322
322
  }
323
- if (o.type === STRAP && /^(in|instanceof|of|as|from)$/.test(o.text)) {
323
+ if (o.type === STRAP && /^(in|instanceof|of|as|from)$/.test(o.text) || o.type === STAMP && !o.unary) {
324
324
  o = p;
325
325
  continue;
326
326
  }
@@ -18,7 +18,7 @@ var codecolor = function (c, encode) {
18
18
  if (!/^\</.test(keys[keys.length - 1])) keys[keys.length - 1] = `<invoke>${keys[keys.length - 1]}</invoke>`;
19
19
  }
20
20
  var [name] = keys;
21
- if (/^\</.test(name));
21
+ if (/^[\<\?]/.test(name) || !name);
22
22
  else if (c.program?.strap_reg.test(name) || c.program?.value_reg.test(name) || /^(this|arguments)$/.test(name)) name = `<strap>${name}</strap>`;
23
23
  else name = `<${label}>${name}</${label}>`;
24
24
  keys[0] = name;
@@ -29,6 +29,15 @@ var codecolor = function (c, encode) {
29
29
  if (used) for (var k in envs) {
30
30
  used[k].forEach(k in predefs ? setPredef : setOutside);
31
31
  }
32
+ var spaceReg = c.program.space_exp;
33
+ var unspaceReg = new RegExp(spaceReg.source.replace(/^\[/, "[^"), spaceReg.flags + 'g');
34
+ var wraptext = function (t, l) {
35
+ t = t.replace(unspaceReg, a => {
36
+ a = encode(a);
37
+ return `<${l}>${a}</${l}>`
38
+ });
39
+ return t;
40
+ }
32
41
 
33
42
  var setcolor = function (o) {
34
43
  var text = o.text;
@@ -43,14 +52,23 @@ var codecolor = function (c, encode) {
43
52
  o.leave = "<text>" + o.leave + "</text>";
44
53
  break;
45
54
  }
55
+ if (/^\//.test(o.text)) {
56
+ var source = o.text;
57
+ var flags = /[^\/]+$/.exec(source);
58
+ if (flags) {
59
+ flags = flags[0];
60
+ source = source.slice(0, source.length - flags.length);
61
+ }
62
+ source = wraptext(source, 'regexp');
63
+ if (flags) source = source + wraptext(flags, 'strap');
64
+ o.text = source;
65
+ break;
66
+ }
46
67
  case PIECE:
47
68
  if (o.queue && o.queue.tag) {
48
69
  o.text = encode(o.text);
49
70
  }
50
- else if (/^\//.test(o.text)) {
51
- o.text = `<regexp>${encode(o.text)}</regexp>`;
52
- }
53
- else o.text = `<text>${encode(o.text)}</text>`;
71
+ else o.text = wraptext(o.text, 'text');
54
72
  break;
55
73
  break;
56
74
  case ELEMENT:
@@ -95,7 +113,7 @@ var codecolor = function (c, encode) {
95
113
  // else o.text = `<stamp>${encode(o.text)}</stamp>`;
96
114
  break;
97
115
  case COMMENT:
98
- o.text = `<comment>${encode(o.text)}</comment>`;
116
+ o.text = wraptext(o.text, 'comment');
99
117
  break;
100
118
  }
101
119
  };
@@ -1,5 +1,6 @@
1
1
  <style>
2
2
  :scope {
3
+ white-space: pre;
3
4
  padding: 10px 20px;
4
5
  border-radius: 3px;
5
6
  display: inline-block;
@@ -88,7 +89,7 @@
88
89
  </style>
89
90
  <script>
90
91
  var encode = function (text) {
91
- return text.replace(/[\<\>\|]/g, a => `&#${a.charCodeAt()};`)
92
+ return text.replace(/[\<\>\|]/g, a => `&#${a.charCodeAt()};`);
92
93
  };
93
94
  var typescript = new compile$Javascript;
94
95
  typescript.straps = typescript.straps.concat("interface", "implements", "declare", "module", "readonly", "enum");
@@ -198,7 +199,7 @@
198
199
  if (c) return c.text += blink, true;
199
200
  return false;
200
201
  };
201
- function codetext(type, text, blink) {
202
+ var rows = function (type, text, blink) {
202
203
  type = type.toLowerCase();
203
204
  if (type in codesupports) {
204
205
  text = codesupports[type](text, blink);
@@ -213,7 +214,12 @@
213
214
  }
214
215
  }
215
216
  if (minSpace > 0) codes = codes.map(c => /^\s+/.test(c) ? c.slice(minSpace) : c);
216
- return `<code type=${type}>${codes.join("<br/>").replace(/\t/g, Array(5).join('&ensp;')).replace(/\s/g, '&ensp;')}</code>`;
217
+ return codes;
218
+ }
219
+ function codetext(type, text, blink) {
220
+ var ws = rows(type, text, blink);
221
+ return `<code type=${type}>${ws.join("<br/>")}</code>`;
217
222
  }
223
+ codetext.rows = rows;
218
224
  codetext.encode = encode;
219
225
  </script>
@@ -14,14 +14,11 @@ return class XMLHttpRequest {
14
14
  this.url = url;
15
15
  }
16
16
  send(data) {
17
- var u = new URL(this.url);
18
- if (!u.host) u.host = location.host || 'localhost'
19
- this.fetch(this.url, { method: this.method }).then(d => {
20
-
17
+ this.fetch(this.url, { method: this.method, headers: { referer: document.location.href.replace(/^#[\s\S]*$/g, '') } }).then(async d => {
21
18
  this.fetched = d;
22
19
  this.readyState = 4;
23
20
  this.status = d.status;
24
- this.responseText = d.text();
21
+ this.responseText = await d.text();
25
22
  if (this.onreadystatechange) this.onreadystatechange({ target: this });
26
23
  if (this.onload) this.onload({ target: this });
27
24
  }, e => {
@@ -71,8 +71,8 @@ function alert() {
71
71
  } else {
72
72
  elem = _text(elem, styles.log, [text]);
73
73
  }
74
- if (!container.parentNode) popup(container);
75
- if (!elem.parentNode) appendChild(container, elem);
74
+ if (!isMounted(container)) popup(container);
75
+ if (!isMounted(elem)) appendChild(container, elem);
76
76
  waitclose(autoclose, 400);
77
77
  return elem;
78
78
  };
@@ -141,7 +141,7 @@ function confirm() {
141
141
  element.tabIndex = -1;
142
142
 
143
143
  Promise.resolve().then(function () {
144
- if (element.parentNode) return;
144
+ if (isMounted(element)) return;
145
145
  element.mask = true;
146
146
  popup(element, target || [.5, .5], target ? 'rhomb' : true);
147
147
  element.focus();
@@ -2,16 +2,15 @@
2
2
  * 创建自定义事件
3
3
  */
4
4
  if ("createEvent" in document) var createEvent = function createEvent(eventName, canBubble = false, cancelable = true) {
5
- var event = document.createEvent("Event");
5
+ var event = document.createEvent(/Events?$/.test(eventName) ? eventName : "Event");
6
6
  event.initEvent(eventName, canBubble, cancelable);
7
7
  return event;
8
8
  }
9
- else if ("createEventObject" in document) var createEvent = function createEventObject(eventName) {
10
- var event = document.createEventObject();
9
+ else var createEvent = function createEventObject(eventName) {
10
+ if ("createEventObject" in document) var event = document.createEventObject();
11
+ else if (window.Event) event = new Event(eventName);
12
+ else event = {};
11
13
  event.type = eventName;
12
- return event;
13
- }
14
- else var Event = window.Event, createEvent = function (eventName) {
15
- var event = new Event(eventName);
14
+ if (!event.initMouseEvent) event.initMouseEvent = function () { };
16
15
  return event;
17
16
  }
@@ -1,11 +1,15 @@
1
- var dispatch = "dispatchEvent" in document ? function dispatchEvent(target, event) {
2
- return target.dispatchEvent(event);
1
+ var dispatch = "dispatchEvent" in document ? function dispatchEvent2(target, event) {
2
+ try {
3
+ return target.dispatchEvent(event);
4
+ } catch (e) {
5
+ return -1;
6
+ }
3
7
  } : function (target, event) {
4
8
  var fire = "on" + event.type;
5
9
  try {
6
10
  return target.fireEvent(fire, event);
7
11
  } catch (e) {
8
- return target[fire] && target[fire](event);
12
+ return -1;
9
13
  }
10
14
  };
11
15
  var isWorseEnv = /MSIE\s([2-9]|10)|Presto/.test(navigator.userAgent);
@@ -16,7 +20,7 @@ function dispatch2(t, e) {
16
20
  var on = 'on' + e.type;
17
21
  var f = t[on];
18
22
  var res = dispatch(t, e);
19
- if (f && (t.nodeType !== 1 || t.constructor === window.HTMLUnknownElement || isWorseEnv && !(on in t.constructor.prototype))) {
23
+ if (f && (res === -1 || t.nodeType && t.nodeType !== 1 || t.constructor === window.HTMLUnknownElement || isWorseEnv && !(on in t.constructor.prototype))) {
20
24
  return f.call(t, e) !== false;
21
25
  }
22
26
  return res;
@@ -1,4 +1,4 @@
1
- function getScreenPosition(target) {
1
+ function getScreenPosition(target, bounding = true) {
2
2
  if (!target) {
3
3
  target = {
4
4
  offsetTop: 0,
@@ -12,7 +12,7 @@ function getScreenPosition(target) {
12
12
  top = target.offsetTop,
13
13
  width = target.offsetWidth,
14
14
  height = target.offsetHeight;
15
- while (target.offsetParent) {
15
+ if (bounding) while (target.offsetParent) {
16
16
  target = target.offsetParent;
17
17
  left += target.offsetLeft - target.scrollLeft + target.clientLeft;
18
18
  top += target.offsetTop - target.scrollTop + target.clientTop;
@@ -30,10 +30,10 @@ function getScreenPosition(target) {
30
30
  }
31
31
  var rect = target.getBoundingClientRect();
32
32
  var { left, top, width, height, right, bottom } = rect;
33
- rect = { left, top, width, height, right, bottom };
34
- if (rect.width === undefined) {
35
- rect.width = rect.right - rect.left;
36
- rect.height = rect.bottom - rect.top;
33
+ if (width === undefined) {
34
+ width = right - left;
35
+ height = bottom - top;
37
36
  }
37
+ rect = { left, top, width, height, right, bottom };
38
38
  return rect;
39
39
  }
@@ -485,28 +485,27 @@ var grid_prototype = {
485
485
  if (rest_height < 1) {
486
486
  return (height - rest_height) / (grid_height - bounds_bottom - bounds_top) * 100 + "%";
487
487
  }
488
- var rest_offset = fromOffset(rest_height / (bounds_top + bounds_bottom) * (parseFloat(grid_padding_top) + parseFloat(grid_padding_bottom)));
488
+ var rest_offset = rest_height / (bounds_top + bounds_bottom) * (grid_padding_top + grid_padding_bottom);
489
489
  if (rest_height < height) {
490
- return `calc(${(height - rest_height) / (grid_height - bounds_bottom - bounds_top) * 100}% + ${rest_offset})`;
490
+ return `calc(${(height - rest_height) / (grid_height - bounds_bottom - bounds_top) * 100}% + ${fromOffset(rest_offset)})`;
491
491
  }
492
- return rest_offset;
492
+ return height / rest_height * rest_offset;
493
493
  }
494
494
  var setRelativeDiv = function (_div, width, height, left, top) {
495
495
  var [bounds_top, bounds_right, bounds_bottom, bounds_left] = bounds;
496
- var computed = getComputedStyle(grid);
497
496
  css(_div, {
498
- width: getDivSize(left, width, bounds_left, bounds_right, grid.width, computed.paddingLeft, computed.paddingRight),
499
- height: getDivSize(top, height, bounds_top, bounds_bottom, grid.height, computed.paddingTop, computed.paddingBottom)
497
+ width: getDivSize(left, width, bounds_left, bounds_right, grid.width, grid_left, grid_right),
498
+ height: getDivSize(top, height, bounds_top, bounds_bottom, grid.height, grid_top, grid_bottom)
500
499
  });
501
500
  if (top <= 0) {
502
- css(_div, { marginTop: fromOffset(- parseFloat(computed.paddingTop)) });
501
+ css(_div, { marginTop: fromOffset(- grid_top) });
503
502
  } else if (top + height >= grid.height) {
504
- css(_div, { marginBottom: fromOffset(-parseFloat(computed.paddingBottom)) });
503
+ css(_div, { marginBottom: fromOffset(-grid_bottom) });
505
504
  }
506
505
  if (left <= 0) {
507
- css(_div, { marginLeft: fromOffset(-parseFloat(computed.paddingLeft)) });
506
+ css(_div, { marginLeft: fromOffset(-grid_left) });
508
507
  } else if (left + width >= grid.width) {
509
- css(_div, { marginRight: fromOffset(-parseFloat(computed.paddingRight)) });
508
+ css(_div, { marginRight: fromOffset(-grid_right) });
510
509
  }
511
510
  }
512
511
  var append = function (point, index, points) {
@@ -607,6 +606,11 @@ var grid_prototype = {
607
606
  }
608
607
  }
609
608
  };
609
+ var computed = getComputedStyle(grid);
610
+ var grid_top = parseFloat(computed.paddingTop);
611
+ var grid_bottom = parseFloat(computed.paddingBottom);
612
+ var grid_left = parseFloat(computed.paddingLeft);
613
+ var grid_right = parseFloat(computed.paddingRight);
610
614
  append(this.breakpoints);
611
615
  var reshapecount = 0;
612
616
  var store = function (point) {
@@ -72,6 +72,18 @@ function ylist(container, generator, $Y) {
72
72
  }
73
73
  return null;
74
74
  };
75
+ var getRelativeElement = function (element, delta) {
76
+ delta = +delta;
77
+ if (!delta || !isFinite(element.index)) return;
78
+ var target = element.index + delta;
79
+ if (!target) return;
80
+ if (delta < 0) var key = "previousElementSibling";
81
+ else key = "nextElementSibling";
82
+ while (element) {
83
+ if (element.index === target) return element;
84
+ element = element[key];
85
+ }
86
+ }
75
87
  var hasCover = function (child) {
76
88
  var scrollTop = list.scrollTop;
77
89
  if (child.offsetTop + child.offsetHeight < scrollTop || child.offsetTop >= scrollTop + list.clientHeight) return false;
@@ -581,6 +593,7 @@ function ylist(container, generator, $Y) {
581
593
  else if (emit) list.setFocus(e, true), dispatch(list, 'focused');
582
594
  else list.setFocus(e);
583
595
  };
596
+ list.getRelativeElement = getRelativeElement;
584
597
  return list;
585
598
  }
586
599
  var allArgumentsNames = arguments[arguments.length - 1];
@@ -667,6 +680,5 @@ function list() {
667
680
  if (src && old) children = Array.prototype.filter.call(children, c => src[c.index] !== old[c.index]);
668
681
  remove(children);
669
682
  };
670
-
671
683
  return list;
672
684
  }
package/coms/zimoli/on.js CHANGED
@@ -416,7 +416,7 @@ var on = document.efronton = function (k) {
416
416
  var invoke = function (event, type, pointerType) {
417
417
  var target = event.target;
418
418
  var touch = event.changedTouches ? event.changedTouches[0] : event;
419
- var clickEvent = document.createEvent("MouseEvents");
419
+ var clickEvent = createEvent("MouseEvents");
420
420
  clickEvent.touchend = true;
421
421
  clickEvent.pointerType = pointerType
422
422
  clickEvent.initMouseEvent(type, true, true, window, 1, touch.screenX, touch.screenY, touch.clientX, touch.clientY, false, false, false, false, 0, null);
@@ -426,6 +426,7 @@ var invoke = function (event, type, pointerType) {
426
426
  (function () {
427
427
  var pointeractive = null;
428
428
  if ("onpointerdown" in document) return;
429
+ document.onpointerdown = null;
429
430
  var getPointerType = function (event) {
430
431
  return event.type.replace(/(start|move|end|cancel|down|up|leave|out|over|enter)$/i, '');
431
432
  };
@@ -163,7 +163,7 @@ function picture(url, to = 0, key) {
163
163
  var urls = [].concat(url);
164
164
  var p = slider(gen, false);
165
165
  }
166
- p.go(to);
166
+ if (isFinite(to)) p.go(to);
167
167
  p.getScale = function () {
168
168
  if (p.current) return p.current.getScale();
169
169
  return 1;
@@ -68,6 +68,8 @@ function slider() {
68
68
  direction,
69
69
  _speed = speed(1);
70
70
  var reshape = function (index, ising, emit) {
71
+ if (!isFinite(index)) return;
72
+ index = +index;
71
73
  outter.index = current_index = index;
72
74
  var width = outter.clientWidth || +innerWidth;
73
75
  var indexLeft = floor(index);
@@ -272,6 +274,8 @@ function slider() {
272
274
  })
273
275
 
274
276
  outter.go = lazy(function (index, cache) {
277
+ if (!isFinite(index)) return;
278
+ index = +index;
275
279
  if (outter.index === index && cache !== false) return;
276
280
  negative_index = -index;
277
281
  var _removingMain = _imageMain;