babel-source 4.6.1 → 4.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/lib/babel.js +654 -178
- 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
|
+
OWU2YTk4NjM0ZGJjNDRiNDVmMjgzZDIwMzEyN2UxMWNiZTdhZTA3NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YzcyODJhMGRiMDBmMmZmZDE4NjVmOWExODc0MGM3NDk5OTRmYmQ3Mw==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmI2N2EyNTE3M2JkMWQ3YmQzYzJkYTI0YWQyMGJhODg2ZmMzNDllZTA3ZWMz
|
10
|
+
MmMxMmI0NmJiODFjYjc2OGQ0OTlmNjU5ODUzMjQ0NjU0ZmQ1OWFlYzlmMWU2
|
11
|
+
ZDE0MzJjODNhYTM0OWIxNGQzZjFhOWY0ZjE4NzE1MzkyOWEyMWU=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MWM0YmE5MDgyNmZmNjNkNmUxZmM3YTAwODQyOGJiNTc1MTQxOTllYTNkMWQ4
|
14
|
+
ZTBmNTdkODc0MDA4ZjMxZjY0YTM0NjVkYjQwYmJhYWU2YjlhMTc0NmQ5ZDE0
|
15
|
+
MzgxZjNjNmQyYjcyYTllZTNiMjM4Nzc5NGFlNDFhZmU0Zjg2NTU=
|
data/lib/babel.js
CHANGED
@@ -318,9 +318,11 @@ exports.__esModule = true;
|
|
318
318
|
},{}],4:[function(require,module,exports){
|
319
319
|
"use strict";
|
320
320
|
|
321
|
+
exports.ClassDeclaration = ClassDeclaration;
|
321
322
|
exports.ClassBody = ClassBody;
|
322
323
|
exports.MethodDefinition = MethodDefinition;
|
323
|
-
|
324
|
+
|
325
|
+
function ClassDeclaration(node, print) {
|
324
326
|
this.push("class");
|
325
327
|
|
326
328
|
if (node.id) {
|
@@ -328,14 +330,24 @@ exports.ClassExpression = exports.ClassDeclaration = function (node, print) {
|
|
328
330
|
print(node.id);
|
329
331
|
}
|
330
332
|
|
333
|
+
print(node.typeParameters);
|
334
|
+
|
331
335
|
if (node.superClass) {
|
332
336
|
this.push(" extends ");
|
333
337
|
print(node.superClass);
|
338
|
+
print(node.superTypeParameters);
|
339
|
+
}
|
340
|
+
|
341
|
+
if (node["implements"]) {
|
342
|
+
this.push(" implements ");
|
343
|
+
print.join(node["implements"], { separator: ", " });
|
334
344
|
}
|
335
345
|
|
336
346
|
this.space();
|
337
347
|
print(node.body);
|
338
|
-
}
|
348
|
+
}
|
349
|
+
|
350
|
+
exports.ClassExpression = ClassDeclaration;
|
339
351
|
|
340
352
|
function ClassBody(node, print) {
|
341
353
|
if (node.body.length === 0) {
|
@@ -568,10 +580,270 @@ exports.__esModule = true;
|
|
568
580
|
},{"../../types":122,"is-integer":188,"lodash/lang/isNumber":292}],7:[function(require,module,exports){
|
569
581
|
"use strict";
|
570
582
|
|
571
|
-
|
583
|
+
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
584
|
+
|
585
|
+
exports.AnyTypeAnnotation = AnyTypeAnnotation;
|
586
|
+
exports.ArrayTypeAnnotation = ArrayTypeAnnotation;
|
587
|
+
exports.BooleanTypeAnnotation = BooleanTypeAnnotation;
|
588
|
+
exports.ClassProperty = ClassProperty;
|
589
|
+
exports.DeclareClass = DeclareClass;
|
590
|
+
exports.DeclareFunction = DeclareFunction;
|
591
|
+
exports.DeclareModule = DeclareModule;
|
592
|
+
exports.DeclareVariable = DeclareVariable;
|
593
|
+
exports.FunctionTypeAnnotation = FunctionTypeAnnotation;
|
594
|
+
exports.FunctionTypeParam = FunctionTypeParam;
|
595
|
+
exports.InterfaceExtends = InterfaceExtends;
|
596
|
+
exports._interfaceish = _interfaceish;
|
597
|
+
exports.InterfaceDeclaration = InterfaceDeclaration;
|
598
|
+
exports.IntersectionTypeAnnotation = IntersectionTypeAnnotation;
|
599
|
+
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
600
|
+
exports.NumberTypeAnnotation = NumberTypeAnnotation;
|
601
|
+
exports.StringLiteralTypeAnnotation = StringLiteralTypeAnnotation;
|
602
|
+
exports.StringTypeAnnotation = StringTypeAnnotation;
|
603
|
+
exports.TupleTypeAnnotation = TupleTypeAnnotation;
|
604
|
+
exports.TypeofTypeAnnotation = TypeofTypeAnnotation;
|
605
|
+
exports.TypeAlias = TypeAlias;
|
606
|
+
exports.TypeAnnotation = TypeAnnotation;
|
607
|
+
exports.TypeParameterInstantiation = TypeParameterInstantiation;
|
608
|
+
exports.ObjectTypeAnnotation = ObjectTypeAnnotation;
|
609
|
+
exports.ObjectTypeCallProperty = ObjectTypeCallProperty;
|
610
|
+
exports.ObjectTypeIndexer = ObjectTypeIndexer;
|
611
|
+
exports.ObjectTypeProperty = ObjectTypeProperty;
|
612
|
+
exports.QualifiedTypeIdentifier = QualifiedTypeIdentifier;
|
613
|
+
exports.UnionTypeAnnotation = UnionTypeAnnotation;
|
614
|
+
exports.TypeCastExpression = TypeCastExpression;
|
615
|
+
exports.VoidTypeAnnotation = VoidTypeAnnotation;
|
616
|
+
|
617
|
+
var t = _interopRequire(require("../../types"));
|
618
|
+
|
619
|
+
function AnyTypeAnnotation() {
|
620
|
+
this.push("any");
|
621
|
+
}
|
622
|
+
|
623
|
+
function ArrayTypeAnnotation(node, print) {
|
624
|
+
print(node.elementType);
|
625
|
+
this.push("[");
|
626
|
+
this.push("]");
|
627
|
+
}
|
628
|
+
|
629
|
+
function BooleanTypeAnnotation(node) {
|
630
|
+
this.push("bool");
|
631
|
+
}
|
632
|
+
|
633
|
+
function ClassProperty(node, print) {
|
634
|
+
if (node["static"]) this.push("static ");
|
635
|
+
print(node.key);
|
636
|
+
print(node.typeAnnotation);
|
637
|
+
this.semicolon();
|
638
|
+
}
|
639
|
+
|
640
|
+
function DeclareClass(node, print) {
|
641
|
+
this.push("declare class ");
|
642
|
+
this._interfaceish(node, print);
|
643
|
+
}
|
644
|
+
|
645
|
+
function DeclareFunction(node, print) {
|
646
|
+
this.push("declare function ");
|
647
|
+
print(node.id);
|
648
|
+
print(node.id.typeAnnotation.typeAnnotation);
|
649
|
+
this.semicolon();
|
650
|
+
}
|
651
|
+
|
652
|
+
function DeclareModule(node, print) {
|
653
|
+
this.push("declare module ");
|
654
|
+
print(node.id);
|
655
|
+
this.space();
|
656
|
+
print(node.body);
|
657
|
+
}
|
658
|
+
|
659
|
+
function DeclareVariable(node, print) {
|
660
|
+
this.push("declare var ");
|
661
|
+
print(node.id);
|
662
|
+
print(node.id.typeAnnotation);
|
663
|
+
this.semicolon();
|
664
|
+
}
|
665
|
+
|
666
|
+
function FunctionTypeAnnotation(node, print, parent) {
|
667
|
+
print(node.typeParameters);
|
668
|
+
this.push("(");
|
669
|
+
print.list(node.params);
|
670
|
+
|
671
|
+
if (node.rest) {
|
672
|
+
if (node.params.length) {
|
673
|
+
this.push(",");
|
674
|
+
this.space();
|
675
|
+
}
|
676
|
+
this.push("...");
|
677
|
+
print(node.rest);
|
678
|
+
}
|
679
|
+
|
680
|
+
this.push(")");
|
681
|
+
|
682
|
+
// this node type is overloaded, not sure why but it makes it EXTREMELY annoying
|
683
|
+
if (parent.type === "ObjectTypeProperty" || parent.type === "ObjectTypeCallProperty" || parent.type === "DeclareFunction") {
|
684
|
+
this.push(":");
|
685
|
+
} else {
|
686
|
+
this.space();
|
687
|
+
this.push("=>");
|
688
|
+
}
|
689
|
+
|
690
|
+
this.space();
|
691
|
+
print(node.returnType);
|
692
|
+
}
|
693
|
+
|
694
|
+
function FunctionTypeParam(node, print) {
|
695
|
+
print(node.name);
|
696
|
+
if (node.optional) this.push("?");
|
697
|
+
this.push(":");
|
698
|
+
this.space();
|
699
|
+
print(node.typeAnnotation);
|
700
|
+
}
|
701
|
+
|
702
|
+
function InterfaceExtends(node, print) {
|
703
|
+
print(node.id);
|
704
|
+
print(node.typeParameters);
|
705
|
+
}
|
706
|
+
|
707
|
+
exports.ClassImplements = InterfaceExtends;
|
708
|
+
exports.GenericTypeAnnotation = InterfaceExtends;
|
709
|
+
|
710
|
+
function _interfaceish(node, print) {
|
711
|
+
print(node.id);
|
712
|
+
print(node.typeParameters);
|
713
|
+
if (node["extends"].length) {
|
714
|
+
this.push(" extends ");
|
715
|
+
print.join(node["extends"], { separator: ", " });
|
716
|
+
}
|
717
|
+
this.space();
|
718
|
+
print(node.body);
|
719
|
+
}
|
720
|
+
|
721
|
+
function InterfaceDeclaration(node, print) {
|
722
|
+
this.push("interface ");
|
723
|
+
this._interfaceish(node, print);
|
724
|
+
}
|
725
|
+
|
726
|
+
function IntersectionTypeAnnotation(node, print) {
|
727
|
+
print.join(node.types, { separator: " & " });
|
728
|
+
}
|
729
|
+
|
730
|
+
function NullableTypeAnnotation(node, print) {
|
731
|
+
this.push("?");
|
732
|
+
print(node.typeAnnotation);
|
733
|
+
}
|
734
|
+
|
735
|
+
function NumberTypeAnnotation() {
|
736
|
+
this.push("number");
|
737
|
+
}
|
738
|
+
|
739
|
+
function StringLiteralTypeAnnotation(node) {
|
740
|
+
this._stringLiteral(node.value);
|
741
|
+
}
|
742
|
+
|
743
|
+
function StringTypeAnnotation() {
|
744
|
+
this.push("string");
|
745
|
+
}
|
746
|
+
|
747
|
+
function TupleTypeAnnotation(node, print) {
|
748
|
+
this.push("[");
|
749
|
+
print.join(node.types, { separator: ", " });
|
750
|
+
this.push("]");
|
751
|
+
}
|
752
|
+
|
753
|
+
function TypeofTypeAnnotation(node, print) {
|
754
|
+
this.push("typeof ");
|
755
|
+
print(node.argument);
|
756
|
+
}
|
572
757
|
|
573
|
-
|
574
|
-
|
758
|
+
function TypeAlias(node, print) {
|
759
|
+
this.push("type ");
|
760
|
+
print(node.id);
|
761
|
+
print(node.typeParameters);
|
762
|
+
this.space();
|
763
|
+
this.push("=");
|
764
|
+
this.space();
|
765
|
+
print(node.right);
|
766
|
+
this.semicolon();
|
767
|
+
}
|
768
|
+
|
769
|
+
function TypeAnnotation(node, print) {
|
770
|
+
this.push(":");
|
771
|
+
this.space();
|
772
|
+
if (node.optional) this.push("?");
|
773
|
+
print(node.typeAnnotation);
|
774
|
+
}
|
775
|
+
|
776
|
+
function TypeParameterInstantiation(node, print) {
|
777
|
+
this.push("<");
|
778
|
+
print.join(node.params, { separator: ", " });
|
779
|
+
this.push(">");
|
780
|
+
}
|
781
|
+
|
782
|
+
exports.TypeParameterDeclaration = TypeParameterInstantiation;
|
783
|
+
|
784
|
+
function ObjectTypeAnnotation(node, print) {
|
785
|
+
this.push("{");
|
786
|
+
var props = node.properties.concat(node.callProperties, node.indexers);
|
787
|
+
if (props.length) {
|
788
|
+
this.space();
|
789
|
+
print.list(props, { indent: true, separator: "; " });
|
790
|
+
this.space();
|
791
|
+
}
|
792
|
+
this.push("}");
|
793
|
+
}
|
794
|
+
|
795
|
+
function ObjectTypeCallProperty(node, print) {
|
796
|
+
if (node["static"]) this.push("static ");
|
797
|
+
print(node.value);
|
798
|
+
}
|
799
|
+
|
800
|
+
function ObjectTypeIndexer(node, print) {
|
801
|
+
if (node["static"]) this.push("static ");
|
802
|
+
this.push("[");
|
803
|
+
print(node.id);
|
804
|
+
this.push(":");
|
805
|
+
this.space();
|
806
|
+
print(node.key);
|
807
|
+
this.push("]");
|
808
|
+
this.push(":");
|
809
|
+
this.space();
|
810
|
+
print(node.value);
|
811
|
+
}
|
812
|
+
|
813
|
+
function ObjectTypeProperty(node, print) {
|
814
|
+
if (node["static"]) this.push("static ");
|
815
|
+
print(node.key);
|
816
|
+
if (node.optional) this.push("?");
|
817
|
+
if (!t.isFunctionTypeAnnotation(node.value)) {
|
818
|
+
this.push(":");
|
819
|
+
this.space();
|
820
|
+
}
|
821
|
+
print(node.value);
|
822
|
+
}
|
823
|
+
|
824
|
+
function QualifiedTypeIdentifier(node, print) {
|
825
|
+
print(node.qualification);
|
826
|
+
this.push(".");
|
827
|
+
print(node.id);
|
828
|
+
}
|
829
|
+
|
830
|
+
function UnionTypeAnnotation(node, print) {
|
831
|
+
print.join(node.types, { separator: " | " });
|
832
|
+
}
|
833
|
+
|
834
|
+
function TypeCastExpression(node, print) {
|
835
|
+
this.push("(");
|
836
|
+
print(node.expression);
|
837
|
+
print(node.typeAnnotation);
|
838
|
+
this.push(")");
|
839
|
+
}
|
840
|
+
|
841
|
+
function VoidTypeAnnotation(node) {
|
842
|
+
this.push("void");
|
843
|
+
}
|
844
|
+
|
845
|
+
exports.__esModule = true;
|
846
|
+
},{"../../types":122}],8:[function(require,module,exports){
|
575
847
|
"use strict";
|
576
848
|
|
577
849
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
@@ -678,9 +950,21 @@ exports.ArrowFunctionExpression = ArrowFunctionExpression;
|
|
678
950
|
var t = _interopRequire(require("../../types"));
|
679
951
|
|
680
952
|
function _params(node, print) {
|
953
|
+
var _this = this;
|
954
|
+
|
955
|
+
print(node.typeParameters);
|
681
956
|
this.push("(");
|
682
|
-
print.list(node.params
|
957
|
+
print.list(node.params, {
|
958
|
+
iterator: function (node) {
|
959
|
+
if (node.optional) _this.push("?");
|
960
|
+
print(node.typeAnnotation);
|
961
|
+
}
|
962
|
+
});
|
683
963
|
this.push(")");
|
964
|
+
|
965
|
+
if (node.returnType) {
|
966
|
+
print(node.returnType);
|
967
|
+
}
|
684
968
|
}
|
685
969
|
|
686
970
|
function _method(node, print) {
|
@@ -1104,14 +1388,13 @@ function PrivateDeclaration(node, print) {
|
|
1104
1388
|
}
|
1105
1389
|
|
1106
1390
|
function VariableDeclarator(node, print) {
|
1391
|
+
print(node.id);
|
1392
|
+
print(node.id.typeAnnotation);
|
1107
1393
|
if (node.init) {
|
1108
|
-
print(node.id);
|
1109
1394
|
this.space();
|
1110
1395
|
this.push("=");
|
1111
1396
|
this.space();
|
1112
1397
|
print(node.init);
|
1113
|
-
} else {
|
1114
|
-
print(node.id);
|
1115
1398
|
}
|
1116
1399
|
}
|
1117
1400
|
|
@@ -1167,6 +1450,7 @@ exports.Identifier = Identifier;
|
|
1167
1450
|
exports.VirtualPropertyExpression = VirtualPropertyExpression;
|
1168
1451
|
exports.Property = Property;
|
1169
1452
|
exports.Literal = Literal;
|
1453
|
+
exports._stringLiteral = _stringLiteral;
|
1170
1454
|
|
1171
1455
|
var each = _interopRequire(require("lodash/collection/each"));
|
1172
1456
|
|
@@ -1251,14 +1535,7 @@ function Literal(node) {
|
|
1251
1535
|
var type = typeof val;
|
1252
1536
|
|
1253
1537
|
if (type === "string") {
|
1254
|
-
|
1255
|
-
|
1256
|
-
// escape illegal js but valid json unicode characters
|
1257
|
-
val = val.replace(/[\u000A\u000D\u2028\u2029]/g, function (c) {
|
1258
|
-
return "\\u" + ("0000" + c.charCodeAt(0).toString(16)).slice(-4);
|
1259
|
-
});
|
1260
|
-
|
1261
|
-
this.push(val);
|
1538
|
+
this._stringLiteral(val);
|
1262
1539
|
} else if (type === "number") {
|
1263
1540
|
this.push(val + "");
|
1264
1541
|
} else if (type === "boolean") {
|
@@ -1270,6 +1547,17 @@ function Literal(node) {
|
|
1270
1547
|
}
|
1271
1548
|
}
|
1272
1549
|
|
1550
|
+
function _stringLiteral(val) {
|
1551
|
+
val = JSON.stringify(val);
|
1552
|
+
|
1553
|
+
// escape illegal js but valid json unicode characters
|
1554
|
+
val = val.replace(/[\u000A\u000D\u2028\u2029]/g, function (c) {
|
1555
|
+
return "\\u" + ("0000" + c.charCodeAt(0).toString(16)).slice(-4);
|
1556
|
+
});
|
1557
|
+
|
1558
|
+
this.push(val);
|
1559
|
+
}
|
1560
|
+
|
1273
1561
|
exports.__esModule = true;
|
1274
1562
|
},{"lodash/collection/each":201}],15:[function(require,module,exports){
|
1275
1563
|
"use strict";
|
@@ -1422,7 +1710,7 @@ var CodeGenerator = (function () {
|
|
1422
1710
|
|
1423
1711
|
var opts = arguments[2] === undefined ? {} : arguments[2];
|
1424
1712
|
|
1425
|
-
if (!node) return
|
1713
|
+
if (!node) return;
|
1426
1714
|
|
1427
1715
|
if (parent && parent._compact) {
|
1428
1716
|
node._compact = true;
|
@@ -1805,6 +2093,7 @@ each(Node, function (fn, key) {
|
|
1805
2093
|
|
1806
2094
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
1807
2095
|
|
2096
|
+
exports.NullableTypeAnnotation = NullableTypeAnnotation;
|
1808
2097
|
exports.UpdateExpression = UpdateExpression;
|
1809
2098
|
exports.ObjectExpression = ObjectExpression;
|
1810
2099
|
exports.Binary = Binary;
|
@@ -1814,6 +2103,7 @@ exports.YieldExpression = YieldExpression;
|
|
1814
2103
|
exports.ClassExpression = ClassExpression;
|
1815
2104
|
exports.UnaryLike = UnaryLike;
|
1816
2105
|
exports.FunctionExpression = FunctionExpression;
|
2106
|
+
exports.ConditionalExpression = ConditionalExpression;
|
1817
2107
|
|
1818
2108
|
var each = _interopRequire(require("lodash/collection/each"));
|
1819
2109
|
|
@@ -1827,6 +2117,12 @@ each([["||"], ["&&"], ["|"], ["^"], ["&"], ["==", "===", "!=", "!=="], ["<", ">"
|
|
1827
2117
|
});
|
1828
2118
|
});
|
1829
2119
|
|
2120
|
+
function NullableTypeAnnotation(node, parent) {
|
2121
|
+
return t.isArrayTypeAnnotation(parent);
|
2122
|
+
}
|
2123
|
+
|
2124
|
+
exports.FunctionTypeAnnotation = NullableTypeAnnotation;
|
2125
|
+
|
1830
2126
|
function UpdateExpression(node, parent) {
|
1831
2127
|
if (t.isMemberExpression(parent) && parent.object === node) {
|
1832
2128
|
// (foo++).test()
|
@@ -1939,7 +2235,7 @@ function FunctionExpression(node, parent) {
|
|
1939
2235
|
}
|
1940
2236
|
}
|
1941
2237
|
|
1942
|
-
|
2238
|
+
function ConditionalExpression(node, parent) {
|
1943
2239
|
if (t.isUnaryLike(parent)) {
|
1944
2240
|
return true;
|
1945
2241
|
}
|
@@ -1963,7 +2259,9 @@ exports.AssignmentExpression = exports.ConditionalExpression = function (node, p
|
|
1963
2259
|
}
|
1964
2260
|
|
1965
2261
|
return false;
|
1966
|
-
}
|
2262
|
+
}
|
2263
|
+
|
2264
|
+
exports.AssignmentExpression = ConditionalExpression;
|
1967
2265
|
exports.__esModule = true;
|
1968
2266
|
},{"../../types":122,"lodash/collection/each":201}],18:[function(require,module,exports){
|
1969
2267
|
"use strict";
|
@@ -2703,12 +3001,12 @@ var checkTransformerVisitor = {
|
|
2703
3001
|
}
|
2704
3002
|
};
|
2705
3003
|
|
2706
|
-
|
3004
|
+
function checkNode(stack, node, scope) {
|
2707
3005
|
each(stack, function (pass) {
|
2708
3006
|
if (pass.shouldRun) return;
|
2709
3007
|
pass.checkNode(node, scope);
|
2710
3008
|
});
|
2711
|
-
}
|
3009
|
+
}
|
2712
3010
|
|
2713
3011
|
var File = (function () {
|
2714
3012
|
function File(opts) {
|
@@ -3275,7 +3573,7 @@ var messages = _interopRequireWildcard(require("../../messages"));
|
|
3275
3573
|
|
3276
3574
|
var esutils = _interopRequire(require("esutils"));
|
3277
3575
|
|
3278
|
-
var react =
|
3576
|
+
var react = _interopRequireWildcard(require("./react"));
|
3279
3577
|
|
3280
3578
|
var t = _interopRequire(require("../../types"));
|
3281
3579
|
|
@@ -3553,6 +3851,9 @@ module.exports = function (exports, opts) {
|
|
3553
3851
|
|
3554
3852
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
3555
3853
|
|
3854
|
+
exports.push = push;
|
3855
|
+
exports.build = build;
|
3856
|
+
|
3556
3857
|
var cloneDeep = _interopRequire(require("lodash/lang/cloneDeep"));
|
3557
3858
|
|
3558
3859
|
var traverse = _interopRequire(require("../../traversal"));
|
@@ -3565,7 +3866,7 @@ var has = _interopRequire(require("lodash/object/has"));
|
|
3565
3866
|
|
3566
3867
|
var t = _interopRequire(require("../../types"));
|
3567
3868
|
|
3568
|
-
|
3869
|
+
function push(mutatorMap, key, kind, computed, value) {
|
3569
3870
|
var alias;
|
3570
3871
|
|
3571
3872
|
if (t.isIdentifier(key)) {
|
@@ -3591,9 +3892,9 @@ exports.push = function (mutatorMap, key, kind, computed, value) {
|
|
3591
3892
|
}
|
3592
3893
|
|
3593
3894
|
map[kind] = value;
|
3594
|
-
}
|
3895
|
+
}
|
3595
3896
|
|
3596
|
-
|
3897
|
+
function build(mutatorMap) {
|
3597
3898
|
var objExpr = t.objectExpression([]);
|
3598
3899
|
|
3599
3900
|
each(mutatorMap, function (map) {
|
@@ -3630,7 +3931,9 @@ exports.build = function (mutatorMap) {
|
|
3630
3931
|
});
|
3631
3932
|
|
3632
3933
|
return objExpr;
|
3633
|
-
}
|
3934
|
+
}
|
3935
|
+
|
3936
|
+
exports.__esModule = true;
|
3634
3937
|
},{"../../traversal":117,"../../types":122,"lodash/collection/each":201,"lodash/lang/clone":284,"lodash/lang/cloneDeep":285,"lodash/object/has":300}],35:[function(require,module,exports){
|
3635
3938
|
"use strict";
|
3636
3939
|
|
@@ -3724,6 +4027,9 @@ var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? ob
|
|
3724
4027
|
|
3725
4028
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
3726
4029
|
|
4030
|
+
exports.property = property;
|
4031
|
+
exports.bare = bare;
|
4032
|
+
|
3727
4033
|
var getFunctionArity = _interopRequire(require("./get-function-arity"));
|
3728
4034
|
|
3729
4035
|
var util = _interopRequireWildcard(require("../../util"));
|
@@ -3808,7 +4114,7 @@ var visit = function visit(node, name, scope) {
|
|
3808
4114
|
return state;
|
3809
4115
|
};
|
3810
4116
|
|
3811
|
-
|
4117
|
+
function property(node, file, scope) {
|
3812
4118
|
var key = t.toComputedKey(node, node.key);
|
3813
4119
|
if (!t.isLiteral(key)) return node; // we can't set a function id with this
|
3814
4120
|
|
@@ -3818,9 +4124,9 @@ exports.property = function (node, file, scope) {
|
|
3818
4124
|
var method = node.value;
|
3819
4125
|
var state = visit(method, name, scope);
|
3820
4126
|
node.value = wrap(state, method, id, scope);
|
3821
|
-
}
|
4127
|
+
}
|
3822
4128
|
|
3823
|
-
|
4129
|
+
function bare(node, parent, scope) {
|
3824
4130
|
// has an `id` so we don't need to infer one
|
3825
4131
|
if (node.id) return;
|
3826
4132
|
|
@@ -3842,7 +4148,9 @@ exports.bare = function (node, parent, scope) {
|
|
3842
4148
|
|
3843
4149
|
var state = visit(node, name, scope);
|
3844
4150
|
return wrap(state, node, id, scope);
|
3845
|
-
}
|
4151
|
+
}
|
4152
|
+
|
4153
|
+
exports.__esModule = true;
|
3846
4154
|
|
3847
4155
|
// otherwise it's defined somewhere in scope like:
|
3848
4156
|
//
|
@@ -3857,11 +4165,14 @@ exports.bare = function (node, parent, scope) {
|
|
3857
4165
|
|
3858
4166
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
3859
4167
|
|
4168
|
+
exports.isCreateClass = isCreateClass;
|
4169
|
+
exports.isCompatTag = isCompatTag;
|
4170
|
+
|
3860
4171
|
var t = _interopRequire(require("../../types"));
|
3861
4172
|
|
3862
4173
|
var isCreateClassCallExpression = t.buildMatchMemberExpression("React.createClass");
|
3863
4174
|
|
3864
|
-
|
4175
|
+
function isCreateClass(node) {
|
3865
4176
|
if (!node || !t.isCallExpression(node)) return false;
|
3866
4177
|
|
3867
4178
|
// not React.createClass call member object
|
@@ -3876,13 +4187,15 @@ exports.isCreateClass = function (node) {
|
|
3876
4187
|
if (!t.isObjectExpression(first)) return false;
|
3877
4188
|
|
3878
4189
|
return true;
|
3879
|
-
}
|
4190
|
+
}
|
3880
4191
|
|
3881
|
-
exports.isReactComponent = t.buildMatchMemberExpression("React.Component");
|
4192
|
+
var isReactComponent = exports.isReactComponent = t.buildMatchMemberExpression("React.Component");
|
3882
4193
|
|
3883
|
-
|
4194
|
+
function isCompatTag(tagName) {
|
3884
4195
|
return tagName && /^[a-z]|\-/.test(tagName);
|
3885
|
-
}
|
4196
|
+
}
|
4197
|
+
|
4198
|
+
exports.__esModule = true;
|
3886
4199
|
},{"../../types":122}],39:[function(require,module,exports){
|
3887
4200
|
"use strict";
|
3888
4201
|
|
@@ -4242,14 +4555,17 @@ module.exports = ReplaceSupers;
|
|
4242
4555
|
|
4243
4556
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
4244
4557
|
|
4558
|
+
exports.has = has;
|
4559
|
+
exports.wrap = wrap;
|
4560
|
+
|
4245
4561
|
var t = _interopRequire(require("../../types"));
|
4246
4562
|
|
4247
|
-
|
4563
|
+
function has(node) {
|
4248
4564
|
var first = node.body[0];
|
4249
4565
|
return t.isExpressionStatement(first) && t.isLiteral(first.expression, { value: "use strict" });
|
4250
|
-
}
|
4566
|
+
}
|
4251
4567
|
|
4252
|
-
|
4568
|
+
function wrap(node, callback) {
|
4253
4569
|
var useStrictNode;
|
4254
4570
|
if (exports.has(node)) {
|
4255
4571
|
useStrictNode = node.body.shift();
|
@@ -4260,7 +4576,9 @@ exports.wrap = function (node, callback) {
|
|
4260
4576
|
if (useStrictNode) {
|
4261
4577
|
node.body.unshift(useStrictNode);
|
4262
4578
|
}
|
4263
|
-
}
|
4579
|
+
}
|
4580
|
+
|
4581
|
+
exports.__esModule = true;
|
4264
4582
|
},{"../../types":122}],43:[function(require,module,exports){
|
4265
4583
|
"use strict";
|
4266
4584
|
|
@@ -5489,10 +5807,12 @@ exports.__esModule = true;
|
|
5489
5807
|
|
5490
5808
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
5491
5809
|
|
5810
|
+
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
5811
|
+
|
5492
5812
|
exports.check = check;
|
5493
5813
|
exports.ObjectExpression = ObjectExpression;
|
5494
5814
|
|
5495
|
-
var defineMap =
|
5815
|
+
var defineMap = _interopRequireWildcard(require("../../helpers/define-map"));
|
5496
5816
|
|
5497
5817
|
var t = _interopRequire(require("../../../types"));
|
5498
5818
|
|
@@ -5529,7 +5849,7 @@ exports.ArrowFunctionExpression = ArrowFunctionExpression;
|
|
5529
5849
|
|
5530
5850
|
var t = _interopRequire(require("../../../types"));
|
5531
5851
|
|
5532
|
-
exports.check = t.isArrowFunctionExpression;
|
5852
|
+
var check = exports.check = t.isArrowFunctionExpression;
|
5533
5853
|
|
5534
5854
|
function ArrowFunctionExpression(node) {
|
5535
5855
|
t.ensureBlock(node);
|
@@ -5547,6 +5867,8 @@ exports.__esModule = true;
|
|
5547
5867
|
|
5548
5868
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
5549
5869
|
|
5870
|
+
exports.BlockStatement = BlockStatement;
|
5871
|
+
|
5550
5872
|
var t = _interopRequire(require("../../../types"));
|
5551
5873
|
|
5552
5874
|
var visitor = {
|
@@ -5572,9 +5894,9 @@ var visitor = {
|
|
5572
5894
|
}
|
5573
5895
|
};
|
5574
5896
|
|
5575
|
-
exports.optional = true;
|
5897
|
+
var optional = exports.optional = true;
|
5576
5898
|
|
5577
|
-
|
5899
|
+
function BlockStatement(node, parent, scope, file) {
|
5578
5900
|
var letRefs = node._letReferences;
|
5579
5901
|
if (!letRefs) return;
|
5580
5902
|
|
@@ -5584,7 +5906,11 @@ exports.Loop = exports.Program = exports.BlockStatement = function (node, parent
|
|
5584
5906
|
};
|
5585
5907
|
|
5586
5908
|
scope.traverse(node, visitor, state);
|
5587
|
-
}
|
5909
|
+
}
|
5910
|
+
|
5911
|
+
exports.Program = BlockStatement;
|
5912
|
+
exports.Loop = BlockStatement;
|
5913
|
+
exports.__esModule = true;
|
5588
5914
|
},{"../../../types":122}],63:[function(require,module,exports){
|
5589
5915
|
"use strict";
|
5590
5916
|
|
@@ -5594,6 +5920,11 @@ var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["defau
|
|
5594
5920
|
|
5595
5921
|
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
|
5596
5922
|
|
5923
|
+
exports.check = check;
|
5924
|
+
exports.VariableDeclaration = VariableDeclaration;
|
5925
|
+
exports.Loop = Loop;
|
5926
|
+
exports.BlockStatement = BlockStatement;
|
5927
|
+
|
5597
5928
|
var traverse = _interopRequire(require("../../../traversal"));
|
5598
5929
|
|
5599
5930
|
var object = _interopRequire(require("../../../helpers/object"));
|
@@ -5606,11 +5937,7 @@ var values = _interopRequire(require("lodash/object/values"));
|
|
5606
5937
|
|
5607
5938
|
var extend = _interopRequire(require("lodash/object/extend"));
|
5608
5939
|
|
5609
|
-
|
5610
|
-
return t.isVariableDeclaration(node) && (node.kind === "let" || node.kind === "const");
|
5611
|
-
};
|
5612
|
-
|
5613
|
-
var isLet = function isLet(node, parent) {
|
5940
|
+
function isLet(node, parent) {
|
5614
5941
|
if (!t.isVariableDeclaration(node)) return false;
|
5615
5942
|
if (node._let) return true;
|
5616
5943
|
if (node.kind !== "let") return false;
|
@@ -5627,23 +5954,27 @@ var isLet = function isLet(node, parent) {
|
|
5627
5954
|
node._let = true;
|
5628
5955
|
node.kind = "var";
|
5629
5956
|
return true;
|
5630
|
-
}
|
5957
|
+
}
|
5631
5958
|
|
5632
|
-
|
5959
|
+
function isLetInitable(node, parent) {
|
5633
5960
|
return !t.isFor(parent) || !t.isFor(parent, { left: node });
|
5634
|
-
}
|
5961
|
+
}
|
5635
5962
|
|
5636
|
-
|
5963
|
+
function isVar(node, parent) {
|
5637
5964
|
return t.isVariableDeclaration(node, { kind: "var" }) && !isLet(node, parent);
|
5638
|
-
}
|
5965
|
+
}
|
5639
5966
|
|
5640
|
-
|
5967
|
+
function standardizeLets(declars) {
|
5641
5968
|
for (var i = 0; i < declars.length; i++) {
|
5642
5969
|
delete declars[i]._let;
|
5643
5970
|
}
|
5644
|
-
}
|
5971
|
+
}
|
5972
|
+
|
5973
|
+
function check(node) {
|
5974
|
+
return t.isVariableDeclaration(node) && (node.kind === "let" || node.kind === "const");
|
5975
|
+
}
|
5645
5976
|
|
5646
|
-
|
5977
|
+
function VariableDeclaration(node, parent, scope, file) {
|
5647
5978
|
if (!isLet(node, parent)) return;
|
5648
5979
|
|
5649
5980
|
if (isLetInitable(node) && file.transformers["es6.blockScopingTDZ"].canRun()) {
|
@@ -5663,9 +5994,9 @@ exports.VariableDeclaration = function (node, parent, scope, file) {
|
|
5663
5994
|
|
5664
5995
|
return nodes;
|
5665
5996
|
}
|
5666
|
-
}
|
5997
|
+
}
|
5667
5998
|
|
5668
|
-
|
5999
|
+
function Loop(node, parent, scope, file) {
|
5669
6000
|
var init = node.left || node.init;
|
5670
6001
|
if (isLet(init, node)) {
|
5671
6002
|
t.ensureBlock(node);
|
@@ -5673,14 +6004,16 @@ exports.Loop = function (node, parent, scope, file) {
|
|
5673
6004
|
}
|
5674
6005
|
var blockScoping = new BlockScoping(node, node.body, parent, scope, file);
|
5675
6006
|
blockScoping.run();
|
5676
|
-
}
|
6007
|
+
}
|
5677
6008
|
|
5678
|
-
|
6009
|
+
function BlockStatement(block, parent, scope, file) {
|
5679
6010
|
if (!t.isLoop(parent)) {
|
5680
6011
|
var blockScoping = new BlockScoping(false, block, parent, scope, file);
|
5681
6012
|
blockScoping.run();
|
5682
6013
|
}
|
5683
|
-
}
|
6014
|
+
}
|
6015
|
+
|
6016
|
+
exports.Program = BlockStatement;
|
5684
6017
|
|
5685
6018
|
function replace(node, parent, scope, remaps) {
|
5686
6019
|
if (!t.isReferencedIdentifier(node, parent)) return;
|
@@ -6157,6 +6490,8 @@ var BlockScoping = (function () {
|
|
6157
6490
|
|
6158
6491
|
return BlockScoping;
|
6159
6492
|
})();
|
6493
|
+
|
6494
|
+
exports.__esModule = true;
|
6160
6495
|
},{"../../../helpers/object":24,"../../../traversal":117,"../../../types":122,"../../../util":124,"lodash/object/extend":299,"lodash/object/values":303}],64:[function(require,module,exports){
|
6161
6496
|
"use strict";
|
6162
6497
|
|
@@ -6166,11 +6501,14 @@ var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["defau
|
|
6166
6501
|
|
6167
6502
|
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
|
6168
6503
|
|
6504
|
+
exports.ClassDeclaration = ClassDeclaration;
|
6505
|
+
exports.ClassExpression = ClassExpression;
|
6506
|
+
|
6169
6507
|
var ReplaceSupers = _interopRequire(require("../../helpers/replace-supers"));
|
6170
6508
|
|
6171
|
-
var nameMethod =
|
6509
|
+
var nameMethod = _interopRequireWildcard(require("../../helpers/name-method"));
|
6172
6510
|
|
6173
|
-
var defineMap =
|
6511
|
+
var defineMap = _interopRequireWildcard(require("../../helpers/define-map"));
|
6174
6512
|
|
6175
6513
|
var messages = _interopRequireWildcard(require("../../../messages"));
|
6176
6514
|
|
@@ -6178,13 +6516,13 @@ var util = _interopRequireWildcard(require("../../../util"));
|
|
6178
6516
|
|
6179
6517
|
var t = _interopRequire(require("../../../types"));
|
6180
6518
|
|
6181
|
-
exports.check = t.isClass;
|
6519
|
+
var check = exports.check = t.isClass;
|
6182
6520
|
|
6183
|
-
|
6521
|
+
function ClassDeclaration(node, parent, scope, file) {
|
6184
6522
|
return new ClassTransformer(node, file, scope, true).run();
|
6185
|
-
}
|
6523
|
+
}
|
6186
6524
|
|
6187
|
-
|
6525
|
+
function ClassExpression(node, parent, scope, file) {
|
6188
6526
|
if (!node.id) {
|
6189
6527
|
if (t.isProperty(parent) && parent.value === node && !parent.computed && t.isIdentifier(parent.key)) {
|
6190
6528
|
// var o = { foo: class {} };
|
@@ -6198,7 +6536,7 @@ exports.ClassExpression = function (node, parent, scope, file) {
|
|
6198
6536
|
}
|
6199
6537
|
|
6200
6538
|
return new ClassTransformer(node, file, scope, false).run();
|
6201
|
-
}
|
6539
|
+
}
|
6202
6540
|
|
6203
6541
|
var ClassTransformer = (function () {
|
6204
6542
|
|
@@ -6463,6 +6801,8 @@ var ClassTransformer = (function () {
|
|
6463
6801
|
|
6464
6802
|
return ClassTransformer;
|
6465
6803
|
})();
|
6804
|
+
|
6805
|
+
exports.__esModule = true;
|
6466
6806
|
},{"../../../messages":27,"../../../types":122,"../../../util":124,"../../helpers/define-map":34,"../../helpers/name-method":37,"../../helpers/replace-supers":41}],65:[function(require,module,exports){
|
6467
6807
|
"use strict";
|
6468
6808
|
|
@@ -6470,13 +6810,17 @@ var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["defau
|
|
6470
6810
|
|
6471
6811
|
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
6472
6812
|
|
6813
|
+
exports.check = check;
|
6814
|
+
exports.Scopable = Scopable;
|
6815
|
+
exports.VariableDeclaration = VariableDeclaration;
|
6816
|
+
|
6473
6817
|
var messages = _interopRequireWildcard(require("../../../messages"));
|
6474
6818
|
|
6475
6819
|
var t = _interopRequire(require("../../../types"));
|
6476
6820
|
|
6477
|
-
|
6821
|
+
function check(node) {
|
6478
6822
|
return t.isVariableDeclaration(node, { kind: "const" });
|
6479
|
-
}
|
6823
|
+
}
|
6480
6824
|
|
6481
6825
|
var visitor = {
|
6482
6826
|
enter: function enter(node, parent, scope, state) {
|
@@ -6509,16 +6853,18 @@ var visitor = {
|
|
6509
6853
|
}
|
6510
6854
|
};
|
6511
6855
|
|
6512
|
-
|
6856
|
+
function Scopable(node, parent, scope, file) {
|
6513
6857
|
scope.traverse(node, visitor, {
|
6514
6858
|
constants: scope.getAllBindingsOfKind("const"),
|
6515
6859
|
file: file
|
6516
6860
|
});
|
6517
|
-
}
|
6861
|
+
}
|
6518
6862
|
|
6519
|
-
|
6863
|
+
function VariableDeclaration(node) {
|
6520
6864
|
if (node.kind === "const") node.kind = "let";
|
6521
|
-
}
|
6865
|
+
}
|
6866
|
+
|
6867
|
+
exports.__esModule = true;
|
6522
6868
|
},{"../../../messages":27,"../../../types":122}],66:[function(require,module,exports){
|
6523
6869
|
"use strict";
|
6524
6870
|
|
@@ -6528,13 +6874,19 @@ var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? ob
|
|
6528
6874
|
|
6529
6875
|
var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } };
|
6530
6876
|
|
6877
|
+
exports.ForOfStatement = ForOfStatement;
|
6878
|
+
exports.CatchClause = CatchClause;
|
6879
|
+
exports.ExpressionStatement = ExpressionStatement;
|
6880
|
+
exports.AssignmentExpression = AssignmentExpression;
|
6881
|
+
exports.VariableDeclaration = VariableDeclaration;
|
6882
|
+
|
6531
6883
|
var messages = _interopRequireWildcard(require("../../../messages"));
|
6532
6884
|
|
6533
6885
|
var t = _interopRequire(require("../../../types"));
|
6534
6886
|
|
6535
|
-
exports.check = t.isPattern;
|
6887
|
+
var check = exports.check = t.isPattern;
|
6536
6888
|
|
6537
|
-
|
6889
|
+
function ForOfStatement(node, parent, scope, file) {
|
6538
6890
|
var left = node.left;
|
6539
6891
|
|
6540
6892
|
if (t.isPattern(left)) {
|
@@ -6574,7 +6926,9 @@ exports.ForInStatement = exports.ForOfStatement = function (node, parent, scope,
|
|
6574
6926
|
|
6575
6927
|
var block = node.body;
|
6576
6928
|
block.body = nodes.concat(block.body);
|
6577
|
-
}
|
6929
|
+
}
|
6930
|
+
|
6931
|
+
exports.ForInStatement = ForOfStatement;
|
6578
6932
|
|
6579
6933
|
exports.Function = function (node, parent, scope, file) {
|
6580
6934
|
var nodes = [];
|
@@ -6606,7 +6960,7 @@ exports.Function = function (node, parent, scope, file) {
|
|
6606
6960
|
block.body = nodes.concat(block.body);
|
6607
6961
|
};
|
6608
6962
|
|
6609
|
-
|
6963
|
+
function CatchClause(node, parent, scope, file) {
|
6610
6964
|
var pattern = node.param;
|
6611
6965
|
if (!t.isPattern(pattern)) return;
|
6612
6966
|
|
@@ -6626,9 +6980,9 @@ exports.CatchClause = function (node, parent, scope, file) {
|
|
6626
6980
|
node.body.body = nodes.concat(node.body.body);
|
6627
6981
|
|
6628
6982
|
return node;
|
6629
|
-
}
|
6983
|
+
}
|
6630
6984
|
|
6631
|
-
|
6985
|
+
function ExpressionStatement(node, parent, scope, file) {
|
6632
6986
|
var expr = node.expression;
|
6633
6987
|
if (expr.type !== "AssignmentExpression") return;
|
6634
6988
|
if (!t.isPattern(expr.left)) return;
|
@@ -6648,9 +7002,9 @@ exports.ExpressionStatement = function (node, parent, scope, file) {
|
|
6648
7002
|
destructuring.init(expr.left, ref);
|
6649
7003
|
|
6650
7004
|
return nodes;
|
6651
|
-
}
|
7005
|
+
}
|
6652
7006
|
|
6653
|
-
|
7007
|
+
function AssignmentExpression(node, parent, scope, file) {
|
6654
7008
|
if (!t.isPattern(node.left)) return;
|
6655
7009
|
|
6656
7010
|
var ref = scope.generateUidIdentifier("temp");
|
@@ -6673,18 +7027,18 @@ exports.AssignmentExpression = function (node, parent, scope, file) {
|
|
6673
7027
|
nodes.push(ref);
|
6674
7028
|
|
6675
7029
|
return t.toSequenceExpression(nodes, scope);
|
6676
|
-
}
|
7030
|
+
}
|
6677
7031
|
|
6678
|
-
|
7032
|
+
function variableDeclarationHasPattern(node) {
|
6679
7033
|
for (var i = 0; i < node.declarations.length; i++) {
|
6680
7034
|
if (t.isPattern(node.declarations[i].id)) {
|
6681
7035
|
return true;
|
6682
7036
|
}
|
6683
7037
|
}
|
6684
7038
|
return false;
|
6685
|
-
}
|
7039
|
+
}
|
6686
7040
|
|
6687
|
-
|
7041
|
+
function VariableDeclaration(node, parent, scope, file) {
|
6688
7042
|
if (t.isForInStatement(parent) || t.isForOfStatement(parent)) return;
|
6689
7043
|
if (!variableDeclarationHasPattern(node)) return;
|
6690
7044
|
|
@@ -6738,7 +7092,9 @@ exports.VariableDeclaration = function (node, parent, scope, file) {
|
|
6738
7092
|
}
|
6739
7093
|
|
6740
7094
|
return nodes;
|
6741
|
-
}
|
7095
|
+
}
|
7096
|
+
|
7097
|
+
;
|
6742
7098
|
|
6743
7099
|
var hasRest = function hasRest(pattern) {
|
6744
7100
|
for (var i = 0; i < pattern.elements.length; i++) {
|
@@ -6989,6 +7345,8 @@ var DestructuringTransformer = (function () {
|
|
6989
7345
|
|
6990
7346
|
return DestructuringTransformer;
|
6991
7347
|
})();
|
7348
|
+
|
7349
|
+
exports.__esModule = true;
|
6992
7350
|
},{"../../../messages":27,"../../../types":122}],67:[function(require,module,exports){
|
6993
7351
|
"use strict";
|
6994
7352
|
|
@@ -6996,15 +7354,17 @@ var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["defau
|
|
6996
7354
|
|
6997
7355
|
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
6998
7356
|
|
7357
|
+
exports.ForOfStatement = ForOfStatement;
|
7358
|
+
|
6999
7359
|
var messages = _interopRequireWildcard(require("../../../messages"));
|
7000
7360
|
|
7001
7361
|
var util = _interopRequireWildcard(require("../../../util"));
|
7002
7362
|
|
7003
7363
|
var t = _interopRequire(require("../../../types"));
|
7004
7364
|
|
7005
|
-
exports.check = t.isForOfStatement;
|
7365
|
+
var check = exports.check = t.isForOfStatement;
|
7006
7366
|
|
7007
|
-
|
7367
|
+
function ForOfStatement(node, parent, scope, file) {
|
7008
7368
|
var callback = spec;
|
7009
7369
|
if (file.isLoose("es6.forOf")) callback = loose;
|
7010
7370
|
|
@@ -7033,7 +7393,7 @@ exports.ForOfStatement = function (node, parent, scope, file) {
|
|
7033
7393
|
loop._scopeInfo = node._scopeInfo;
|
7034
7394
|
|
7035
7395
|
return build.node;
|
7036
|
-
}
|
7396
|
+
}
|
7037
7397
|
|
7038
7398
|
var breakVisitor = {
|
7039
7399
|
enter: function enter(node, parent, scope, state) {
|
@@ -7159,6 +7519,7 @@ var spec = function spec(node, parent, scope, file) {
|
|
7159
7519
|
node: template
|
7160
7520
|
};
|
7161
7521
|
};
|
7522
|
+
exports.__esModule = true;
|
7162
7523
|
},{"../../../messages":27,"../../../types":122,"../../../util":124}],68:[function(require,module,exports){
|
7163
7524
|
"use strict";
|
7164
7525
|
|
@@ -7390,7 +7751,7 @@ var util = _interopRequireWildcard(require("../../../util"));
|
|
7390
7751
|
|
7391
7752
|
var t = _interopRequire(require("../../../types"));
|
7392
7753
|
|
7393
|
-
exports.check = t.isRestElement;
|
7754
|
+
var check = exports.check = t.isRestElement;
|
7394
7755
|
|
7395
7756
|
var memberExpressionOptimisationVisitor = {
|
7396
7757
|
enter: function enter(node, parent, scope, state) {
|
@@ -7416,27 +7777,26 @@ var memberExpressionOptimisationVisitor = {
|
|
7416
7777
|
// optimise it
|
7417
7778
|
var prop = parent.property;
|
7418
7779
|
if (isNumber(prop.value) || t.isUnaryExpression(prop) || t.isBinaryExpression(prop)) {
|
7419
|
-
|
7420
|
-
state.
|
7780
|
+
state.candidates.push(this);
|
7781
|
+
state.canOptimise = true;
|
7421
7782
|
return;
|
7422
7783
|
}
|
7423
7784
|
}
|
7424
7785
|
|
7425
|
-
state.
|
7786
|
+
state.canOptimise = false;
|
7787
|
+
this.stop();
|
7426
7788
|
}
|
7427
7789
|
};
|
7428
7790
|
|
7429
|
-
function optimizeMemberExpression(
|
7791
|
+
function optimizeMemberExpression(parent, offset) {
|
7430
7792
|
var newExpr;
|
7431
7793
|
var prop = parent.property;
|
7432
7794
|
|
7433
7795
|
if (t.isLiteral(prop)) {
|
7434
|
-
node.name = "arguments";
|
7435
7796
|
prop.value += offset;
|
7436
7797
|
prop.raw = String(prop.value);
|
7437
7798
|
} else {
|
7438
7799
|
// // UnaryExpression, BinaryExpression
|
7439
|
-
node.name = "arguments";
|
7440
7800
|
newExpr = t.binaryExpression("+", prop, t.literal(offset));
|
7441
7801
|
parent.property = newExpr;
|
7442
7802
|
}
|
@@ -7471,15 +7831,23 @@ exports.Function = function (node, parent, scope) {
|
|
7471
7831
|
|
7472
7832
|
var state = {
|
7473
7833
|
outerBinding: scope.getBindingIdentifier(rest.name),
|
7474
|
-
|
7475
|
-
|
7834
|
+
canOptimise: false,
|
7835
|
+
candidates: [],
|
7476
7836
|
method: node,
|
7477
|
-
name: rest.name
|
7837
|
+
name: rest.name
|
7838
|
+
};
|
7478
7839
|
|
7479
7840
|
scope.traverse(node, memberExpressionOptimisationVisitor, state);
|
7480
7841
|
|
7481
7842
|
// we only have shorthands and there's no other references
|
7482
|
-
if (
|
7843
|
+
if (state.canOptimise) {
|
7844
|
+
for (var i = 0; i < state.candidates.length; i++) {
|
7845
|
+
var candidate = state.candidates[i];
|
7846
|
+
candidate.node = argsId;
|
7847
|
+
optimizeMemberExpression(candidate.parent, node.params.length);
|
7848
|
+
}
|
7849
|
+
return;
|
7850
|
+
}
|
7483
7851
|
|
7484
7852
|
//
|
7485
7853
|
|
@@ -7517,6 +7885,7 @@ exports.Function = function (node, parent, scope) {
|
|
7517
7885
|
loop._blockHoist = node.params.length + 1;
|
7518
7886
|
node.body.body.unshift(loop);
|
7519
7887
|
};
|
7888
|
+
exports.__esModule = true;
|
7520
7889
|
},{"../../../types":122,"../../../util":124,"lodash/lang/isNumber":292}],72:[function(require,module,exports){
|
7521
7890
|
"use strict";
|
7522
7891
|
|
@@ -7732,8 +8101,6 @@ var includes = _interopRequire(require("lodash/collection/includes"));
|
|
7732
8101
|
|
7733
8102
|
var t = _interopRequire(require("../../../types"));
|
7734
8103
|
|
7735
|
-
exports.check = t.isSpreadElement;
|
7736
|
-
|
7737
8104
|
function getSpreadLiteral(spread, scope) {
|
7738
8105
|
return scope.toArray(spread.argument, true);
|
7739
8106
|
}
|
@@ -7773,6 +8140,8 @@ function build(props, scope) {
|
|
7773
8140
|
return nodes;
|
7774
8141
|
}
|
7775
8142
|
|
8143
|
+
var check = exports.check = t.isSpreadElement;
|
8144
|
+
|
7776
8145
|
function ArrayExpression(node, parent, scope) {
|
7777
8146
|
var elements = node.elements;
|
7778
8147
|
if (!hasSpread(elements)) return;
|
@@ -8698,6 +9067,9 @@ module.exports = {
|
|
8698
9067
|
|
8699
9068
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
8700
9069
|
|
9070
|
+
exports.Program = Program;
|
9071
|
+
exports.FunctionDeclaration = FunctionDeclaration;
|
9072
|
+
|
8701
9073
|
var t = _interopRequire(require("../../../types"));
|
8702
9074
|
|
8703
9075
|
var functionChildrenVisitor = {
|
@@ -8775,18 +9147,23 @@ var go = function go(getBody, node, scope) {
|
|
8775
9147
|
}
|
8776
9148
|
};
|
8777
9149
|
|
8778
|
-
|
9150
|
+
function Program(node, parent, scope) {
|
8779
9151
|
go(function () {
|
8780
9152
|
return node.body;
|
8781
9153
|
}, node, scope);
|
8782
|
-
}
|
9154
|
+
}
|
9155
|
+
|
9156
|
+
;
|
8783
9157
|
|
8784
|
-
|
9158
|
+
function FunctionDeclaration(node, parent, scope) {
|
8785
9159
|
go(function () {
|
8786
9160
|
t.ensureBlock(node);
|
8787
9161
|
return node.body.body;
|
8788
9162
|
}, node, scope);
|
8789
|
-
}
|
9163
|
+
}
|
9164
|
+
|
9165
|
+
exports.FunctionExpression = FunctionDeclaration;
|
9166
|
+
exports.__esModule = true;
|
8790
9167
|
},{"../../../types":122}],85:[function(require,module,exports){
|
8791
9168
|
"use strict";
|
8792
9169
|
|
@@ -8805,7 +9182,7 @@ var values = _interopRequire(require("lodash/object/values"));
|
|
8805
9182
|
// - 2 Priority over normal nodes
|
8806
9183
|
// - 3 We want this to be at the **very** top
|
8807
9184
|
|
8808
|
-
|
9185
|
+
var BlockStatement = exports.BlockStatement = {
|
8809
9186
|
exit: function exit(node) {
|
8810
9187
|
var hasChange = false;
|
8811
9188
|
for (var i = 0; i < node.body.length; i++) {
|
@@ -8824,30 +9201,44 @@ exports.BlockStatement = exports.Program = {
|
|
8824
9201
|
node.body = flatten(values(nodePriorities).reverse());
|
8825
9202
|
}
|
8826
9203
|
};
|
9204
|
+
|
9205
|
+
exports.Program = BlockStatement;
|
9206
|
+
exports.__esModule = true;
|
8827
9207
|
},{"lodash/array/flatten":196,"lodash/collection/groupBy":203,"lodash/object/values":303}],86:[function(require,module,exports){
|
8828
9208
|
"use strict";
|
8829
9209
|
|
8830
|
-
exports.SequenceExpression =
|
8831
|
-
|
8832
|
-
|
8833
|
-
|
8834
|
-
|
9210
|
+
var SequenceExpression = exports.SequenceExpression = {
|
9211
|
+
exit: function exit(node) {
|
9212
|
+
if (node.expressions.length === 1) {
|
9213
|
+
return node.expressions[0];
|
9214
|
+
} else if (!node.expressions.length) {
|
9215
|
+
this.remove();
|
9216
|
+
}
|
8835
9217
|
}
|
8836
|
-
}
|
9218
|
+
};
|
8837
9219
|
|
9220
|
+
var ExpressionStatement = exports.ExpressionStatement = {
|
9221
|
+
exit: function exit(node) {
|
9222
|
+
if (!node.expression) this.remove();
|
9223
|
+
}
|
9224
|
+
};
|
8838
9225
|
exports.__esModule = true;
|
8839
9226
|
},{}],87:[function(require,module,exports){
|
8840
9227
|
"use strict";
|
8841
9228
|
|
8842
9229
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
8843
9230
|
|
8844
|
-
var
|
9231
|
+
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
9232
|
+
|
9233
|
+
exports.BlockStatement = BlockStatement;
|
9234
|
+
|
9235
|
+
var useStrict = _interopRequireWildcard(require("../../helpers/use-strict"));
|
8845
9236
|
|
8846
9237
|
var t = _interopRequire(require("../../../types"));
|
8847
9238
|
|
8848
9239
|
var secondPass = exports.secondPass = true;
|
8849
9240
|
|
8850
|
-
|
9241
|
+
function BlockStatement(node, parent, scope, file) {
|
8851
9242
|
if (!node._declarations) return;
|
8852
9243
|
|
8853
9244
|
useStrict.wrap(node, function () {
|
@@ -8877,16 +9268,18 @@ exports.BlockStatement = exports.Program = function (node, parent, scope, file)
|
|
8877
9268
|
|
8878
9269
|
node._declarations = null;
|
8879
9270
|
});
|
8880
|
-
}
|
9271
|
+
}
|
9272
|
+
|
9273
|
+
exports.Program = BlockStatement;
|
8881
9274
|
exports.__esModule = true;
|
8882
9275
|
},{"../../../types":122,"../../helpers/use-strict":42}],88:[function(require,module,exports){
|
8883
9276
|
"use strict";
|
8884
9277
|
|
8885
|
-
var
|
9278
|
+
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
8886
9279
|
|
8887
9280
|
exports.Program = Program;
|
8888
9281
|
|
8889
|
-
var useStrict =
|
9282
|
+
var useStrict = _interopRequireWildcard(require("../../helpers/use-strict"));
|
8890
9283
|
|
8891
9284
|
function Program(program, parent, scope, file) {
|
8892
9285
|
if (!file.transformers["es6.modules"].canRun()) return;
|
@@ -9168,12 +9561,28 @@ exports.__esModule = true;
|
|
9168
9561
|
|
9169
9562
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
9170
9563
|
|
9564
|
+
exports.Flow = Flow;
|
9565
|
+
exports.ClassProperty = ClassProperty;
|
9566
|
+
exports.Class = Class;
|
9171
9567
|
exports.TypeCastExpression = TypeCastExpression;
|
9172
9568
|
exports.ImportDeclaration = ImportDeclaration;
|
9173
9569
|
exports.ExportDeclaration = ExportDeclaration;
|
9174
9570
|
|
9175
9571
|
var t = _interopRequire(require("../../../types"));
|
9176
9572
|
|
9573
|
+
function Flow(node) {
|
9574
|
+
this.remove();
|
9575
|
+
}
|
9576
|
+
|
9577
|
+
function ClassProperty(node) {
|
9578
|
+
node.typeAnnotation = null;
|
9579
|
+
if (!node.value) this.remove();
|
9580
|
+
}
|
9581
|
+
|
9582
|
+
function Class(node) {
|
9583
|
+
node["implements"] = null;
|
9584
|
+
}
|
9585
|
+
|
9177
9586
|
function TypeCastExpression(node) {
|
9178
9587
|
return node.expression;
|
9179
9588
|
}
|
@@ -9192,9 +9601,11 @@ exports.__esModule = true;
|
|
9192
9601
|
|
9193
9602
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
9194
9603
|
|
9604
|
+
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
9605
|
+
|
9195
9606
|
exports.manipulateOptions = manipulateOptions;
|
9196
9607
|
|
9197
|
-
var react =
|
9608
|
+
var react = _interopRequireWildcard(require("../../helpers/react"));
|
9198
9609
|
|
9199
9610
|
var t = _interopRequire(require("../../../types"));
|
9200
9611
|
|
@@ -9221,9 +9632,11 @@ exports.__esModule = true;
|
|
9221
9632
|
|
9222
9633
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
9223
9634
|
|
9635
|
+
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
9636
|
+
|
9224
9637
|
exports.Program = Program;
|
9225
9638
|
|
9226
|
-
var react =
|
9639
|
+
var react = _interopRequireWildcard(require("../../helpers/react"));
|
9227
9640
|
|
9228
9641
|
var t = _interopRequire(require("../../../types"));
|
9229
9642
|
|
@@ -9407,6 +9820,7 @@ var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["defau
|
|
9407
9820
|
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
9408
9821
|
|
9409
9822
|
exports.Program = Program;
|
9823
|
+
exports.FunctionExpression = FunctionExpression;
|
9410
9824
|
exports.ThisExpression = ThisExpression;
|
9411
9825
|
exports.CallExpression = CallExpression;
|
9412
9826
|
|
@@ -9421,9 +9835,11 @@ function Program(program) {
|
|
9421
9835
|
}
|
9422
9836
|
}
|
9423
9837
|
|
9424
|
-
|
9838
|
+
function FunctionExpression() {
|
9425
9839
|
this.skip();
|
9426
|
-
}
|
9840
|
+
}
|
9841
|
+
|
9842
|
+
exports.FunctionDeclaration = FunctionExpression;
|
9427
9843
|
|
9428
9844
|
function ThisExpression() {
|
9429
9845
|
return t.identifier("undefined");
|
@@ -9560,6 +9976,8 @@ exports.__esModule = true;
|
|
9560
9976
|
|
9561
9977
|
var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["default"] : obj; };
|
9562
9978
|
|
9979
|
+
exports.MethodDefinition = MethodDefinition;
|
9980
|
+
|
9563
9981
|
var t = _interopRequire(require("../../../types"));
|
9564
9982
|
|
9565
9983
|
var playground = exports.playground = true;
|
@@ -9574,7 +9992,7 @@ var visitor = {
|
|
9574
9992
|
}
|
9575
9993
|
};
|
9576
9994
|
|
9577
|
-
|
9995
|
+
function MethodDefinition(node, parent, scope, file) {
|
9578
9996
|
if (node.kind !== "memo") return;
|
9579
9997
|
node.kind = "get";
|
9580
9998
|
|
@@ -9595,7 +10013,9 @@ exports.Property = exports.MethodDefinition = function (node, parent, scope, fil
|
|
9595
10013
|
scope.traverse(value, visitor, state);
|
9596
10014
|
|
9597
10015
|
return node;
|
9598
|
-
}
|
10016
|
+
}
|
10017
|
+
|
10018
|
+
exports.Property = MethodDefinition;
|
9599
10019
|
exports.__esModule = true;
|
9600
10020
|
},{"../../../types":122}],107:[function(require,module,exports){
|
9601
10021
|
"use strict";
|
@@ -9758,6 +10178,8 @@ var _interopRequire = function (obj) { return obj && obj.__esModule ? obj["defau
|
|
9758
10178
|
|
9759
10179
|
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
9760
10180
|
|
10181
|
+
exports.ForOfStatement = ForOfStatement;
|
10182
|
+
|
9761
10183
|
var messages = _interopRequireWildcard(require("../../../messages"));
|
9762
10184
|
|
9763
10185
|
var _types = require("../../../types");
|
@@ -9766,13 +10188,15 @@ var t = _interopRequire(_types);
|
|
9766
10188
|
|
9767
10189
|
exports.check = _types.isFor;
|
9768
10190
|
|
9769
|
-
|
10191
|
+
function ForOfStatement(node, parent, scope, file) {
|
9770
10192
|
var left = node.left;
|
9771
10193
|
if (t.isVariableDeclaration(left)) {
|
9772
10194
|
var declar = left.declarations[0];
|
9773
10195
|
if (declar.init) throw file.errorWithNode(declar, messages.get("noAssignmentsInForHead"));
|
9774
10196
|
}
|
9775
|
-
}
|
10197
|
+
}
|
10198
|
+
|
10199
|
+
exports.ForInStatement = ForOfStatement;
|
9776
10200
|
exports.__esModule = true;
|
9777
10201
|
},{"../../../messages":27,"../../../types":122}],113:[function(require,module,exports){
|
9778
10202
|
"use strict";
|
@@ -9817,6 +10241,7 @@ exports.__esModule = true;
|
|
9817
10241
|
var _interopRequireWildcard = function (obj) { return obj && obj.__esModule ? obj : { "default": obj }; };
|
9818
10242
|
|
9819
10243
|
exports.check = check;
|
10244
|
+
exports.Property = Property;
|
9820
10245
|
|
9821
10246
|
var messages = _interopRequireWildcard(require("../../../messages"));
|
9822
10247
|
|
@@ -9824,11 +10249,13 @@ function check(node) {
|
|
9824
10249
|
return node.kind === "set";
|
9825
10250
|
}
|
9826
10251
|
|
9827
|
-
|
10252
|
+
function Property(node, parent, scope, file) {
|
9828
10253
|
if (node.kind === "set" && node.value.params.length !== 1) {
|
9829
10254
|
throw file.errorWithNode(node.value, messages.get("settersInvalidParamLength"));
|
9830
10255
|
}
|
9831
|
-
}
|
10256
|
+
}
|
10257
|
+
|
10258
|
+
exports.MethodDefinition = Property;
|
9832
10259
|
exports.__esModule = true;
|
9833
10260
|
},{"../../../messages":27}],115:[function(require,module,exports){
|
9834
10261
|
"use strict";
|
@@ -9937,7 +10364,7 @@ var TraversalConext = (function () {
|
|
9937
10364
|
if (this.shouldFlatten) {
|
9938
10365
|
node[key] = flatten(node[key]);
|
9939
10366
|
|
9940
|
-
if (key === "body") {
|
10367
|
+
if (key === "body" || key === "expressions") {
|
9941
10368
|
// we can safely compact this
|
9942
10369
|
node[key] = compact(node[key]);
|
9943
10370
|
}
|
@@ -10041,7 +10468,9 @@ traverse.explode = function (obj) {
|
|
10041
10468
|
var aliases = t.FLIPPED_ALIAS_KEYS[type];
|
10042
10469
|
if (aliases) {
|
10043
10470
|
for (var i = 0; i < aliases.length; i++) {
|
10044
|
-
|
10471
|
+
var _obj = obj;
|
10472
|
+
var _aliases$i = aliases[i];
|
10473
|
+
if (!_obj[_aliases$i]) _obj[_aliases$i] = fns;
|
10045
10474
|
}
|
10046
10475
|
}
|
10047
10476
|
}
|
@@ -10587,7 +11016,7 @@ var Scope = (function () {
|
|
10587
11016
|
var info = this.getBindingInfo(name);
|
10588
11017
|
if (!info) return;
|
10589
11018
|
|
10590
|
-
info.
|
11019
|
+
info.typeAnnotation = type;
|
10591
11020
|
};
|
10592
11021
|
|
10593
11022
|
Scope.prototype.getTypeAnnotation = function getTypeAnnotation(name, id, node) {
|
@@ -11012,6 +11441,39 @@ module.exports={
|
|
11012
11441
|
"JSXMemberExpression": ["Expression"],
|
11013
11442
|
"YieldExpression": ["Expression"],
|
11014
11443
|
|
11444
|
+
"AnyTypeAnnotation": ["Flow"],
|
11445
|
+
"ArrayTypeAnnotation": ["Flow"],
|
11446
|
+
"BooleanTypeAnnotation": ["Flow"],
|
11447
|
+
"ClassImplements": ["Flow"],
|
11448
|
+
"DeclareClass": ["Flow"],
|
11449
|
+
"DeclareFunction": ["Flow"],
|
11450
|
+
"DeclareModule": ["Flow"],
|
11451
|
+
"DeclareVariable": ["Flow"],
|
11452
|
+
"FunctionTypeAnnotation": ["Flow"],
|
11453
|
+
"FunctionTypeParam": ["Flow"],
|
11454
|
+
"GenericTypeAnnotation": ["Flow"],
|
11455
|
+
"InterfaceExtends": ["Flow"],
|
11456
|
+
"InterfaceDeclaration": ["Flow"],
|
11457
|
+
"IntersectionTypeAnnotation": ["Flow"],
|
11458
|
+
"NullableTypeAnnotation": ["Flow"],
|
11459
|
+
"NumberTypeAnnotation": ["Flow"],
|
11460
|
+
"StringLiteralTypeAnnotation": ["Flow"],
|
11461
|
+
"StringTypeAnnotation": ["Flow"],
|
11462
|
+
"TupleTypeAnnotation": ["Flow"],
|
11463
|
+
"TypeofTypeAnnotation": ["Flow"],
|
11464
|
+
"TypeAlias": ["Flow"],
|
11465
|
+
"TypeAnnotation": ["Flow"],
|
11466
|
+
"TypeCastExpression": ["Flow"],
|
11467
|
+
"TypeParameterDeclaration": ["Flow"],
|
11468
|
+
"TypeParameterInstantiation": ["Flow"],
|
11469
|
+
"ObjectTypeAnnotation": ["Flow"],
|
11470
|
+
"ObjectTypeCallProperty": ["Flow"],
|
11471
|
+
"ObjectTypeIndexer": ["Flow"],
|
11472
|
+
"ObjectTypeProperty": ["Flow"],
|
11473
|
+
"QualifiedTypeIdentifier": ["Flow"],
|
11474
|
+
"UnionTypeAnnotation": ["Flow"],
|
11475
|
+
"VoidTypeAnnotation": ["Flow"],
|
11476
|
+
|
11015
11477
|
"JSXAttribute": ["JSX"],
|
11016
11478
|
"JSXClosingElement": ["JSX"],
|
11017
11479
|
"JSXElement": ["JSX", "Expression"],
|
@@ -11923,6 +12385,10 @@ t.inherits = function (child, parent) {
|
|
11923
12385
|
child.start = parent.start;
|
11924
12386
|
child.loc = parent.loc;
|
11925
12387
|
child.end = parent.end;
|
12388
|
+
|
12389
|
+
child.typeAnnotation = parent.typeAnnotation;
|
12390
|
+
child.returnType = parent.returnType;
|
12391
|
+
|
11926
12392
|
t.inheritsComments(child, parent);
|
11927
12393
|
return child;
|
11928
12394
|
};
|
@@ -12019,8 +12485,8 @@ toFastProperties(t.VISITOR_KEYS);
|
|
12019
12485
|
},{"../helpers/object":24,"../helpers/to-fast-properties":26,"./alias-keys":120,"./builder-keys":121,"./visitor-keys":123,"esutils":185,"lodash/array/compact":195,"lodash/array/uniq":199,"lodash/collection/each":201,"lodash/lang/isString":295}],123:[function(require,module,exports){
|
12020
12486
|
module.exports={
|
12021
12487
|
"ArrayExpression": ["elements"],
|
12022
|
-
"ArrayPattern": ["elements"],
|
12023
|
-
"ArrowFunctionExpression": ["params", "defaults", "rest", "body"],
|
12488
|
+
"ArrayPattern": ["elements", "typeAnnotation"],
|
12489
|
+
"ArrowFunctionExpression": ["params", "defaults", "rest", "body", "returnType"],
|
12024
12490
|
"AssignmentExpression": ["left", "right"],
|
12025
12491
|
"AssignmentPattern": ["left", "right"],
|
12026
12492
|
"AwaitExpression": ["argument"],
|
@@ -12032,8 +12498,8 @@ module.exports={
|
|
12032
12498
|
"CallExpression": ["callee", "arguments"],
|
12033
12499
|
"CatchClause": ["param", "body"],
|
12034
12500
|
"ClassBody": ["body"],
|
12035
|
-
"ClassDeclaration": ["id", "body", "superClass"],
|
12036
|
-
"ClassExpression": ["id", "body", "superClass"],
|
12501
|
+
"ClassDeclaration": ["id", "body", "superClass", "typeParameters", "superTypeParameters", "implements"],
|
12502
|
+
"ClassExpression": ["id", "body", "superClass", "typeParameters", "superTypeParameters", "implements"],
|
12037
12503
|
"ComprehensionBlock": ["left", "right", "body"],
|
12038
12504
|
"ComprehensionExpression": ["filter", "blocks", "body"],
|
12039
12505
|
"ConditionalExpression": ["test", "consequent", "alternate"],
|
@@ -12049,9 +12515,9 @@ module.exports={
|
|
12049
12515
|
"ForInStatement": ["left", "right", "body"],
|
12050
12516
|
"ForOfStatement": ["left", "right", "body"],
|
12051
12517
|
"ForStatement": ["init", "test", "update", "body"],
|
12052
|
-
"FunctionDeclaration": ["id", "params", "defaults", "rest", "body"],
|
12053
|
-
"FunctionExpression": ["id", "params", "defaults", "rest", "body"],
|
12054
|
-
"Identifier": [],
|
12518
|
+
"FunctionDeclaration": ["id", "params", "defaults", "rest", "body", "returnType", "typeParameters"],
|
12519
|
+
"FunctionExpression": ["id", "params", "defaults", "rest", "body", "returnType", "typeParameters"],
|
12520
|
+
"Identifier": ["typeAnnotation"],
|
12055
12521
|
"IfStatement": ["test", "consequent", "alternate"],
|
12056
12522
|
"ImportBatchSpecifier": ["id"],
|
12057
12523
|
"ImportDeclaration": ["specifiers", "source"],
|
@@ -12063,11 +12529,11 @@ module.exports={
|
|
12063
12529
|
"MethodDefinition": ["key", "value"],
|
12064
12530
|
"NewExpression": ["callee", "arguments"],
|
12065
12531
|
"ObjectExpression": ["properties"],
|
12066
|
-
"ObjectPattern": ["properties"],
|
12532
|
+
"ObjectPattern": ["properties", "typeAnnotation"],
|
12067
12533
|
"PrivateDeclaration": ["declarations"],
|
12068
12534
|
"Program": ["body"],
|
12069
12535
|
"Property": ["key", "value"],
|
12070
|
-
"RestElement": ["argument"],
|
12536
|
+
"RestElement": ["argument", "typeAnnotation"],
|
12071
12537
|
"ReturnStatement": ["argument"],
|
12072
12538
|
"SequenceExpression": ["expressions"],
|
12073
12539
|
"SpreadElement": ["argument"],
|
@@ -12090,36 +12556,37 @@ module.exports={
|
|
12090
12556
|
"YieldExpression": ["argument"],
|
12091
12557
|
|
12092
12558
|
"AnyTypeAnnotation": [],
|
12093
|
-
"ArrayTypeAnnotation": [],
|
12559
|
+
"ArrayTypeAnnotation": ["elementType"],
|
12094
12560
|
"BooleanTypeAnnotation": [],
|
12095
|
-
"
|
12096
|
-
"
|
12097
|
-
"
|
12098
|
-
"
|
12099
|
-
"
|
12100
|
-
"
|
12101
|
-
"
|
12102
|
-
"
|
12103
|
-
"
|
12104
|
-
"
|
12105
|
-
"
|
12106
|
-
"
|
12561
|
+
"ClassImplements": ["id", "typeParameters"],
|
12562
|
+
"ClassProperty": ["key", "value", "typeAnnotation"],
|
12563
|
+
"DeclareClass": ["id", "typeParameters", "extends", "body"],
|
12564
|
+
"DeclareFunction": ["id"],
|
12565
|
+
"DeclareModule": ["id", "body"],
|
12566
|
+
"DeclareVariable": ["id"],
|
12567
|
+
"FunctionTypeAnnotation": ["typeParameters", "params", "rest", "returnType"],
|
12568
|
+
"FunctionTypeParam": ["name", "typeAnnotation"],
|
12569
|
+
"GenericTypeAnnotation": ["id", "typeParameters"],
|
12570
|
+
"InterfaceExtends": ["id", "typeParameters"],
|
12571
|
+
"InterfaceDeclaration": ["id", "typeParameters", "extends", "body"],
|
12572
|
+
"IntersectionTypeAnnotation": ["types"],
|
12573
|
+
"NullableTypeAnnotation": ["typeAnnotation"],
|
12107
12574
|
"NumberTypeAnnotation": [],
|
12108
12575
|
"StringLiteralTypeAnnotation": [],
|
12109
12576
|
"StringTypeAnnotation": [],
|
12110
|
-
"TupleTypeAnnotation": [],
|
12111
|
-
"TypeofTypeAnnotation": [],
|
12112
|
-
"TypeAlias": [],
|
12113
|
-
"TypeAnnotation": [],
|
12577
|
+
"TupleTypeAnnotation": ["types"],
|
12578
|
+
"TypeofTypeAnnotation": ["argument"],
|
12579
|
+
"TypeAlias": ["id", "typeParameters", "right"],
|
12580
|
+
"TypeAnnotation": ["typeAnnotation"],
|
12114
12581
|
"TypeCastExpression": ["expression"],
|
12115
|
-
"TypeParameterDeclaration": [],
|
12116
|
-
"TypeParameterInstantiation": [],
|
12117
|
-
"ObjectTypeAnnotation": [],
|
12118
|
-
"ObjectTypeCallProperty": [],
|
12119
|
-
"ObjectTypeIndexer": [],
|
12120
|
-
"ObjectTypeProperty": [],
|
12121
|
-
"QualifiedTypeIdentifier": [],
|
12122
|
-
"UnionTypeAnnotation": [],
|
12582
|
+
"TypeParameterDeclaration": ["params"],
|
12583
|
+
"TypeParameterInstantiation": ["params"],
|
12584
|
+
"ObjectTypeAnnotation": ["key", "value"],
|
12585
|
+
"ObjectTypeCallProperty": ["value"],
|
12586
|
+
"ObjectTypeIndexer": ["id", "key", "value"],
|
12587
|
+
"ObjectTypeProperty": ["key", "value"],
|
12588
|
+
"QualifiedTypeIdentifier": ["id", "qualification"],
|
12589
|
+
"UnionTypeAnnotation": ["types"],
|
12123
12590
|
"VoidTypeAnnotation": [],
|
12124
12591
|
|
12125
12592
|
"JSXAttribute": ["name", "value"],
|
@@ -12179,7 +12646,10 @@ var fs = _interopRequire(require("fs"));
|
|
12179
12646
|
|
12180
12647
|
var t = _interopRequire(require("./types"));
|
12181
12648
|
|
12182
|
-
|
12649
|
+
var _util = require("util");
|
12650
|
+
|
12651
|
+
exports.inherits = _util.inherits;
|
12652
|
+
exports.inspect = _util.inspect;
|
12183
12653
|
var debug = exports.debug = buildDebug("babel");
|
12184
12654
|
|
12185
12655
|
function canCompile(filename, altExts) {
|
@@ -12798,25 +13268,29 @@ exports.__esModule = true;
|
|
12798
13268
|
|
12799
13269
|
// The ECMAScript 3 reserved word list.
|
12800
13270
|
|
12801
|
-
var isReservedWord3 = function anonymous(str
|
13271
|
+
var isReservedWord3 = function anonymous(str
|
13272
|
+
/**/) {
|
12802
13273
|
switch(str.length){case 6:switch(str){case "double":case "export":case "import":case "native":case "public":case "static":case "throws":return true}return false;case 4:switch(str){case "byte":case "char":case "enum":case "goto":case "long":return true}return false;case 5:switch(str){case "class":case "final":case "float":case "short":case "super":return true}return false;case 7:switch(str){case "boolean":case "extends":case "package":case "private":return true}return false;case 9:switch(str){case "interface":case "protected":case "transient":return true}return false;case 8:switch(str){case "abstract":case "volatile":return true}return false;case 10:return str === "implements";case 3:return str === "int";case 12:return str === "synchronized";}
|
12803
13274
|
};
|
12804
13275
|
|
12805
13276
|
// ECMAScript 5 reserved words.
|
12806
13277
|
|
12807
|
-
var isReservedWord5 = function anonymous(str
|
13278
|
+
var isReservedWord5 = function anonymous(str
|
13279
|
+
/**/) {
|
12808
13280
|
switch(str.length){case 5:switch(str){case "class":case "super":case "const":return true}return false;case 6:switch(str){case "export":case "import":return true}return false;case 4:return str === "enum";case 7:return str === "extends";}
|
12809
13281
|
};
|
12810
13282
|
|
12811
13283
|
// The additional reserved words in strict mode.
|
12812
13284
|
|
12813
|
-
var isStrictReservedWord = function anonymous(str
|
13285
|
+
var isStrictReservedWord = function anonymous(str
|
13286
|
+
/**/) {
|
12814
13287
|
switch(str.length){case 9:switch(str){case "interface":case "protected":return true}return false;case 7:switch(str){case "package":case "private":return true}return false;case 6:switch(str){case "public":case "static":return true}return false;case 10:return str === "implements";case 3:return str === "let";case 5:return str === "yield";}
|
12815
13288
|
};
|
12816
13289
|
|
12817
13290
|
// The forbidden variable names in strict mode.
|
12818
13291
|
|
12819
|
-
var isStrictBadIdWord = function anonymous(str
|
13292
|
+
var isStrictBadIdWord = function anonymous(str
|
13293
|
+
/**/) {
|
12820
13294
|
switch(str){case "eval":case "arguments":return true}return false;
|
12821
13295
|
};
|
12822
13296
|
|
@@ -12824,13 +13298,15 @@ switch(str){case "eval":case "arguments":return true}return false;
|
|
12824
13298
|
|
12825
13299
|
var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";
|
12826
13300
|
|
12827
|
-
var isEcma5AndLessKeyword = function anonymous(str
|
13301
|
+
var isEcma5AndLessKeyword = function anonymous(str
|
13302
|
+
/**/) {
|
12828
13303
|
switch(str.length){case 4:switch(str){case "case":case "else":case "with":case "null":case "true":case "void":case "this":return true}return false;case 5:switch(str){case "break":case "catch":case "throw":case "while":case "false":return true}return false;case 3:switch(str){case "for":case "try":case "var":case "new":return true}return false;case 6:switch(str){case "return":case "switch":case "typeof":case "delete":return true}return false;case 8:switch(str){case "continue":case "debugger":case "function":return true}return false;case 2:switch(str){case "do":case "if":case "in":return true}return false;case 7:switch(str){case "default":case "finally":return true}return false;case 10:return str === "instanceof";}
|
12829
13304
|
};
|
12830
13305
|
|
12831
13306
|
var ecma6AndLessKeywords = ecma5AndLessKeywords + " let const class extends export import yield";
|
12832
13307
|
|
12833
|
-
var isEcma6Keyword = function anonymous(str
|
13308
|
+
var isEcma6Keyword = function anonymous(str
|
13309
|
+
/**/) {
|
12834
13310
|
switch(str.length){case 5:switch(str){case "break":case "catch":case "throw":case "while":case "false":case "const":case "class":case "yield":return true}return false;case 4:switch(str){case "case":case "else":case "with":case "null":case "true":case "void":case "this":return true}return false;case 6:switch(str){case "return":case "switch":case "typeof":case "delete":case "export":case "import":return true}return false;case 3:switch(str){case "for":case "try":case "var":case "new":case "let":return true}return false;case 8:switch(str){case "continue":case "debugger":case "function":return true}return false;case 7:switch(str){case "default":case "finally":case "extends":return true}return false;case 2:switch(str){case "do":case "if":case "in":return true}return false;case 10:return str === "instanceof";}
|
12835
13311
|
};
|
12836
13312
|
|
@@ -15640,7 +16116,7 @@ switch(str.length){case 5:switch(str){case "break":case "catch":case "throw":cas
|
|
15640
16116
|
var listItem = exprList[i];
|
15641
16117
|
if (listItem.type === "TypeCastExpression") {
|
15642
16118
|
var expr = listItem.expression;
|
15643
|
-
expr.
|
16119
|
+
expr.typeAnnotation = listItem.typeAnnotation;
|
15644
16120
|
exprList[i] = expr;
|
15645
16121
|
}
|
15646
16122
|
}
|
@@ -44650,7 +45126,7 @@ module.exports = function (str) {
|
|
44650
45126
|
module.exports={
|
44651
45127
|
"name": "babel",
|
44652
45128
|
"description": "Turn ES6 code into readable vanilla ES5 with source maps",
|
44653
|
-
"version": "4.6.
|
45129
|
+
"version": "4.6.2",
|
44654
45130
|
"author": "Sebastian McKenzie <sebmck@gmail.com>",
|
44655
45131
|
"homepage": "https://babeljs.io/",
|
44656
45132
|
"repository": "babel/babel",
|
@@ -44685,7 +45161,7 @@ module.exports={
|
|
44685
45161
|
"test": "make test"
|
44686
45162
|
},
|
44687
45163
|
"dependencies": {
|
44688
|
-
"acorn-babel": "0.11.1-
|
45164
|
+
"acorn-babel": "0.11.1-37",
|
44689
45165
|
"ast-types": "~0.6.1",
|
44690
45166
|
"chalk": "^1.0.0",
|
44691
45167
|
"chokidar": "^0.12.6",
|