Permalink
Browse files

feat(experimental): function bind

  • Loading branch information...
h13i32maru committed Nov 20, 2016
1 parent aa59b40 commit 5b7a7d06028e432d1e23b43963905c1a76b102b2
View
@@ -63,6 +63,7 @@ export default class ESParser {
if (experimental.classProperties) option.plugins.push('classProperties');
if (experimental.objectRestSpread) option.plugins.push('objectRestSpread');
if (experimental.doExpressions) option.plugins.push('doExpressions');
+ if (experimental.functionBind) option.plugins.push('functionBind');
}
return option;
View
@@ -32,6 +32,7 @@
* @property {boolean} experimentalProposal.classProperties
* @property {boolean} experimentalProposal.objectRestSpread
* @property {boolean} experimentalProposal.doExpressions
+ * @property {boolean} experimentalProposal.functionBind
* @see https://esdoc.org/config.html
*/
@@ -0,0 +1,6 @@
+function foo(){}
+export default class Foo {
+ method() {
+ this::foo();
+ }
+}
@@ -8,5 +8,8 @@ describe('ESParser', ()=>{
assert(ast.program.sourceType === 'module');
});
- // todo: enhance test patterns.
+ it('can parse "function bind"', ()=>{
+ const ast = ESParser.parse({experimentalProposal: {functionBind: true}}, './test/fixture/syntax/FunctionBind.js');
+ assert(ast.program.sourceType === 'module');
+ });
});

0 comments on commit 5b7a7d0

Please sign in to comment.