Skip to content

Commit fe8a265

Browse files
committed
feat(experimental): function sent
1 parent 5b7a7d0 commit fe8a265

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

src/Parser/ESParser.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ export default class ESParser {
6464
if (experimental.objectRestSpread) option.plugins.push('objectRestSpread');
6565
if (experimental.doExpressions) option.plugins.push('doExpressions');
6666
if (experimental.functionBind) option.plugins.push('functionBind');
67+
if (experimental.functionSent) option.plugins.push('functionSent');
6768
}
6869

6970
return option;

src/Typedef/typedef.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* @property {boolean} experimentalProposal.objectRestSpread
3434
* @property {boolean} experimentalProposal.doExpressions
3535
* @property {boolean} experimentalProposal.functionBind
36+
* @property {boolean} experimentalProposal.functionSent
3637
* @see https://esdoc.org/config.html
3738
*/
3839

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export default class Foo {
2+
*method() {
3+
console.log(function.sent);
4+
}
5+
}

test/src/ParserTest/ESParserTest.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,9 @@ describe('ESParser', ()=>{
1212
const ast = ESParser.parse({experimentalProposal: {functionBind: true}}, './test/fixture/syntax/FunctionBind.js');
1313
assert(ast.program.sourceType === 'module');
1414
});
15+
16+
it('can parse "function sent"', ()=>{
17+
const ast = ESParser.parse({experimentalProposal: {functionSent: true}}, './test/fixture/syntax/FunctionSent.js');
18+
assert(ast.program.sourceType === 'module');
19+
});
1520
});

0 commit comments

Comments
 (0)