Coder Social home page Coder Social logo

microsoft / node Goto Github PK

View Code? Open in Web Editor NEW
1.9K 150.0 343.0 419.48 MB

Node.js on ChakraCore :sparkles::turtle::rocket::sparkles:

License: Other

Makefile 0.32% Shell 0.22% JavaScript 58.60% C 3.04% C++ 20.96% Python 14.76% R 0.05% DTrace 0.28% Batchfile 0.30% HTML 1.21% Roff 0.08% Emacs Lisp 0.11% Perl 0.09%
nodejs node

node's Introduction

Node.js on ChakraCore

This project enables Node.js to optionally use the ChakraCore JavaScript engine. This project is still work in progress and not an officially supported Node.js branch. For more context into this project, please refer to the original PR.

How it works

To enable building and running Node.js with the ChakraCore JavaScript engine, a V8 API shim (ChakraShim) is created on top of the ChakraCore runtime hosting API (JSRT. ChakraShim implements the most essential V8 APIs so that the underlying JavaScript engine change is transparent to Node.js and other native addon modules written for V8.

A rebuild of node and native addon modules with ChakraCore is required for this to work.

Time Travel Debugging

Time-Travel debugging is an exciting new addition to Node.js debugging, first introduced in Node-ChakraCore, and now supported by VSCode. We are developing in the open and want to share our progress to get feedback, bug reports, functionality requests, and pull-requests from the community.

Check out this Time-Travel Debugging page to learn how to get started with TTD on Node-ChakraCore with VSCode.

Node.js API (NAPI)

Node-ChakraCore is an active participant in the ABI-Stable-Node project also called NAPI. The goal of this project is to ease the lives of native add-ons developers, by providing a stable Node API which also guarantees stable ABI across disparate Node versions. This allows native modules to just work across different versions and flavors of Node.js without recompilations, reducing the maintenance cost for module developers and thus improving compatibility.

Head over to the NAPI Project repo to learn more about it and ways to get involved.

Installing prebuilt Node-ChakraCore binaries

You can download and install stable prebuilt Node-ChakraCore from the releases page.

For installing Node-ChakraCore side-by-side your existing Node installation, we recommend Node Version Switcher (NVS).

$ nvs remote chakracore https://nodejs.org/download/chakracore-release/
$ nvs add chakracore/latest
$ nvs use chakracore

Nightly builds of Node-ChakraCore are available at https://nodejs.org/download/chakracore-nightly/ Please use the following instructions to install the nightly builds.

$ nvs remote chakracore-nightly https://nodejs.org/download/chakracore-nightly/
$ nvs add chakracore-nightly/latest
$ nvs use chakracore-nightly

Building Node-ChakraCore

Node-ChakraCore can be built on Windows, Linux, and macOS.

If you are looking to build this yourself, here's what you will need.

Windows

Prerequisites:

Build Command:

> vcbuild [x86|x64|arm]

To run unit tests

> vcbuild nobuild test ignore-flaky [x86|x64|arm]

To test if Node.js was built correctly with ChakraCore:

> node -e "console.log('Hello from Node.js ' + process.jsEngine)"
Hello from Node.js chakracore

Linux

Install building tools and ChakraCore dependencies: Clang 3.7+ / CMake 3.2 are required

Debian/Ubuntu:

$ sudo apt-get install -y build-essential cmake clang libicu-dev

Fedora:

$ su
$ dnf group install -y "Development Tools" "C Development Tools and Libraries"
$ dnf install -y git cmake clang gcc gcc-c++ kernel-devel python llvm
$ dnf install -y lttng-ust-devel.x86_64 libicu-devel.x86_64 libstdc++-static.x86_64

Clone this repo and check out master branch:

$ git checkout master

Build:

$ ./configure
$ make

To run unit tests:

$ FLAKY_TESTS=dontcare make test

To test if Node.js was built correctly with ChakraCore:

$ node -e "console.log('Hello from Node.js ' + process.jsEngine)"
Hello from Node.js chakracore

macOS

Prerequisites:

Install the building tools:

$ xcode-select --install
$ brew install cmake

Clone this repo and check out master branch:

$ git checkout master

Build:

$ ./configure
$ make 

To test if Node.js was built correctly with ChakraCore:

$ ./node -e "console.log('Hello from Node.js ' + process.jsEngine)"
Hello from Node.js chakracore

Issues

Please report all issues related to Node-ChakraCore on our issues page.

node's People

Contributors

addaleax avatar apapirovski avatar bnoordhuis avatar bridgear avatar chakrabot avatar cjihrig avatar danbev avatar fishrock123 avatar indutny avatar isaacs avatar jasnell avatar joyeecheung avatar kfarnung avatar koichik avatar mscdex avatar mylesborins avatar piscisaureus avatar refack avatar rvagg avatar ry avatar sam-github avatar shigeki avatar targos avatar timothygu avatar tjfontaine avatar tniessen avatar tootallnate avatar trevnorris avatar trott avatar vsemozhetbyt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node's Issues

Node addons

Actual Node (V8) addons works with C/C++

The Node with chakra ... I can create addons using C#?

Participation in the node-chakracore Working Group

Following up to the discussion at nodejs/node#4765, I’d like to start a new working group, node-chakracore, and extend an invitation to members of @nodejs/collaborators, @nodejs/ctc and @nodejs/chakra to participate.

As I see it, the main purpose of this WG would be to act in the same capacity for this repo as @nodejs/collaborators act for the nodej/node repo, primarily reviewing issues and pull requests (with potential escalation to the CTC).

Members of the Microsoft Chakra team who already worked on node-chakracore will naturally be part of the WG. Input from Node collaborators would be very valuable to ensure that the work on this project can continue in a way that it’s in line with the way that things are done in nodejs/node, and to socialize the Chakra team with Node collaborators.

With the assumption that changes to deps/chakrashim can be treated as atomic dependency updates, the rate of changes to node source code is expected to be pretty low, so hopefully this won’t be a big time drain. I don’t expect that regular meetings will be needed either.

Please respond here if you would like to be a member of the @nodejs/node-chakracore team. Thanks!

npm adduser not working

v8

>ver
Microsoft Windows [Version 6.3.9600]

>node -v
v5.10.1

>npm -v
3.8.3

>npm adduser
Username: <user>
<user>
Password:
Password:<pass typed, not shown>
Email: (this IS public) <email>
Logged in as <user> on https://registry.npmjs.org/.

Notice the problems with duplicated outout, but at least I can login...

chakracore

>ver
Microsoft Windows [Version 6.3.9600]

>node -v
v6.0.0-pre6

>npm -v
3.7.3

>npm adduser
Username: <user>
Password: <pass typed & shown!>

Email: (this IS public)
npm ERR! cb() never called!

I wasn't even offered a chance to type my email after plain-text password entry; it just errs out.

Compiling modules requiring native binding

I am trying the chackra node.js engine and was checking if it supports native bindings (indeed this is not clear from the documentation...).

When I try to install the headers with node-gyp I get the following output:

D:\nodejs_chakra>node-gyp install
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | win32 | ia32
gyp http GET https://nodejs.org/dist/v5.0.0-0/node-v5.0.0-0-headers.tar.gz
gyp http 404 https://nodejs.org/dist/v5.0.0-0/node-v5.0.0-0-headers.tar.gz
gyp WARN install got an error, rolling back install
gyp ERR! install error
gyp ERR! stack Error: 404 response downloading https://nodejs.org/dist/v5.0.0-0/node-v5.0.0-0-headers.tar.gz
gyp ERR! stack at Anonymous function (C:\Users\Francesco\AppData\Roaming\npm\node_modules\node-gyp\lib\install.js:244:11)
gyp ERR! stack at emitOne (events.js:82:7)
gyp ERR! stack at emit (events.js:169:7)
gyp ERR! stack at Request.prototype.onRequestResponse (C:\Users\Francesco\AppData\Roaming\npm\node_modules\node-gyp\node_modules\request\request.js:951:5)
gyp ERR! stack at emitOne (events.js:77:5)
gyp ERR! stack at emit (events.js:169:7)
gyp ERR! stack at parserOnIncomingClient (_http_client.js:421:3)
gyp ERR! stack at parserOnHeadersComplete (_http_common.js:88:5)
gyp ERR! stack at socketOnData (_http_client.js:311:3)
gyp ERR! stack at emitOne (events.js:77:5)
gyp ERR! stack at emit (events.js:169:7)
gyp ERR! stack at readableAddChunk (_stream_readable.js:146:9)
gyp ERR! stack at Readable.prototype.push (_stream_readable.js:110:3)
gyp ERR! stack at onread (net.js:523:5)
gyp ERR! System Windows_NT 10.0.10586
gyp ERR! command "C:\Program Files (x86)\NodejsUwp\Console\node.exe" "C:\Users\Francesco\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js" "install"
gyp ERR! cwd D:\nodejs_chakra
gyp ERR! node -v v5.0.0-0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok

Is there a misconfiguration on my development machine or native modules are not supposed to work?

Thanks

installer doesn't add node to path

This looks really cool! I'm trying to get koa 2.0.0 up and running, since it requires async/await, and I've heard tell this fork supports it. I'm trying to install using the msi download for pre-release 2. I'm running on ubuntu 15.04

» lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 15.04
Release:    15.04
Codename:   vivid

When I invoke the installer, I get a wizard that walks me through installation. It seems to succeed, as does the repair flow. I checked all the boxes, including the ones that say "Add to PATH". However, when I check my node version, I still get 5.4.1.

» node -v
v5.4.1

As I gather, I should be getting v6.0.0. I'll admit my path isn't the tidiest

» echo $PATH
/home/doug/.rvm/gems/ruby-1.9.3-p547/bin:/home/doug/.rvm/gems/ruby-1.9.3-p547@global/bin:/home/doug/.rvm/rubies/ruby-1.9.3-p547/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/doug/.rvm/bin:/bin:/home/doug/bin

but there doesn't seem to be anything obviously wrong with it, though my node is pretty early on it

» which node
/usr/local/bin/node  

I tried building from source, but the link to download visual studio, https://www.visualstudio.com/en-us/downloads/download-visual-studio%0A-vs.aspx, is broken -- I get

Bad Request - Invalid URL

HTTP Error 400. The request URL is invalid.

so I can't build from source. Have a made a mistake of some kind? I use n as my node version manager.

Building with enable-vtune fails due to deprecated <hash_map>

Building with below command fails due to deprecated <hash_map>. It should be replaced with <unordered_map>
cmdline: vcbuild chakracore x86 nosign enable-vtune

Affected file: ./deps/v8/src/third-party/vtune/vtune-jit.cc

Also, not sure if enable-vtune is enabled with chakracore option since above path points to v8

  • Version: 6.0.0-pre
  • Platform: Win8.1 64bit
  • Subsystem: optional. if known - please specify affected core module name

fs: re-evaluating native module sources is not supported

With the latest build I'm starting to get warnings when I run certain npm commands:

> node -v
v6.0.0-pre5

> npm install
(node:3164) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

> npm dedup
(node:5460) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

ES6 Modules Support

Sample Code...

//------ main.js ------
import * as lib from 'lib';

console.log(lib.square(11)); // 121
console.log(lib.diag(4, 3)); // 5
//------ lib.js ------
export const sqrt = Math.sqrt;
export function square(x) {
    return x * x;
}
export function diag(x, y) {
    return sqrt(square(x) + square(y));
}

//------ main.js ------
import { square, diag } from 'lib';
console.log(square(11)); // 121
console.log(diag(4, 3)); // 5

Output

M:\javascript\module-test>"H:\dev2\nodejs (chakracore)\node" main.js
SyntaxError: Syntax error
   at tryWrapper (module.js:31:5)
   at Module.prototype._compile (module.js:397:3)
   at Module._extensions[.js] (module.js:432:3)
   at Module.prototype.load (module.js:367:3)
   at Module._load (module.js:324:5)
   at Module.runMain (module.js:457:3)
   at startup (node.js:139:11)
   at Anonymous function (node.js:1001:3)

Not very informative error; nodeJS with V8 Usually outputs the source line in question... as in

NodeJS (V8)

M:\javascript\module-test>h:\dev2\nodejs\node main.js
M:\javascript\module-test\main.js:2
import * as lib from 'lib';
^^^^^^

SyntaxError: Unexpected token import
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:405:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:430:10)
    at startup (node.js:141:18)
    at node.js:1003:3

node-chakracore-6.0.0-pre7 release proposal

This is to propose node-chakracore-6.0.0-pre7 release. There have been 2 nodejs/master merges and a few chakrashim fixes since node-chakracore-6.0.0-pre6. Also the new release would resolve #55.

Commits

  • [589206a] - chakrashim: remove a jslint comment
  • [5dafb03] - Merge branch 'nodejs/master' into chakracore-master
  • [8fb96bc] - test: update 5 node-chakracore message test baselines
  • [40b5f7c] - test: fix wrong python script indentation
  • [bb0707b] - test: patch tests for chakra
  • [df8d10e] - chakrashim: correct function callback context
  • [41d9652] - chakrashim: let caller TryCatch record exception
  • [53c2d8e] - test: skip null-buffer-neuter on node-chakracore
  • [313cec1] - chakrashim: add test/addons dependency stubs
  • [0cd4cb8] - gyp: revert incorrect quote_cmd fix
  • [c864edf] - Merge branch 'nodejs/master' into chakracore-master

Missing vcvarsall.bat.

I'm trying to follow the build instructions.

I'm on Windows 10 Build 10586.36 and have installed Python 2.711, Node v5, and both Visual Studio Community and Visual Studio Enterprise Trial (the readme should specify which is required)

I restarted and tried

node>vcbuild chakra nosign x64

Then got

Looking for Visual Studio 2015
Looking for Visual Studio 2013
Failed to find Visual Studio installation

My environment variable %VS140COMNTOOLS% is set but the file at %VS140COMNTOOLS%\..\..\vc\vcvarsall.bat is missing.

Does the Persistent<T>::SetWeak() do the same thing in v8 compared to chakra?

  • Version:
  • Platform:
  • Subsystem:

Or is there a "weak reference" conception in chakra? Because I notice chakra only has "JsRef" conception.

So I wonder if there is difference between the "Weak reference" management in v8 and chakrashim.
As I read in v8.h: There is no guarantee as to when or even if the callback is invoked. But in chakra, what will happen?

/**
 *  Install a finalization callback on this object.
 *  NOTE: There is no guarantee as to *when* or even *if* the callback is
 *  invoked. The invocation is performed solely on a best effort basis.
 *  As always, GC-based finalization should *not* be relied upon for any
 *  critical form of resource management!
 */
template <typename P>
V8_INLINE V8_DEPRECATED(
    "use WeakCallbackInfo version",
    void SetWeak(P* parameter,
                 typename WeakCallbackData<T, P>::Callback callback));

child_process.* exits with -2147483645

  • Version: v6.0.0-pre2
  • Platform: Windows IoT Core, Raspberry Pi 2 Model B
  • Subsystem: child_process

Any function related to spawn from child_process makes the program crash with %errorlevel% -2147483645.

I am using it with ssh. Pressing any keys like arrow keys blocks the console and prevents any other ssh connection.

Here is the code the I use

const spawn = require('child_process').spawn; 
const bat = spawn('cmd.exe', []);

Not compatible with v8 nodejs packages (pre5)

got following error when running gulp tasks

(node:26596) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

Fix captureStackTrace behavior when passed o.p

  • Version:
  • Platform:
  • Subsystem:

Currently Error.captureStackTrace don't honor 2nd parameter to be function in the form o.p.

var o = {};
var q = {};
q.bar = function () {
    o.baz();
}
o.bar = function () {
    q.bar();

}
o.baz = function () {
    var r = new Error;
    Error.captureStackTrace(r, o.bar);
    throw r;
}
function foo() {
 o.bar();
}
foo();

Expected:

Error
    at foo (E:\temp\errstack.js:17:4)
    at Object.<anonymous> (E:\temp\errstack.js:19:1)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Function.Module.runMain (module.js:575:10)
    at startup (node.js:160:18)
    at node.js:449:3

Actual:

Error
   at o.baz (E:\temp\errstack.js:14:5)
   at q.bar (E:\temp\errstack.js:5:5)
   at o.bar (E:\temp\errstack.js:8:5)
   at foo (E:\temp\errstack.js:17:2)
   at Anonymous function (E:\temp\errstack.js:19:1)
   at Module.prototype._compile (module.js:541:3)
   at Module._extensions[.js] (module.js:550:3)
   at Module.prototype.load (module.js:458:3)
   at tryModuleLoad (module.js:417:5)
   at Module._load (module.js:409:3)

ARM builds are broken

  • Version: Latest
  • Platform: Windows
  • Subsystem:

Currently ARM builds for node+chakracore is failing to build tools\icu\icudata.vcxproj.

F:\2418\src\node-msft\Release\obj\global_intermediate\icudt57l_dat.obj : fatal error LNK1112: module machine type 'X86'
 conflicts with target machine type 'ARM' [F:\2418\src\node-msft\tools\icu\icudata.vcxproj]

--v8-option gives "bad option"

Wanting to see if nodeChakra would play nicely with AlaSQL I installed 6.0.0-pre2

npm install works fin.

When I do a npm test I get the message that --v8-option is a "bad option".

So - I cant get to the interesting part (running the tests) because node --v8-options is called.

Any plans to support the --v8-options flag (as a shim)?

skaermbillede 2016-01-21 08 55 49

Expose (and tie) ChakraCore options like --v8-options

Showing which options that could be passed to ChakraCore would be nice for debugging and customizing purposes.

$ ~/node-chakracore/Release/node.exe --v8-options
Options:
--use_strict (enforce strict mode)
type: bool default: false
--expose_gc (expose gc extension)
type: bool default: false
--harmony (Ignored in node running with chakracore)
--debug (Ignored in node running with chakracore)
--stack-size (Ignored in node running with chakracore)

  • Version: v6.0.0-pre
  • Platform: Win8.1 64bit
  • Subsystem: optional. if known - please specify affected core module name

building with Microsoft Visual C++ Build Tools 2015 Technical Preview

Do you support building with Microsoft Visual C++ Build Tools 2015 Technical Preview?

On Win 10 Pro with only the Build tools (both 8 and 10 SDKs installed) using

  • Visual C++ x64 Native Build Tools Command Prompt
  • added set VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
  • cmd> vcbuild chakracore nosign x64

I get a bunch of failures due to missing cor.h?

Is there some way to get around this? Or is this something the team working on the standalone C++ Build Tools Preview needs to address?

First error:
c:\dev\cygwin\home\am\node-chakracore\deps\chakrashim\core\lib\runtime\Base\DelayLoadLibrary.h(14): fatal error C1083: Cannot open include file: 'cor.h': No such file or directory [C:\dev\cygwin\home\am\node-chakracore\deps\chakrashim\cor e\lib\jsrt\Chakra.Jsrt.vcxproj] [C:\dev\cygwin\home\am\node-chakracore\deps\chakrashim\chakracore.vcxproj]

C:\dev\cygwin\home\am\node-chakracore>vcbuild chakracore nosign x64
Looking for Visual Studio 2015
Found Visual Studio 2015
configure   --engine=chakracore --dest-cpu=x64 --tag=
ctrpp not found in WinSDK path--using pre-gen files from tools/msvs/genfiles.
creating  icu_config.gypi
{ 'target_defaults': { 'cflags': [],
                       'default_configuration': 'Release',
                       'defines': [],
                       'include_dirs': [],
                       'libraries': []},
  'variables': { 'asan': 0,
                 'host_arch': 'x64',
                 'icu_small': 'false',
                 'node_byteorder': 'little',
                 'node_enable_v8_vtunejit': 'false',
                 'node_engine': 'chakracore',
                 'node_install_npm': 'true',
                 'node_prefix': '/usr/local',
                 'node_release_urlbase': '',
                 'node_shared_http_parser': 'false',
                 'node_shared_libuv': 'false',
                 'node_shared_openssl': 'false',
                 'node_shared_zlib': 'false',
                 'node_tag': '',
                 'node_use_dtrace': 'false',
                 'node_use_etw': 'true',
                 'node_use_lttng': 'false',
                 'node_use_openssl': 'true',
                 'node_use_perfctr': 'true',
                 'openssl_fips': '',
                 'openssl_no_asm': 0,
                 'python': 'C:\\dev\\python27\\python.exe',
                 'target_arch': 'x64',
                 'v8_enable_gdbjit': 0,
                 'v8_enable_i18n_support': 0,
                 'v8_no_strict_aliasing': 1,
                 'v8_optimized_debug': 0,
                 'v8_random_seed': 0,
                 'v8_use_snapshot': 'true',
                 'want_separate_host_toolset': 0}}

node-chakracore-6.0.0-pre6 release proposal

node-chakracore-6.0.0-pre6 release proposal

Commits

[d9469f1] - chakrashim: update chakracore to 1.1.0.5
[b838007] - chakrashim: use microtask queue to run Promise
[2723d94] - test: address 2 new failures on node-chakracore
[88dc654] - Merge remote-tracking branch 'nodejs/master'
[803af69] - chakrashim: add dummy Debug.MakeMirror
[e7b09ef] - chakrashim: better StackTrace API compat
[c6d6e6b] - chakrashim: implement new APIs added in v8
[58ff8db] - Merge remote-tracking branch 'nodejs/master'
[878b8fd] - chakrashim: fix ObjectTemplate callbacks compat
[75ace7d] - chakrashim: ensure chakra_shim_native buffer is null terminated
[adfadcc] - test: fix unittest for Chakra engine
[d875ac9] - Merge remote-tracking branch 'nodejs/master'
[9e23f00] - chakrashim: allow Persistent::Reset after V8::Dispose

REPL broken for async function

REPL for Node-ChakraCore does not work with async functions.

Node-Chakra version
v6.0.0-pre4

> async function foo() { }
undefined
> foo()
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:96:7)
> foo().then(function() { console.log("done") })
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:96:7)
> done

invalid option --nolazy

  • Version: v7.0.0-pre8
  • Platform: Windows 10 x64
  • Subsystem: Unknown

I am working on a new application in TypeScript. I have installed the node.js and TypeScript tools on Visual Studio 2015 and created a new 'Starter Node.js Express 3 Application'. I cannot run the template that is generated because I get the error 'invalid option --nolazy'. Apparently the --nolazy option is used to hit breakpoints reliably. Is there any way to enable this option in node with ChakraCore?

process.env.hasOwnProperty('abc') throws exception

Node.js with v8 returns false but with chakracore throws.

node -pe "process.env.hasOwnProperty('abc')"
TypeError: Object expected
   at Global code ([eval]:1:1)
   at exports.runInThisContext (vm.js:54:3)
   at Anonymous function ([eval]-wrapper:6:1)
   at Module.prototype._compile (module.js:417:3)
   at Anonymous function (node.js:575:7)
   at _combinedTickCallback (node.js:399:9)
   at _tickCallback (node.js:430:11)

Found by #32.

ActiveX

Since Internet Explorer use Chakra, and in Internet Explorer one can new-up an ActiveXObject instance to access safe-COM objects, does that mean that this open source version of Chakra can do the same? If so, does that mean I can execute that type of code from within version of node that's bound to Chakra?

I want to be able to execute code that looks like this:
var xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");

6.0.0-pre3 wrong version string

It's not that important, but I couldn't find anywhere else to comment on this.

The latest MSI release is still reporting as 6.0.0-pre2 when I run node -v, which makes me initially thought the upgrade failed.

socket.io not working

requiring socket.io doesn't work and fails silently.

It installs correctly

npm install socket.io
C:\test\chakrasocket
└─┬ [email protected]

This is the simple test file:

index.js

console.log(1);
require('socket.io');
console.log(2);

Running it logs 1 but exits silently after it

C:\test\chakrasocket>node a
1

C:\test\chakrasocket>
  • Version: v6.0.0-pre5
  • Platform: Windows 10 64 bit

IONIC FRAMEWORK

  • Version:
  • Platform:
  • Subsystem:

Hi Everyone,

I have installed ionic, but when i try to create a project, I am facing below error, re-evaluating native module sources is not supported if you are using the graceful-fs module , please update..

Could you please help .

Thanks in Advance,
shravs

How do I use it ?

I installed ChakraCore from here https://github.com/Microsoft/node/releases

The readme states that This Node.js will work side-by-side with any existing Node.js with v8 installation..

But how do I use it ? From a command line, node --version still points to my existing nodejs with v8 installation.

Managing this repository with Git towards the PR at the end

@nodejs/node-chakracore

The objective of this repository is to keep developing Node on ChakraCore, in order to open a pull request on the main Node repository when we agree that it is time.

How will we open the pull request?

  • Directly from chakracore-master, using a merge commit to land: This would keep all the merges from master to chakracore-master, all the updates to chakracore and chakrashim, making the review process harder. This would import all development history to master.
  • Taking the difference between master and chakracore-master and dividing into easier to review commits: This seems to be what was done for the original PR ( nodejs/node#4765 ), making the review process much easier. However, it is possible to lose metadata, including authorship of contributions that we eventually receive.

I'd like to start this discussion by suggesting a third alternative: Rebasing the ChakraCore changes on master, instead of using merges. This would give us a clear set of commits to open the pull request with. By using branch names with a date suffix, the rebases could be reviewed with pull requests. Here is a detailed draft: https://gist.github.com/joaocgreis/869eccafda12f77473da , feel free to suggest improvements.

I believe this is closer to what was suggested in nodejs/node#4765 (comment) , giving us a permanent and easy to review way to see what ChakraCore adds. Currently, we cannot easily see what would be used to open the pull request, nor by looking at the commits (because of merges and updates), nor by looking at git diff (because changes have landed that are not to be included).

Reported by Thali project - Leveldown does not work with Node-ChakraCore.

The thali project is trying to make its platform run on Node-ChakraCore and have run into an issue with the package "leveldown". Here's the test code which is showing this error

npm ERR! Refusing to install leveldown as a dependency of itself

var PouchDB = require(‘pouchDB’);
  var testPouch = new PouchDB('icky', { db: require(‘leveldown’)});
  testPouch.put({
    _id: 'nada'
  }).then(function (response) {
    console.log(response);
  }).catch(function (err) {
    console.log(err);
  })

cc: @yaronyg

Slow TCP

So I've decided to see how node-chakracore v6.0.0-pre1 will compare to node-v8 v5.4.0 in generating reports in one of my apps (~500k documents fetched from MongoDB). On average node-chakracore took 2x more time to finish than node-v8.

Then I tried to import data from 27 ~8 MB text files. Parsing (CPU only) in ChakraCore was faster than in v8 (chakra=6.8s vs v8=5.6s), but then came time for some I/O (MongoDB) and there v8 won again (chakra=143s vs v8=50s).

Simple TCP client-server scripts show that the net module is 2x slower in ChakraCore (92k data events per second in v8 - 42k in ChakraCore).

node and MongoDB are on the same machine (Windows 10 Home 64-bit). Tried to run it on a different machine (laptop) with Windows 7 Enterprise 64-bit, but node.exe ends immediately without any errors (node -v still shows v6.0.0-pre1).

Node ChakraCore collaborators sync-up

As we have new people from both the worlds (Node.js and Chakra), I feel that it would be better to have a meeting to sync up on the processes followed, preferred communication channel and other stuff. Also it would give us a chance to introduce ourselves to the team. Thoughts cc @nodejs/node-chakracore

Add missing stack trace properties on chakrashim

  • Version:
    6.0
  • Platform:
    Windows 10
  • Subsystem:

Few APIs like getFunction(), IsConstructor(), etc. are missing from stackTrace that shim exposes. Need to support missing APIs. Currently many modules has callsites module has a dependency and node+chakracore fails for these APIs.

Post Mortem Support

Any thoughts on post mortem support? It's possible to generate a core dump of a V8 Node process and inspect both javascript and native objects. This is useful for many classes of problems. In particular, this helps to diagnose unexpected crashes and memory leaks.

parseStack fails for certain Error messages

  • Version: v6.0.0-pre7
  • Platform: Windows Server 2012r2

Logging Error messages can cause unexpected errors.

Reproduce using REPL - this works:

> new Error('\n\n\n')
Error:



   at Anonymous function (Unknown script code:238:20)
   at withStackTraceLimitOffset (Unknown script code:169:7)
   at __newType (Unknown script code:237:9)
   at Global code (repl:1:1)
   at defaultEval (repl.js:271:11)
   at bound (domain.js:280:5)
   at runBound (domain.js:293:5)
   at Anonymous function (repl.js:441:7)
   at emitOne (events.js:95:7)
   at emit (events.js:182:7)
   at Interface.prototype._onLine (readline.js:216:5)
   at Interface.prototype._line (readline.js:555:3)
   at Interface.prototype._ttyWrite (readline.js:832:9)

But this doesn't:

> new Error('\n\n\n\n')
TypeError: Unable to get property 'index' of undefined or null reference
   at parseStack (Unknown script code:98:7)
   at ensureStackTrace (Unknown script code:198:9)
   at stackGetter (Unknown script code:208:9)
   at formatError (util.js:525:3)
   at formatValue (util.js:310:7)
   at inspect (util.js:143:3)
   at self.writer (repl.js:365:7)
   at finish (repl.js:490:9)
   at defaultEval (repl.js:292:5)
   at bound (domain.js:280:5)

Unable to query Azure DB from Windows 10 IoT Core

  • Version: v5.10.1-0
  • Platform: Windows 10 IoT Core
  • Subsystem: node-mssql , tedious

I'm unable to query Azure MS SQL DB from Windows 10 IoT Core (Raspberry Pi). Will this ever be supported or it already should be?

I've created sample so we can reproduce issue:
https://github.com/matejv1/nodejs.universal-windows-app.connect-to-azure

It works on Windows 10 - if I just run "node server.js". When debugging or deploying to Raspberry Pi, the app just crashes.

Hopefully someone will give some feedback.

I've posted an issue to node-mssql repository as well. Might be tedious the issue.

Thanks.

node-chakracore-7.0.0-pre8 release proposal

  • Version:
  • Platform:
  • Subsystem:

This is to propose a new node-chakracore-7.0.0-pre8 release. There have been several master syncs, update to chakracore 1.2 and implementation of idleGc.

Commits

  • [89dbaf8] - build: merged conditions for v8_inspector
  • [f2ad532] - lib,test: fixed jslint errors
  • [b3610fe] - test: fixed unit test for error message
  • [8b48ffd] - src,build: added todo for isolate_data
  • [0402b9e] - Merge 'nodejs/master' into chakracore-master
  • [1ec0729] - chakrashim: implement triggering GC when idle
  • [8641dc0] - doc,deps,test: fixed deps\test after upgrade to 1.2
  • [4dd7c22] - build: do not build icu for chakracore-master
  • [8f00534] - deps: Modified chakracore to enable/disable SIMD
  • [7cd4c61] - chakrashim: updated chakracore to 1.2
  • [407e16c] - test: Suppress debugger test and fixed jslint
  • [5556a39] - deps: Expose --harmony-simd in node+chakracore
  • [2684f39] - deps: Modified chakracore to enable/disable SIMD
  • [3b6a55e] - Merge 'nodejs/master into chakracore-master
  • [8d11795] - tool: modified eslint rule for line-breaks
  • [2048b2c] - test: Disabled a debugger unit test
  • [6fd464c] - Merge 'nodejs/master' into chakracore-master
  • [b1e66d7] - tools: fixed jslint errors after merge
  • [60e2711] - Merge nodejs/master into chakracore-master
  • [574b01e] - test: fixed test case after merge
  • [7c88be6] - deps: added chakrashim apis for Proxy
  • [ca75446] - Merge branch 'nodejs/master' into chakracore-master
  • [c7129ab] - test: update message/...chakracore.out
  • [007b8f6] - Merge branch 'nodejs/master' into chakracore-master
  • [2a8b3b0] - chakrashim: correct Template properties support

console.log

  • Version: 5.10
  • Platform: Windows 10 IoT Core
  • Subsystem: console

console.log should put \r\n as line ending, now it is only \n.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.