Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flow] Explicit inexact objects with
...
(#8884)
- Loading branch information
1 parent
d942d47
commit e4929e1
Showing
77 changed files
with
1,181 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -308,7 +308,8 @@ | |
], | ||
"indexers": [], | ||
"internalSlots": [], | ||
"exact": false | ||
"exact": false, | ||
"inexact": false | ||
} | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,7 +239,8 @@ | |
], | ||
"indexers": [], | ||
"internalSlots": [], | ||
"exact": false | ||
"exact": false, | ||
"inexact": false | ||
} | ||
} | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -239,7 +239,8 @@ | |
], | ||
"indexers": [], | ||
"internalSlots": [], | ||
"exact": false | ||
"exact": false, | ||
"inexact": false | ||
} | ||
} | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,7 +146,8 @@ | |
], | ||
"indexers": [], | ||
"internalSlots": [], | ||
"exact": false | ||
"exact": false, | ||
"inexact": false | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,7 +192,8 @@ | |
], | ||
"indexers": [], | ||
"internalSlots": [], | ||
"exact": false | ||
"exact": false, | ||
"inexact": false | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -243,7 +243,8 @@ | |
} | ||
], | ||
"internalSlots": [], | ||
"exact": false | ||
"exact": false, | ||
"inexact": false | ||
} | ||
} | ||
], | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...ixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//@flow | ||
declare class A { | ||
...; | ||
} |
5 changes: 5 additions & 0 deletions
5
...res/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects1/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["jsx", "flow"], | ||
"throws": "Spread operator cannot appear in class or interface definitions (3:2)" | ||
} |
5 changes: 5 additions & 0 deletions
5
...ixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@flow | ||
declare class B { | ||
foo: number; | ||
...; | ||
} |
5 changes: 5 additions & 0 deletions
5
...res/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects2/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["jsx", "flow"], | ||
"throws": "Spread operator cannot appear in class or interface definitions (4:2)" | ||
} |
5 changes: 5 additions & 0 deletions
5
...ixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@flow | ||
declare class C { | ||
...; | ||
foo: number; | ||
} |
5 changes: 5 additions & 0 deletions
5
...res/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects3/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["jsx", "flow"], | ||
"throws": "Spread operator cannot appear in class or interface definitions (3:2)" | ||
} |
6 changes: 6 additions & 0 deletions
6
...ixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//@flow | ||
declare class D { | ||
foo: number; | ||
...; | ||
bar: number; | ||
} |
5 changes: 5 additions & 0 deletions
5
...res/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects4/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["jsx", "flow"], | ||
"throws": "Spread operator cannot appear in class or interface definitions (4:2)" | ||
} |
5 changes: 5 additions & 0 deletions
5
...ixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@flow | ||
interface F { | ||
foo: number; | ||
...; | ||
} |
5 changes: 5 additions & 0 deletions
5
...res/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects5/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["jsx", "flow"], | ||
"throws": "Spread operator cannot appear in class or interface definitions (4:2)" | ||
} |
5 changes: 5 additions & 0 deletions
5
...ixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//@flow | ||
interface G { | ||
...; | ||
foo: number; | ||
} |
5 changes: 5 additions & 0 deletions
5
...res/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects6/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["jsx", "flow"], | ||
"throws": "Spread operator cannot appear in class or interface definitions (3:2)" | ||
} |
6 changes: 6 additions & 0 deletions
6
...ixtures/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
//@flow | ||
interface H { | ||
foo: number; | ||
...; | ||
bar: number; | ||
} |
5 changes: 5 additions & 0 deletions
5
...res/flow/explicit-inexact-object/explicit_inexact_disallowed_in_non_objects7/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["jsx", "flow"], | ||
"throws": "Spread operator cannot appear in class or interface definitions (4:2)" | ||
} |
2 changes: 2 additions & 0 deletions
2
...r/test/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//@flow | ||
type T = {| foo: number, ... |} |
5 changes: 5 additions & 0 deletions
5
...st/fixtures/flow/explicit-inexact-object/explicit_inexact_forbidden_in_exact/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["jsx", "flow"], | ||
"throws": "Explicit inexact syntax cannot appear inside an explicit exact object type (2:29)" | ||
} |
2 changes: 2 additions & 0 deletions
2
...ser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//@flow | ||
type T = {..., foo: number}; |
5 changes: 5 additions & 0 deletions
5
...test/fixtures/flow/explicit-inexact-object/explicit_inexact_must_appear_last/options.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"sourceType": "module", | ||
"plugins": ["jsx", "flow"], | ||
"throws": "Explicit inexact syntax must appear at the end of an inexact object (2:15)" | ||
} |
4 changes: 4 additions & 0 deletions
4
.../babel-parser/test/fixtures/flow/explicit-inexact-object/explicit_inexact_object/input.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
//@flow | ||
type T = {...}; | ||
type U = {x: number, ...}; | ||
type V = {x: number, ...V, ...U}; |
Oops, something went wrong.