diff --git a/packages/flow-parser/test/custom_ast_types.js b/packages/flow-parser/test/custom_ast_types.js index 09d1bb85530..badb8310895 100644 --- a/packages/flow-parser/test/custom_ast_types.js +++ b/packages/flow-parser/test/custom_ast_types.js @@ -361,12 +361,11 @@ function custom_ast_types(fork) { .field('argument', def('FlowType')); def('TypeParameter') .field('usesExtendsBound', or(undefined, Boolean)) - .field('const', or(def('ConstModifier'), null), defaults['null']); + .field('const', Boolean); def('Variance').field( 'kind', or('plus', 'minus', 'readonly', 'in', 'out', 'in-out'), ); - def('ConstModifier').bases('Node'); def('AsExpression') .bases('Expression') .build('expression', 'typeAnnotation') diff --git a/packages/flow-parser/test/esprima_test_runner.js b/packages/flow-parser/test/esprima_test_runner.js index 5905ed9237b..535c8ef817a 100644 --- a/packages/flow-parser/test/esprima_test_runner.js +++ b/packages/flow-parser/test/esprima_test_runner.js @@ -283,6 +283,7 @@ function handleSpecialObjectCompare(esprima, flow, env) { param.bound = param.typeAnnotation || null; param.default = param.default || null; param.variance = param.variance || null; + param.const = param.const || false; delete param.typeAnnotation; delete param.optional; } diff --git a/src/parser/estree_translator.ml b/src/parser/estree_translator.ml index 688975a49d3..f138dbaad11 100644 --- a/src/parser/estree_translator.ml +++ b/src/parser/estree_translator.ml @@ -2199,12 +2199,10 @@ with type t = Impl.t = struct backwards-compatibility. TODO: change this? *) ("name", string name); ("bound", hint type_annotation bound); + ("const", bool (Option.is_some const)); ("variance", option variance tp_var); ("default", option _type default); ] - @ (match const with - | Some (loc, comments) -> [("const", node ?comments "ConstModifier" loc [])] - | None -> []) @ match bound_kind with | Type.TypeParam.Colon -> [] diff --git a/src/parser/test/flow/ES6/modules/migrated_0023.tree.json b/src/parser/test/flow/ES6/modules/migrated_0023.tree.json index 5b7097ebf45..bb2b737f396 100644 --- a/src/parser/test/flow/ES6/modules/migrated_0023.tree.json +++ b/src/parser/test/flow/ES6/modules/migrated_0023.tree.json @@ -94,6 +94,7 @@ "range":[24,25], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/ES6/modules/migrated_0024.tree.json b/src/parser/test/flow/ES6/modules/migrated_0024.tree.json index 93e4f604a59..746a60e9060 100644 --- a/src/parser/test/flow/ES6/modules/migrated_0024.tree.json +++ b/src/parser/test/flow/ES6/modules/migrated_0024.tree.json @@ -18,7 +18,6 @@ "range":[23,25], "body":[] }, - "superClass":null, "typeParameters":{ "type":"TypeParameterDeclaration", "loc":{"source":null,"start":{"line":1,"column":20},"end":{"line":1,"column":23}}, @@ -30,11 +29,13 @@ "range":[21,22], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } ] }, + "superClass":null, "superTypeParameters":null, "implements":[], "decorators":[] diff --git a/src/parser/test/flow/arrow_function/migrated_0006.tree.json b/src/parser/test/flow/arrow_function/migrated_0006.tree.json index 9b80f0b70fb..59170a0c43c 100644 --- a/src/parser/test/flow/arrow_function/migrated_0006.tree.json +++ b/src/parser/test/flow/arrow_function/migrated_0006.tree.json @@ -82,6 +82,7 @@ "range":[1,2], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/async_arrow_functions/with_type_parameters.tree.json b/src/parser/test/flow/async_arrow_functions/with_type_parameters.tree.json index c05f969bdca..753c3b8a7af 100644 --- a/src/parser/test/flow/async_arrow_functions/with_type_parameters.tree.json +++ b/src/parser/test/flow/async_arrow_functions/with_type_parameters.tree.json @@ -140,6 +140,7 @@ "range":[17,18], "name":"T", "bound":null, + "const":false, "variance":null, "default":null }, @@ -149,6 +150,7 @@ "range":[20,21], "name":"R", "bound":null, + "const":false, "variance":null, "default":null }, @@ -158,6 +160,7 @@ "range":[23,24], "name":"S", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/async_await/async_generic_method.tree.json b/src/parser/test/flow/async_await/async_generic_method.tree.json index 7f2fe6633ae..d7860f81464 100644 --- a/src/parser/test/flow/async_await/async_generic_method.tree.json +++ b/src/parser/test/flow/async_await/async_generic_method.tree.json @@ -52,6 +52,7 @@ "range":[9,10], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/async_generators/migrated_0001.tree.json b/src/parser/test/flow/async_generators/migrated_0001.tree.json index cd753a9925c..5199523d1f8 100644 --- a/src/parser/test/flow/async_generators/migrated_0001.tree.json +++ b/src/parser/test/flow/async_generators/migrated_0001.tree.json @@ -65,6 +65,7 @@ "range":[19,20], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/async_generators/migrated_0003.tree.json b/src/parser/test/flow/async_generators/migrated_0003.tree.json index bfd0b29cbda..f030ebefd8f 100644 --- a/src/parser/test/flow/async_generators/migrated_0003.tree.json +++ b/src/parser/test/flow/async_generators/migrated_0003.tree.json @@ -87,6 +87,7 @@ "range":[20,21], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/async_generators/migrated_0005.tree.json b/src/parser/test/flow/async_generators/migrated_0005.tree.json index ea4ac89e749..239ce943958 100644 --- a/src/parser/test/flow/async_generators/migrated_0005.tree.json +++ b/src/parser/test/flow/async_generators/migrated_0005.tree.json @@ -87,6 +87,7 @@ "range":[27,28], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/async_generators/migrated_0007.tree.json b/src/parser/test/flow/async_generators/migrated_0007.tree.json index 5e178d40b98..5c3a1c40bb6 100644 --- a/src/parser/test/flow/async_generators/migrated_0007.tree.json +++ b/src/parser/test/flow/async_generators/migrated_0007.tree.json @@ -75,6 +75,7 @@ "range":[25,26], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/call_properties/migrated_0003.tree.json b/src/parser/test/flow/call_properties/migrated_0003.tree.json index 71da97b43a7..995bb1848e2 100644 --- a/src/parser/test/flow/call_properties/migrated_0003.tree.json +++ b/src/parser/test/flow/call_properties/migrated_0003.tree.json @@ -85,6 +85,7 @@ "range":[11,12], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/class_expression/anonymous_with_type_params.tree.json b/src/parser/test/flow/class_expression/anonymous_with_type_params.tree.json index 9e1da09cd90..989f7a4ccb5 100644 --- a/src/parser/test/flow/class_expression/anonymous_with_type_params.tree.json +++ b/src/parser/test/flow/class_expression/anonymous_with_type_params.tree.json @@ -53,6 +53,7 @@ "range": [8, 9], "name": "T", "bound": null, + "const":false, "variance": null, "default": null } diff --git a/src/parser/test/flow/class_method_kinds/async_as_id_tparams.tree.json b/src/parser/test/flow/class_method_kinds/async_as_id_tparams.tree.json index f7f4635d282..d628adef841 100644 --- a/src/parser/test/flow/class_method_kinds/async_as_id_tparams.tree.json +++ b/src/parser/test/flow/class_method_kinds/async_as_id_tparams.tree.json @@ -60,6 +60,7 @@ "range":[18,19], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/class_method_kinds/async_tparams.tree.json b/src/parser/test/flow/class_method_kinds/async_tparams.tree.json index e955fcc6c4f..b440571a9d5 100644 --- a/src/parser/test/flow/class_method_kinds/async_tparams.tree.json +++ b/src/parser/test/flow/class_method_kinds/async_tparams.tree.json @@ -60,6 +60,7 @@ "range":[20,21], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/class_method_kinds/get_as_id_tparams.tree.json b/src/parser/test/flow/class_method_kinds/get_as_id_tparams.tree.json index 8921e663938..9ea71f94765 100644 --- a/src/parser/test/flow/class_method_kinds/get_as_id_tparams.tree.json +++ b/src/parser/test/flow/class_method_kinds/get_as_id_tparams.tree.json @@ -60,6 +60,7 @@ "range":[16,17], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/class_method_kinds/static_as_id_tparams.tree.json b/src/parser/test/flow/class_method_kinds/static_as_id_tparams.tree.json index 19e0af419a8..eefe0ce3324 100644 --- a/src/parser/test/flow/class_method_kinds/static_as_id_tparams.tree.json +++ b/src/parser/test/flow/class_method_kinds/static_as_id_tparams.tree.json @@ -60,6 +60,7 @@ "range":[19,20], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/class_method_kinds/static_static_as_id_tparams.tree.json b/src/parser/test/flow/class_method_kinds/static_static_as_id_tparams.tree.json index 1843103b852..6e8d8170721 100644 --- a/src/parser/test/flow/class_method_kinds/static_static_as_id_tparams.tree.json +++ b/src/parser/test/flow/class_method_kinds/static_static_as_id_tparams.tree.json @@ -60,6 +60,7 @@ "range":[26,27], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/class_properties/migrated_0014.tree.json b/src/parser/test/flow/class_properties/migrated_0014.tree.json index ab4a4fa776a..c3bee9af110 100644 --- a/src/parser/test/flow/class_properties/migrated_0014.tree.json +++ b/src/parser/test/flow/class_properties/migrated_0014.tree.json @@ -60,6 +60,7 @@ "range":[23,24], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/class_properties/migrated_0019.tree.json b/src/parser/test/flow/class_properties/migrated_0019.tree.json index b129361b7c2..1e30950eb11 100644 --- a/src/parser/test/flow/class_properties/migrated_0019.tree.json +++ b/src/parser/test/flow/class_properties/migrated_0019.tree.json @@ -60,6 +60,7 @@ "range":[23,24], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/class_properties/static_with_params.tree.json b/src/parser/test/flow/class_properties/static_with_params.tree.json index 19e0af419a8..eefe0ce3324 100644 --- a/src/parser/test/flow/class_properties/static_with_params.tree.json +++ b/src/parser/test/flow/class_properties/static_with_params.tree.json @@ -60,6 +60,7 @@ "range":[19,20], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/class_properties/static_with_params_no_types.tree.json b/src/parser/test/flow/class_properties/static_with_params_no_types.tree.json index d0595b0d47c..9c868967488 100644 --- a/src/parser/test/flow/class_properties/static_with_params_no_types.tree.json +++ b/src/parser/test/flow/class_properties/static_with_params_no_types.tree.json @@ -66,6 +66,7 @@ "range":[19,20], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/arrow_function.tree.json b/src/parser/test/flow/comment_interning/arrow_function.tree.json index b0da76a2bd9..20d2cd80d48 100644 --- a/src/parser/test/flow/comment_interning/arrow_function.tree.json +++ b/src/parser/test/flow/comment_interning/arrow_function.tree.json @@ -222,6 +222,7 @@ "range":[236,237], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -360,6 +361,7 @@ "range":[395,396], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/class_declaration.tree.json b/src/parser/test/flow/comment_interning/class_declaration.tree.json index 69c073ec8eb..b44181784d1 100644 --- a/src/parser/test/flow/comment_interning/class_declaration.tree.json +++ b/src/parser/test/flow/comment_interning/class_declaration.tree.json @@ -142,6 +142,7 @@ "range":[143,144], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -459,6 +460,7 @@ "range":[603,604], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -915,6 +917,7 @@ "range":[1187,1188], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -1022,6 +1025,7 @@ "range":[1388,1389], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/class_expression.tree.json b/src/parser/test/flow/comment_interning/class_expression.tree.json index 0c34bbae467..b00df95dfbb 100644 --- a/src/parser/test/flow/comment_interning/class_expression.tree.json +++ b/src/parser/test/flow/comment_interning/class_expression.tree.json @@ -92,6 +92,7 @@ "range":[84,85], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -170,6 +171,7 @@ "range":[195,196], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/class_method.tree.json b/src/parser/test/flow/comment_interning/class_method.tree.json index 3c063d1ab17..cd847cf5994 100644 --- a/src/parser/test/flow/comment_interning/class_method.tree.json +++ b/src/parser/test/flow/comment_interning/class_method.tree.json @@ -100,6 +100,7 @@ "range":[55,56], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -823,6 +824,7 @@ "range":[814,815], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -939,6 +941,7 @@ "range":[933,934], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/declare_class.tree.json b/src/parser/test/flow/comment_interning/declare_class.tree.json index 7d3d0e4b8be..af9ee6b287b 100644 --- a/src/parser/test/flow/comment_interning/declare_class.tree.json +++ b/src/parser/test/flow/comment_interning/declare_class.tree.json @@ -91,6 +91,7 @@ "range":[147,148], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -456,6 +457,7 @@ "range":[639,640], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/declare_function.tree.json b/src/parser/test/flow/comment_interning/declare_function.tree.json index a681e8844a2..8ead7b2e36b 100644 --- a/src/parser/test/flow/comment_interning/declare_function.tree.json +++ b/src/parser/test/flow/comment_interning/declare_function.tree.json @@ -139,6 +139,7 @@ "range":[152,153], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -427,6 +428,7 @@ "range":[592,593], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/declare_type_alias.tree.json b/src/parser/test/flow/comment_interning/declare_type_alias.tree.json index 4c81ddda4df..363deba759f 100644 --- a/src/parser/test/flow/comment_interning/declare_type_alias.tree.json +++ b/src/parser/test/flow/comment_interning/declare_type_alias.tree.json @@ -274,6 +274,7 @@ "range":[444,445], "name":"U", "bound":null, + "const":false, "variance":null, "default":null } @@ -321,6 +322,7 @@ "range":[509,510], "name":"U", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/function_declaration.tree.json b/src/parser/test/flow/comment_interning/function_declaration.tree.json index 301ff0788f6..aca35a973f2 100644 --- a/src/parser/test/flow/comment_interning/function_declaration.tree.json +++ b/src/parser/test/flow/comment_interning/function_declaration.tree.json @@ -179,6 +179,7 @@ "range":[268,269], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -719,6 +720,7 @@ "range":[936,937], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -867,6 +869,7 @@ "range":[1097,1098], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/function_expression.tree.json b/src/parser/test/flow/comment_interning/function_expression.tree.json index 1f80ed8d9e8..48e351ca1ce 100644 --- a/src/parser/test/flow/comment_interning/function_expression.tree.json +++ b/src/parser/test/flow/comment_interning/function_expression.tree.json @@ -189,6 +189,7 @@ "range":[260,261], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -294,6 +295,7 @@ "range":[370,371], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -449,6 +451,7 @@ "range":[506,507], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -599,6 +602,7 @@ "range":[662,663], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/function_type.tree.json b/src/parser/test/flow/comment_interning/function_type.tree.json index 988cb5e7e8d..e4d3d289fad 100644 --- a/src/parser/test/flow/comment_interning/function_type.tree.json +++ b/src/parser/test/flow/comment_interning/function_type.tree.json @@ -305,6 +305,7 @@ "range":[279,280], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -434,6 +435,7 @@ "range":[469,470], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/interface.tree.json b/src/parser/test/flow/comment_interning/interface.tree.json index d5648ac6450..29090f2c2a8 100644 --- a/src/parser/test/flow/comment_interning/interface.tree.json +++ b/src/parser/test/flow/comment_interning/interface.tree.json @@ -91,6 +91,7 @@ "range":[124,125], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -338,6 +339,7 @@ "range":[417,418], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/object.tree.json b/src/parser/test/flow/comment_interning/object.tree.json index c2d5c6e527a..60d10122d00 100644 --- a/src/parser/test/flow/comment_interning/object.tree.json +++ b/src/parser/test/flow/comment_interning/object.tree.json @@ -342,6 +342,7 @@ "range":[365,366], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -594,6 +595,7 @@ "range":[582,583], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -710,6 +712,7 @@ "range":[701,702], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/object_type.tree.json b/src/parser/test/flow/comment_interning/object_type.tree.json index 84e20e04248..ae05e0d3dfd 100644 --- a/src/parser/test/flow/comment_interning/object_type.tree.json +++ b/src/parser/test/flow/comment_interning/object_type.tree.json @@ -639,6 +639,7 @@ "range":[736,737], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -737,6 +738,7 @@ "range":[846,847], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -848,6 +850,7 @@ "range":[963,964], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -1454,6 +1457,7 @@ "range":[1813,1814], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -1506,7 +1510,8 @@ "range":[1925,1929] }, "rest":null, - "typeParameters":null + "typeParameters":null, + "this":null }, "method":true, "optional":false, @@ -1560,6 +1565,7 @@ "range":[1935,1936], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -1623,6 +1629,7 @@ "range":[2004,2005], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/type_alias.tree.json b/src/parser/test/flow/comment_interning/type_alias.tree.json index ea5828681b3..2e45f2f3cb9 100644 --- a/src/parser/test/flow/comment_interning/type_alias.tree.json +++ b/src/parser/test/flow/comment_interning/type_alias.tree.json @@ -66,6 +66,7 @@ "range":[64,65], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -162,6 +163,7 @@ "range":[242,243], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -385,6 +387,7 @@ "range":[603,604], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -435,6 +438,7 @@ "range":[668,669], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/type_parameters.tree.json b/src/parser/test/flow/comment_interning/type_parameters.tree.json index 1f3a3d67a8a..e1bef4b3ee5 100644 --- a/src/parser/test/flow/comment_interning/type_parameters.tree.json +++ b/src/parser/test/flow/comment_interning/type_parameters.tree.json @@ -43,6 +43,7 @@ "range":[1,2], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/comment_interning/types.tree.json b/src/parser/test/flow/comment_interning/types.tree.json index 30bb480526f..d29eb96304f 100644 --- a/src/parser/test/flow/comment_interning/types.tree.json +++ b/src/parser/test/flow/comment_interning/types.tree.json @@ -149,6 +149,7 @@ "typeParameters":null } }, + "const":false, "variance":{ "type":"Variance", "leadingComments":[ diff --git a/src/parser/test/flow/components/component.tree.json b/src/parser/test/flow/components/component.tree.json index a551b072c34..56f231f0912 100644 --- a/src/parser/test/flow/components/component.tree.json +++ b/src/parser/test/flow/components/component.tree.json @@ -155,6 +155,7 @@ "range":[174,175], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/components/component_type.tree.json b/src/parser/test/flow/components/component_type.tree.json index 36094c2e43d..8a2be4b7d52 100644 --- a/src/parser/test/flow/components/component_type.tree.json +++ b/src/parser/test/flow/components/component_type.tree.json @@ -99,6 +99,7 @@ "range":[99,100], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/components/declare_component.tree.json b/src/parser/test/flow/components/declare_component.tree.json index e209718c7b9..d5f357908a6 100644 --- a/src/parser/test/flow/components/declare_component.tree.json +++ b/src/parser/test/flow/components/declare_component.tree.json @@ -137,6 +137,7 @@ "range":[175,176], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/hook_syntax/hook_type.tree.json b/src/parser/test/flow/hook_syntax/hook_type.tree.json index 8ea75cb2695..f073f4b0910 100644 --- a/src/parser/test/flow/hook_syntax/hook_type.tree.json +++ b/src/parser/test/flow/hook_syntax/hook_type.tree.json @@ -188,6 +188,7 @@ "range":[113,114], "name":"T", "bound":null, + "const":false, "variance":null, "default":null }, @@ -215,6 +216,7 @@ "typeParameters":null } }, + "const":false, "variance":null, "default":{ "type":"GenericTypeAnnotation", diff --git a/src/parser/test/flow/lshift_type_arg/example.tree.json b/src/parser/test/flow/lshift_type_arg/example.tree.json index 358aebc2602..a6d3d76dc0d 100644 --- a/src/parser/test/flow/lshift_type_arg/example.tree.json +++ b/src/parser/test/flow/lshift_type_arg/example.tree.json @@ -151,6 +151,7 @@ "range":[4,5], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -297,6 +298,7 @@ "range":[25,26], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/ts_syntax/in_out_variance.tree.json b/src/parser/test/flow/ts_syntax/in_out_variance.tree.json index 4587f4d9a20..5e1ec952642 100644 --- a/src/parser/test/flow/ts_syntax/in_out_variance.tree.json +++ b/src/parser/test/flow/ts_syntax/in_out_variance.tree.json @@ -26,6 +26,7 @@ "range":[7,11], "name":"A", "bound":null, + "const":false, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":1,"column":7},"end":{"line":1,"column":9}}, @@ -74,6 +75,7 @@ "range":[25,30], "name":"A", "bound":null, + "const":false, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":2,"column":7},"end":{"line":2,"column":10}}, @@ -122,6 +124,7 @@ "range":[44,52], "name":"A", "bound":null, + "const":false, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":3,"column":7},"end":{"line":3,"column":13}}, @@ -170,6 +173,7 @@ "range":[67,69], "name":"in", "bound":null, + "const":false, "variance":null, "default":null } @@ -213,6 +217,7 @@ "range":[84,87], "name":"out", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/ts_syntax/readonly_variance.tree.json b/src/parser/test/flow/ts_syntax/readonly_variance.tree.json index 2c145b9d4c9..23c1d2234a8 100644 --- a/src/parser/test/flow/ts_syntax/readonly_variance.tree.json +++ b/src/parser/test/flow/ts_syntax/readonly_variance.tree.json @@ -203,6 +203,7 @@ "range":[129,130], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -475,6 +476,7 @@ "range":[294,295], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -616,6 +618,7 @@ "range":[377,378], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -843,6 +846,7 @@ "range":[520,521], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/ts_syntax/type_param_extends.tree.json b/src/parser/test/flow/ts_syntax/type_param_extends.tree.json index 0d6b41eb9c1..105a906a89b 100644 --- a/src/parser/test/flow/ts_syntax/type_param_extends.tree.json +++ b/src/parser/test/flow/ts_syntax/type_param_extends.tree.json @@ -35,6 +35,7 @@ "range":[17,23] } }, + "const":false, "variance":null, "default":null, "usesExtendsBound":true diff --git a/src/parser/test/flow/type_guards/callback.tree.json b/src/parser/test/flow/type_guards/callback.tree.json index e222631046e..c766e6129ad 100644 --- a/src/parser/test/flow/type_guards/callback.tree.json +++ b/src/parser/test/flow/type_guards/callback.tree.json @@ -119,6 +119,7 @@ "range":[21,22], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/type_guards/poly_guard.tree.json b/src/parser/test/flow/type_guards/poly_guard.tree.json index 81421e6d74e..f3d9e5e67a2 100644 --- a/src/parser/test/flow/type_guards/poly_guard.tree.json +++ b/src/parser/test/flow/type_guards/poly_guard.tree.json @@ -97,6 +97,7 @@ "range":[37,38], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/aliases/migrated_0002.tree.json b/src/parser/test/flow/types/aliases/migrated_0002.tree.json index 3680dfffff0..dbd4f18d115 100644 --- a/src/parser/test/flow/types/aliases/migrated_0002.tree.json +++ b/src/parser/test/flow/types/aliases/migrated_0002.tree.json @@ -26,6 +26,7 @@ "range":[9,10], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/annotations/migrated_0014.tree.json b/src/parser/test/flow/types/annotations/migrated_0014.tree.json index 5c235191bd8..9eca38e7239 100644 --- a/src/parser/test/flow/types/annotations/migrated_0014.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0014.tree.json @@ -38,6 +38,7 @@ "range":[13,14], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/annotations/migrated_0015.tree.json b/src/parser/test/flow/types/annotations/migrated_0015.tree.json index 86872a6c169..b848aec13ef 100644 --- a/src/parser/test/flow/types/annotations/migrated_0015.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0015.tree.json @@ -38,6 +38,7 @@ "range":[13,14], "name":"T", "bound":null, + "const":false, "variance":null, "default":null }, @@ -47,6 +48,7 @@ "range":[15,16], "name":"S", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/annotations/migrated_0017.tree.json b/src/parser/test/flow/types/annotations/migrated_0017.tree.json index a59b239450c..1baf7641cc5 100644 --- a/src/parser/test/flow/types/annotations/migrated_0017.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0017.tree.json @@ -48,6 +48,7 @@ "range":[11,12], "name":"T", "bound":null, + "const":false, "variance":null, "default":null }, @@ -57,6 +58,7 @@ "range":[13,14], "name":"S", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/annotations/migrated_0045.tree.json b/src/parser/test/flow/types/annotations/migrated_0045.tree.json index 42ebd746b1e..d1f949ab273 100644 --- a/src/parser/test/flow/types/annotations/migrated_0045.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0045.tree.json @@ -50,6 +50,7 @@ "range":[14,15], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/annotations/migrated_0046.tree.json b/src/parser/test/flow/types/annotations/migrated_0046.tree.json index 924954b37c7..77fa8cf3905 100644 --- a/src/parser/test/flow/types/annotations/migrated_0046.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0046.tree.json @@ -21,7 +21,6 @@ "range":[13,15], "body":[] }, - "superClass":null, "typeParameters":{ "type":"TypeParameterDeclaration", "loc":{"source":null,"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, @@ -33,11 +32,13 @@ "range":[10,11], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } ] }, + "superClass":null, "superTypeParameters":null, "implements":[], "decorators":[] diff --git a/src/parser/test/flow/types/annotations/migrated_0047.tree.json b/src/parser/test/flow/types/annotations/migrated_0047.tree.json index 6ae35910704..f8f5f6fb982 100644 --- a/src/parser/test/flow/types/annotations/migrated_0047.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0047.tree.json @@ -82,6 +82,7 @@ "range":[19,20], "name":"U", "bound":null, + "const":false, "variance":null, "default":null } @@ -95,7 +96,6 @@ } ] }, - "superClass":null, "typeParameters":{ "type":"TypeParameterDeclaration", "loc":{"source":null,"start":{"line":1,"column":9},"end":{"line":1,"column":12}}, @@ -107,11 +107,13 @@ "range":[10,11], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } ] }, + "superClass":null, "superTypeParameters":null, "implements":[], "decorators":[] diff --git a/src/parser/test/flow/types/annotations/migrated_0048.tree.json b/src/parser/test/flow/types/annotations/migrated_0048.tree.json index e71620428e7..8627ed274ba 100644 --- a/src/parser/test/flow/types/annotations/migrated_0048.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0048.tree.json @@ -59,6 +59,7 @@ "range":[18,19], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -72,8 +73,8 @@ } ] }, - "superClass":null, "typeParameters":null, + "superClass":null, "superTypeParameters":null, "implements":[], "decorators":[] diff --git a/src/parser/test/flow/types/annotations/migrated_0055.tree.json b/src/parser/test/flow/types/annotations/migrated_0055.tree.json index 60a238f4c58..407fb8481c2 100644 --- a/src/parser/test/flow/types/annotations/migrated_0055.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0055.tree.json @@ -40,6 +40,7 @@ "range":[10,11], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/annotations/migrated_0056.tree.json b/src/parser/test/flow/types/annotations/migrated_0056.tree.json index b9a1706dc0f..8b20579ea1c 100644 --- a/src/parser/test/flow/types/annotations/migrated_0056.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0056.tree.json @@ -57,6 +57,7 @@ "range":[14,15], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/annotations/migrated_0057.tree.json b/src/parser/test/flow/types/annotations/migrated_0057.tree.json index 47729d414ea..03794ba6a8a 100644 --- a/src/parser/test/flow/types/annotations/migrated_0057.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0057.tree.json @@ -21,7 +21,6 @@ "range":[19,21], "body":[] }, - "superClass":null, "typeParameters":{ "type":"TypeParameterDeclaration", "loc":{"source":null,"start":{"line":1,"column":9},"end":{"line":1,"column":18}}, @@ -33,6 +32,7 @@ "range":[10,13], "name":"T1", "bound":null, + "const":false, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":1,"column":10},"end":{"line":1,"column":11}}, @@ -47,6 +47,7 @@ "range":[14,17], "name":"T2", "bound":null, + "const":false, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":1,"column":14},"end":{"line":1,"column":15}}, @@ -57,6 +58,7 @@ } ] }, + "superClass":null, "superTypeParameters":null, "implements":[], "decorators":[] diff --git a/src/parser/test/flow/types/annotations/migrated_0063.tree.json b/src/parser/test/flow/types/annotations/migrated_0063.tree.json index 6f629b90cef..88bd240af53 100644 --- a/src/parser/test/flow/types/annotations/migrated_0063.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0063.tree.json @@ -26,6 +26,7 @@ "range":[16,17], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -177,7 +178,8 @@ }, "optional":false }, - "typeParameters":null + "typeParameters":null, + "this":null }, "method":true, "optional":false, diff --git a/src/parser/test/flow/types/annotations/migrated_0068.tree.json b/src/parser/test/flow/types/annotations/migrated_0068.tree.json index 5a27cdb5e34..fa821827757 100644 --- a/src/parser/test/flow/types/annotations/migrated_0068.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0068.tree.json @@ -26,6 +26,7 @@ "range":[16,17], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } @@ -177,7 +178,8 @@ }, "optional":false }, - "typeParameters":null + "typeParameters":null, + "this":null }, "method":true, "optional":false, diff --git a/src/parser/test/flow/types/annotations/migrated_0071.tree.json b/src/parser/test/flow/types/annotations/migrated_0071.tree.json index 1a97ae1dd64..bc962f5d97a 100644 --- a/src/parser/test/flow/types/annotations/migrated_0071.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0071.tree.json @@ -81,11 +81,13 @@ "range":[15,16], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } ] - } + }, + "this":null } }, "optional":false diff --git a/src/parser/test/flow/types/annotations/migrated_0074.tree.json b/src/parser/test/flow/types/annotations/migrated_0074.tree.json index 4b0986c78af..9a98b772f93 100644 --- a/src/parser/test/flow/types/annotations/migrated_0074.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0074.tree.json @@ -26,6 +26,7 @@ "range":[9,10], "name":"A", "bound":null, + "const":false, "variance":null, "default":null }, @@ -35,6 +36,7 @@ "range":[11,12], "name":"B", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/annotations/migrated_0075.tree.json b/src/parser/test/flow/types/annotations/migrated_0075.tree.json index 0257826c6af..c80fc6c0a8f 100644 --- a/src/parser/test/flow/types/annotations/migrated_0075.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0075.tree.json @@ -40,6 +40,7 @@ "range":[10,11], "name":"A", "bound":null, + "const":false, "variance":null, "default":null }, @@ -49,6 +50,7 @@ "range":[12,13], "name":"B", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/annotations/migrated_0076.tree.json b/src/parser/test/flow/types/annotations/migrated_0076.tree.json index ebc361c4e05..a552200390d 100644 --- a/src/parser/test/flow/types/annotations/migrated_0076.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0076.tree.json @@ -26,6 +26,7 @@ "range":[14,15], "name":"A", "bound":null, + "const":false, "variance":null, "default":null }, @@ -35,6 +36,7 @@ "range":[16,17], "name":"B", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/annotations/migrated_0077.tree.json b/src/parser/test/flow/types/annotations/migrated_0077.tree.json index 7958cdaec29..b73dbaa8307 100644 --- a/src/parser/test/flow/types/annotations/migrated_0077.tree.json +++ b/src/parser/test/flow/types/annotations/migrated_0077.tree.json @@ -22,10 +22,6 @@ "range":[19,21], "body":[] }, - "async":false, - "generator":false, - "predicate":null, - "expression":false, "returnType":null, "typeParameters":{ "type":"TypeParameterDeclaration", @@ -38,6 +34,7 @@ "range":[11,12], "name":"A", "bound":null, + "const":false, "variance":null, "default":null }, @@ -47,11 +44,16 @@ "range":[13,14], "name":"B", "bound":null, + "const":false, "variance":null, "default":null } ] - } + }, + "async":false, + "generator":false, + "predicate":null, + "expression":false } ], "comments":[] diff --git a/src/parser/test/flow/types/annotations_in_comments/migrated_0016.tree.json b/src/parser/test/flow/types/annotations_in_comments/migrated_0016.tree.json index 425c19d25af..a8abcc604c0 100644 --- a/src/parser/test/flow/types/annotations_in_comments/migrated_0016.tree.json +++ b/src/parser/test/flow/types/annotations_in_comments/migrated_0016.tree.json @@ -63,10 +63,6 @@ } ] }, - "async":false, - "generator":false, - "predicate":null, - "expression":false, "returnType":{ "type":"TypeAnnotation", "loc":{"source":null,"start":{"line":1,"column":35},"end":{"line":1,"column":40}}, @@ -97,11 +93,16 @@ "range":[18,19], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } ] - } + }, + "async":false, + "generator":false, + "predicate":null, + "expression":false } ], "comments":[] diff --git a/src/parser/test/flow/types/conditional_types/error.tree.json b/src/parser/test/flow/types/conditional_types/error.tree.json index e5df39a663d..01e581aaadf 100644 --- a/src/parser/test/flow/types/conditional_types/error.tree.json +++ b/src/parser/test/flow/types/conditional_types/error.tree.json @@ -108,6 +108,7 @@ "range":[171,177] } }, + "const":false, "variance":null, "default":null, "usesExtendsBound":true diff --git a/src/parser/test/flow/types/conditional_types/passing.tree.json b/src/parser/test/flow/types/conditional_types/passing.tree.json index bfa1a925dce..183bf5598ff 100644 --- a/src/parser/test/flow/types/conditional_types/passing.tree.json +++ b/src/parser/test/flow/types/conditional_types/passing.tree.json @@ -478,6 +478,7 @@ "range":[559,560], "name":"T", "bound":null, + "const":false, "variance":null, "default":null }] @@ -525,6 +526,7 @@ "range":[586,587], "name":"E", "bound":null, + "const":false, "variance":null, "default":null, "usesExtendsBound":true @@ -599,6 +601,7 @@ "range":[642,648] } }, + "const":false, "variance":null, "default":null, "usesExtendsBound":true @@ -653,6 +656,7 @@ "range":[683,684], "name":"T", "bound":null, + "const":false, "variance":null, "default":null, "usesExtendsBound":true @@ -722,6 +726,7 @@ "range":[750,751], "name":"T", "bound":null, + "const":false, "variance":null, "default":null, "usesExtendsBound":true @@ -821,6 +826,7 @@ "range":[894,900] } }, + "const":false, "variance":null, "default":null, "usesExtendsBound":true @@ -864,6 +870,7 @@ "range":[916,917], "name":"A", "bound":null, + "const":false, "variance":null, "default":null, "usesExtendsBound":true @@ -883,6 +890,7 @@ "range":[933,934], "name":"B", "bound":null, + "const":false, "variance":null, "default":null, "usesExtendsBound":true @@ -898,6 +906,7 @@ "range":[949,950], "name":"C", "bound":null, + "const":false, "variance":null, "default":null, "usesExtendsBound":true @@ -913,6 +922,7 @@ "range":[959,960], "name":"D", "bound":null, + "const":false, "variance":null, "default":null, "usesExtendsBound":true @@ -928,6 +938,7 @@ "range":[969,970], "name":"E", "bound":null, + "const":false, "variance":null, "default":null, "usesExtendsBound":true diff --git a/src/parser/test/flow/types/declare_export/class/migrated_0018.tree.json b/src/parser/test/flow/types/declare_export/class/migrated_0018.tree.json index d8e6f9ae77b..a118ac495bb 100644 --- a/src/parser/test/flow/types/declare_export/class/migrated_0018.tree.json +++ b/src/parser/test/flow/types/declare_export/class/migrated_0018.tree.json @@ -31,6 +31,7 @@ "range":[23,24], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/declare_export/default/migrated_0026.tree.json b/src/parser/test/flow/types/declare_export/default/migrated_0026.tree.json index aa28b51e8c4..c1c8162bf28 100644 --- a/src/parser/test/flow/types/declare_export/default/migrated_0026.tree.json +++ b/src/parser/test/flow/types/declare_export/default/migrated_0026.tree.json @@ -43,11 +43,13 @@ "range":[36,37], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } ] - } + }, + "this":null } }, "optional":false diff --git a/src/parser/test/flow/types/declare_export/default/migrated_0029.tree.json b/src/parser/test/flow/types/declare_export/default/migrated_0029.tree.json index fd7a740152a..fe9af1b7c93 100644 --- a/src/parser/test/flow/types/declare_export/default/migrated_0029.tree.json +++ b/src/parser/test/flow/types/declare_export/default/migrated_0029.tree.json @@ -31,6 +31,7 @@ "range":[31,32], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/declare_export/function/migrated_0014.tree.json b/src/parser/test/flow/types/declare_export/function/migrated_0014.tree.json index b7d19adedb8..abcb48230aa 100644 --- a/src/parser/test/flow/types/declare_export/function/migrated_0014.tree.json +++ b/src/parser/test/flow/types/declare_export/function/migrated_0014.tree.json @@ -26,7 +26,6 @@ "loc":{"source":null,"start":{"line":1,"column":27},"end":{"line":1,"column":38}}, "range":[27,38], "params":[], - "this":null, "returnType":{ "type":"VoidTypeAnnotation", "loc":{"source":null,"start":{"line":1,"column":34},"end":{"line":1,"column":38}}, @@ -44,11 +43,13 @@ "range":[28,29], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } ] - } + }, + "this":null } }, "optional":false diff --git a/src/parser/test/flow/types/declare_interface/migrated_0001.tree.json b/src/parser/test/flow/types/declare_interface/migrated_0001.tree.json index ddecf6a8f2a..06aac870065 100644 --- a/src/parser/test/flow/types/declare_interface/migrated_0001.tree.json +++ b/src/parser/test/flow/types/declare_interface/migrated_0001.tree.json @@ -26,6 +26,7 @@ "range":[20,21], "name":"T", "bound":null, + "const":false, "variance":null, "default":null }, @@ -35,6 +36,7 @@ "range":[23,24], "name":"S", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/declare_interface/migrated_0005.tree.json b/src/parser/test/flow/types/declare_interface/migrated_0005.tree.json index 54838c28d39..7f8e795b52e 100644 --- a/src/parser/test/flow/types/declare_interface/migrated_0005.tree.json +++ b/src/parser/test/flow/types/declare_interface/migrated_0005.tree.json @@ -26,6 +26,7 @@ "range":[20,21], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/declare_statements/migrated_0007.tree.json b/src/parser/test/flow/types/declare_statements/migrated_0007.tree.json index 6f4318f3e5f..277924a1d6b 100644 --- a/src/parser/test/flow/types/declare_statements/migrated_0007.tree.json +++ b/src/parser/test/flow/types/declare_statements/migrated_0007.tree.json @@ -26,6 +26,7 @@ "range":[16,17], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/interfaces/migrated_0001.tree.json b/src/parser/test/flow/types/interfaces/migrated_0001.tree.json index 576cb876212..9ffa52c94df 100644 --- a/src/parser/test/flow/types/interfaces/migrated_0001.tree.json +++ b/src/parser/test/flow/types/interfaces/migrated_0001.tree.json @@ -26,6 +26,7 @@ "range":[12,13], "name":"T", "bound":null, + "const":false, "variance":null, "default":null }, @@ -35,6 +36,7 @@ "range":[15,16], "name":"S", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/interfaces/migrated_0005.tree.json b/src/parser/test/flow/types/interfaces/migrated_0005.tree.json index d3bc572ae5c..90acc0f4afd 100644 --- a/src/parser/test/flow/types/interfaces/migrated_0005.tree.json +++ b/src/parser/test/flow/types/interfaces/migrated_0005.tree.json @@ -26,6 +26,7 @@ "range":[12,13], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/interfaces/prop_named_static.tree.json b/src/parser/test/flow/types/interfaces/prop_named_static.tree.json index 32190b03061..45b824df553 100644 --- a/src/parser/test/flow/types/interfaces/prop_named_static.tree.json +++ b/src/parser/test/flow/types/interfaces/prop_named_static.tree.json @@ -252,6 +252,7 @@ "range":[179,180], "name":"X", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/invalid_keywords/migrated_0001.tree.json b/src/parser/test/flow/types/invalid_keywords/migrated_0001.tree.json index 6ca83deb1fa..76c605f64dd 100644 --- a/src/parser/test/flow/types/invalid_keywords/migrated_0001.tree.json +++ b/src/parser/test/flow/types/invalid_keywords/migrated_0001.tree.json @@ -32,6 +32,7 @@ "range":[9,15], "name":"number", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/mapped_types/minus_optional.tree.json b/src/parser/test/flow/types/mapped_types/minus_optional.tree.json index 49a7d1c1753..36c1ad5886e 100644 --- a/src/parser/test/flow/types/mapped_types/minus_optional.tree.json +++ b/src/parser/test/flow/types/mapped_types/minus_optional.tree.json @@ -38,6 +38,7 @@ "range":[9,12], "name":"key", "bound":null, + "const":false, "variance":null, "default":null }, diff --git a/src/parser/test/flow/types/mapped_types/multiple_props.tree.json b/src/parser/test/flow/types/mapped_types/multiple_props.tree.json index f83d31ce2df..49a167566fc 100644 --- a/src/parser/test/flow/types/mapped_types/multiple_props.tree.json +++ b/src/parser/test/flow/types/mapped_types/multiple_props.tree.json @@ -57,6 +57,7 @@ "range":[29,30], "name":"K", "bound":null, + "const":false, "variance":null, "default":null }, @@ -125,6 +126,7 @@ "range":[81,82], "name":"K", "bound":null, + "const":false, "variance":null, "default":null }, diff --git a/src/parser/test/flow/types/mapped_types/optional.tree.json b/src/parser/test/flow/types/mapped_types/optional.tree.json index ff4b664c82b..6e8fde82ba6 100644 --- a/src/parser/test/flow/types/mapped_types/optional.tree.json +++ b/src/parser/test/flow/types/mapped_types/optional.tree.json @@ -38,6 +38,7 @@ "range":[9,12], "name":"key", "bound":null, + "const":false, "variance":null, "default":null }, diff --git a/src/parser/test/flow/types/mapped_types/optional_with_variance.tree.json b/src/parser/test/flow/types/mapped_types/optional_with_variance.tree.json index 505d3615e90..783403108c2 100644 --- a/src/parser/test/flow/types/mapped_types/optional_with_variance.tree.json +++ b/src/parser/test/flow/types/mapped_types/optional_with_variance.tree.json @@ -38,6 +38,7 @@ "range":[10,13], "name":"key", "bound":null, + "const":false, "variance":null, "default":null }, diff --git a/src/parser/test/flow/types/mapped_types/plain.tree.json b/src/parser/test/flow/types/mapped_types/plain.tree.json index df2623c865e..cab40f4f2d3 100644 --- a/src/parser/test/flow/types/mapped_types/plain.tree.json +++ b/src/parser/test/flow/types/mapped_types/plain.tree.json @@ -38,6 +38,7 @@ "range":[9,12], "name":"key", "bound":null, + "const":false, "variance":null, "default":null }, diff --git a/src/parser/test/flow/types/mapped_types/plus_optional.tree.json b/src/parser/test/flow/types/mapped_types/plus_optional.tree.json index 8c0ae68d5a1..b0ffd80ffc5 100644 --- a/src/parser/test/flow/types/mapped_types/plus_optional.tree.json +++ b/src/parser/test/flow/types/mapped_types/plus_optional.tree.json @@ -38,6 +38,7 @@ "range":[9,12], "name":"key", "bound":null, + "const":false, "variance":null, "default":null }, diff --git a/src/parser/test/flow/types/mapped_types/static_error.tree.json b/src/parser/test/flow/types/mapped_types/static_error.tree.json index b644f29d473..65bd8b9d17d 100644 --- a/src/parser/test/flow/types/mapped_types/static_error.tree.json +++ b/src/parser/test/flow/types/mapped_types/static_error.tree.json @@ -67,6 +67,7 @@ "range":[24,27], "name":"key", "bound":null, + "const":false, "variance":null, "default":null }, diff --git a/src/parser/test/flow/types/mapped_types/variance.tree.json b/src/parser/test/flow/types/mapped_types/variance.tree.json index 278a6cbcffb..dff00c2df4f 100644 --- a/src/parser/test/flow/types/mapped_types/variance.tree.json +++ b/src/parser/test/flow/types/mapped_types/variance.tree.json @@ -38,6 +38,7 @@ "range":[10,13], "name":"key", "bound":null, + "const":false, "variance":null, "default":null }, diff --git a/src/parser/test/flow/types/object/method_named_static_polymorphic.tree.json b/src/parser/test/flow/types/object/method_named_static_polymorphic.tree.json index 83594dedce8..cfb2c620b28 100644 --- a/src/parser/test/flow/types/object/method_named_static_polymorphic.tree.json +++ b/src/parser/test/flow/types/object/method_named_static_polymorphic.tree.json @@ -67,6 +67,7 @@ "range":[62,63], "name":"X", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/object/methods/generic_method.tree.json b/src/parser/test/flow/types/object/methods/generic_method.tree.json index 650902c9925..e85120ebc4b 100644 --- a/src/parser/test/flow/types/object/methods/generic_method.tree.json +++ b/src/parser/test/flow/types/object/methods/generic_method.tree.json @@ -20,8 +20,8 @@ "type":"ObjectTypeAnnotation", "loc":{"source":null,"start":{"line":1,"column":9},"end":{"line":1,"column":34}}, "range":[9,34], - "exact":false, "inexact":false, + "exact":false, "properties":[ { "type":"ObjectTypeProperty", @@ -86,11 +86,13 @@ "range":[15,16], "name":"U", "bound":null, + "const":false, "variance":null, "default":null } ] - } + }, + "this":null }, "method":true, "optional":false, diff --git a/src/parser/test/flow/types/object/unexpected_static_006.tree.json b/src/parser/test/flow/types/object/unexpected_static_006.tree.json index 6751bb11228..12d5807f38d 100644 --- a/src/parser/test/flow/types/object/unexpected_static_006.tree.json +++ b/src/parser/test/flow/types/object/unexpected_static_006.tree.json @@ -101,6 +101,7 @@ "range":[67,68], "name":"X", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0000.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0000.tree.json index f1ca467f5f8..c8e89e1c38c 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0000.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0000.tree.json @@ -26,6 +26,7 @@ "range":[7,17], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0001.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0001.tree.json index 0653a64c90d..25307e83ba1 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0001.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0001.tree.json @@ -40,6 +40,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0002.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0002.tree.json index abdeaedc365..1e73a88d5ee 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0002.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0002.tree.json @@ -26,6 +26,7 @@ "range":[7,8], "name":"S", "bound":null, + "const":false, "variance":null, "default":null }, @@ -49,6 +50,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0003.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0003.tree.json index 70a7226a805..c5930a145f6 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0003.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0003.tree.json @@ -26,6 +26,7 @@ "range":[7,17], "name":"S", "bound":null, + "const":false, "variance":null, "default":{ "type":"NumberTypeAnnotation", @@ -53,6 +54,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0004.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0004.tree.json index 783737cde33..d62a997c91b 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0004.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0004.tree.json @@ -32,6 +32,7 @@ "range":[8,18], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0005.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0005.tree.json index b859cc8eb9a..23df8e60ed7 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0005.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0005.tree.json @@ -46,6 +46,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0006.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0006.tree.json index 65d073fb5ab..906d21526e3 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0006.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0006.tree.json @@ -32,6 +32,7 @@ "range":[8,9], "name":"S", "bound":null, + "const":false, "variance":null, "default":null }, @@ -55,6 +56,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0007.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0007.tree.json index a2a168f289f..0411749e3d1 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0007.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0007.tree.json @@ -32,6 +32,7 @@ "range":[8,18], "name":"S", "bound":null, + "const":false, "variance":null, "default":{ "type":"NumberTypeAnnotation", @@ -59,6 +60,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0008.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0008.tree.json index ddad297b34e..5f8a984f826 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0008.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0008.tree.json @@ -36,6 +36,7 @@ "range":[9,19], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0009.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0009.tree.json index bd721b0daae..8a49bb330e0 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0009.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0009.tree.json @@ -50,6 +50,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0010.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0010.tree.json index 577e99d021d..6fb19cf7e26 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0010.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0010.tree.json @@ -36,6 +36,7 @@ "range":[9,10], "name":"S", "bound":null, + "const":false, "variance":null, "default":null }, @@ -59,6 +60,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0011.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0011.tree.json index bda2a7add62..16a420c51f1 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0011.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0011.tree.json @@ -36,6 +36,7 @@ "range":[9,19], "name":"S", "bound":null, + "const":false, "variance":null, "default":{ "type":"NumberTypeAnnotation", @@ -63,6 +64,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0012.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0012.tree.json index 5f2c773216e..0712bb4ca73 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0012.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0012.tree.json @@ -26,6 +26,7 @@ "range":[16,26], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0013.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0013.tree.json index 389bed90445..3dfcb8a2c70 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0013.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0013.tree.json @@ -40,6 +40,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0014.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0014.tree.json index 00188cb7a66..35830155392 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0014.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0014.tree.json @@ -26,6 +26,7 @@ "range":[16,17], "name":"S", "bound":null, + "const":false, "variance":null, "default":null }, @@ -49,6 +50,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0015.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0015.tree.json index 84569df40e5..5610c9d6b31 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0015.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0015.tree.json @@ -26,6 +26,7 @@ "range":[16,26], "name":"S", "bound":null, + "const":false, "variance":null, "default":{ "type":"NumberTypeAnnotation", @@ -53,6 +54,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0016.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0016.tree.json index 04daa92a879..1d029fcf430 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0016.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0016.tree.json @@ -26,6 +26,7 @@ "range":[12,22], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0017.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0017.tree.json index 71d1d38915f..32243040b0b 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0017.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0017.tree.json @@ -40,6 +40,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0018.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0018.tree.json index 1e9a4f377bc..04e4fcd748a 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0018.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0018.tree.json @@ -26,6 +26,7 @@ "range":[12,13], "name":"S", "bound":null, + "const":false, "variance":null, "default":null }, @@ -49,6 +50,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0019.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0019.tree.json index 6767c8b03bb..9225e82172b 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0019.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0019.tree.json @@ -26,6 +26,7 @@ "range":[12,22], "name":"S", "bound":null, + "const":false, "variance":null, "default":{ "type":"NumberTypeAnnotation", @@ -53,6 +54,7 @@ } } }, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0022.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0022.tree.json index 49b6ba81f59..818206a583e 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0022.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0022.tree.json @@ -44,6 +44,7 @@ "range":[7,17], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", @@ -57,6 +58,7 @@ "range":[21,27], "name":"string", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0023.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0023.tree.json index bbe9d2fd3fb..08fd4494d4d 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0023.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0023.tree.json @@ -32,6 +32,7 @@ "range":[7,26], "name":"HasDefault", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", @@ -45,6 +46,7 @@ "range":[28,37], "name":"NoDefault", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0026.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0026.tree.json index 5f42722e2fc..71bd2e233de 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0026.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0026.tree.json @@ -22,10 +22,6 @@ "range":[27,29], "body":[] }, - "async":false, - "generator":false, - "predicate":null, - "expression":false, "returnType":null, "typeParameters":{ "type":"TypeParameterDeclaration", @@ -38,6 +34,7 @@ "range":[13,23], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", @@ -46,7 +43,11 @@ } } ] - } + }, + "async":false, + "generator":false, + "predicate":null, + "expression":false } ], "comments":[] diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0027.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0027.tree.json index 035be6f804e..5bfa1eded63 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0027.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0027.tree.json @@ -39,7 +39,6 @@ "loc":{"source":null,"start":{"line":1,"column":20},"end":{"line":1,"column":36}}, "range":[20,36], "params":[], - "this":null, "returnType":{ "type":"AnyTypeAnnotation", "loc":{"source":null,"start":{"line":1,"column":36},"end":{"line":1,"column":37}}, @@ -57,6 +56,7 @@ "range":[21,31], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", @@ -65,7 +65,8 @@ } } ] - } + }, + "this":null } }, "optional":false diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0028.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0028.tree.json index 373e67ae897..7690c405f4d 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0028.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0028.tree.json @@ -52,6 +52,7 @@ "range":[7,17], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0029.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0029.tree.json index 68e557023e4..6a2e3f4392b 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0029.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0029.tree.json @@ -60,6 +60,7 @@ "range":[14,24], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0030.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0030.tree.json index 2acfbcc6575..648ea3c20b4 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0030.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0030.tree.json @@ -64,6 +64,7 @@ "range":[15,25], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0031.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0031.tree.json index 3d268c6b7b3..cf8cb356ad6 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0031.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0031.tree.json @@ -56,6 +56,7 @@ "range":[22,32], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", @@ -64,7 +65,8 @@ } } ] - } + }, + "this":null }, "method":true, "optional":false, diff --git a/src/parser/test/flow/types/parameter_defaults/migrated_0032.tree.json b/src/parser/test/flow/types/parameter_defaults/migrated_0032.tree.json index cda84de6f1a..568c454bec1 100644 --- a/src/parser/test/flow/types/parameter_defaults/migrated_0032.tree.json +++ b/src/parser/test/flow/types/parameter_defaults/migrated_0032.tree.json @@ -36,6 +36,7 @@ "range":[1,11], "name":"T", "bound":null, + "const":false, "variance":null, "default":{ "type":"StringTypeAnnotation", diff --git a/src/parser/test/flow/types/type_params/class_const_params.tree.json b/src/parser/test/flow/types/type_params/class_const_params.tree.json index 6948fb70e44..5c2482849a8 100644 --- a/src/parser/test/flow/types/type_params/class_const_params.tree.json +++ b/src/parser/test/flow/types/type_params/class_const_params.tree.json @@ -32,13 +32,9 @@ "range":[9,16], "name":"X", "bound":null, + "const":true, "variance":null, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":1,"column":9},"end":{"line":1,"column":14}}, - "range":[9,14] - } + "default":null } ] }, @@ -76,18 +72,14 @@ "range":[30,38], "name":"X", "bound":null, + "const":true, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":2,"column":15},"end":{"line":2,"column":16}}, "range":[36,37], "kind":"plus" }, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":2,"column":9},"end":{"line":2,"column":14}}, - "range":[30,35] - } + "default":null } ] }, @@ -125,18 +117,14 @@ "range":[52,60], "name":"X", "bound":null, + "const":true, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":3,"column":15},"end":{"line":3,"column":16}}, "range":[58,59], "kind":"minus" }, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":3,"column":9},"end":{"line":3,"column":14}}, - "range":[52,57] - } + "default":null } ] }, @@ -174,18 +162,14 @@ "range":[74,84], "name":"X", "bound":null, + "const":true, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":4,"column":15},"end":{"line":4,"column":17}}, "range":[80,82], "kind":"in" }, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":4,"column":9},"end":{"line":4,"column":14}}, - "range":[74,79] - } + "default":null } ] }, @@ -223,18 +207,14 @@ "range":[98,109], "name":"X", "bound":null, + "const":true, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":5,"column":15},"end":{"line":5,"column":18}}, "range":[104,107], "kind":"out" }, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":5,"column":9},"end":{"line":5,"column":14}}, - "range":[98,103] - } + "default":null } ] }, @@ -272,6 +252,7 @@ "range":[123,137], "name":"X", "bound":null, + "const":true, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":6,"column":15},"end":{"line":6,"column":17}}, @@ -291,11 +272,6 @@ "optional":false }, "typeParameters":null - }, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":6,"column":9},"end":{"line":6,"column":14}}, - "range":[123,128] } } ] diff --git a/src/parser/test/flow/types/type_params/function_const_params.tree.json b/src/parser/test/flow/types/type_params/function_const_params.tree.json index 0f1ed793f60..d775bdc8a78 100644 --- a/src/parser/test/flow/types/type_params/function_const_params.tree.json +++ b/src/parser/test/flow/types/type_params/function_const_params.tree.json @@ -43,13 +43,9 @@ "range":[12,19], "name":"X", "bound":null, + "const":true, "variance":null, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":1,"column":12},"end":{"line":1,"column":17}}, - "range":[12,17] - } + "default":null } ] }, @@ -98,13 +94,9 @@ "range":[44,51], "name":"X", "bound":null, + "const":true, "variance":null, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":2,"column":12},"end":{"line":2,"column":17}}, - "range":[44,49] - } + "default":null }, { "type":"TypeParameter", @@ -112,6 +104,7 @@ "range":[53,54], "name":"Y", "bound":null, + "const":false, "variance":null, "default":null } @@ -162,6 +155,7 @@ "range":[79,80], "name":"X", "bound":null, + "const":false, "variance":null, "default":null }, @@ -171,13 +165,9 @@ "range":[82,89], "name":"Y", "bound":null, + "const":true, "variance":null, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":3,"column":15},"end":{"line":3,"column":20}}, - "range":[82,87] - } + "default":null } ] }, @@ -226,6 +216,7 @@ "range":[114,125], "name":"Y", "bound":null, + "const":true, "variance":null, "default":{ "type":"GenericTypeAnnotation", @@ -240,11 +231,6 @@ "optional":false }, "typeParameters":null - }, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":4,"column":12},"end":{"line":4,"column":17}}, - "range":[114,119] } } ] @@ -312,13 +298,9 @@ "typeParameters":null } }, + "const":true, "variance":null, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":5,"column":12},"end":{"line":5,"column":17}}, - "range":[150,155] - } + "default":null } ] }, @@ -417,21 +399,9 @@ "typeParameters":null } }, + "const":true, "variance":null, - "default":null, - "const":{ - "type":"ConstModifier", - "leadingComments":[ - { - "type":"Block", - "loc":{"source":null,"start":{"line":6,"column":14},"end":{"line":6,"column":29}}, - "range":[188,203], - "value":" comment 1 " - } - ], - "loc":{"source":null,"start":{"line":6,"column":30},"end":{"line":6,"column":35}}, - "range":[204,209] - } + "default":null } ] }, diff --git a/src/parser/test/flow/types/type_params/invalid_class_const_params1.tree.json b/src/parser/test/flow/types/type_params/invalid_class_const_params1.tree.json index fb641156aff..a5b8da0891d 100644 --- a/src/parser/test/flow/types/type_params/invalid_class_const_params1.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_class_const_params1.tree.json @@ -42,6 +42,7 @@ "range":[8,14], "name":"const", "bound":null, + "const":false, "variance":{ "type":"Variance", "loc":{"source":null,"start":{"line":1,"column":8},"end":{"line":1,"column":9}}, @@ -56,6 +57,7 @@ "range":[15,16], "name":"X", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/type_params/invalid_class_const_params2.tree.json b/src/parser/test/flow/types/type_params/invalid_class_const_params2.tree.json index a64fd49e393..b9f691e4c9f 100644 --- a/src/parser/test/flow/types/type_params/invalid_class_const_params2.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_class_const_params2.tree.json @@ -38,6 +38,7 @@ "range":[8,10], "name":"in", "bound":null, + "const":false, "variance":null, "default":null }, @@ -47,13 +48,9 @@ "range":[11,18], "name":"X", "bound":null, + "const":true, "variance":null, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":1,"column":11},"end":{"line":1,"column":16}}, - "range":[11,16] - } + "default":null } ] }, diff --git a/src/parser/test/flow/types/type_params/invalid_const_param_no_name.tree.json b/src/parser/test/flow/types/type_params/invalid_const_param_no_name.tree.json index ddff9f85f78..2168c3ed5c7 100644 --- a/src/parser/test/flow/types/type_params/invalid_const_param_no_name.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_const_param_no_name.tree.json @@ -55,11 +55,7 @@ "bound":null, "variance":null, "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":1,"column":13},"end":{"line":1,"column":18}}, - "range":[13,18] - } + "const":true } ] }, diff --git a/src/parser/test/flow/types/type_params/invalid_multiple_params_missing_comma.tree.json b/src/parser/test/flow/types/type_params/invalid_multiple_params_missing_comma.tree.json index a4110c5d3d6..26b6247a3c2 100644 --- a/src/parser/test/flow/types/type_params/invalid_multiple_params_missing_comma.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_multiple_params_missing_comma.tree.json @@ -32,6 +32,7 @@ "range":[7,8], "name":"U", "bound":null, + "const":false, "variance":null, "default":null }, @@ -41,6 +42,7 @@ "range":[9,10], "name":"V", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/type_params/invalid_multiple_params_semicolon.tree.json b/src/parser/test/flow/types/type_params/invalid_multiple_params_semicolon.tree.json index 46edfd723a8..f707772532f 100644 --- a/src/parser/test/flow/types/type_params/invalid_multiple_params_semicolon.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_multiple_params_semicolon.tree.json @@ -32,6 +32,7 @@ "range":[7,8], "name":"U", "bound":null, + "const":false, "variance":null, "default":null }, @@ -41,6 +42,7 @@ "range":[10,11], "name":"V", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/type_params/invalid_unclosed_params_class.tree.json b/src/parser/test/flow/types/type_params/invalid_unclosed_params_class.tree.json index 0dad3fe2779..b124606d2fe 100644 --- a/src/parser/test/flow/types/type_params/invalid_unclosed_params_class.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_unclosed_params_class.tree.json @@ -52,6 +52,7 @@ "range":[9,14], "name":"class", "bound":null, + "const":false, "variance":null, "default":null }, @@ -61,6 +62,7 @@ "range":[15,16], "name":"C", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_assign.tree.json b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_assign.tree.json index 17961b579be..734e93cb439 100644 --- a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_assign.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_assign.tree.json @@ -32,6 +32,7 @@ "range":[7,17], "name":"U", "bound":null, + "const":false, "variance":null, "default":{ "type":"NumberTypeAnnotation", diff --git a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_enum.tree.json b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_enum.tree.json index 7efd4053dad..21844ac2061 100644 --- a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_enum.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_enum.tree.json @@ -40,6 +40,7 @@ "range":[7,8], "name":"U", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_implements.tree.json b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_implements.tree.json index a3a24258bc7..56d6bc4aba9 100644 --- a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_implements.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_implements.tree.json @@ -38,6 +38,7 @@ "range":[8,9], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_keyword.tree.json b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_keyword.tree.json index 18e62c89e06..601a1d2ccf4 100644 --- a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_keyword.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_keyword.tree.json @@ -40,6 +40,7 @@ "range":[7,8], "name":"U", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_lparen.tree.json b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_lparen.tree.json index 5d8d0f7fd0a..901c23bf473 100644 --- a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_lparen.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_lparen.tree.json @@ -28,10 +28,6 @@ "range":[15,17], "body":[] }, - "async":false, - "generator":false, - "predicate":null, - "expression":false, "returnType":null, "typeParameters":{ "type":"TypeParameterDeclaration", @@ -44,11 +40,16 @@ "range":[11,12], "name":"T", "bound":null, + "const":false, "variance":null, "default":null } ] - } + }, + "async":false, + "generator":false, + "predicate":null, + "expression":false } ], "comments":[] diff --git a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_type.tree.json b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_type.tree.json index caa37a4555a..cf0a995d444 100644 --- a/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_type.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_unclosed_params_end_of_list_type.tree.json @@ -48,6 +48,7 @@ "range":[7,8], "name":"U", "bound":null, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/type_params/invalid_unfinished_bound.tree.json b/src/parser/test/flow/types/type_params/invalid_unfinished_bound.tree.json index 962ae443081..59f0ac219c1 100644 --- a/src/parser/test/flow/types/type_params/invalid_unfinished_bound.tree.json +++ b/src/parser/test/flow/types/type_params/invalid_unfinished_bound.tree.json @@ -164,6 +164,7 @@ "internalSlots":[] } }, + "const":false, "variance":null, "default":null } diff --git a/src/parser/test/flow/types/type_params/type_const_params.tree.json b/src/parser/test/flow/types/type_params/type_const_params.tree.json index ae4235890bf..b3bbc69b6b2 100644 --- a/src/parser/test/flow/types/type_params/type_const_params.tree.json +++ b/src/parser/test/flow/types/type_params/type_const_params.tree.json @@ -26,13 +26,9 @@ "range":[7,14], "name":"X", "bound":null, + "const":true, "variance":null, - "default":null, - "const":{ - "type":"ConstModifier", - "loc":{"source":null,"start":{"line":1,"column":7},"end":{"line":1,"column":12}}, - "range":[7,12] - } + "default":null } ] },