Node.js 0.12中提供的ECMAScript 6功能 [英] ECMAScript 6 features available in Node.js 0.12

查看:124
本文介绍了Node.js 0.12中提供的ECMAScript 6功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个新的稳定版本的Node.js(0.12)最近登陆了一个升级后的Google v8 JavaScript引擎,这个引擎是v3.28.73。



什么ECMAScript 6功能当前存在于Node.js中,而不使用 - 和谐标志?



I已经检查了几个声称列出ES 6功能的网站,但所有这些网站似乎已经过时了 - 最突出的是,此表格更新: 现在更新为当前的Node.js状态为0.12 ),因为几个功能被列为需要 - 和声标志,而我发现其中一些默认启用(地图,集合,符号等)。 更新特定于节点的表已经可用



此外,尝试谷歌这个信息纯粹为v8引擎提供了最新的信息 - 目前的v8版本是4.2。* ,这是比Node先进的。 js使用。



我的希望是,这个问题(及其答案)将成为现在可用于Node.js开发人员的ES 6功能的全面总结。 p>

在Node.js中启用了ES 6功能0.12我目前知道:




  • 地图,Set / WeakMaps,WeakSets

  • 符号

  • Object.observe

  • 承诺

  • 号码


    • .isInteger

    • .isSafeInteger

    • .isNaN

    • .EPSILON

    • .MIN_SAFE_INTEGER

    • .MAX_SAFE_INTEGER


  • Math


    • .clz32

    • .imul

    • sign

    • .log10

    • .log2

    • .log1p

    • .expm1

    • .cosh

    • .sinh

    • .tanh

    • .acosh

    • .asinh

    • .atanh

    • .trunc

    • .fround

    • .cbrt

    • .hypot



解决方案

没有的功能 - 和谐标志:





我认为这些都是我们没有 - 和谐标志。



功能与 - 和谐标志:





我想是这样。也许如果我忘了一些东西 - 我稍后会添加到列表中。


A new stable release of Node.js (0.12) has landed recently with an upgraded Google's v8 JavaScript engine, v3.28.73.

What ECMAScript 6 features are currently present in Node.js, without using the --harmony flag?

I have checked several sites claiming to list the ES 6 features but all of them seem out of date - most prominently, this table (Update: now updated with current Node.js status as of 0.12), because several of the features are listed as requiring the --harmony flag while I found some of them being enabled by default (Maps, Sets, Symbols, to name a few). Update: Node specific tables have since been made available

Also, trying to google this information purely for the v8 engine gives too up-to-date information - current v8 release is 4.2.*, which is quite ahead of what Node.js uses.

My hopes are that this question (and its answers) will become a comprehensive summary on what ES 6 features are now available to Node.js developers.

ES 6 features enabled in Node.js 0.12 I currently know of:

  • Maps, Sets / WeakMaps, WeakSets
  • Symbols
  • Object.observe
  • Promises
  • Number
    • .isInteger
    • .isSafeInteger
    • .isNaN
    • .EPSILON
    • .MIN_SAFE_INTEGER
    • .MAX_SAFE_INTEGER
  • Math
    • .clz32
    • .imul
    • .sign
    • .log10
    • .log2
    • .log1p
    • .expm1
    • .cosh
    • .sinh
    • .tanh
    • .acosh
    • .asinh
    • .atanh
    • .trunc
    • .fround
    • .cbrt
    • .hypot

解决方案

Features without --harmony flag:

I thinks that's all that we have without --harmony flag.

Features with --harmony flag:

I think that's all. Maybe if I forgot something - I'll add it later to the list.

这篇关于Node.js 0.12中提供的ECMAScript 6功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆