Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
Merge nodejs/master into chakracore-master
Browse files Browse the repository at this point in the history
Sync nodejs/master (2016-05-12) at dffafde

PR-URL: #71
Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
Reviewed-By: Jianchun Xu <Jianchun.Xu@microsoft.com>
  • Loading branch information
kunalspathak committed May 17, 2016
2 parents 574b01e + dffafde commit 60e2711
Show file tree
Hide file tree
Showing 830 changed files with 82,957 additions and 16,449 deletions.
3 changes: 3 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ rules:
# Best Practices
# http://eslint.org/docs/rules/#best-practices
no-fallthrough: 2
no-multi-spaces: 2
no-octal: 2
no-redeclare: 2
no-self-assign: 2
Expand Down Expand Up @@ -57,6 +58,7 @@ rules:
comma-spacing: 2
eol-last: 2
indent: [2, 2, {SwitchCase: 1}]
key-spacing: [2, {mode: "minimum"}]
keyword-spacing: 2
max-len: [2, 80, 2]
new-parens: 2
Expand All @@ -83,6 +85,7 @@ rules:
no-new-symbol: 2
no-this-before-super: 2
prefer-const: 2
template-curly-spacing: 2

# Custom rules in tools/eslint-rules
align-function-arguments: 2
Expand Down
25 changes: 25 additions & 0 deletions BUILDING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,37 @@ To run the tests:
$ make test
```

To run the native module tests:

```text
$ make test-addons
```

To run the npm test suite:

*note: to run the suite on node v4 or earlier you must first*
*run `make install`*

```
$ make test-npm
```

To build the documentation:

This will build Node.js first (if necessary) and then use it to build the docs:

```text
$ make doc
```

If you have an existing Node.js you can build just the docs with:

```text
$ NODE=node make doc-only
```

(Where `node` is the path to your executable.)

To read the documentation:

```text
Expand Down
6,001 changes: 952 additions & 5,049 deletions CHANGELOG.md

Large diffs are not rendered by default.

28 changes: 16 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ BUILDTYPE_LOWER := $(shell echo $(BUILDTYPE) | tr '[A-Z]' '[a-z]')
EXEEXT := $(shell $(PYTHON) -c \
"import sys; print('.exe' if sys.platform == 'win32' else '')")

NODE ?= ./node$(EXEEXT)
NODE_EXE = node$(EXEEXT)
NODE ?= ./$(NODE_EXE)
NODE_G_EXE = node_g$(EXEEXT)

# Flags for packaging.
Expand Down Expand Up @@ -116,7 +116,7 @@ v8:

test: | build-addons cctest # Both targets depend on 'all'.
$(PYTHON) tools/test.py --mode=release -J \
addon doctool message parallel sequential
addon doctool known_issues message parallel sequential
$(MAKE) lint

test-parallel: all
Expand All @@ -127,13 +127,14 @@ test-valgrind: all

test/gc/node_modules/weak/build/Release/weakref.node: $(NODE_EXE)
$(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
--python="$(PYTHON)" \
--directory="$(shell pwd)/test/gc/node_modules/weak" \
--nodedir="$(shell pwd)"

# Implicitly depends on $(NODE_EXE), see the build-addons rule for rationale.
test/addons/.docbuildstamp: doc/api/addons.md
test/addons/.docbuildstamp: tools/doc/addon-verify.js doc/api/addons.md
$(RM) -r test/addons/??_*/
$(NODE) tools/doc/addon-verify.js
$(NODE) $<
touch $@

ADDONS_BINDING_GYPS := \
Expand All @@ -144,11 +145,12 @@ ADDONS_BINDING_GYPS := \
test/addons/.buildstamp: $(ADDONS_BINDING_GYPS) \
deps/uv/include/*.h deps/v8/include/*.h \
src/node.h src/node_buffer.h src/node_object_wrap.h \
| test/addons/.docbuildstamp
test/addons/.docbuildstamp
# Cannot use $(wildcard test/addons/*/) here, it's evaluated before
# embedded addons have been generated from the documentation.
for dirname in test/addons/*/; do \
$(NODE) deps/npm/node_modules/node-gyp/bin/node-gyp rebuild \
--python="$(PYTHON)" \
--directory="$$PWD/$$dirname" \
--nodedir="$$PWD" || exit 1 ; \
done
Expand Down Expand Up @@ -176,7 +178,7 @@ test-all-valgrind: test-build
test-ci: | build-addons
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
--mode=release --flaky-tests=$(FLAKY_TESTS) \
$(TEST_CI_ARGS) addons doctool message parallel sequential
$(TEST_CI_ARGS) addons doctool known_issues message parallel sequential

test-release: test-build
$(PYTHON) tools/test.py --mode=release
Expand All @@ -200,7 +202,7 @@ test-debugger: all
$(PYTHON) tools/test.py debugger

test-known-issues: all
$(PYTHON) tools/test.py known_issues --expect-fail
$(PYTHON) tools/test.py known_issues

test-npm: $(NODE_EXE)
NODE=$(NODE) tools/test-npm.sh
Expand Down Expand Up @@ -258,7 +260,9 @@ apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets

apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))

doc: $(apidoc_dirs) $(apiassets) $(apidocs) tools/doc/ $(NODE_EXE)
doc-only: $(apidoc_dirs) $(apiassets) $(apidocs) tools/doc/

doc: $(NODE_EXE) doc-only

$(apidoc_dirs):
mkdir -p $@
Expand All @@ -269,11 +273,11 @@ out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
out/doc/%: doc/%
cp -r $< $@

out/doc/api/%.json: doc/api/%.md $(NODE_EXE)
out/doc/api/%.json: doc/api/%.md
$(NODE) tools/doc/generate.js --format=json $< > $@

out/doc/api/%.html: doc/api/%.md $(NODE_EXE)
$(NODE) tools/doc/generate.js --format=html --template=doc/template.html $< > $@
out/doc/api/%.html: doc/api/%.md
$(NODE) tools/doc/generate.js --node-version=$(FULLVERSION) --format=html --template=doc/template.html $< > $@

docopen: out/doc/api/all.html
-google-chrome out/doc/api/all.html
Expand Down Expand Up @@ -663,5 +667,5 @@ endif
blog blogclean tar binary release-only bench-http-simple bench-idle \
bench-all bench bench-misc bench-array bench-buffer bench-net \
bench-http bench-fs bench-tls cctest run-ci test-v8 test-v8-intl \
test-v8-benchmarks test-v8-all v8 lint-ci bench-ci jslint-ci \
test-v8-benchmarks test-v8-all v8 lint-ci bench-ci jslint-ci doc-only \
$(TARBALL)-headers
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
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. Please refer to the original [PR](https://github.com/nodejs/node/pull/4765).
## Resources for Newcomers

* [Website](https://nodejs.org/en/)
* [Contributing to the project](./CONTRIBUTING.md)
* IRC (general questions): [#node.js on chat.freenode.net](https://webchat.freenode.net?channels=node.js&uio=d4)
* IRC (node core development): [#node-dev on chat.reenode.net](https://webchat.freenode.net?channels=node-dev&uio=d4)


### How it works

Expand Down Expand Up @@ -36,7 +43,6 @@ vcbuild chakracore nobuild test [x86|x64|arm]
```

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

```batch
C:\>node -e "console.log('Hello from Node.js ' + process.jsEngine)"
Hello from Node.js chakracore
Expand Down
8 changes: 4 additions & 4 deletions benchmark/buffers/buffer-write.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ var bench = common.createBenchmark(main, {
millions: [1]
});

const INT8 = 0x7f;
const INT16 = 0x7fff;
const INT32 = 0x7fffffff;
const UINT8 = (INT8 * 2) + 1;
const INT8 = 0x7f;
const INT16 = 0x7fff;
const INT32 = 0x7fffffff;
const UINT8 = (INT8 * 2) + 1;
const UINT16 = (INT16 * 2) + 1;
const UINT32 = INT32;

Expand Down
8 changes: 4 additions & 4 deletions benchmark/buffers/dataview-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ var bench = common.createBenchmark(main, {
millions: [1]
});

const INT8 = 0x7f;
const INT16 = 0x7fff;
const INT32 = 0x7fffffff;
const UINT8 = INT8 * 2;
const INT8 = 0x7f;
const INT16 = 0x7fff;
const INT32 = 0x7fffffff;
const UINT8 = INT8 * 2;
const UINT16 = INT16 * 2;
const UINT32 = INT32 * 2;

Expand Down
3 changes: 0 additions & 3 deletions common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@
# Don't bake anything extra into the snapshot.
'v8_use_external_startup_data%': 0,

# Don't compile with -B, we don't bundle ld.gold.
'linux_use_bundled_gold%': 0,

'conditions': [
['OS == "win"', {
'os_posix': 0,
Expand Down
4 changes: 2 additions & 2 deletions deps/npm/.travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: node_js
node_js:
- "5"
- "6"
- "4"
- iojs
- "5"
- "0.12"
- "0.10"
- "0.8"
Expand Down
7 changes: 7 additions & 0 deletions deps/npm/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -389,3 +389,10 @@ Thomas Hallock <thomas@1stdibs.com>
Paul Irish <paul.irish@gmail.com>
Paul O'Leary McCann <polm@dampfkraft.com>
Francis Gulotta <wizard@roborooter.com>
Felix Rieseberg <felix@felixrieseberg.com>
Glen Mailer <glenjamin@gmail.com>
Federico Brigante <bfred-it@users.noreply.github.com>
Steve Mao <maochenyan@gmail.com>
Anna Henningsen <anna@addaleax.net>
Rachel Evans <git@rve.org.uk>
Sam Minnee <sam@silverstripe.com>
Loading

0 comments on commit 60e2711

Please sign in to comment.