Skip to content
This repository was archived by the owner on Oct 9, 2020. It is now read-only.

Commit d6bb947

Browse files
committed
Babel upgrade
1 parent 1835b16 commit d6bb947

13 files changed

Lines changed: 34748 additions & 31010 deletions

File tree

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
build-babel/jspm_packages
2-
build-babel/node_modules
1+
node_modules
2+
jspm_packages

babel-helpers/createClass.js

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
2-
function defineProperties(target, props) {
3-
for (var i = 0; i < props.length; i++) {
4-
var descriptor = props[i];
5-
descriptor.enumerable = descriptor.enumerable || false;
6-
descriptor.configurable = true;
7-
if ("value" in descriptor) descriptor.writable = true;
8-
Object.defineProperty(target, descriptor.key, descriptor);
1+
export default (function () {
2+
function defineProperties(target, props) {
3+
for (var i = 0; i < props.length; i++) {
4+
var descriptor = props[i];
5+
descriptor.enumerable = descriptor.enumerable || false;
6+
descriptor.configurable = true;
7+
if ("value" in descriptor) descriptor.writable = true;
8+
Object.defineProperty(target, descriptor.key, descriptor);
9+
}
910
}
10-
}
1111

12-
export default function (Constructor, protoProps, staticProps) {
13-
if (protoProps) defineProperties(Constructor.prototype, protoProps);
14-
if (staticProps) defineProperties(Constructor, staticProps);
15-
return Constructor;
16-
};
12+
return function (Constructor, protoProps, staticProps) {
13+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
14+
if (staticProps) defineProperties(Constructor, staticProps);
15+
return Constructor;
16+
};
17+
})();

babel-helpers/jsx.js

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,42 @@
1-
var REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol.for && Symbol.for("react.element") || 0xeac7;
2-
export default function createRawReactElement(type, props, key, children) {
3-
var defaultProps = type && type.defaultProps;
4-
var childrenLength = arguments.length - 3;
1+
export default (function () {
2+
var REACT_ELEMENT_TYPE = typeof Symbol === "function" && Symbol.for && Symbol.for("react.element") || 0xeac7;
3+
return function createRawReactElement(type, props, key, children) {
4+
var defaultProps = type && type.defaultProps;
5+
var childrenLength = arguments.length - 3;
56

6-
if (!props && childrenLength !== 0) {
7-
props = {};
8-
}
7+
if (!props && childrenLength !== 0) {
8+
props = {};
9+
}
910

10-
if (props && defaultProps) {
11-
for (var propName in defaultProps) {
12-
if (props[propName] === void 0) {
13-
props[propName] = defaultProps[propName];
11+
if (props && defaultProps) {
12+
for (var propName in defaultProps) {
13+
if (props[propName] === void 0) {
14+
props[propName] = defaultProps[propName];
15+
}
1416
}
17+
} else if (!props) {
18+
props = defaultProps || {};
1519
}
16-
} else if (!props) {
17-
props = defaultProps || {};
18-
}
1920

20-
if (childrenLength === 1) {
21-
props.children = children;
22-
} else if (childrenLength > 1) {
23-
var childArray = Array(childrenLength);
21+
if (childrenLength === 1) {
22+
props.children = children;
23+
} else if (childrenLength > 1) {
24+
var childArray = Array(childrenLength);
2425

25-
for (var i = 0; i < childrenLength; i++) {
26-
childArray[i] = arguments[i + 3];
27-
}
26+
for (var i = 0; i < childrenLength; i++) {
27+
childArray[i] = arguments[i + 3];
28+
}
2829

29-
props.children = childArray;
30-
}
30+
props.children = childArray;
31+
}
3132

32-
return {
33-
$$typeof: REACT_ELEMENT_TYPE,
34-
type: type,
35-
key: key === undefined ? null : '' + key,
36-
ref: null,
37-
props: props,
38-
_owner: null
33+
return {
34+
$$typeof: REACT_ELEMENT_TYPE,
35+
type: type,
36+
key: key === undefined ? null : '' + key,
37+
ref: null,
38+
props: props,
39+
_owner: null
40+
};
3941
};
40-
};
42+
})();

babel-helpers/slicedToArray.js

Lines changed: 31 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,37 @@
1-
function sliceIterator(arr, i) {
2-
var _arr = [];
3-
var _n = true;
4-
var _d = false;
5-
var _e = undefined;
1+
export default (function () {
2+
function sliceIterator(arr, i) {
3+
var _arr = [];
4+
var _n = true;
5+
var _d = false;
6+
var _e = undefined;
67

7-
try {
8-
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
9-
_arr.push(_s.value);
10-
11-
if (i && _arr.length === i) break;
12-
}
13-
} catch (err) {
14-
_d = true;
15-
_e = err;
16-
} finally {
178
try {
18-
if (!_n && _i["return"]) _i["return"]();
9+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
10+
_arr.push(_s.value);
11+
12+
if (i && _arr.length === i) break;
13+
}
14+
} catch (err) {
15+
_d = true;
16+
_e = err;
1917
} finally {
20-
if (_d) throw _e;
18+
try {
19+
if (!_n && _i["return"]) _i["return"]();
20+
} finally {
21+
if (_d) throw _e;
22+
}
2123
}
22-
}
2324

24-
return _arr;
25-
}
26-
27-
export default function (arr, i) {
28-
if (Array.isArray(arr)) {
29-
return arr;
30-
} else if (Symbol.iterator in Object(arr)) {
31-
return sliceIterator(arr, i);
32-
} else {
33-
throw new TypeError("Invalid attempt to destructure non-iterable instance");
25+
return _arr;
3426
}
35-
};
27+
28+
return function (arr, i) {
29+
if (Array.isArray(arr)) {
30+
return arr;
31+
} else if (Symbol.iterator in Object(arr)) {
32+
return sliceIterator(arr, i);
33+
} else {
34+
throw new TypeError("Invalid attempt to destructure non-iterable instance");
35+
}
36+
};
37+
})();

0 commit comments

Comments
 (0)