LoginSignup
9
9

More than 5 years have passed since last update.

ChakraCore入りNode.jsを試す

Last updated at Posted at 2016-01-25

公式インストーラーがあります。
Release Node.js with ChakraCore (node-chakracore-6.0.0-pre2) · Microsoft/node

ダウンロードして、インストールします。

Original版は次の手順でビルドできます。
Node.jsをWindowsでビルドする - Qiita

比べてみましょう。

バージョン

一応、変更されていいます。2が追加されています。

Original

$ Release/node.exe -v
v6.0.0-pre

ChakraCore

$ node -v
v6.0.0-pre2

process.jsEngine

JavaScriptエンジンを確認するための変数jsEngineが追加されています

Original

$ Release/node.exe
> process.jsEngine
undefined

ChakraCore

$ node
> process.jsEngine
'chakracore'

分割代入

分割代入が実装されています。

Original

$ Release/node.exe
> let [a, b] = [1, 2]
ReferenceError: let is not defined
    at repl:1:1
    at REPLServer.defaultEval (repl.js:252:27)
    at bound (domain.js:281:14)
    at REPLServer.runBound [as eval] (domain.js:294:12)
    at REPLServer.<anonymous> (repl.js:417:12)
    at emitOne (events.js:96:20)
    at REPLServer.emit (events.js:183:7)
    at REPLServer.Interface._onLine (readline.js:216:10)
    at REPLServer.Interface._line (readline.js:555:8)
    at REPLServer.Interface._ttyWrite (readline.js:832:14)

ChakraCore

$ node
> let [a, b] = [1, 2]
[ 1, 2 ]
> console.log(a, b)
1 2

async-await

シンタックスは実装されています。実行は出来ません。

Original

$ Release/node.exe
> async funcitona () {}
SyntaxError: Unexpected identifier
    at Object.exports.createScript (vm.js:24:10)
    at REPLServer.defaultEval (repl.js:225:25)
    at bound (domain.js:281:14)
    at REPLServer.runBound [as eval] (domain.js:294:12)
    at REPLServer.<anonymous> (repl.js:417:12)
    at emitOne (events.js:96:20)
    at REPLServer.emit (events.js:183:7)
    at REPLServer.Interface._onLine (readline.js:216:10)
    at REPLServer.Interface._line (readline.js:555:8)
    at REPLServer.Interface._ttyWrite (readline.js:832:14)

ChakraCore

$ node
> async function a(){}
undefined
> a()
TypeError: Object doesn't support property or method 'MakeMirror'
   at inspectPromise (util.js:204:3)
   at formatValue (util.js:354:5)
   at inspect (util.js:109:3)
   at self.writer (repl.js:342:7)
   at finish (repl.js:463:9)
   at defaultEval (repl.js:273:5)
   at bound (domain.js:281:5)
   at runBound (domain.js:294:5)
   at Anonymous function (repl.js:417:7)
   at emitOne (events.js:83:7)
9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9