Node.js - 重载函数
有没有办法重载node.js中的函数,类似于 __noSuchMethod__?
Is there a way to overload functions in node.js similar to __noSuchMethod__ ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
有没有办法重载node.js中的函数,类似于 __noSuchMethod__?
Is there a way to overload functions in node.js similar to __noSuchMethod__ ?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(2)
就像 bxjx 简要提到的那样,Node.js 基于 Google 的 V8 javascript 引擎,这意味着任何语言的构造或功能都来自于此。鉴于它是非标准的,我认为他们不会在不久的将来添加它。另外,我不认为 Node 会基于非官方的 V8 分支,但谁知道呢。您仍然可以自己使用那把叉子。
Like bxjx briefly mentioned, Node.js is based on Google's V8 javascript engine, meaning that any language constructs or features come from that. Seeing as it is non-standard, i don't think they will add it in the near future. Also i don't think Node will ever base itself on a non-official V8 fork, but who knows. You can still use that fork yourself.
那会很酷。它将开放类似于 ruby 中的 DSL 功能。
根据node.js google 论坛上的此对话,这可能不会发生。如果没有 object.send('method') 我想不出另一种方法,但也许这是可能的。
看起来人们已经分叉了 V8 来添加这种东西。
That would be cool. It would open up DSL like capabilities found in ruby.
According to this conversation on the node.js google group, it's probably not going to happen. I can't think of another way around it without object.send('method'), but maybe it's possible.
Looks like people have forked V8 to add this sort of thing.