Skip to content

Commit 380a5fc

Browse files
authored
Merge pull request github#2444 from esbena/js/flow-spread-prop-types
Approved by max-schaefer
2 parents 95bceae + 9ffe03b commit 380a5fc

File tree

5 files changed

+303
-84
lines changed

5 files changed

+303
-84
lines changed

change-notes/1.23/extractor-javascript.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ extraction:
1616
- include: "**/bower_components"
1717
```
1818
19+
* Additional [Flow](https://flow.org/) syntax is now supported.
1920
* Recognition of CommonJS modules has improved. As a result, some files that were previously extracted as
2021
global scripts are now extracted as modules.
2122
* Top-level `await` is now supported.

javascript/extractor/src/com/semmle/jcorn/flow/FlowParser.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,11 @@ private void flowParseObjectType(boolean allowStatic, boolean allowExact, boolea
541541
if (isStatic && this.type == TokenType.colon) {
542542
this.parseIdent(false);
543543
} else if (allowSpread && this.eat(TokenType.ellipsis)) {
544-
flowParseType();
544+
boolean hasType =
545+
this.type != endDelim && this.type != TokenType.comma && this.type != TokenType.semi;
546+
if (hasType) {
547+
flowParseType();
548+
}
545549
flowObjectTypeSemicolon();
546550
continue;
547551
} else {

javascript/extractor/src/com/semmle/js/extractor/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class Main {
3737
* A version identifier that should be updated every time the extractor changes in such a way that
3838
* it may produce different tuples for the same file under the same {@link ExtractorConfig}.
3939
*/
40-
public static final String EXTRACTOR_VERSION = "2019-11-17";
40+
public static final String EXTRACTOR_VERSION = "2019-11-26";
4141

4242
public static final Pattern NEWLINE = Pattern.compile("\n");
4343

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
type A = { x: int };
2-
type B = { ...A, y: string };
2+
type B = { ...A, y: string };
3+
type C<T> = {c: null | T, ...} | ((r: null | T) => mixed);
4+
type D = { d: D, ..., };

0 commit comments

Comments
 (0)