refactor: fastApply for step invoke

This commit is contained in:
cha0s 2019-05-02 20:55:29 -05:00
parent be5fdb1d82
commit dfb0d94bc2

View File

@ -1,5 +1,7 @@
import D from 'debug'; import D from 'debug';
import {fastApply} from '@avocado/core';
import {Globals} from './globals'; import {Globals} from './globals';
import {TraversalCompiler} from './traversal-compiler'; import {TraversalCompiler} from './traversal-compiler';
import {TypeMap} from './types'; import {TypeMap} from './types';
@ -71,7 +73,8 @@ class Context extends Map {
case 'key': case 'key':
return node[step.key]; return node[step.key];
case 'invoke': case 'invoke':
return node(...step.args.map((arg) => arg.get(this))); const args = step.args.map((arg) => arg.get(this));
return fastApply(null, node, args);
} }
} }