Fix empty exports (#225)

```js
export {};
```

was printed as

```js
export
```

which is invalid.

This was discovered by #223
master
Christopher Chedeau 2017-01-15 20:53:41 -08:00 committed by James Long
parent 05be0eb31b
commit 0e1afd6312
4 changed files with 10 additions and 0 deletions

View File

@ -1870,6 +1870,8 @@ function printExportDeclaration(path, options, print) {
}
parts.push(";");
} else {
parts.push("{};");
}
return concat(parts);

View File

@ -0,0 +1,6 @@
exports[`test empty.js 1`] = `
"export {};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export {};
"
`;

1
tests/export/empty.js Normal file
View File

@ -0,0 +1 @@
export {};

View File

@ -0,0 +1 @@
run_spec(__dirname);