Skip to content

Commit

Permalink
feat(experimental): export extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
h13i32maru committed Nov 26, 2016
1 parent c941951 commit 8803005
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Parser/ESParser.js
Expand Up @@ -68,6 +68,7 @@ export default class ESParser {
if (experimental.asyncGenerators) option.plugins.push('asyncGenerators');
if (experimental.asyncGenerators) option.plugins.push('asyncGenerators');
if (experimental.decorators) option.plugins.push('decorators');
if (experimental.exportExtensions) option.plugins.push('exportExtensions');
}

return option;
Expand Down
1 change: 1 addition & 0 deletions src/Typedef/typedef.js
Expand Up @@ -36,6 +36,7 @@
* @property {boolean} experimentalProposal.functionSent
* @property {boolean} experimentalProposal.asyncGenerators
* @property {boolean} experimentalProposal.decorators
* @property {boolean} experimentalProposal.exportExtensions
* @see https://esdoc.org/config.html
*/

Expand Down
4 changes: 4 additions & 0 deletions test/fixture/syntax/ExportExtensions.js
@@ -0,0 +1,4 @@
export * as ns from 'mod'
export v from "mod"
export vv, {x, y as w} from "mod"
export default from "mod"
5 changes: 5 additions & 0 deletions test/src/ParserTest/ESParserTest.js
Expand Up @@ -22,4 +22,9 @@ describe('ESParser', ()=>{
const ast = ESParser.parse({experimentalProposal: {asyncGenerators: true}}, './test/fixture/syntax/AsyncGenerators.js');
assert(ast.program.sourceType === 'module');
});

it('can parse "export extensions"', ()=>{
const ast = ESParser.parse({experimentalProposal: {exportExtensions: true}}, './test/fixture/syntax/ExportExtensions.js');
assert(ast.program.sourceType === 'module');
});
});

0 comments on commit 8803005

Please sign in to comment.