【发布时间】:2026-02-22 03:05:01
【问题描述】:
我似乎找不到这个问题的简明答案。在调用 @_instanceMethod 而不是函数绑定本身时,从 _otherInstanceMethod 返回值的正确咖啡脚本方法是什么?
x = _instanceMethod: () ->
@_otherInstanceMethod key: 'value'
编辑(感谢评论者)
这会返回:
x = function () {
[...] # function body omitted
});
代替
x = 'some value returned by _otherInstanceMethod'
我希望返回值而不是绑定到 _otherInstanceMethod 的函数
【问题讨论】:
-
您能否具体说明问题出在哪里?这个问题在我看来不是很明显。
标签: coffeescript