efront 3.33.0 → 3.33.1
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/coms/basic/ArrayFill.js +5 -0
- package/coms/basic/backEach.js +6 -0
- package/coms/basic_/[]map.js +10 -9
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/readme.md +1 -0
package/coms/basic_/[]map.js
CHANGED
|
@@ -16,7 +16,7 @@ function map(f, o) {
|
|
|
16
16
|
} else {
|
|
17
17
|
for (var cx in this) {
|
|
18
18
|
if (!isFinite(cx)) break;
|
|
19
|
-
res[cx] = f.call(o, this[cx], cx, this);
|
|
19
|
+
res[cx] = f.call(o, this[cx], +cx, this);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
return res;
|
|
@@ -28,7 +28,7 @@ function forEach(f, o) {
|
|
|
28
28
|
}
|
|
29
29
|
for (var cx in this) {
|
|
30
30
|
if (!isFinite(cx)) break;
|
|
31
|
-
f.call(o, this[cx], cx, this);
|
|
31
|
+
f.call(o, this[cx], +cx, this);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
function filter(f, o) {
|
|
@@ -39,7 +39,7 @@ function filter(f, o) {
|
|
|
39
39
|
}
|
|
40
40
|
for (var cx in this) {
|
|
41
41
|
if (!isFinite(cx)) break;
|
|
42
|
-
if (f.call(o, this[cx], cx, this))
|
|
42
|
+
if (f.call(o, this[cx], +cx, this))
|
|
43
43
|
result.push(this[cx]);
|
|
44
44
|
}
|
|
45
45
|
return result;
|
|
@@ -48,7 +48,7 @@ function indexOf(searchElement, fromIndex = 0) {
|
|
|
48
48
|
if (fromIndex < 0) fromIndex += this.length;
|
|
49
49
|
if (fromIndex < 0) fromIndex = 0;
|
|
50
50
|
for (var cx = fromIndex, dx = this.length; cx < dx; cx++) {
|
|
51
|
-
if (cx in this && this[cx] === searchElement) return cx;
|
|
51
|
+
if (cx in this && this[cx] === searchElement) return +cx;
|
|
52
52
|
}
|
|
53
53
|
return -1;
|
|
54
54
|
}
|
|
@@ -65,16 +65,17 @@ var keys = function keys(object) {
|
|
|
65
65
|
}
|
|
66
66
|
return result;
|
|
67
67
|
};
|
|
68
|
-
|
|
69
|
-
if (!
|
|
70
|
-
if (!
|
|
71
|
-
if (!
|
|
68
|
+
var ArrayProto = Array.prototype;
|
|
69
|
+
if (!ArrayProto.map) ArrayProto.map = map;
|
|
70
|
+
if (!ArrayProto.forEach) ArrayProto.forEach = forEach;
|
|
71
|
+
if (!ArrayProto.indexOf) ArrayProto.indexOf = indexOf;
|
|
72
|
+
if (!ArrayProto.filter) ArrayProto.filter = filter;
|
|
72
73
|
if (!"".trim) String.prototype.trim = trim;
|
|
73
74
|
if (!Object.keys) Object.keys = keys;
|
|
74
75
|
if (!Object.create) Object.create = function (object) {
|
|
75
76
|
return { __proto__: object };
|
|
76
77
|
};
|
|
77
|
-
if (!
|
|
78
|
+
if (!Function.prototype.bind) Function.prototype.bind = function (context) {
|
|
78
79
|
var args = [].slice.call(arguments, 1);
|
|
79
80
|
var f = this;
|
|
80
81
|
return function () {
|