babel-source 5.6.14 → 5.6.15
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 +24 -35
- data/lib/babel/source.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjQ2NThmYjU5MzEyNDFjODM2YzczNDJjNjA1NDEyYjI3MTAwNTQ1YQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ZGFiNjdlYjIzNzExNzUyNGE1ZjA3N2MyZmI4MWIyNzViYzYzMWE2Mw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OTg0ZmNmOGY4NDI0NjMzMDlkYTAwOTY3YjQyNjUzMWYyYjgwMmNiMjAyMjVh
|
10
|
+
ODJmYjdlOGM2M2QzODg3ZGI5ZTgyMGIxOTRiN2NhOTY3MmEyOGUzYjRlZjZh
|
11
|
+
Y2Y3ODg2Y2M5NDAxYTFkMmE4Y2QyMmM0YTJiN2FmMWRhYzkyYjg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MjI4YjM1NTViMTBkZmY4NGI2MjVmNGVjMDg2Zjg2YTU4MTRmYzBmNTcyNGFj
|
14
|
+
YWIxYzU5YWIzMDRiNDkwZDBhZWI0YTZlNWUwZmViY2ZjYzEwNDNmZjU0ZDE2
|
15
|
+
MDRiY2JlMzcyYWUwZTU5ZjExODJmMDRiODkzMTU0MGMyNzI4YWE=
|
data/lib/babel.js
CHANGED
@@ -57,6 +57,15 @@ pp.expectRelational = function (op) {
|
|
57
57
|
}
|
58
58
|
};
|
59
59
|
|
60
|
+
pp.flow_parseTypeInitialiser = function (tok) {
|
61
|
+
var oldInType = this.inType;
|
62
|
+
this.inType = true;
|
63
|
+
this.expect(tok || tt.colon);
|
64
|
+
var type = this.flow_parseType();
|
65
|
+
this.inType = oldInType;
|
66
|
+
return type;
|
67
|
+
};
|
68
|
+
|
60
69
|
pp.flow_parseDeclareClass = function (node) {
|
61
70
|
this.next();
|
62
71
|
this.flow_parseInterfaceish(node, true);
|
@@ -82,12 +91,7 @@ pp.flow_parseDeclareFunction = function (node) {
|
|
82
91
|
typeNode.params = tmp.params;
|
83
92
|
typeNode.rest = tmp.rest;
|
84
93
|
this.expect(tt.parenR);
|
85
|
-
|
86
|
-
var oldInType = this.inType;
|
87
|
-
this.inType = true;
|
88
|
-
this.expect(tt.colon);
|
89
|
-
typeNode.returnType = this.flow_parseType();
|
90
|
-
this.inType = oldInType;
|
94
|
+
typeNode.returnType = this.flow_parseTypeInitialiser();
|
91
95
|
|
92
96
|
typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation");
|
93
97
|
id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation");
|
@@ -197,15 +201,7 @@ pp.flow_parseTypeAlias = function (node) {
|
|
197
201
|
node.typeParameters = null;
|
198
202
|
}
|
199
203
|
|
200
|
-
|
201
|
-
this.inType = true;
|
202
|
-
|
203
|
-
this.expect(tt.eq);
|
204
|
-
|
205
|
-
node.right = this.flow_parseType();
|
206
|
-
|
207
|
-
this.inType = oldInType;
|
208
|
-
|
204
|
+
node.right = this.flow_parseTypeInitialiser(tt.eq);
|
209
205
|
this.semicolon();
|
210
206
|
|
211
207
|
return this.finishNode(node, "TypeAlias");
|
@@ -259,11 +255,9 @@ pp.flow_parseObjectTypeIndexer = function (node, isStatic) {
|
|
259
255
|
|
260
256
|
this.expect(tt.bracketL);
|
261
257
|
node.id = this.flow_parseObjectPropertyKey();
|
262
|
-
this.
|
263
|
-
node.key = this.flow_parseType();
|
258
|
+
node.key = this.flow_parseTypeInitialiser();
|
264
259
|
this.expect(tt.bracketR);
|
265
|
-
this.
|
266
|
-
node.value = this.flow_parseType();
|
260
|
+
node.value = this.flow_parseTypeInitialiser();
|
267
261
|
|
268
262
|
this.flow_objectTypeSemicolon();
|
269
263
|
return this.finishNode(node, "ObjectTypeIndexer");
|
@@ -290,8 +284,7 @@ pp.flow_parseObjectTypeMethodish = function (node) {
|
|
290
284
|
node.rest = this.flow_parseFunctionTypeParam();
|
291
285
|
}
|
292
286
|
this.expect(tt.parenR);
|
293
|
-
this.
|
294
|
-
node.returnType = this.flow_parseType();
|
287
|
+
node.returnType = this.flow_parseTypeInitialiser();
|
295
288
|
|
296
289
|
return this.finishNode(node, "FunctionTypeAnnotation");
|
297
290
|
};
|
@@ -355,9 +348,8 @@ pp.flow_parseObjectType = function (allowStatic) {
|
|
355
348
|
if (this.eat(tt.question)) {
|
356
349
|
optional = true;
|
357
350
|
}
|
358
|
-
this.expect(tt.colon);
|
359
351
|
node.key = propertyKey;
|
360
|
-
node.value = this.
|
352
|
+
node.value = this.flow_parseTypeInitialiser();
|
361
353
|
node.optional = optional;
|
362
354
|
node["static"] = isStatic;
|
363
355
|
this.flow_objectTypeSemicolon();
|
@@ -425,9 +417,8 @@ pp.flow_parseFunctionTypeParam = function () {
|
|
425
417
|
if (this.eat(tt.question)) {
|
426
418
|
optional = true;
|
427
419
|
}
|
428
|
-
this.expect(tt.colon);
|
429
420
|
node.optional = optional;
|
430
|
-
node.typeAnnotation = this.
|
421
|
+
node.typeAnnotation = this.flow_parseTypeInitialiser();
|
431
422
|
return this.finishNode(node, "FunctionTypeParam");
|
432
423
|
};
|
433
424
|
|
@@ -617,13 +608,7 @@ pp.flow_parseType = function () {
|
|
617
608
|
|
618
609
|
pp.flow_parseTypeAnnotation = function () {
|
619
610
|
var node = this.startNode();
|
620
|
-
|
621
|
-
var oldInType = this.inType;
|
622
|
-
this.inType = true;
|
623
|
-
this.expect(tt.colon);
|
624
|
-
node.typeAnnotation = this.flow_parseType();
|
625
|
-
this.inType = oldInType;
|
626
|
-
|
611
|
+
node.typeAnnotation = this.flow_parseTypeInitialiser();
|
627
612
|
return this.finishNode(node, "TypeAnnotation");
|
628
613
|
};
|
629
614
|
|
@@ -15966,6 +15951,11 @@ var memberExpressionOptimisationVisitor = {
|
|
15966
15951
|
}
|
15967
15952
|
},
|
15968
15953
|
|
15954
|
+
Flow: function Flow() {
|
15955
|
+
// don't touch reference in type annotations
|
15956
|
+
this.skip();
|
15957
|
+
},
|
15958
|
+
|
15969
15959
|
Function: function Function(node, parent, scope, state) {
|
15970
15960
|
// skip over functions as whatever `arguments` we reference inside will refer
|
15971
15961
|
// to the wrong function
|
@@ -64623,7 +64613,7 @@ module.exports = function (str) {
|
|
64623
64613
|
module.exports={
|
64624
64614
|
"name": "babel-core",
|
64625
64615
|
"description": "A compiler for writing next generation JavaScript",
|
64626
|
-
"version": "5.6.
|
64616
|
+
"version": "5.6.15",
|
64627
64617
|
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
64628
64618
|
"homepage": "https://babeljs.io/",
|
64629
64619
|
"license": "MIT",
|
@@ -64651,7 +64641,6 @@ module.exports={
|
|
64651
64641
|
"dependencies": {
|
64652
64642
|
"acorn-jsx": "^1.0.0",
|
64653
64643
|
"ast-types": "~0.7.0",
|
64654
|
-
"babel-eslint": "^3.1.19",
|
64655
64644
|
"babel-plugin-constant-folding": "^1.0.1",
|
64656
64645
|
"babel-plugin-dead-code-elimination": "^1.0.2",
|
64657
64646
|
"babel-plugin-eval": "^1.0.1",
|
@@ -64700,7 +64689,7 @@ module.exports={
|
|
64700
64689
|
},
|
64701
64690
|
"devDependencies": {
|
64702
64691
|
"babel": "5.6.10",
|
64703
|
-
"babel-eslint": "^3.1.
|
64692
|
+
"babel-eslint": "^3.1.19",
|
64704
64693
|
"browserify": "^9.0.8",
|
64705
64694
|
"chai": "^2.2.0",
|
64706
64695
|
"eslint": "^0.21.2",
|
data/lib/babel/source.rb
CHANGED