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.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/lib/babel.js +24 -35
  3. data/lib/babel/source.rb +2 -2
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZTMwZDY1Y2QyNzQ1OGFhNzhlMDQ0NDcyNDAyNGU3NzA3MDdmZTg5Mg==
4
+ YjQ2NThmYjU5MzEyNDFjODM2YzczNDJjNjA1NDEyYjI3MTAwNTQ1YQ==
5
5
  data.tar.gz: !binary |-
6
- MWE5MDliNzYxODA1ZDljN2Q3OGNmOWQ4ZGI3YTA0ZWUxZjAxMTJhZg==
6
+ ZGFiNjdlYjIzNzExNzUyNGE1ZjA3N2MyZmI4MWIyNzViYzYzMWE2Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZjhkZDczOGQ4MDliYWY3ODIyMGNjNGNkZGU1MWYxMjJkMTAwNzMxMGRiMDUz
10
- YjM0M2JkNTdkYzhjYTBkYmI1ZjMyZWRkOWMxNjFkZWE5MjYzNTc1NWMyM2Vl
11
- ZWI1M2ViYTQ1NDEyNmI0MDFmYzkzOTZjNzQwMjA4MGYwOWYzZmE=
9
+ OTg0ZmNmOGY4NDI0NjMzMDlkYTAwOTY3YjQyNjUzMWYyYjgwMmNiMjAyMjVh
10
+ ODJmYjdlOGM2M2QzODg3ZGI5ZTgyMGIxOTRiN2NhOTY3MmEyOGUzYjRlZjZh
11
+ Y2Y3ODg2Y2M5NDAxYTFkMmE4Y2QyMmM0YTJiN2FmMWRhYzkyYjg=
12
12
  data.tar.gz: !binary |-
13
- N2IxOGNhNDc5OTRjN2Q0MDViMTllZGMxYzM5YzA1ZmVlNDdlZGM3MGJjYTZh
14
- MjcxODMyYWVlOTEyOGVlNmQzYjhkMDg4YjgwOTgzNTEyYWM3NDI2YmJhNjQy
15
- YjExOTIyNWViYzYyYTFkODdmYmI1MjJjZjU2MjNiMzcyNGQ5NjE=
13
+ MjI4YjM1NTViMTBkZmY4NGI2MjVmNGVjMDg2Zjg2YTU4MTRmYzBmNTcyNGFj
14
+ YWIxYzU5YWIzMDRiNDkwZDBhZWI0YTZlNWUwZmViY2ZjYzEwNDNmZjU0ZDE2
15
+ MDRiY2JlMzcyYWUwZTU5ZjExODJmMDRiODkzMTU0MGMyNzI4YWE=
@@ -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
- var oldInType = this.inType;
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.expect(tt.colon);
263
- node.key = this.flow_parseType();
258
+ node.key = this.flow_parseTypeInitialiser();
264
259
  this.expect(tt.bracketR);
265
- this.expect(tt.colon);
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.expect(tt.colon);
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.flow_parseType();
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.flow_parseType();
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.14",
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.9",
64692
+ "babel-eslint": "^3.1.19",
64704
64693
  "browserify": "^9.0.8",
64705
64694
  "chai": "^2.2.0",
64706
64695
  "eslint": "^0.21.2",
@@ -1,7 +1,7 @@
1
1
  module Babel
2
2
  module Source
3
- VERSION = "5.6.14"
4
- DATE = Time.at(1435327743)
3
+ VERSION = "5.6.15"
4
+ DATE = Time.at(1435360044)
5
5
  PATH = File.expand_path("../..", __FILE__)
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: babel-source
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.6.14
4
+ version: 5.6.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian McKenzie