babel-source 4.7.16 → 5.0.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/babel.js +17260 -15510
- data/lib/babel/external-helpers.js +69 -23
- data/lib/babel/source.rb +2 -2
- metadata +4 -4
@@ -34,13 +34,13 @@
|
|
34
34
|
|
35
35
|
babelHelpers.createClass = (function () {
|
36
36
|
function defineProperties(target, props) {
|
37
|
-
for (var
|
38
|
-
var
|
39
|
-
|
40
|
-
|
37
|
+
for (var i = 0; i < props.length; i++) {
|
38
|
+
var descriptor = props[i];
|
39
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
40
|
+
descriptor.configurable = true;
|
41
|
+
if (descriptor.value) descriptor.writable = true;
|
42
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
41
43
|
}
|
42
|
-
|
43
|
-
Object.defineProperties(target, props);
|
44
44
|
}
|
45
45
|
|
46
46
|
return function (Constructor, protoProps, staticProps) {
|
@@ -50,29 +50,43 @@
|
|
50
50
|
};
|
51
51
|
})();
|
52
52
|
|
53
|
-
babelHelpers.
|
54
|
-
function defineProperties(target,
|
55
|
-
for (var i = 0; i <
|
56
|
-
var
|
57
|
-
|
58
|
-
|
59
|
-
|
53
|
+
babelHelpers.createDecoratedClass = (function () {
|
54
|
+
function defineProperties(target, descriptors, initializers) {
|
55
|
+
for (var i = 0; i < descriptors.length; i++) {
|
56
|
+
var descriptor = descriptors[i];
|
57
|
+
var decorators = descriptor.decorators;
|
58
|
+
var key = descriptor.key;
|
59
|
+
delete descriptor.key;
|
60
|
+
delete descriptor.decorators;
|
61
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
62
|
+
descriptor.configurable = true;
|
63
|
+
if ("value" in descriptor || descriptor.initializer) descriptor.writable = true;
|
64
|
+
|
65
|
+
if (decorators) {
|
66
|
+
for (var f = 0; f < decorators.length; f++) {
|
67
|
+
var decorator = decorators[f];
|
68
|
+
|
69
|
+
if (typeof decorator === "function") {
|
70
|
+
descriptor = decorator(target, key, descriptor) || descriptor;
|
71
|
+
} else {
|
72
|
+
throw new TypeError("The decorator for method " + descriptor.key + " is of the invalid type " + typeof decorator);
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
initializers[key] = descriptor.initializer;
|
77
|
+
}
|
78
|
+
|
79
|
+
Object.defineProperty(target, key, descriptor);
|
60
80
|
}
|
61
81
|
}
|
62
82
|
|
63
|
-
return function (Constructor, protoProps, staticProps) {
|
64
|
-
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
65
|
-
if (staticProps) defineProperties(Constructor, staticProps);
|
83
|
+
return function (Constructor, protoProps, staticProps, protoInitializers, staticInitializers) {
|
84
|
+
if (protoProps) defineProperties(Constructor.prototype, protoProps, protoInitializers);
|
85
|
+
if (staticProps) defineProperties(Constructor, staticProps, staticInitializers);
|
66
86
|
return Constructor;
|
67
87
|
};
|
68
88
|
})();
|
69
89
|
|
70
|
-
babelHelpers.applyConstructor = function (Constructor, args) {
|
71
|
-
var instance = Object.create(Constructor.prototype);
|
72
|
-
var result = Constructor.apply(instance, args);
|
73
|
-
return result != null && (typeof result == "object" || typeof result == "function") ? result : instance;
|
74
|
-
};
|
75
|
-
|
76
90
|
babelHelpers.taggedTemplateLiteral = function (strings, raw) {
|
77
91
|
return Object.freeze(Object.defineProperties(strings, {
|
78
92
|
raw: {
|
@@ -105,6 +119,38 @@
|
|
105
119
|
};
|
106
120
|
|
107
121
|
babelHelpers.slicedToArray = function (arr, i) {
|
122
|
+
if (Array.isArray(arr)) {
|
123
|
+
return arr;
|
124
|
+
} else if (Symbol.iterator in Object(arr)) {
|
125
|
+
var _arr = [];
|
126
|
+
var _n = true;
|
127
|
+
var _d = false;
|
128
|
+
var _e = undefined;
|
129
|
+
|
130
|
+
try {
|
131
|
+
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
|
132
|
+
_arr.push(_s.value);
|
133
|
+
|
134
|
+
if (i && _arr.length === i) break;
|
135
|
+
}
|
136
|
+
} catch (err) {
|
137
|
+
_d = true;
|
138
|
+
_e = err;
|
139
|
+
} finally {
|
140
|
+
try {
|
141
|
+
if (!_n && _i["return"]) _i["return"]();
|
142
|
+
} finally {
|
143
|
+
if (_d) throw _e;
|
144
|
+
}
|
145
|
+
}
|
146
|
+
|
147
|
+
return _arr;
|
148
|
+
} else {
|
149
|
+
throw new TypeError("Invalid attempt to destructure non-iterable instance");
|
150
|
+
}
|
151
|
+
};
|
152
|
+
|
153
|
+
babelHelpers.slicedToArrayLoose = function (arr, i) {
|
108
154
|
if (Array.isArray(arr)) {
|
109
155
|
return arr;
|
110
156
|
} else if (Symbol.iterator in Object(arr)) {
|
@@ -141,7 +187,7 @@
|
|
141
187
|
babelHelpers.defineProperty = function (obj, key, value) {
|
142
188
|
return Object.defineProperty(obj, key, {
|
143
189
|
value: value,
|
144
|
-
enumerable:
|
190
|
+
enumerable: key == null || typeof Symbol == "undefined" || key.constructor !== Symbol,
|
145
191
|
configurable: true,
|
146
192
|
writable: true
|
147
193
|
});
|
data/lib/babel/source.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: babel-source
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 5.0.0.beta1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian McKenzie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-03-
|
11
|
+
date: 2015-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description:
|
14
14
|
email: sebmck@gmail.com
|
@@ -36,9 +36,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
36
36
|
version: '0'
|
37
37
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - ! '
|
39
|
+
- - ! '>'
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 1.3.1
|
42
42
|
requirements: []
|
43
43
|
rubyforge_project:
|
44
44
|
rubygems_version: 2.4.5
|