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

Commit 535c25e

Browse files
chakrabotjackhorton
authored andcommitted
Merge nodejs/master
Merge 70832bc as of 2017-10-18. This is an automatically created merge. For any problems please contact @kunalspathak.
2 parents 1fac205 + 70832bc commit 535c25e

File tree

67 files changed

+264
-161
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+264
-161
lines changed

Diff for: .eslintrc.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -197,3 +197,4 @@ globals:
197197
LTTNG_HTTP_SERVER_RESPONSE: false
198198
LTTNG_NET_SERVER_CONNECTION: false
199199
LTTNG_NET_STREAM_END: false
200+
internalBinding: false

Diff for: Makefile

+3-5
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ else
200200
test: all
201201
$(MAKE) build-addons
202202
$(MAKE) build-addons-napi
203+
$(MAKE) doc
203204
$(MAKE) cctest
204205
$(PYTHON) tools/test.py --mode=release --flaky-tests=$(FLAKY_TESTS) -J \
205206
$(CI_ASYNC_HOOKS) \
@@ -379,7 +380,7 @@ test-ci-js: | clear-stalled
379380
fi
380381

381382
test-ci: LOGLEVEL := info
382-
test-ci: | clear-stalled build-addons build-addons-napi
383+
test-ci: | clear-stalled build-addons build-addons-napi doc
383384
out/Release/cctest --gtest_output=tap:cctest.tap
384385
$(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \
385386
--mode=release --flaky-tests=$(FLAKY_TESTS) \
@@ -409,9 +410,6 @@ test-pummel: all
409410
test-internet: all
410411
$(PYTHON) tools/test.py internet
411412

412-
test-inspector: all
413-
$(PYTHON) tools/test.py inspector
414-
415413
test-node-inspect: $(NODE_EXE)
416414
USE_EMBEDDED_NODE_INSPECT=1 $(NODE) tools/test-npm-package \
417415
--install deps/node-inspect test
@@ -518,7 +516,7 @@ doc: $(NODE_EXE) doc-only
518516
$(apidoc_dirs):
519517
mkdir -p $@
520518

521-
out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets/
519+
out/doc/api/assets/%: doc/api_assets/% out/doc/api/assets
522520
cp $< $@
523521

524522
out/doc/%: doc/%

Diff for: common.gypi

+4
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
# Default to -O0 for debug builds.
2828
'v8_optimized_debug%': 0,
2929

30+
# Reset this number to 0 on major V8 upgrades.
31+
# Increment by one for each non-official patch applied to deps/v8.
32+
'v8_embedder_string': '-node.0',
33+
3034
# Enable disassembler for `--print-code` v8 options
3135
'v8_enable_disassembler': 1,
3236

Diff for: deps/v8/BUILD.gn

+6
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ declare_args() {
3939
# Embeds the given script into the snapshot.
4040
v8_embed_script = ""
4141

42+
# Allows the embedder to add a custom suffix to the version string.
43+
v8_embedder_string = ""
44+
4245
# Sets -dENABLE_DISASSEMBLER.
4346
v8_enable_disassembler = ""
4447

@@ -217,6 +220,9 @@ config("features") {
217220

218221
defines = []
219222

223+
if (v8_embedder_string != "") {
224+
defines += [ "V8_EMBEDDER_STRING=\"$v8_embedder_string\"" ]
225+
}
220226
if (v8_enable_disassembler) {
221227
defines += [ "ENABLE_DISASSEMBLER" ]
222228
}

Diff for: deps/v8/gypfiles/features.gypi

+6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929

3030
{
3131
'variables': {
32+
# Allows the embedder to add a custom suffix to the version string.
33+
'v8_embedder_string%': '',
34+
3235
'v8_enable_disassembler%': 0,
3336

3437
'v8_promise_internal_field_count%': 0,
@@ -79,6 +82,9 @@
7982
},
8083
'target_defaults': {
8184
'conditions': [
85+
['v8_embedder_string!=""', {
86+
'defines': ['V8_EMBEDDER_STRING="<(v8_embedder_string)"',],
87+
}],
8288
['v8_enable_disassembler==1', {
8389
'defines': ['ENABLE_DISASSEMBLER',],
8490
}],

Diff for: deps/v8/include/v8-version-string.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,18 @@
1616
#define V8_CANDIDATE_STRING ""
1717
#endif
1818

19+
#ifndef V8_EMBEDDER_STRING
20+
#define V8_EMBEDDER_STRING ""
21+
#endif
22+
1923
#define V8_SX(x) #x
2024
#define V8_S(x) V8_SX(x)
2125

2226
#if V8_PATCH_LEVEL > 0
2327
#define V8_VERSION_STRING \
2428
V8_S(V8_MAJOR_VERSION) \
2529
"." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) "." V8_S( \
26-
V8_PATCH_LEVEL) V8_CANDIDATE_STRING
30+
V8_PATCH_LEVEL) V8_EMBEDDER_STRING V8_CANDIDATE_STRING
2731
#else
2832
#define V8_VERSION_STRING \
2933
V8_S(V8_MAJOR_VERSION) \

Diff for: deps/v8/src/log-utils.cc

+10-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,16 @@ void Log::Initialize(const char* log_file_name) {
5555

5656
if (output_handle_ != nullptr) {
5757
Log::MessageBuilder msg(this);
58-
msg.Append("v8-version,%d,%d,%d,%d,%d", Version::GetMajor(),
59-
Version::GetMinor(), Version::GetBuild(), Version::GetPatch(),
60-
Version::IsCandidate());
58+
if (strlen(Version::GetEmbedder()) == 0) {
59+
msg.Append("v8-version,%d,%d,%d,%d,%d", Version::GetMajor(),
60+
Version::GetMinor(), Version::GetBuild(),
61+
Version::GetPatch(), Version::IsCandidate());
62+
} else {
63+
msg.Append("v8-version,%d,%d,%d,%d,%s,%d", Version::GetMajor(),
64+
Version::GetMinor(), Version::GetBuild(),
65+
Version::GetPatch(), Version::GetEmbedder(),
66+
Version::IsCandidate());
67+
}
6168
msg.WriteToLogFile();
6269
}
6370
}

Diff for: deps/v8/src/version.cc

+10-9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ int Version::major_ = V8_MAJOR_VERSION;
2020
int Version::minor_ = V8_MINOR_VERSION;
2121
int Version::build_ = V8_BUILD_NUMBER;
2222
int Version::patch_ = V8_PATCH_LEVEL;
23+
const char* Version::embedder_ = V8_EMBEDDER_STRING;
2324
bool Version::candidate_ = (V8_IS_CANDIDATE_VERSION != 0);
2425
const char* Version::soname_ = SONAME;
2526
const char* Version::version_string_ = V8_VERSION_STRING;
@@ -33,12 +34,12 @@ void Version::GetString(Vector<char> str) {
3334
const char* is_simulator = "";
3435
#endif // USE_SIMULATOR
3536
if (GetPatch() > 0) {
36-
SNPrintF(str, "%d.%d.%d.%d%s%s",
37-
GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate,
38-
is_simulator);
37+
SNPrintF(str, "%d.%d.%d.%d%s%s%s",
38+
GetMajor(), GetMinor(), GetBuild(), GetPatch(), GetEmbedder(),
39+
candidate, is_simulator);
3940
} else {
40-
SNPrintF(str, "%d.%d.%d%s%s",
41-
GetMajor(), GetMinor(), GetBuild(), candidate,
41+
SNPrintF(str, "%d.%d.%d%s%s%s",
42+
GetMajor(), GetMinor(), GetBuild(), GetEmbedder(), candidate,
4243
is_simulator);
4344
}
4445
}
@@ -50,11 +51,11 @@ void Version::GetSONAME(Vector<char> str) {
5051
// Generate generic SONAME if no specific SONAME is defined.
5152
const char* candidate = IsCandidate() ? "-candidate" : "";
5253
if (GetPatch() > 0) {
53-
SNPrintF(str, "libv8-%d.%d.%d.%d%s.so",
54-
GetMajor(), GetMinor(), GetBuild(), GetPatch(), candidate);
54+
SNPrintF(str, "libv8-%d.%d.%d.%d%s%s.so", GetMajor(), GetMinor(),
55+
GetBuild(), GetPatch(), GetEmbedder(), candidate);
5556
} else {
56-
SNPrintF(str, "libv8-%d.%d.%d%s.so",
57-
GetMajor(), GetMinor(), GetBuild(), candidate);
57+
SNPrintF(str, "libv8-%d.%d.%d%s%s.so", GetMajor(), GetMinor(), GetBuild(),
58+
GetEmbedder(), candidate);
5859
}
5960
} else {
6061
// Use specific SONAME.

Diff for: deps/v8/src/version.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class Version {
1818
static int GetMinor() { return minor_; }
1919
static int GetBuild() { return build_; }
2020
static int GetPatch() { return patch_; }
21+
static const char* GetEmbedder() { return embedder_; }
2122
static bool IsCandidate() { return candidate_; }
2223
static uint32_t Hash() {
2324
return static_cast<uint32_t>(
@@ -38,13 +39,15 @@ class Version {
3839
static int minor_;
3940
static int build_;
4041
static int patch_;
42+
static const char* embedder_;
4143
static bool candidate_;
4244
static const char* soname_;
4345
static const char* version_string_;
4446

4547
// In test-version.cc.
4648
friend void SetVersion(int major, int minor, int build, int patch,
47-
bool candidate, const char* soname);
49+
const char* embedder, bool candidate,
50+
const char* soname);
4851
};
4952

5053
} // namespace internal

Diff for: deps/v8/test/cctest/test-version.cc

+34-17
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,12 @@ namespace v8 {
3737
namespace internal {
3838

3939
void SetVersion(int major, int minor, int build, int patch,
40-
bool candidate, const char* soname) {
40+
const char* embedder, bool candidate, const char* soname) {
4141
Version::major_ = major;
4242
Version::minor_ = minor;
4343
Version::build_ = build;
4444
Version::patch_ = patch;
45+
Version::embedder_ = embedder;
4546
Version::candidate_ = candidate;
4647
Version::soname_ = soname;
4748
}
@@ -50,23 +51,23 @@ void SetVersion(int major, int minor, int build, int patch,
5051
} // namespace v8
5152

5253

53-
static void CheckVersion(int major, int minor, int build,
54-
int patch, bool candidate,
54+
static void CheckVersion(int major, int minor, int build, int patch,
55+
const char* embedder, bool candidate,
5556
const char* expected_version_string,
5657
const char* expected_generic_soname) {
5758
static v8::internal::EmbeddedVector<char, 128> version_str;
5859
static v8::internal::EmbeddedVector<char, 128> soname_str;
5960

6061
// Test version without specific SONAME.
61-
SetVersion(major, minor, build, patch, candidate, "");
62+
SetVersion(major, minor, build, patch, embedder, candidate, "");
6263
Version::GetString(version_str);
6364
CHECK_EQ(0, strcmp(expected_version_string, version_str.start()));
6465
Version::GetSONAME(soname_str);
6566
CHECK_EQ(0, strcmp(expected_generic_soname, soname_str.start()));
6667

6768
// Test version with specific SONAME.
6869
const char* soname = "libv8.so.1";
69-
SetVersion(major, minor, build, patch, candidate, soname);
70+
SetVersion(major, minor, build, patch, embedder, candidate, soname);
7071
Version::GetString(version_str);
7172
CHECK_EQ(0, strcmp(expected_version_string, version_str.start()));
7273
Version::GetSONAME(soname_str);
@@ -88,18 +89,34 @@ TEST(VersionString) {
8889
CheckVersion(2, 5, 10, 7, false, "2.5.10.7 SIMULATOR", "libv8-2.5.10.7.so");
8990
CheckVersion(2, 5, 10, 7, true,
9091
"2.5.10.7 (candidate) SIMULATOR", "libv8-2.5.10.7-candidate.so");
92+
CheckVersion(6, 0, 287, 0, "-emb.1", false, "6.0.287-emb.1 SIMULATOR",
93+
"libv8-6.0.287-emb.1.so");
94+
CheckVersion(6, 0, 287, 0, "-emb.1", true, "6.0.287-emb.1 (candidate) SIMULATOR",
95+
"libv8-6.0.287-emb.1-candidate.so");
96+
CheckVersion(6, 0, 287, 53, "-emb.1", false, "6.0.287.53-emb.1 SIMULATOR",
97+
"libv8-6.0.287.53-emb.1.so");
98+
CheckVersion(6, 0, 287, 53, "-emb.1", true, "6.0.287.53-emb.1 (candidate) SIMULATOR",
99+
"libv8-6.0.287.53-emb.1-candidate.so");
91100
#else
92-
CheckVersion(0, 0, 0, 0, false, "0.0.0", "libv8-0.0.0.so");
93-
CheckVersion(0, 0, 0, 0, true,
94-
"0.0.0 (candidate)", "libv8-0.0.0-candidate.so");
95-
CheckVersion(1, 0, 0, 0, false, "1.0.0", "libv8-1.0.0.so");
96-
CheckVersion(1, 0, 0, 0, true,
97-
"1.0.0 (candidate)", "libv8-1.0.0-candidate.so");
98-
CheckVersion(1, 0, 0, 1, false, "1.0.0.1", "libv8-1.0.0.1.so");
99-
CheckVersion(1, 0, 0, 1, true,
100-
"1.0.0.1 (candidate)", "libv8-1.0.0.1-candidate.so");
101-
CheckVersion(2, 5, 10, 7, false, "2.5.10.7", "libv8-2.5.10.7.so");
102-
CheckVersion(2, 5, 10, 7, true,
103-
"2.5.10.7 (candidate)", "libv8-2.5.10.7-candidate.so");
101+
CheckVersion(0, 0, 0, 0, "", false, "0.0.0", "libv8-0.0.0.so");
102+
CheckVersion(0, 0, 0, 0, "", true, "0.0.0 (candidate)",
103+
"libv8-0.0.0-candidate.so");
104+
CheckVersion(1, 0, 0, 0, "", false, "1.0.0", "libv8-1.0.0.so");
105+
CheckVersion(1, 0, 0, 0, "", true, "1.0.0 (candidate)",
106+
"libv8-1.0.0-candidate.so");
107+
CheckVersion(1, 0, 0, 1, "", false, "1.0.0.1", "libv8-1.0.0.1.so");
108+
CheckVersion(1, 0, 0, 1, "", true, "1.0.0.1 (candidate)",
109+
"libv8-1.0.0.1-candidate.so");
110+
CheckVersion(2, 5, 10, 7, "", false, "2.5.10.7", "libv8-2.5.10.7.so");
111+
CheckVersion(2, 5, 10, 7, "", true, "2.5.10.7 (candidate)",
112+
"libv8-2.5.10.7-candidate.so");
113+
CheckVersion(6, 0, 287, 0, "-emb.1", false, "6.0.287-emb.1",
114+
"libv8-6.0.287-emb.1.so");
115+
CheckVersion(6, 0, 287, 0, "-emb.1", true, "6.0.287-emb.1 (candidate)",
116+
"libv8-6.0.287-emb.1-candidate.so");
117+
CheckVersion(6, 0, 287, 53, "-emb.1", false, "6.0.287.53-emb.1",
118+
"libv8-6.0.287.53-emb.1.so");
119+
CheckVersion(6, 0, 287, 53, "-emb.1", true, "6.0.287.53-emb.1 (candidate)",
120+
"libv8-6.0.287.53-emb.1-candidate.so");
104121
#endif
105122
}

Diff for: doc/api/crypto.md

+14-14
Original file line numberDiff line numberDiff line change
@@ -1712,45 +1712,45 @@ Encrypts `buffer` with `privateKey`.
17121712
`privateKey` can be an object or a string. If `privateKey` is a string, it is
17131713
treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`.
17141714

1715-
### crypto.publicDecrypt(publicKey, buffer)
1715+
### crypto.publicDecrypt(key, buffer)
17161716
<!-- YAML
17171717
added: v1.1.0
17181718
-->
1719-
- `publicKey` {Object | string}
1720-
- `key` {string} A PEM encoded public key.
1721-
- `passphrase` {string} An optional passphrase for the public key.
1719+
- `key` {Object | string}
1720+
- `key` {string} A PEM encoded public or private key.
1721+
- `passphrase` {string} An optional passphrase for the private key.
17221722
- `padding` {crypto.constants} An optional padding value defined in
17231723
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or
17241724
`RSA_PKCS1_PADDING`.
17251725
- `buffer` {Buffer | TypedArray | DataView}
17261726
- Returns: {Buffer} A new `Buffer` with the decrypted content.
17271727

1728-
Decrypts `buffer` with `publicKey`.
1728+
Decrypts `buffer` with `key`.
17291729

1730-
`publicKey` can be an object or a string. If `publicKey` is a string, it is
1731-
treated as the key with no passphrase and will use `RSA_PKCS1_PADDING`.
1730+
`key` can be an object or a string. If `key` is a string, it is treated as
1731+
the key with no passphrase and will use `RSA_PKCS1_PADDING`.
17321732

17331733
Because RSA public keys can be derived from private keys, a private key may
17341734
be passed instead of a public key.
17351735

1736-
### crypto.publicEncrypt(publicKey, buffer)
1736+
### crypto.publicEncrypt(key, buffer)
17371737
<!-- YAML
17381738
added: v0.11.14
17391739
-->
1740-
- `publicKey` {Object | string}
1741-
- `key` {string} A PEM encoded public key.
1742-
- `passphrase` {string} An optional passphrase for the public key.
1740+
- `key` {Object | string}
1741+
- `key` {string} A PEM encoded public or private key.
1742+
- `passphrase` {string} An optional passphrase for the private key.
17431743
- `padding` {crypto.constants} An optional padding value defined in
17441744
`crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`,
17451745
`RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`.
17461746
- `buffer` {Buffer | TypedArray | DataView}
17471747
- Returns: {Buffer} A new `Buffer` with the encrypted content.
17481748

1749-
Encrypts the content of `buffer` with `publicKey` and returns a new
1749+
Encrypts the content of `buffer` with `key` and returns a new
17501750
[`Buffer`][] with encrypted content.
17511751

1752-
`publicKey` can be an object or a string. If `publicKey` is a string, it is
1753-
treated as the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`.
1752+
`key` can be an object or a string. If `key` is a string, it is treated as
1753+
the key with no passphrase and will use `RSA_PKCS1_OAEP_PADDING`.
17541754

17551755
Because RSA public keys can be derived from private keys, a private key may
17561756
be passed instead of a public key.

Diff for: doc/api/os.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ added: v0.3.3
5858
* Returns: {Array}
5959

6060
The `os.cpus()` method returns an array of objects containing information about
61-
each CPU/core installed.
61+
each logical CPU core.
6262

6363
The properties included on each object include:
6464

Diff for: doc/api/process.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -1790,6 +1790,9 @@ changes:
17901790
- version: v4.2.0
17911791
pr-url: https://github.com/nodejs/node/pull/3102
17921792
description: The `icu` property is now supported.
1793+
- version: REPLACEME
1794+
pr-url: https://github.com/nodejs/node/pull/15785
1795+
description: The `v8` property now includes a Node.js specific suffix.
17931796
-->
17941797

17951798
* {Object}
@@ -1810,7 +1813,7 @@ Will generate an object similar to:
18101813
{
18111814
http_parser: '2.3.0',
18121815
node: '1.1.1',
1813-
v8: '4.1.0.14',
1816+
v8: '6.1.534.42-node.0',
18141817
uv: '1.3.0',
18151818
zlib: '1.2.8',
18161819
ares: '1.10.0-DEV',

Diff for: doc/guides/maintaining-V8.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ to be cherry-picked in the Node.js repository and V8-CI must test the change.
167167

168168
* For each abandoned V8 branch corresponding to an LTS branch that is affected by the bug:
169169
* Open a cherry-pick PR on nodejs/node targeting the appropriate *vY.x-staging* branch (e.g. *v6.x-staging* to fix an issue in V8-5.1).
170-
* Increase the patch level version in v8-version.h. This will not cause any problems with versioning because V8 will not publish other patches for this branch, so Node.js can effectively bump the patch version.
170+
* On Node.js < 9.0.0: Increase the patch level version in v8-version.h. This will not cause any problems with versioning because V8 will not publish other patches for this branch, so Node.js can effectively bump the patch version.
171+
* On Node.js >= 9.0.0: Increase the `v8_embedder_string` number in `common.gypi`.
171172
* In some cases the patch may require extra effort to merge in case V8 has changed substantially. For important issues we may be able to lean on the V8 team to get help with reimplementing the patch.
172173
* Run the Node.js [V8-CI](https://ci.nodejs.org/job/node-test-commit-v8-linux/) in addition to the [Node.js CI](https://ci.nodejs.org/job/node-test-pull-request/).
173174

@@ -265,6 +266,7 @@ above. A better strategy is to
265266

266267
1. Audit the current master branch and look at the patches that have been floated since the last major V8 update.
267268
1. Replace the copy of V8 in Node.js with a fresh checkout of the latest stable V8 branch. Special care must be taken to recursively update the DEPS that V8 has a compile time dependency on (at the moment of this writing, these are only trace_event and gtest_prod.h)
269+
1. Reset the `v8_embedder_string` variable to "-node.0" in `common.gypi`.
268270
1. Refloat (cherry-pick) all the patches from list computed in 1) as necessary. Some of the patches may no longer be necessary.
269271

270272
To audit for floating patches:

0 commit comments

Comments
 (0)