babel-source 5.6.12 → 5.6.13

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 +45 -2
  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
- ODE3ODBhYTJlNzg5ZWIwNjYyM2Y4YTc0NzQzZTE5NGNmYTg3M2YxYQ==
4
+ OTRkNWRhZTliZjEyZGM3ZGZlM2VmNGE4ZWQ2OGRjNGUwZjhiY2Y2NA==
5
5
  data.tar.gz: !binary |-
6
- YmI5YTEwNGY2NDdlNWFkZmYyY2RlZDMwOTgyMjQzMzBlNmY2ZTg4ZQ==
6
+ OWQ2Y2MzOWI3OTgyNmI1ZGMwMTg1N2JlOTk4ZGNiYWJkZWFkMzk1Mw==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MzY0Mzc2OTYwZmMwMGRlZmY4OTkyYjA3NDVmZDY0ZWQ1ZDYyYTQxYmQ1ZWE0
10
- MTE3MzBkYjdhMzJhNTZiMjc4MzI4MDIzODcyYmFkYmU5ZjBiMWMwOTc1ZDZh
11
- NWRjYTczYjg0NWQ4OTkwZDQ3ZDlhYTQ5MzhlYzY0MmNhNzhlODM=
9
+ YWVkZGFmMmU3NWQ3ZTYxMmIxMWIzZDc4YTdhNWU5NjU2OTAxMzdkYjVlN2Zj
10
+ NTg2Nzg3NmRkMDlmNWNiZmZjZGE5ZDdiMWIwMmM0MDc3Y2NhN2FkZjRiYTkw
11
+ ZDkyNDY4MDM5OWE0YTk3ODU4MDNiMDIzYzk5NmZiMGQ2NmJlZWE=
12
12
  data.tar.gz: !binary |-
13
- NTgwZDg0MjAxNTRjNGNkYzg2MWY2OTNmZjBiNDlkNWNjZmI2ZjNjYWVjYzBj
14
- MGZkYTFkMmY4YzU0YjI3OTU5MDU1ZWRkMDRhMzM2NmVmNTM4ZWMwMDljYTNi
15
- OTU3NTdlNmQwM2Y5NzYwMTU2ZGExODk2ZWRjYjAwYTI3Zjc4MTk=
13
+ Njc5YzliYWU4ZjU1NGVkOGEzNTAzYjIwYzQ4OGJkYTk1MmVkNjc1ZTdkNWYy
14
+ N2I3NzlmZmI5YTM3NDE1YTY3NDc3YjIxZDQxNTczMjc5MmE3MzczMTQ3MzRk
15
+ Y2M5ZGFmNzA0ODk4ZDljNDQxNzk0MTdkZjhkZjVhOWI4NjQ2OTY=
data/lib/babel.js CHANGED
@@ -27178,6 +27178,7 @@ var def = types.Type.def;
27178
27178
  var or = types.Type.or;
27179
27179
  var builtin = types.builtInTypes;
27180
27180
  var isString = builtin.string;
27181
+ var isNumber = builtin.number;
27181
27182
  var isBoolean = builtin.boolean;
27182
27183
  var defaults = require("../lib/shared").defaults;
27183
27184
 
@@ -27288,6 +27289,12 @@ def("VoidTypeAnnotation")
27288
27289
  def("NumberTypeAnnotation")
27289
27290
  .bases("Type");
27290
27291
 
27292
+ def("NumberLiteralTypeAnnotation")
27293
+ .bases("Type")
27294
+ .build("value", "raw")
27295
+ .field("value", isNumber)
27296
+ .field("raw", isString);
27297
+
27291
27298
  def("StringTypeAnnotation")
27292
27299
  .bases("Type");
27293
27300
 
@@ -27300,6 +27307,12 @@ def("StringLiteralTypeAnnotation")
27300
27307
  def("BooleanTypeAnnotation")
27301
27308
  .bases("Type");
27302
27309
 
27310
+ def("BooleanLiteralTypeAnnotation")
27311
+ .bases("Type")
27312
+ .build("value", "raw")
27313
+ .field("value", isBoolean)
27314
+ .field("raw", isString);
27315
+
27303
27316
  def("TypeAnnotation")
27304
27317
  .bases("Node")
27305
27318
  .build("typeAnnotation")
@@ -29677,7 +29690,7 @@ Dp.build = function(/* param1, param2, ... */) {
29677
29690
  // Every buildable type will have its "type" field filled in
29678
29691
  // automatically. This includes types that are not subtypes of Node,
29679
29692
  // like SourceLocation, but that seems harmless (TODO?).
29680
- self.field("type", self.typeName, function() { return self.typeName });
29693
+ self.field("type", isString, function() { return self.typeName });
29681
29694
 
29682
29695
  // Override Dp.buildable for this Def instance.
29683
29696
  Object.defineProperty(self, "buildable", { value: true });
@@ -29769,6 +29782,13 @@ function getBuilderName(typeName) {
29769
29782
  }
29770
29783
  });
29771
29784
  }
29785
+ exports.getBuilderName = getBuilderName;
29786
+
29787
+ function getStatementBuilderName(typeName) {
29788
+ typeName = getBuilderName(typeName);
29789
+ return typeName.replace(/(Expression)?$/, "Statement");
29790
+ }
29791
+ exports.getStatementBuilderName = getStatementBuilderName;
29772
29792
 
29773
29793
  // The reason fields are specified using .field(...) instead of an object
29774
29794
  // literal syntax is somewhat subtle: the object literal syntax would
@@ -29877,9 +29897,32 @@ Dp.finalize = function() {
29877
29897
 
29878
29898
  // A linearization of the inheritance hierarchy.
29879
29899
  populateSupertypeList(this.typeName, this.supertypeList);
29900
+
29901
+ if (this.buildable && this.supertypeList.lastIndexOf("Expression") >= 0) {
29902
+ wrapExpressionBuilderWithStatement(this.typeName);
29903
+ }
29880
29904
  }
29881
29905
  };
29882
29906
 
29907
+ // Adds an additional builder for Expression subtypes
29908
+ // that wraps the built Expression in an ExpressionStatements.
29909
+ function wrapExpressionBuilderWithStatement(typeName) {
29910
+ var wrapperName = getStatementBuilderName(typeName);
29911
+
29912
+ // skip if the builder already exists
29913
+ if (builders[wrapperName]) return;
29914
+
29915
+ // the builder function to wrap with builders.ExpressionStatement
29916
+ var wrapped = builders[getBuilderName(typeName)];
29917
+
29918
+ // skip if there is nothing to wrap
29919
+ if (!wrapped) return;
29920
+
29921
+ builders[wrapperName] = function() {
29922
+ return builders.expressionStatement(wrapped.apply(builders, arguments));
29923
+ };
29924
+ }
29925
+
29883
29926
  function populateSupertypeList(typeName, list) {
29884
29927
  list.length = 0;
29885
29928
  list.push(typeName);
@@ -64580,7 +64623,7 @@ module.exports = function (str) {
64580
64623
  module.exports={
64581
64624
  "name": "babel-core",
64582
64625
  "description": "A compiler for writing next generation JavaScript",
64583
- "version": "5.6.12",
64626
+ "version": "5.6.13",
64584
64627
  "author": "Sebastian McKenzie <sebmck@gmail.com>",
64585
64628
  "homepage": "https://babeljs.io/",
64586
64629
  "license": "MIT",
data/lib/babel/source.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  module Babel
2
2
  module Source
3
- VERSION = "5.6.12"
4
- DATE = Time.at(1435315240)
3
+ VERSION = "5.6.13"
4
+ DATE = Time.at(1435317900)
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.12
4
+ version: 5.6.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sebastian McKenzie