Add support for flow type spread in .43 and babylon beta8 (#1064)

Fixes https://twitter.com/ryyppy/status/844116626467438592
This commit is contained in:
Christopher Chedeau authored and GitHub committed 2017-04-04 14:52:16 -07:00
1 parent 6c9cb86a6d
commit 1578e180f4
6 files changed
+24 -17

No files matched your search

+1 -1
View File
@@ -15,7 +15,7 @@
"babylon": "7.0.0-beta.8",
"chalk": "1.1.3",
"esutils": "2.0.2",
"flow-parser": "0.40.0",
"flow-parser": "0.43.0",
"get-stdin": "5.0.1",
"glob": "7.1.1",
"jest-validate": "19.0.0",
+1
View File
@@ -265,6 +265,7 @@ function genericPrintNoParens(path, options, print) {
case "SpreadProperty":
case "SpreadPropertyPattern":
case "RestElement":
case "ObjectTypeSpreadProperty":
return concat([
"...",
path.call(print, "argument"),
@@ -0,0 +1,15 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`spread.js 1`] = `
"type TypeB = { ...TypeA };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
type TypeB = { ...TypeA };
"
`;
exports[`spread.js 2`] = `
"type TypeB = { ...TypeA };
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
type TypeB = { ...TypeA };
"
`;
+2
View File
@@ -0,0 +1,2 @@
run_spec(__dirname);
run_spec(__dirname, {parser: 'flow'});
+1
View File
@@ -0,0 +1 @@
type TypeB = { ...TypeA };
+4 -16
View File
@@ -105,10 +105,6 @@ assert-plus@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/assert-plus/-/assert-plus-1.0.0.tgz#f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525"
ast-types@0.8.18:
version "0.8.18"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.8.18.tgz#c8b98574898e8914e9d8de74b947564a9fe929af"
ast-types@0.9.8:
version "0.9.8"
resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.8.tgz#6cb6a40beba31f49f20928e28439fc14a3dab078"
@@ -469,10 +465,6 @@ color-name@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.1.tgz#4b1415304cf50028ea81643643bd82ea05803689"
colors@>=0.6.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.0.3.tgz#0433f44d809680fdeb60ed260f1b0c262e82a40b"
combined-stream@^1.0.5, combined-stream@~1.0.5:
version "1.0.5"
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.5.tgz#938370a57b4a51dea2c77c15d5c5fdf895164009"
@@ -754,13 +746,9 @@ find-up@^2.1.0:
dependencies:
locate-path "^2.0.0"
flow-parser@0.40.0:
version "0.40.0"
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.40.0.tgz#b3444742189093323c4319c4fe9d35391f46bcbc"
dependencies:
ast-types "0.8.18"
colors ">=0.6.2"
minimist ">=0.2.0"
flow-parser@0.43.0:
version "0.43.0"
resolved "https://registry.yarnpkg.com/flow-parser/-/flow-parser-0.43.0.tgz#e2b8eb1ac83dd53f7b6b04a7c35b6a52c33479b7"
for-in@^0.1.5:
version "0.1.6"
@@ -1551,7 +1539,7 @@ minimist@0.0.8, minimist@~0.0.1:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
minimist@1.2.0, minimist@>=0.2.0, minimist@^1.1.1:
minimist@1.2.0, minimist@^1.1.1:
version "1.2.0"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284"