本文整理汇总了TypeScript中angular2/src/facade/lang.FunctionWrapper类的典型用法代码示例。如果您正苦于以下问题:TypeScript FunctionWrapper类的具体用法?TypeScript FunctionWrapper怎么用?TypeScript FunctionWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了FunctionWrapper类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: eval
eval(context, locals: Locals) {
var evaluatedArgs = evalList(context, locals, this.args);
if (this.receiver instanceof ImplicitReceiver && isPresent(locals) &&
locals.contains(this.name)) {
var fn = locals.get(this.name);
return FunctionWrapper.apply(fn, evaluatedArgs);
} else {
var evaluatedReceiver = this.receiver.eval(context, locals);
return this.fn(evaluatedReceiver, evaluatedArgs);
}
}
示例2: _findOrCreate
_findOrCreate(key, binding, deps) {
try {
var instance = this.injector._getInstance(key);
if (!_isWaiting(instance))
return instance;
return FunctionWrapper.apply(binding.factory, deps);
} catch (e) {
console.log("_findOrCreate", e.stack);
this.injector._clear(key);
throw new InstantiationError(e, key);
}
}
示例3: execute
execute(injector: Injector): void {
var params = ListWrapper.map(this._tokens, (t) => injector.get(t));
FunctionWrapper.apply(this._fn, params);
}
示例4: execute
/**
* Returns the value of the executed function.
*/
execute(injector: Injector): any {
var params = this._tokens.map(t => injector.get(t));
return FunctionWrapper.apply(this._fn, params);
}