Node.js是否包括JS承诺?

发布于 2025-02-10 23:31:04 字数 1394 浏览 1 评论 0 原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

为人所爱 2025-02-17 23:31:04

瑞安·达尔(Ryan Dahl)谈到了很久以前的诺言成为Ecmascript规范的一部分。他在此演示文稿中谈到了这一点“我对node.js”的10件事>(在5:40),使用此幻灯片:

遗憾:不坚持承诺

  • 我在2009年6月增加了节点的承诺,但在2010年2月愚蠢地将其删除。
  • 承诺是异步/等待的必要抽象。
  • 在节点中统一的承诺使用可能会加速最终标准化和异步/等待。
  • 今天节点的许多异步API的衰老都严重老化。

这是节点在其尚未知道包含在Ecmascript标准中。只有在2015年的eCmascript 2015中才承诺被包括在内,并且由于 nofollow noreferrer“>节点版本4 在2015年,Node获得了这种本地承诺支持。

如果Node在2010年没有放弃承诺,那么许多模块都会使用它,并且我们不会最终得到如此多的异步模块,这些模块是过时的或需要尴尬的剪裁(具有向后兼容的)来使它们与承诺一起工作。

Ryan Dahl was speaking of a period long before promises became part of the ECMAScript specification. He talked about this in this presentation "10 Things I Regret About Node.js" (at 5:40), with this slide:

Regret: Not sticking with Promises

  • I added promises to Node in June 2009, but foolishly removed them in February 2010.
  • Promises are the necessary abstraction for async/await.
  • It's possible that unified usage of promises in Node would have sped the delivery of the eventual standardization and async/await.
  • Today Node's many async API's are aging badly due to this.

This was a time when Node was in its first year (when version numbers started with 0), and although the concept of promises was long known, it was not yet included in the ECMAScript standard. It was only with ECMAScript 2015, that promises got included, and since Node version 4 in 2015, Node has had this native promise support.

If Node had not abandoned promises in 2010, many modules would have used it, and we would not have ended up with so many async modules which are either obsolete or needed awkward tailoring (with backwards compatibility) to make them work with promises.

仙气飘飘 2025-02-17 23:31:04

一点点研究和/或更一致的面试观看将为您提供答案。
达尔说,他确实在2009年向节点介绍了诺言,但在2010年后期,他愚蠢地将其删除了。这是与时代的链接:

2012年晚些时候,达尔(Dahl)距离节点一步,这意味着随后的更新不再与他相关联。
当今Node.js当今已有承诺,但这并不是Ryan的功绩。
仅此而已,仅此而已。

A bit of research and/or more consistent interview watching will give you the answer.
Dahl said that he did introduce the promises to Node in 2009 but later in fabruary 2010 he foolishly removed them. Here is the link with timecode:
https://www.youtube.com/watch?v=M3BM9TB-8yA&t=309s

Later in 2012 Dahl made a step away from Node which means that subsequent updates were no longer associated with him.
Surely Node.JS nowadays has promises but it's not straight Ryan's merit.
That's it nothing more, nothing less.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文