Skip to content

Commit

Permalink
feat(experimental): function sent
Browse files Browse the repository at this point in the history
  • Loading branch information
h13i32maru committed Nov 20, 2016
1 parent 5b7a7d0 commit fe8a265
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Parser/ESParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export default class ESParser {
if (experimental.objectRestSpread) option.plugins.push('objectRestSpread');
if (experimental.doExpressions) option.plugins.push('doExpressions');
if (experimental.functionBind) option.plugins.push('functionBind');
if (experimental.functionSent) option.plugins.push('functionSent');
}

return option;
Expand Down
1 change: 1 addition & 0 deletions src/Typedef/typedef.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* @property {boolean} experimentalProposal.objectRestSpread
* @property {boolean} experimentalProposal.doExpressions
* @property {boolean} experimentalProposal.functionBind
* @property {boolean} experimentalProposal.functionSent
* @see https://esdoc.org/config.html
*/

Expand Down
5 changes: 5 additions & 0 deletions test/fixture/syntax/FunctionSent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default class Foo {
*method() {
console.log(function.sent);
}
}
5 changes: 5 additions & 0 deletions test/src/ParserTest/ESParserTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,9 @@ describe('ESParser', ()=>{
const ast = ESParser.parse({experimentalProposal: {functionBind: true}}, './test/fixture/syntax/FunctionBind.js');
assert(ast.program.sourceType === 'module');
});

it('can parse "function sent"', ()=>{
const ast = ESParser.parse({experimentalProposal: {functionSent: true}}, './test/fixture/syntax/FunctionSent.js');
assert(ast.program.sourceType === 'module');
});
});

0 comments on commit fe8a265

Please sign in to comment.