Permalink
Browse files

feat(experimental): function sent

  • Loading branch information...
h13i32maru committed Nov 20, 2016
1 parent 5b7a7d0 commit fe8a2656a93cfae51c0a541f291f3f32330aec3b
Showing with 12 additions and 0 deletions.
  1. +1 −0 src/Parser/ESParser.js
  2. +1 −0 src/Typedef/typedef.js
  3. +5 −0 test/fixture/syntax/FunctionSent.js
  4. +5 −0 test/src/ParserTest/ESParserTest.js
View
@@ -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;
View
@@ -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
*/
@@ -0,0 +1,5 @@
+export default class Foo {
+ *method() {
+ console.log(function.sent);
+ }
+}
@@ -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.