From dd8982dc742107f0a540c8eb24626bb6ce9456bb Mon Sep 17 00:00:00 2001 From: Franziska Hinkelmann Date: Fri, 17 Mar 2017 19:36:27 +0100 Subject: [PATCH 001/198] deps: cherry-pick 09de996 from V8 upstream Original commit message: [debugger] fix switch block source positions. The switch statement itself is part of the switch block. However, the source position of the statement is outside of the block. This leads to confusion for the debugger, if the switch block pushes a block context: the current context is a block context, but the scope analysis based on the current source position tells the debugger that we should be outside the scope, so we should have the function context. R=marja@chromium.org BUG=v8:6085 Review-Url: https://codereview.chromium.org/2744213003 Cr-Commit-Position: refs/heads/master@{#43744} Committed: https://chromium.googlesource.com/v8/v8/+/09de9969ccb9bc3bbd667788afad665b309d02f5 Fixes: https://github.com/nodejs/node/issues/11746 PR-URL: https://github.com/nodejs/node/pull/11905 Fixes: https://github.com/nodejs/node/issues/11746 Reviewed-By: Ben Noordhuis Reviewed-By: Ali Ijaz Sheikh --- deps/v8/include/v8-version.h | 2 +- deps/v8/src/parsing/parser-base.h | 2 +- deps/v8/src/parsing/parser.cc | 4 ++ deps/v8/test/debugger/regress/regress-6085.js | 49 +++++++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) create mode 100644 deps/v8/test/debugger/regress/regress-6085.js diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index bb5cb29c13..663964616f 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -11,7 +11,7 @@ #define V8_MAJOR_VERSION 5 #define V8_MINOR_VERSION 6 #define V8_BUILD_NUMBER 326 -#define V8_PATCH_LEVEL 56 +#define V8_PATCH_LEVEL 57 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/src/parsing/parser-base.h b/deps/v8/src/parsing/parser-base.h index bb62f86e3b..9195aec990 100644 --- a/deps/v8/src/parsing/parser-base.h +++ b/deps/v8/src/parsing/parser-base.h @@ -5008,7 +5008,7 @@ typename ParserBase::StatementT ParserBase::ParseSwitchStatement( { BlockState cases_block_state(zone(), &scope_state_); - cases_block_state.set_start_position(scanner()->location().beg_pos); + cases_block_state.set_start_position(switch_pos); cases_block_state.SetNonlinear(); typename Types::Target target(this, switch_statement); diff --git a/deps/v8/src/parsing/parser.cc b/deps/v8/src/parsing/parser.cc index 8d8890129f..3ed7af267e 100644 --- a/deps/v8/src/parsing/parser.cc +++ b/deps/v8/src/parsing/parser.cc @@ -1729,6 +1729,10 @@ Statement* Parser::RewriteSwitchStatement(Expression* tag, Block* cases_block = factory()->NewBlock(NULL, 1, false, kNoSourcePosition); cases_block->statements()->Add(switch_statement, zone()); cases_block->set_scope(scope); + DCHECK_IMPLIES(scope != nullptr, + switch_statement->position() >= scope->start_position()); + DCHECK_IMPLIES(scope != nullptr, + switch_statement->position() < scope->end_position()); switch_block->statements()->Add(cases_block, zone()); return switch_block; } diff --git a/deps/v8/test/debugger/regress/regress-6085.js b/deps/v8/test/debugger/regress/regress-6085.js new file mode 100644 index 0000000000..ef25151645 --- /dev/null +++ b/deps/v8/test/debugger/regress/regress-6085.js @@ -0,0 +1,49 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +function* serialize() { + debugger; + switch (0) { + case 0: + let x = 1; + return x; // Check scopes + } +} + +let exception = null; +let step_count = 0; +let scopes_checked = false; + +function listener(event, exec_state, event_data, data) { + if (event != Debug.DebugEvent.Break) return; + try { + if (exec_state.frame().sourceLineText().includes("Check scopes")) { + let expected = [ debug.ScopeType.Block, + debug.ScopeType.Local, + debug.ScopeType.Script, + debug.ScopeType.Global ]; + for (let i = 0; i < exec_state.frame().scopeCount(); i++) { + assertEquals(expected[i], exec_state.frame().scope(i).scopeType()); + } + scopes_checked = true; + } + if (step_count++ < 3) exec_state.prepareStep(Debug.StepAction.StepNext); + } catch (e) { + exception = e; + print(e, e.stack); + } +} + + + +let Debug = debug.Debug; +Debug.setListener(listener); + +let gen = serialize(); +gen.next(); + +Debug.setListener(null); +assertNull(exception); +assertEquals(4, step_count); +assertTrue(scopes_checked); From 4895e0c1f0ab49d01da18d6d5d1c7cd938020cad Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Mon, 20 Mar 2017 02:49:37 +0200 Subject: [PATCH 002/198] doc: add vsemozhetbyt to collaborators PR-URL: https://github.com/nodejs/node/pull/11932 Reviewed-By: Anna Henningsen Reviewed-By: Timothy Gu Reviewed-By: Colin Ihrig Reviewed-By: Evan Lucas --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 375119484b..5957e5e526 100644 --- a/README.md +++ b/README.md @@ -337,6 +337,8 @@ more information about the governance of the Node.js project, see **Mike Tunnicliffe** <m.j.tunnicliffe@gmail.com> * [vkurchatkin](https://github.com/vkurchatkin) - **Vladimir Kurchatkin** <vladimir.kurchatkin@gmail.com> +* [vsemozhetbyt](https://github.com/vsemozhetbyt) - +**Vse Mozhet Byt** <vsemozhetbyt@gmail.com> (he/him) * [watilde](https://github.com/watilde) - **Daijiro Wachi** <daijiro.wachi@gmail.com> (he/him) * [whitlockjc](https://github.com/whitlockjc) - From 7ef2d90e1b61971f3ab4d92bdb0f0a9b25ce6dcf Mon Sep 17 00:00:00 2001 From: AnnaMag Date: Tue, 14 Mar 2017 22:53:13 +0000 Subject: [PATCH 003/198] test: fix assertion in vm test Prototypes are not strict equal when they are from different contexts. Therefore, assert.strictEqual() fails for objects that are created in different contexts, e.g., in vm.runInContext(). Instead of expecting the prototypes to be equal, only check the properties of the objects for equality. PR-URL: https://github.com/nodejs/node/pull/11862 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Franziska Hinkelmann --- test/known_issues/test-vm-getters.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/known_issues/test-vm-getters.js b/test/known_issues/test-vm-getters.js index f815e6d658..af27eeee64 100644 --- a/test/known_issues/test-vm-getters.js +++ b/test/known_issues/test-vm-getters.js @@ -16,4 +16,9 @@ const context = vm.createContext(sandbox); const code = 'Object.getOwnPropertyDescriptor(this, "prop");'; const result = vm.runInContext(code, context); -assert.strictEqual(result, descriptor); +// Ref: https://github.com/nodejs/node/issues/11803 + +assert.deepStrictEqual(Object.keys(result), Object.keys(descriptor)); +for (const prop of Object.keys(result)) { + assert.strictEqual(result[prop], descriptor[prop]); +} From 03a6c6ea8c6d74476d0f7f9bea86a2c0ae5cbc70 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Fri, 17 Mar 2017 15:31:14 +0100 Subject: [PATCH 004/198] tls: fix segfault on destroy after partial read OnRead() calls into JS land which can result in the SSL context object being destroyed on return. Check that `ssl_ != nullptr` afterwards. Fixes: https://github.com/nodejs/node/issues/11885 PR-URL: https://github.com/nodejs/node/pull/11898 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- src/tls_wrap.cc | 6 ++++ test/parallel/test-tls-socket-destroy.js | 36 ++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 test/parallel/test-tls-socket-destroy.js diff --git a/src/tls_wrap.cc b/src/tls_wrap.cc index ad6daa4301..d21976c7df 100644 --- a/src/tls_wrap.cc +++ b/src/tls_wrap.cc @@ -446,6 +446,12 @@ void TLSWrap::ClearOut() { memcpy(buf.base, current, avail); OnRead(avail, &buf); + // Caveat emptor: OnRead() calls into JS land which can result in + // the SSL context object being destroyed. We have to carefully + // check that ssl_ != nullptr afterwards. + if (ssl_ == nullptr) + return; + read -= avail; current += avail; } diff --git a/test/parallel/test-tls-socket-destroy.js b/test/parallel/test-tls-socket-destroy.js new file mode 100644 index 0000000000..27651f8ec7 --- /dev/null +++ b/test/parallel/test-tls-socket-destroy.js @@ -0,0 +1,36 @@ +'use strict'; + +const common = require('../common'); + +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} + +const fs = require('fs'); +const net = require('net'); +const tls = require('tls'); + +const key = fs.readFileSync(common.fixturesDir + '/keys/agent1-key.pem'); +const cert = fs.readFileSync(common.fixturesDir + '/keys/agent1-cert.pem'); +const secureContext = tls.createSecureContext({ key, cert }); + +const server = net.createServer(common.mustCall((conn) => { + const options = { isServer: true, secureContext, server }; + const socket = new tls.TLSSocket(conn, options); + socket.once('data', common.mustCall(() => { + socket._destroySSL(); // Should not crash. + server.close(); + })); +})); + +server.listen(0, function() { + const options = { + port: this.address().port, + rejectUnauthorized: false, + }; + tls.connect(options, function() { + this.write('*'.repeat(1 << 20)); // Write more data than fits in a frame. + this.on('error', this.destroy); // Server closes connection on us. + }); +}); From 1ff67960833b0c1d7d80834256a9c9c91efa9f40 Mon Sep 17 00:00:00 2001 From: Luca Maraschi Date: Thu, 16 Mar 2017 00:39:37 +0100 Subject: [PATCH 005/198] test: added net.connect lookup type check Check the options passed to Socket.prototype.connect() to validate the type of the lookup property. PR-URL: https://github.com/nodejs/node/pull/11873 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Evan Lucas Reviewed-By: Luigi Pinca Reviewed-By: Matteo Collina Reviewed-By: Joyee Cheung --- test/parallel/test-net-options-lookup.js | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 test/parallel/test-net-options-lookup.js diff --git a/test/parallel/test-net-options-lookup.js b/test/parallel/test-net-options-lookup.js new file mode 100644 index 0000000000..da23830b12 --- /dev/null +++ b/test/parallel/test-net-options-lookup.js @@ -0,0 +1,34 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const net = require('net'); + +const expectedError = /^TypeError: "lookup" option should be a function$/; + +['foobar', 1, {}, []].forEach((input) => connectThrows(input)); + +function connectThrows(input) { + const opts = { + host: 'localhost', + port: common.PORT, + lookup: input + }; + + assert.throws(function() { + net.connect(opts); + }, expectedError); +} + +[() => {}].forEach((input) => connectDoesNotThrow(input)); + +function connectDoesNotThrow(input) { + const opts = { + host: 'localhost', + port: common.PORT, + lookup: input + }; + + assert.doesNotThrow(function() { + net.connect(opts); + }); +} From 6aed32c57986b90290459e155aca20b962cd3829 Mon Sep 17 00:00:00 2001 From: Luca Maraschi Date: Thu, 16 Mar 2017 23:58:16 +0100 Subject: [PATCH 006/198] test: add tests for unixtimestamp generation This test checks for the different input types for the generation of UNIX timestamps in the fs module. PR-URL: https://github.com/nodejs/node/pull/11886 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- test/parallel/test-fs-timestamp-parsing-error.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/parallel/test-fs-timestamp-parsing-error.js diff --git a/test/parallel/test-fs-timestamp-parsing-error.js b/test/parallel/test-fs-timestamp-parsing-error.js new file mode 100644 index 0000000000..321f80b269 --- /dev/null +++ b/test/parallel/test-fs-timestamp-parsing-error.js @@ -0,0 +1,16 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const fs = require('fs'); + +[undefined, null, []].forEach((input) => { + assert.throws(() => fs._toUnixTimestamp(input), + new RegExp('^Error: Cannot parse time: ' + input + '$')); +}); + +assert.throws(() => fs._toUnixTimestamp({}), + /^Error: Cannot parse time: \[object Object\]$/); + +[1, '1', Date.now(), -1, '-1', Infinity].forEach((input) => { + assert.doesNotThrow(() => fs._toUnixTimestamp(input)); +}); From ef4768754c870e3a0b0d2e09c062cfbde03afb63 Mon Sep 17 00:00:00 2001 From: Michael Dawson Date: Fri, 17 Mar 2017 17:34:54 -0400 Subject: [PATCH 007/198] doc: add supported platforms list PR-URL: https://github.com/nodejs/node/pull/11872 Reviewed-By: James M Snell Reviewed-By: Rich Trott Reviewed-By: Roman Reiss Reviewed-By: Ben Noordhuis Reviewed-By: Gibson Fahnestock --- BUILDING.md | 80 +++++++++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 74 insertions(+), 6 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 13f4e34734..b325972f4b 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -8,21 +8,86 @@ If you consistently can reproduce a test failure, search for it in the [Node.js issue tracker](https://github.com/nodejs/node/issues) or file a new issue. +## Supported platforms + +This list of supported platforms is current as of the branch / release to +which it is attached. + +### Input + +Node.js relies on V8 and libuv. Therefore, we adopt a subset of their +supported platforms. + +### Strategy + +Support is divided into three tiers: + +* **Tier 1**: Full test coverage and maintenance by the Node.js core team and + the broader community. +* **Tier 2**: Full test coverage but more limited maintenance, + often provided by the vendor of the platform. +* **Experimental**: Known to compile but not necessarily reliably or with + a full passing test suite. These are often working to be promoted to Tier + 2 but are not quite ready. There is at least one individual actively + providing maintenance and the team is striving to broaden quality and + reliability of support. + +### Supported platforms + +| System | Support type | Version | Architectures | Notes | +|--------------|--------------|----------------------------------|----------------------|------------------| +| GNU/Linux | Tier 1 | kernel >= 2.6.18, glibc >= 2.5 | x86, x64, arm, arm64 | | +| macOS | Tier 1 | >= 10.10 | x64 | | +| Windows | Tier 1 | >= Windows 7 or >= Windows2008R2 | x86, x64 | | +| SmartOS | Tier 2 | >= 15 < 16.4 | x86, x64 | see note1 | +| FreeBSD | Tier 2 | >= 10 | x64 | | +| GNU/Linux | Tier 2 | kernel >= 4.2.0, glibc >= 2.19 | ppc64be | | +| GNU/Linux | Tier 2 | kernel >= 3.13.0, glibc >= 2.19 | ppc64le | | +| AIX | Tier 2 | >= 6.1 TL09 | ppc64be | | +| GNU/Linux | Tier 2 | kernel >= 3.10, glibc >= 2.17 | s390x | | +| macOS | Experimental | >= 10.8 < 10.10 | x64 | no test coverage | +| Linux (musl) | Experimental | musl >= 1.0 | x64 | | + +note1 - The gcc4.8-libs package needs to be installed, because node + binaries have been built with GCC 4.8, for which runtime libraries are not + installed by default. For these node versions, the recommended binaries + are the ones available in pkgsrc, not the one available from nodejs.org. + Note that the binaries downloaded from the pkgsrc repositories are not + officially supported by the Node.js project, and instead are supported + by Joyent. SmartOS images >= 16.4 are not supported because + GCC 4.8 runtime libraries are not available in their pkgsrc repository + +### Supported toolchains + +Depending on host platform, the selection of toolchains may vary. + +#### Unix + +* GCC 4.8.5 or newer +* Clang 3.4.1 or newer + +#### Windows + +* Building Node: Visual Studio 2015 or Visual C++ Build Tools 2015 or newer +* Building native add-ons: Visual Studio 2013 or Visual C++ Build Tools 2015 + or newer + +## Building Node.js on supported platforms ### Unix / OS X Prerequisites: * `gcc` and `g++` 4.8.5 or newer, or -* `clang` and `clang++` 3.4 or newer +* `clang` and `clang++` 3.4.1 or newer * Python 2.6 or 2.7 * GNU Make 3.81 or newer On OS X, you will also need: * [Xcode](https://developer.apple.com/xcode/download/) - * You also need to install the `Command Line Tools` via Xcode. You can find + - You also need to install the `Command Line Tools` via Xcode. You can find this under the menu `Xcode -> Preferences -> Downloads` - * This step will install `gcc` and the related toolchain containing `make` + - This step will install `gcc` and the related toolchain containing `make` * After building, you may want to setup [firewall rules](tools/macosx-firewall.sh) to avoid popups asking to accept incoming network connections when running tests: @@ -51,7 +116,8 @@ the `-j4` flag. See the [GNU Make Documentation](https://www.gnu.org/software/make/manual/html_node/Parallel.html) for more information. -Note that the above requires that `python` resolve to Python 2.6 or 2.7 and not a newer version. +Note that the above requires that `python` resolve to Python 2.6 or 2.7 +and not a newer version. To run the tests: @@ -252,9 +318,11 @@ It is possible to build Node.js with **Note**: building in this way does **not** allow you to claim that the runtime is FIPS 140-2 validated. Instead you can indicate that the runtime -uses a validated module. See the [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf) +uses a validated module. See the +[security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf) page 60 for more details. In addition, the validation for the underlying module -is only valid if it is deployed in accordance with its [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf). +is only valid if it is deployed in accordance with its +[security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf). If you need FIPS validated cryptography it is recommended that you read both the [security policy](http://csrc.nist.gov/groups/STM/cmvp/documents/140-1/140sp/140sp1747.pdf) and [user guide](https://openssl.org/docs/fips/UserGuide-2.0.pdf). From 60c8a35744ab99aeaaf3b917d10570d07b9a735e Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Mon, 20 Mar 2017 11:40:54 -0700 Subject: [PATCH 008/198] url: restrict setting protocol to "file" Since file URLs can not have `username/password/port`, the specification was updated to restrict setting protocol to "file". Refs: https://github.com/whatwg/url/pull/269 Fixes: https://github.com/nodejs/node/issues/11785 PR-URL: https://github.com/nodejs/node/pull/11887 Reviewed-By: James M Snell Reviewed-By: Timothy Gu Reviewed-By: Joyee Cheung --- lib/internal/url.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/internal/url.js b/lib/internal/url.js index 005f5b6647..91b0640b50 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -133,6 +133,13 @@ function onParseProtocolComplete(flags, protocol, username, password, if ((s && !newIsSpecial) || (!s && newIsSpecial)) { return; } + if (protocol === 'file:' && + (ctx.username || ctx.password || ctx.port !== undefined)) { + return; + } + if (ctx.scheme === 'file:' && !ctx.host) { + return; + } if (newIsSpecial) { ctx.flags |= binding.URL_FLAGS_SPECIAL; } else { From cab58fe5dfb9dc5b679097ecc34ba69e236d6e4b Mon Sep 17 00:00:00 2001 From: Daijiro Wachi Date: Mon, 20 Mar 2017 11:43:30 -0700 Subject: [PATCH 009/198] test: synchronize WPT url setters tests data Synchronize url-setter-test to upstream. Refs: https://github.com/w3c/web-platform-tests/pull/5112 PR-URL: https://github.com/nodejs/node/pull/11887 Reviewed-By: James M Snell Reviewed-By: Timothy Gu Reviewed-By: Joyee Cheung --- test/fixtures/url-setter-tests.json | 51 ++++++++++++++++++++++++++++- 1 file changed, 50 insertions(+), 1 deletion(-) diff --git a/test/fixtures/url-setter-tests.json b/test/fixtures/url-setter-tests.json index 4876b9940c..d0138204b3 100644 --- a/test/fixtures/url-setter-tests.json +++ b/test/fixtures/url-setter-tests.json @@ -111,6 +111,55 @@ "protocol": "http:" } }, + { + "href": "gopher://example.net:1234", + "new_value": "file", + "expected": { + "href": "gopher://example.net:1234/", + "protocol": "gopher:" + } + }, + { + "href": "wss://x:x@example.net:1234", + "new_value": "file", + "expected": { + "href": "wss://x:x@example.net:1234/", + "protocol": "wss:" + } + }, + { + "comment": "Can’t switch from file URL with no host", + "href": "file://localhost/", + "new_value": "http", + "expected": { + "href": "file:///", + "protocol": "file:" + } + }, + { + "href": "file:///test", + "new_value": "gopher", + "expected": { + "href": "file:///test", + "protocol": "file:" + } + }, + { + "href": "file:", + "new_value": "wss", + "expected": { + "href": "file:///", + "protocol": "file:" + } + }, + { + "href": "file://hi/path", + "new_value": "s", + "expected": { + "href": "file://hi/path", + "protocol": "file:" + } + }, { "href": "https://example.net", "new_value": "s", @@ -1177,4 +1226,4 @@ } } ] -} \ No newline at end of file +} From 3622a97715858dc7e6aead57b605189c9cad0337 Mon Sep 17 00:00:00 2001 From: Jyotman Singh Date: Sat, 18 Mar 2017 20:42:00 +0530 Subject: [PATCH 010/198] doc: add missing word in stream.md PR-URL: https://github.com/nodejs/node/pull/11914 Fixes: https://github.com/nodejs/node/issues/11913 Reviewed-By: Luigi Pinca Reviewed-By: Jeremiah Senkpiel Reviewed-By: Yuta Hiroto Reviewed-By: Timothy Gu Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- doc/api/stream.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/stream.md b/doc/api/stream.md index 289250c638..23b8059ed9 100644 --- a/doc/api/stream.md +++ b/doc/api/stream.md @@ -556,7 +556,7 @@ that the stream will *remain* paused once those destinations drain and ask for more data. *Note*: If a [Readable][] is switched into flowing mode and there are no -consumers available handle the data, that data will be lost. This can occur, +consumers available to handle the data, that data will be lost. This can occur, for instance, when the `readable.resume()` method is called without a listener attached to the `'data'` event, or when a `'data'` event handler is removed from the stream. From bd496e0187cebe5ae2d5ea2888487f041e6970fb Mon Sep 17 00:00:00 2001 From: Bartosz Sosnowski Date: Tue, 14 Mar 2017 18:22:53 +0100 Subject: [PATCH 011/198] src: ensure that fd 0-2 are valid on windows Check that stdin, stdout and stderr are valid file descriptors on Windows. If not, reopen them with 'nul' file. Refs: https://github.com/nodejs/node/pull/875 Fixes: https://github.com/nodejs/node/issues/11656 PR-URL: https://github.com/nodejs/node/pull/11863 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel Reviewed-By: Anna Henningsen --- src/node.cc | 13 +++++++++++++ test/fixtures/spawn_closed_stdio.py | 8 ++++++++ test/parallel/test-stdio-closed.js | 14 +++++++++++++- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 test/fixtures/spawn_closed_stdio.py diff --git a/src/node.cc b/src/node.cc index fda6c3f257..d79b8ee30e 100644 --- a/src/node.cc +++ b/src/node.cc @@ -4213,6 +4213,19 @@ inline void PlatformInit() { } while (min + 1 < max); } #endif // __POSIX__ +#ifdef _WIN32 + for (int fd = 0; fd <= 2; ++fd) { + auto handle = reinterpret_cast(_get_osfhandle(fd)); + if (handle == INVALID_HANDLE_VALUE || + GetFileType(handle) == FILE_TYPE_UNKNOWN) { + // Ignore _close result. If it fails or not depends on used Windows + // version. We will just check _open result. + _close(fd); + if (fd != _open("nul", _O_RDWR)) + ABORT(); + } + } +#endif // _WIN32 } diff --git a/test/fixtures/spawn_closed_stdio.py b/test/fixtures/spawn_closed_stdio.py new file mode 100644 index 0000000000..b5de2552c2 --- /dev/null +++ b/test/fixtures/spawn_closed_stdio.py @@ -0,0 +1,8 @@ +import os +import sys +import subprocess +os.close(0) +os.close(1) +os.close(2) +exit_code = subprocess.call(sys.argv[1:], shell=False) +sys.exit(exit_code) diff --git a/test/parallel/test-stdio-closed.js b/test/parallel/test-stdio-closed.js index 98e4f980d5..2313140a26 100644 --- a/test/parallel/test-stdio-closed.js +++ b/test/parallel/test-stdio-closed.js @@ -3,9 +3,21 @@ const common = require('../common'); const assert = require('assert'); const spawn = require('child_process').spawn; const fs = require('fs'); +const path = require('path'); if (common.isWindows) { - common.skip('platform not supported.'); + if (process.argv[2] === 'child') { + process.stdin; + process.stdout; + process.stderr; + return; + } + const python = process.env.PYTHON || 'python'; + const script = path.join(common.fixturesDir, 'spawn_closed_stdio.py'); + const proc = spawn(python, [script, process.execPath, __filename, 'child']); + proc.on('exit', common.mustCall(function(exitCode) { + assert.strictEqual(exitCode, 0); + })); return; } From 2a4a5f0389679481b4aaafddf9fa780022b41cbb Mon Sep 17 00:00:00 2001 From: Roman Reiss Date: Mon, 20 Mar 2017 21:24:05 +0100 Subject: [PATCH 012/198] doc: fix gitter badge in README GitHub now renders Markdown in CommonMark where spaces in a link destination are invalid and need to be escaped. PR-URL: https://github.com/nodejs/node/pull/11944 Reviewed-By: Anna Henningsen Reviewed-By: Ben Noordhuis --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 5957e5e526..e2d66b90be 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Node.js -[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/nodejs/node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/29/badge)](https://bestpractices.coreinfrastructure.org/projects/29) +[![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/nodejs/node?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/29/badge)](https://bestpractices.coreinfrastructure.org/projects/29) Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and From 5425e0dcbee1ed8f6687203eafb7c3cf214f3393 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 27 Feb 2017 16:09:32 -0800 Subject: [PATCH 013/198] http: use more efficient module.exports pattern PR-URL: https://github.com/nodejs/node/pull/11594 Reviewed-By: Colin Ihrig Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Matteo Collina --- lib/_http_agent.js | 6 ++++-- lib/_http_client.js | 5 ++++- lib/_http_common.js | 24 +++++++++++---------- lib/_http_incoming.js | 12 +++++------ lib/_http_outgoing.js | 5 +++++ lib/_http_server.js | 16 ++++++++------ lib/http.js | 50 +++++++++++++++++++++++++------------------ 7 files changed, 70 insertions(+), 48 deletions(-) diff --git a/lib/_http_agent.js b/lib/_http_agent.js index 0661ee1553..351417a7ba 100644 --- a/lib/_http_agent.js +++ b/lib/_http_agent.js @@ -105,7 +105,6 @@ function Agent(options) { } util.inherits(Agent, EventEmitter); -exports.Agent = Agent; Agent.defaultMaxSockets = Infinity; @@ -314,4 +313,7 @@ Agent.prototype.destroy = function destroy() { } }; -exports.globalAgent = new Agent(); +module.exports = { + Agent, + globalAgent: new Agent() +}; diff --git a/lib/_http_client.js b/lib/_http_client.js index b818b05c52..a118bbe3aa 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -286,7 +286,6 @@ function ClientRequest(options, cb) { util.inherits(ClientRequest, OutgoingMessage); -exports.ClientRequest = ClientRequest; ClientRequest.prototype._finish = function _finish() { DTRACE_HTTP_CLIENT_REQUEST(this, this.connection); @@ -752,3 +751,7 @@ ClientRequest.prototype.setSocketKeepAlive = ClientRequest.prototype.clearTimeout = function clearTimeout(cb) { this.setTimeout(0, cb); }; + +module.exports = { + ClientRequest +}; diff --git a/lib/_http_common.js b/lib/_http_common.js index c2ffbfce80..2245ae079a 100644 --- a/lib/_http_common.js +++ b/lib/_http_common.js @@ -32,12 +32,6 @@ const readStart = incoming.readStart; const readStop = incoming.readStop; const debug = require('util').debuglog('http'); -exports.debug = debug; - -exports.CRLF = '\r\n'; -exports.chunkExpression = /(?:^|\W)chunked(?:$|\W)/i; -exports.continueExpression = /(?:^|\W)100-continue(?:$|\W)/i; -exports.methods = methods; const kOnHeaders = HTTPParser.kOnHeaders | 0; const kOnHeadersComplete = HTTPParser.kOnHeadersComplete | 0; @@ -194,7 +188,6 @@ var parsers = new FreeList('parsers', 1000, function() { return parser; }); -exports.parsers = parsers; // Free the parser and also break any links that it @@ -227,7 +220,6 @@ function freeParser(parser, req, socket) { socket.parser = null; } } -exports.freeParser = freeParser; function ondrain() { @@ -239,7 +231,6 @@ function httpSocketSetup(socket) { socket.removeListener('drain', ondrain); socket.on('drain', ondrain); } -exports.httpSocketSetup = httpSocketSetup; /** * Verifies that the given val is a valid HTTP token @@ -306,7 +297,6 @@ function checkIsHttpToken(val) { } return true; } -exports._checkIsHttpToken = checkIsHttpToken; /** * True if val contains an invalid field-vchar @@ -360,4 +350,16 @@ function checkInvalidHeaderChar(val) { } return false; } -exports._checkInvalidHeaderChar = checkInvalidHeaderChar; + +module.exports = { + _checkInvalidHeaderChar: checkInvalidHeaderChar, + _checkIsHttpToken: checkIsHttpToken, + chunkExpression: /(?:^|\W)chunked(?:$|\W)/i, + continueExpression: /(?:^|\W)100-continue(?:$|\W)/i, + CRLF: '\r\n', + debug, + freeParser, + httpSocketSetup, + methods, + parsers +}; diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index b0d5c29b20..be724da310 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -28,14 +28,11 @@ function readStart(socket) { if (socket && !socket._paused && socket.readable) socket.resume(); } -exports.readStart = readStart; function readStop(socket) { if (socket) socket.pause(); } -exports.readStop = readStop; - /* Abstract base class for ServerRequest and ClientResponse. */ function IncomingMessage(socket) { @@ -83,9 +80,6 @@ function IncomingMessage(socket) { util.inherits(IncomingMessage, Stream.Readable); -exports.IncomingMessage = IncomingMessage; - - IncomingMessage.prototype.setTimeout = function setTimeout(msecs, callback) { if (callback) this.on('timeout', callback); @@ -324,3 +318,9 @@ IncomingMessage.prototype._dump = function _dump() { this.resume(); } }; + +module.exports = { + IncomingMessage, + readStart, + readStop +}; diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index 130adef1de..e1fee20cfe 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -887,3 +887,8 @@ OutgoingMessage.prototype.flushHeaders = function flushHeaders() { OutgoingMessage.prototype.flush = internalUtil.deprecate(function() { this.flushHeaders(); }, 'OutgoingMessage.flush is deprecated. Use flushHeaders instead.', 'DEP0001'); + + +module.exports = { + OutgoingMessage +}; diff --git a/lib/_http_server.js b/lib/_http_server.js index 0a300ade61..2821db8f40 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -36,7 +36,7 @@ const httpSocketSetup = common.httpSocketSetup; const OutgoingMessage = require('_http_outgoing').OutgoingMessage; const outHeadersKey = require('internal/http').outHeadersKey; -const STATUS_CODES = exports.STATUS_CODES = { +const STATUS_CODES = { 100: 'Continue', 101: 'Switching Protocols', 102: 'Processing', // RFC 2518, obsoleted by RFC 4918 @@ -128,8 +128,6 @@ ServerResponse.prototype._finish = function _finish() { }; -exports.ServerResponse = ServerResponse; - ServerResponse.prototype.statusCode = 200; ServerResponse.prototype.statusMessage = undefined; @@ -290,9 +288,6 @@ Server.prototype.setTimeout = function setTimeout(msecs, callback) { }; -exports.Server = Server; - - function connectionListener(socket) { debug('SERVER new http connection'); @@ -363,7 +358,7 @@ function connectionListener(socket) { socket._paused = false; } -exports._connectionListener = connectionListener; + function updateOutgoingData(socket, state, delta) { state.outgoingData += delta; @@ -640,3 +635,10 @@ function socketOnWrap(ev, fn) { return res; } + +module.exports = { + STATUS_CODES, + Server, + ServerResponse, + _connectionListener: connectionListener +}; diff --git a/lib/http.js b/lib/http.js index 4b0e589a56..af3e8a017c 100644 --- a/lib/http.js +++ b/lib/http.js @@ -20,35 +20,43 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -exports.IncomingMessage = require('_http_incoming').IncomingMessage; - -exports.OutgoingMessage = require('_http_outgoing').OutgoingMessage; - -exports.METHODS = require('_http_common').methods.slice().sort(); const agent = require('_http_agent'); -exports.Agent = agent.Agent; -exports.globalAgent = agent.globalAgent; - +const client = require('_http_client'); +const common = require('_http_common'); +const incoming = require('_http_incoming'); +const outgoing = require('_http_outgoing'); const server = require('_http_server'); -exports.ServerResponse = server.ServerResponse; -exports.STATUS_CODES = server.STATUS_CODES; -exports._connectionListener = server._connectionListener; -const Server = exports.Server = server.Server; -exports.createServer = function createServer(requestListener) { - return new Server(requestListener); -}; +const Server = server.Server; +const ClientRequest = client.ClientRequest; -const client = require('_http_client'); -const ClientRequest = exports.ClientRequest = client.ClientRequest; +function createServer(requestListener) { + return new Server(requestListener); +} -exports.request = function request(options, cb) { +function request(options, cb) { return new ClientRequest(options, cb); -}; +} -exports.get = function get(options, cb) { - var req = exports.request(options, cb); +function get(options, cb) { + var req = request(options, cb); req.end(); return req; +} + +module.exports = { + _connectionListener: server._connectionListener, + METHODS: common.methods.slice().sort(), + STATUS_CODES: server.STATUS_CODES, + Agent: agent.Agent, + ClientRequest, + globalAgent: agent.globalAgent, + IncomingMessage: incoming.IncomingMessage, + OutgoingMessage: outgoing.OutgoingMessage, + Server, + ServerResponse: server.ServerResponse, + createServer, + get, + request }; From 74c1e0264296d9dbd9bff9dae63ba9c81cae45d4 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Mon, 27 Feb 2017 16:53:13 -0800 Subject: [PATCH 014/198] http: replace uses of self PR-URL: https://github.com/nodejs/node/pull/11594 Reviewed-By: Colin Ihrig Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Matteo Collina --- lib/_http_client.js | 139 +++++++++++++++++++----------------------- lib/_http_outgoing.js | 6 +- 2 files changed, 67 insertions(+), 78 deletions(-) diff --git a/lib/_http_client.js b/lib/_http_client.js index a118bbe3aa..d281b120c8 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -66,8 +66,7 @@ function isInvalidPath(s) { } function ClientRequest(options, cb) { - var self = this; - OutgoingMessage.call(self); + OutgoingMessage.call(this); if (typeof options === 'string') { options = url.parse(options); @@ -95,12 +94,12 @@ function ClientRequest(options, cb) { 'Agent option must be an instance of http.Agent, undefined or false.' ); } - self.agent = agent; + this.agent = agent; var protocol = options.protocol || defaultAgent.protocol; var expectedProtocol = defaultAgent.protocol; - if (self.agent && self.agent.protocol) - expectedProtocol = self.agent.protocol; + if (this.agent && this.agent.protocol) + expectedProtocol = this.agent.protocol; var path; if (options.path) { @@ -121,15 +120,15 @@ function ClientRequest(options, cb) { } const defaultPort = options.defaultPort || - self.agent && self.agent.defaultPort; + this.agent && this.agent.defaultPort; var port = options.port = options.port || defaultPort || 80; var host = options.host = options.hostname || options.host || 'localhost'; var setHost = (options.setHost === undefined); - self.socketPath = options.socketPath; - self.timeout = options.timeout; + this.socketPath = options.socketPath; + this.timeout = options.timeout; var method = options.method; var methodIsString = (typeof method === 'string'); @@ -141,14 +140,14 @@ function ClientRequest(options, cb) { if (!common._checkIsHttpToken(method)) { throw new TypeError('Method must be a valid HTTP token'); } - method = self.method = method.toUpperCase(); + method = this.method = method.toUpperCase(); } else { - method = self.method = 'GET'; + method = this.method = 'GET'; } - self.path = options.path || '/'; + this.path = options.path || '/'; if (cb) { - self.once('response', cb); + this.once('response', cb); } var headersArray = Array.isArray(options.headers); @@ -157,7 +156,7 @@ function ClientRequest(options, cb) { var keys = Object.keys(options.headers); for (var i = 0; i < keys.length; i++) { var key = keys[i]; - self.setHeader(key, options.headers[key]); + this.setHeader(key, options.headers[key]); } } if (host && !this.getHeader('host') && setHost) { @@ -190,21 +189,22 @@ function ClientRequest(options, cb) { method === 'DELETE' || method === 'OPTIONS' || method === 'CONNECT') { - self.useChunkedEncodingByDefault = false; + this.useChunkedEncodingByDefault = false; } else { - self.useChunkedEncodingByDefault = true; + this.useChunkedEncodingByDefault = true; } if (headersArray) { - self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n', + this._storeHeader(this.method + ' ' + this.path + ' HTTP/1.1\r\n', options.headers); - } else if (self.getHeader('expect')) { - if (self._header) { + } else if (this.getHeader('expect')) { + if (this._header) { throw new Error('Can\'t render headers after they are sent to the ' + 'client'); } - self._storeHeader(self.method + ' ' + self.path + ' HTTP/1.1\r\n', - self[outHeadersKey]); + + this._storeHeader(this.method + ' ' + this.path + ' HTTP/1.1\r\n', + this[outHeadersKey]); } this._ended = false; @@ -216,72 +216,65 @@ function ClientRequest(options, cb) { this.maxHeadersCount = null; var called = false; - if (self.socketPath) { - self._last = true; - self.shouldKeepAlive = false; + + const oncreate = (err, socket) => { + if (called) + return; + called = true; + if (err) { + process.nextTick(() => this.emit('error', err)); + return; + } + this.onSocket(socket); + this._deferToConnect(null, null, () => this._flush()); + }; + + if (this.socketPath) { + this._last = true; + this.shouldKeepAlive = false; const optionsPath = { - path: self.socketPath, - timeout: self.timeout + path: this.socketPath, + timeout: this.timeout }; - const newSocket = self.agent.createConnection(optionsPath, oncreate); + const newSocket = this.agent.createConnection(optionsPath, oncreate); if (newSocket && !called) { called = true; - self.onSocket(newSocket); + this.onSocket(newSocket); } else { return; } - } else if (self.agent) { + } else if (this.agent) { // If there is an agent we should default to Connection:keep-alive, // but only if the Agent will actually reuse the connection! // If it's not a keepAlive agent, and the maxSockets==Infinity, then // there's never a case where this socket will actually be reused - if (!self.agent.keepAlive && !Number.isFinite(self.agent.maxSockets)) { - self._last = true; - self.shouldKeepAlive = false; + if (!this.agent.keepAlive && !Number.isFinite(this.agent.maxSockets)) { + this._last = true; + this.shouldKeepAlive = false; } else { - self._last = false; - self.shouldKeepAlive = true; + this._last = false; + this.shouldKeepAlive = true; } - self.agent.addRequest(self, options); + this.agent.addRequest(this, options); } else { // No agent, default to Connection:close. - self._last = true; - self.shouldKeepAlive = false; + this._last = true; + this.shouldKeepAlive = false; if (typeof options.createConnection === 'function') { const newSocket = options.createConnection(options, oncreate); if (newSocket && !called) { called = true; - self.onSocket(newSocket); + this.onSocket(newSocket); } else { return; } } else { debug('CLIENT use net.createConnection', options); - self.onSocket(net.createConnection(options)); - } - } - - function oncreate(err, socket) { - if (called) - return; - called = true; - if (err) { - process.nextTick(function() { - self.emit('error', err); - }); - return; + this.onSocket(net.createConnection(options)); } - self.onSocket(socket); - self._deferToConnect(null, null, function() { - self._flush(); - self = null; - }); } - self._deferToConnect(null, null, function() { - self._flush(); - self = null; - }); + this._deferToConnect(null, null, () => this._flush()); } util.inherits(ClientRequest, OutgoingMessage); @@ -304,7 +297,7 @@ ClientRequest.prototype._implicitHeader = function _implicitHeader() { ClientRequest.prototype.abort = function abort() { if (!this.aborted) { - process.nextTick(emitAbortNT, this); + process.nextTick(emitAbortNT.bind(this)); } // Mark as aborting so we can avoid sending queued request data // This is used as a truthy flag elsewhere. The use of Date.now is for @@ -328,8 +321,8 @@ ClientRequest.prototype.abort = function abort() { }; -function emitAbortNT(self) { - self.emit('abort'); +function emitAbortNT() { + this.emit('abort'); } @@ -681,26 +674,25 @@ function _deferToConnect(method, arguments_, cb) { // calls that happen either now (when a socket is assigned) or // in the future (when a socket gets assigned out of the pool and is // eventually writable). - var self = this; - function callSocketMethod() { + const callSocketMethod = () => { if (method) - self.socket[method].apply(self.socket, arguments_); + this.socket[method].apply(this.socket, arguments_); if (typeof cb === 'function') cb(); - } + }; - var onSocket = function onSocket() { - if (self.socket.writable) { + const onSocket = () => { + if (this.socket.writable) { callSocketMethod(); } else { - self.socket.once('connect', callSocketMethod); + this.socket.once('connect', callSocketMethod); } }; - if (!self.socket) { - self.once('socket', onSocket); + if (!this.socket) { + this.once('socket', onSocket); } else { onSocket(); } @@ -709,10 +701,7 @@ function _deferToConnect(method, arguments_, cb) { ClientRequest.prototype.setTimeout = function setTimeout(msecs, callback) { if (callback) this.once('timeout', callback); - var self = this; - function emitTimeout() { - self.emit('timeout'); - } + const emitTimeout = () => this.emit('timeout'); if (this.socket && this.socket.writable) { if (this.timeoutCb) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index e1fee20cfe..cdca2d4e89 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -625,7 +625,7 @@ const crlf_buf = Buffer.from('\r\n'); OutgoingMessage.prototype.write = function write(chunk, encoding, callback) { if (this.finished) { var err = new Error('write after end'); - process.nextTick(writeAfterEndNT, this, err, callback); + process.nextTick(writeAfterEndNT.bind(this), err, callback); return true; } @@ -684,8 +684,8 @@ OutgoingMessage.prototype.write = function write(chunk, encoding, callback) { }; -function writeAfterEndNT(self, err, callback) { - self.emit('error', err); +function writeAfterEndNT(err, callback) { + this.emit('error', err); if (callback) callback(err); } From cce520a5deb0afc55a2c4e13dba6999a379ded8d Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 16 Mar 2017 22:47:05 -0700 Subject: [PATCH 015/198] tools: ignore URLs in line length linting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Where inclusion of a lengthy URL causes a line to exceed 80 characters in our code base, do not report the line length as a linting error. PR-URL: https://github.com/nodejs/node/pull/11890 Reviewed-By: Michaël Zasso Reviewed-By: Luigi Pinca Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Joyee Cheung --- .eslintrc.yaml | 2 +- lib/_http_incoming.js | 3 +-- lib/_http_server.js | 2 -- test/parallel/test-process-env.js | 2 -- test/parallel/test-url-parse-format.js | 6 ++---- 5 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index ba6334b034..1362c9cb29 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -97,7 +97,7 @@ rules: key-spacing: [2, {mode: minimum}] keyword-spacing: 2 linebreak-style: [2, unix] - max-len: [2, 80, 2] + max-len: [2, {code: 80, ignoreUrls: true, tabWidth: 2}] new-parens: 2 no-mixed-spaces-and-tabs: 2 no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}] diff --git a/lib/_http_incoming.js b/lib/_http_incoming.js index be724da310..9151836ad8 100644 --- a/lib/_http_incoming.js +++ b/lib/_http_incoming.js @@ -144,10 +144,9 @@ function _addHeaderLines(headers, n) { // TODO: perhaps http_parser could be returning both raw and lowercased versions // of known header names to avoid us having to call toLowerCase() for those // headers. -/* eslint-disable max-len */ + // 'array' header list is taken from: // https://mxr.mozilla.org/mozilla/source/netwerk/protocol/http/src/nsHttpHeaderArray.cpp -/* eslint-enable max-len */ function matchKnownFields(field) { var low = false; while (true) { diff --git a/lib/_http_server.js b/lib/_http_server.js index 2821db8f40..a95fe1d21c 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -263,11 +263,9 @@ function Server(requestListener) { this.on('request', requestListener); } - /* eslint-disable max-len */ // Similar option to this. Too lazy to write my own docs. // http://www.squid-cache.org/Doc/config/half_closed_clients/ // http://wiki.squid-cache.org/SquidFaq/InnerWorkings#What_is_a_half-closed_filedescriptor.3F - /* eslint-enable max-len */ this.httpAllowHalfOpen = false; this.on('connection', connectionListener); diff --git a/test/parallel/test-process-env.js b/test/parallel/test-process-env.js index 7d6434c00b..69379f6006 100644 --- a/test/parallel/test-process-env.js +++ b/test/parallel/test-process-env.js @@ -70,7 +70,6 @@ if (process.argv[2] === 'you-are-the-child') { delete process.env.NON_EXISTING_VARIABLE; assert.strictEqual(true, delete process.env.NON_EXISTING_VARIABLE); -/* eslint-disable max-len */ /* For the moment we are not going to support setting the timezone via the * environment variables. The problem is that various V8 platform backends * deal with timezone in different ways. The windows platform backend caches @@ -87,7 +86,6 @@ date = new Date('Fri, 10 Sep 1982 03:15:00 GMT'); assert.strictEqual(3, date.getUTCHours()); assert.strictEqual(5, date.getHours()); */ -/* eslint-enable max-len */ // Environment variables should be case-insensitive on Windows, and // case-sensitive on other platforms. diff --git a/test/parallel/test-url-parse-format.js b/test/parallel/test-url-parse-format.js index f75f979b29..7da6a7167b 100644 --- a/test/parallel/test-url-parse-format.js +++ b/test/parallel/test-url-parse-format.js @@ -1,4 +1,3 @@ -/* eslint-disable max-len */ 'use strict'; require('../common'); const assert = require('assert'); @@ -272,8 +271,7 @@ const parseTests = { }, 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=': { - href: 'http://user:pass@mt0.google.com/vt/lyrs=m@114???' + - '&hl=en&src=api&x=2&y=2&z=3&s=', + href: 'http://user:pass@mt0.google.com/vt/lyrs=m@114???&hl=en&src=api&x=2&y=2&z=3&s=', protocol: 'http:', slashes: true, host: 'mt0.google.com', @@ -842,7 +840,7 @@ const parseTests = { hostname: 'a.b', hash: null, pathname: '/%09bc%0Adr%0Def%20g%22hq%27j%3Ckl%3E', - path: '/%09bc%0Adr%0Def%20g%22hq%27j%3Ckl%3E?mn%5Cop%5Eq=r%6099%7Bst%7Cuv%7Dwz', + path: '/%09bc%0Adr%0Def%20g%22hq%27j%3Ckl%3E?mn%5Cop%5Eq=r%6099%7Bst%7Cuv%7Dwz', // eslint-disable-line max-len search: '?mn%5Cop%5Eq=r%6099%7Bst%7Cuv%7Dwz', query: 'mn%5Cop%5Eq=r%6099%7Bst%7Cuv%7Dwz', href: 'http://a.b/%09bc%0Adr%0Def%20g%22hq%27j%3Ckl%3E?mn%5Cop%5Eq=r%6099%7Bst%7Cuv%7Dwz' From 39bba4dff80fa8c63c52818eff20714ae6659b4f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 17 Mar 2017 13:46:46 -0700 Subject: [PATCH 016/198] buffer: remove unneeded eslint-disable comment lib/buffer.js uses a function declaration for `Buffer`. So it never uses an instance of `Buffer` in the global scope. Therefore the disabling of the `require-buffer` custom rule is not needed. Remove the comment. PR-URL: https://github.com/nodejs/node/pull/11906 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Roman Reiss --- lib/buffer.js | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/buffer.js b/lib/buffer.js index 48eca73b53..415f37238d 100644 --- a/lib/buffer.js +++ b/lib/buffer.js @@ -19,7 +19,6 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. -/* eslint-disable require-buffer */ 'use strict'; const binding = process.binding('buffer'); From 5a71cb6d32c2e2b12cc5db9b7533fe42aba50c46 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Wed, 8 Mar 2017 13:39:57 +0100 Subject: [PATCH 017/198] test: add hasCrypto check to tls-socket-close Currently test-tls-socket-close will fail if node was built using --without-ssl. This commit adds a check to verify is crypto support exists and if not skip this test. PR-URL: https://github.com/nodejs/node/pull/11911 Reviewed-By: Ben Noordhuis Reviewed-By: Luigi Pinca Reviewed-By: Yuta Hiroto Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- test/parallel/test-tls-socket-close.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/parallel/test-tls-socket-close.js b/test/parallel/test-tls-socket-close.js index 440c0c4ff7..4e7382f340 100644 --- a/test/parallel/test-tls-socket-close.js +++ b/test/parallel/test-tls-socket-close.js @@ -1,5 +1,9 @@ 'use strict'; const common = require('../common'); +if (!common.hasCrypto) { + common.skip('missing crypto'); + return; +} const assert = require('assert'); const tls = require('tls'); From 3129ba2bae718b4b92d69ba55e64c136eccbb7a0 Mon Sep 17 00:00:00 2001 From: Lucas Lago Date: Fri, 17 Mar 2017 17:58:53 -0300 Subject: [PATCH 018/198] benchmark: remove v8ForceOptimization calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes common.v8ForceOptimization calls from url and vm benchmark files. PR-URL: https://github.com/nodejs/node/pull/11908 Fixes: https://github.com/nodejs/node/issues/11895 Reviewed-By: Timothy Gu Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Michaël Zasso --- benchmark/url/whatwg-url-idna.js | 2 -- benchmark/vm/run-in-context.js | 2 -- benchmark/vm/run-in-this-context.js | 1 - 3 files changed, 5 deletions(-) diff --git a/benchmark/url/whatwg-url-idna.js b/benchmark/url/whatwg-url-idna.js index 41b4c639de..3d0ea3dc8f 100644 --- a/benchmark/url/whatwg-url-idna.js +++ b/benchmark/url/whatwg-url-idna.js @@ -37,8 +37,6 @@ function main(conf) { const input = inputs[conf.input][to]; const method = to === 'ascii' ? domainToASCII : domainToUnicode; - common.v8ForceOptimization(method, input); - bench.start(); for (var i = 0; i < n; i++) { method(input); diff --git a/benchmark/vm/run-in-context.js b/benchmark/vm/run-in-context.js index 62ebe29146..d1d4b5a7ab 100644 --- a/benchmark/vm/run-in-context.js +++ b/benchmark/vm/run-in-context.js @@ -23,8 +23,6 @@ function main(conf) { const contextifiedSandbox = vm.createContext(); - common.v8ForceOptimization(vm.runInContext, - '0', contextifiedSandbox, options); bench.start(); for (; i < n; i++) vm.runInContext('0', contextifiedSandbox, options); diff --git a/benchmark/vm/run-in-this-context.js b/benchmark/vm/run-in-this-context.js index f66fd31a1a..f3a7e96928 100644 --- a/benchmark/vm/run-in-this-context.js +++ b/benchmark/vm/run-in-this-context.js @@ -21,7 +21,6 @@ function main(conf) { var i = 0; - common.v8ForceOptimization(vm.runInThisContext, '0', options); bench.start(); for (; i < n; i++) vm.runInThisContext('0', options); From ab2d49bcac31484c79426da835fd693ed1529c96 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Fri, 17 Mar 2017 20:03:06 +0200 Subject: [PATCH 019/198] benchmark: fix fs\bench-realpathSync.js Make it call-site-cwd-independent. PR-URL: https://github.com/nodejs/node/pull/11904 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- benchmark/fs/bench-realpathSync.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/benchmark/fs/bench-realpathSync.js b/benchmark/fs/bench-realpathSync.js index ae1c78d30d..bf1a38a746 100644 --- a/benchmark/fs/bench-realpathSync.js +++ b/benchmark/fs/bench-realpathSync.js @@ -3,6 +3,8 @@ const common = require('../common'); const fs = require('fs'); const path = require('path'); + +process.chdir(__dirname); const resolved_path = path.resolve(__dirname, '../../lib/'); const relative_path = path.relative(__dirname, '../../lib/'); From 7738cf22c28ac9d75e0f5a1f8001ad9d09f1f7e9 Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Wed, 8 Mar 2017 17:37:03 -0800 Subject: [PATCH 020/198] 2017-03-21, Version 4.8.1 'Argon' (LTS) Notable Changes: * buffer: - The performance of `.toJSON()` is now up to 2859% faster on average (Brian White) https://github.com/nodejs/node/pull/10895 * IPC: - Batched writes have been enabled for process IPC on platforms that support Unix Domain Sockets. (Alexey Orlenko) https://github.com/nodejs/node/pull/10677 - Performance gains may be up to 40% for some workloads. * http: - Control characters are now always rejected when using `http.request()`. (Ben Noordhuis) https://github.com/nodejs/node/pull/8923 * node: - Heap statistics now support values larger than 4GB. (Ben Noordhuis) https://github.com/nodejs/node/pull/10186 PR-URL: https://github.com/nodejs/node/pull/11760 --- CHANGELOG.md | 3 +- doc/changelogs/CHANGELOG_V4.md | 167 +++++++++++++++++++++++++++++++++ 2 files changed, 169 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 49d686356e..50bbe217ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,7 +84,8 @@ release. 5.0.0
-4.8.0
+4.8.1
+4.8.0
4.7.3
4.7.2
4.7.1
diff --git a/doc/changelogs/CHANGELOG_V4.md b/doc/changelogs/CHANGELOG_V4.md index 1548e6c37e..8408e2063a 100644 --- a/doc/changelogs/CHANGELOG_V4.md +++ b/doc/changelogs/CHANGELOG_V4.md @@ -7,6 +7,7 @@ +4.8.1
4.8.0
4.7.3
4.7.2
@@ -58,6 +59,172 @@ [Node.js Long Term Support Plan](https://github.com/nodejs/LTS) and will be supported actively until April 2017 and maintained until April 2018. + +## 2017-03-21, Version 4.8.1 'Argon' (LTS), @MylesBorins + +This LTS release comes with 147 commits. This includes 55 which are test related, +41 which are doc related, 11 which are build / tool related, +and 1 commits which are updates to dependencies. + +### Notable Changes + +* **buffer**: The performance of `.toJSON()` is now up to 2859% faster on average. (Brian White) [#10895](https://github.com/nodejs/node/pull/10895) +* **IPC**: Batched writes have been enabled for process IPC on platforms that support Unix Domain Sockets. (Alexey Orlenko) [#10677](https://github.com/nodejs/node/pull/10677) + - Performance gains may be up to 40% for some workloads. +* **http**: + - Control characters are now always rejected when using `http.request()`. (Ben Noordhuis) [#8923](https://github.com/nodejs/node/pull/8923) +* **node**: Heap statistics now support values larger than 4GB. (Ben Noordhuis) [#10186](https://github.com/nodejs/node/pull/10186) + +### Commits + +* [[`77f23ec5af`](https://github.com/nodejs/node/commit/77f23ec5af)] - **assert**: unlock the assert API (Rich Trott) [#11304](https://github.com/nodejs/node/pull/11304) +* [[`090037a41a`](https://github.com/nodejs/node/commit/090037a41a)] - **assert**: remove unneeded condition (Rich Trott) [#11314](https://github.com/nodejs/node/pull/11314) +* [[`75af859af7`](https://github.com/nodejs/node/commit/75af859af7)] - **assert**: apply minor refactoring (Rich Trott) [#11511](https://github.com/nodejs/node/pull/11511) +* [[`994f562858`](https://github.com/nodejs/node/commit/994f562858)] - **assert**: update comments (Kai Cataldo) [#10579](https://github.com/nodejs/node/pull/10579) +* [[`14e57c1102`](https://github.com/nodejs/node/commit/14e57c1102)] - **benchmark**: add more thorough timers benchmarks (Jeremiah Senkpiel) [#10925](https://github.com/nodejs/node/pull/10925) +* [[`850f85d96e`](https://github.com/nodejs/node/commit/850f85d96e)] - **benchmark**: add benchmark for object properties (Michaël Zasso) [#10949](https://github.com/nodejs/node/pull/10949) +* [[`626875f2e4`](https://github.com/nodejs/node/commit/626875f2e4)] - **benchmark**: don't lint autogenerated modules (Brian White) [#10756](https://github.com/nodejs/node/pull/10756) +* [[`9da6ebd73f`](https://github.com/nodejs/node/commit/9da6ebd73f)] - **benchmark**: add dgram bind(+/- params) benchmark (Vse Mozhet Byt) [#11313](https://github.com/nodejs/node/pull/11313) +* [[`a597c11ba4`](https://github.com/nodejs/node/commit/a597c11ba4)] - **benchmark**: improve readability of net benchmarks (Brian White) [#10446](https://github.com/nodejs/node/pull/10446) +* [[`22c25dee92`](https://github.com/nodejs/node/commit/22c25dee92)] - **buffer**: improve toJSON() performance (Brian White) [#10895](https://github.com/nodejs/node/pull/10895) +* [[`af3c21197d`](https://github.com/nodejs/node/commit/af3c21197d)] - **build**: move source files from headers section (Daniel Bevenius) [#10850](https://github.com/nodejs/node/pull/10850) +* [[`4bb61553f0`](https://github.com/nodejs/node/commit/4bb61553f0)] - **build**: disable C4267 conversion compiler warning (Ben Noordhuis) [#11205](https://github.com/nodejs/node/pull/11205) +* [[`6a45ac0ea9`](https://github.com/nodejs/node/commit/6a45ac0ea9)] - **build**: fix newlines in addon build output (Brian White) [#11466](https://github.com/nodejs/node/pull/11466) +* [[`bfc553d55d`](https://github.com/nodejs/node/commit/bfc553d55d)] - **build**: fail on CI if leftover processes (Rich Trott) [#11269](https://github.com/nodejs/node/pull/11269) +* [[`094bfe66aa`](https://github.com/nodejs/node/commit/094bfe66aa)] - **build**: fix node_g target (Daniel Bevenius) [#10153](https://github.com/nodejs/node/pull/10153) +* [[`87db4f7225`](https://github.com/nodejs/node/commit/87db4f7225)] - **build**: Don't regenerate node symlink (sxa555) [#9827](https://github.com/nodejs/node/pull/9827) +* [[`e0dc0ceb37`](https://github.com/nodejs/node/commit/e0dc0ceb37)] - **build**: don't squash signal handlers with --shared (Stewart X Addison) [#10539](https://github.com/nodejs/node/pull/10539) +* [[`4676eec382`](https://github.com/nodejs/node/commit/4676eec382)] - **child_process**: remove empty if condition (cjihrig) [#11427](https://github.com/nodejs/node/pull/11427) +* [[`2b867d2ae5`](https://github.com/nodejs/node/commit/2b867d2ae5)] - **child_process**: refactor internal/child_process.js (Arseniy Maximov) [#11366](https://github.com/nodejs/node/pull/11366) +* [[`c9a92ff494`](https://github.com/nodejs/node/commit/c9a92ff494)] - **crypto**: return the retval of HMAC_Update (Travis Meisenheimer) [#10891](https://github.com/nodejs/node/pull/10891) +* [[`9c53e402d7`](https://github.com/nodejs/node/commit/9c53e402d7)] - **crypto**: freelist_max_len is gone in OpenSSL 1.1.0 (Adam Langley) [#10859](https://github.com/nodejs/node/pull/10859) +* [[`c6f6b029a1`](https://github.com/nodejs/node/commit/c6f6b029a1)] - **crypto**: add cert check issued by StartCom/WoSign (Shigeki Ohtsu) [#9469](https://github.com/nodejs/node/pull/9469) +* [[`c56719f47a`](https://github.com/nodejs/node/commit/c56719f47a)] - **crypto**: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](https://github.com/nodejs/node/pull/9469) +* [[`b48f6ffc63`](https://github.com/nodejs/node/commit/b48f6ffc63)] - **crypto**: use CHECK_NE instead of ABORT or abort (Sam Roberts) [#10413](https://github.com/nodejs/node/pull/10413) +* [[`35a660ee70`](https://github.com/nodejs/node/commit/35a660ee70)] - **crypto**: fix handling of root_cert_store. (Adam Langley) [#9409](https://github.com/nodejs/node/pull/9409) +* [[`3516f35b77`](https://github.com/nodejs/node/commit/3516f35b77)] - **deps**: backport 7c3748a from upstream V8 (Cristian Cavalli) [#10873](https://github.com/nodejs/node/pull/10873) +* [[`f9e121ead8`](https://github.com/nodejs/node/commit/f9e121ead8)] - **dgram**: fix possibly deoptimizing use of arguments (Vse Mozhet Byt) +* [[`fc2bb2c8ef`](https://github.com/nodejs/node/commit/fc2bb2c8ef)] - **doc**: remove Chris Dickinson from active releasers (Ben Noordhuis) [#11011](https://github.com/nodejs/node/pull/11011) +* [[`725a89606b`](https://github.com/nodejs/node/commit/725a89606b)] - **doc**: remove duplicate properties bullet in readme (Javis Sullivan) [#10741](https://github.com/nodejs/node/pull/10741) +* [[`db03294c41`](https://github.com/nodejs/node/commit/db03294c41)] - **doc**: fix typo in http.md (Peter Mescalchin) [#10975](https://github.com/nodejs/node/pull/10975) +* [[`15188900b8`](https://github.com/nodejs/node/commit/15188900b8)] - **doc**: add who to CC list for dgram (cjihrig) [#11035](https://github.com/nodejs/node/pull/11035) +* [[`a0742902bd`](https://github.com/nodejs/node/commit/a0742902bd)] - **doc**: correct and complete dgram's Socket.bind docs (Alex Jordan) [#11025](https://github.com/nodejs/node/pull/11025) +* [[`f464dd837f`](https://github.com/nodejs/node/commit/f464dd837f)] - **doc**: edit CONTRIBUTING.md for clarity (Rich Trott) [#11045](https://github.com/nodejs/node/pull/11045) +* [[`07dfed8f45`](https://github.com/nodejs/node/commit/07dfed8f45)] - **doc**: fix confusing example in dns.md (Vse Mozhet Byt) [#11022](https://github.com/nodejs/node/pull/11022) +* [[`d55d760086`](https://github.com/nodejs/node/commit/d55d760086)] - **doc**: add personal pronouns option (Rich Trott) [#11089](https://github.com/nodejs/node/pull/11089) +* [[`b86843a463`](https://github.com/nodejs/node/commit/b86843a463)] - **doc**: clarify msg when doc/api/cli.md not updated (Stewart X Addison) [#10872](https://github.com/nodejs/node/pull/10872) +* [[`c2d70908e6`](https://github.com/nodejs/node/commit/c2d70908e6)] - **doc**: edit stability text for clarity and style (Rich Trott) [#11112](https://github.com/nodejs/node/pull/11112) +* [[`115448ec94`](https://github.com/nodejs/node/commit/115448ec94)] - **doc**: remove assertions about assert (Rich Trott) [#11113](https://github.com/nodejs/node/pull/11113) +* [[`e90317d739`](https://github.com/nodejs/node/commit/e90317d739)] - **doc**: fix "initial delay" link in http.md (Timo Tijhof) [#11108](https://github.com/nodejs/node/pull/11108) +* [[`788d736ab6`](https://github.com/nodejs/node/commit/788d736ab6)] - **doc**: typographical fixes in COLLABORATOR_GUIDE.md (Anna Henningsen) [#11163](https://github.com/nodejs/node/pull/11163) +* [[`2016aa4e07`](https://github.com/nodejs/node/commit/2016aa4e07)] - **doc**: add not-an-aardvark as ESLint contact (Rich Trott) [#11169](https://github.com/nodejs/node/pull/11169) +* [[`2b6ee39264`](https://github.com/nodejs/node/commit/2b6ee39264)] - **doc**: improve testing guide (Joyee Cheung) [#11150](https://github.com/nodejs/node/pull/11150) +* [[`aae768c599`](https://github.com/nodejs/node/commit/aae768c599)] - **doc**: remove extraneous paragraph from assert doc (Rich Trott) [#11174](https://github.com/nodejs/node/pull/11174) +* [[`ca4b2f6154`](https://github.com/nodejs/node/commit/ca4b2f6154)] - **doc**: fix typo in dgram doc (Rich Trott) [#11186](https://github.com/nodejs/node/pull/11186) +* [[`bb1e97c31a`](https://github.com/nodejs/node/commit/bb1e97c31a)] - **doc**: add and fix System Error properties (Daiki Arai) [#10986](https://github.com/nodejs/node/pull/10986) +* [[`e1e02efac5`](https://github.com/nodejs/node/commit/e1e02efac5)] - **doc**: clarify the behavior of Buffer.byteLength (Nikolai Vavilov) [#11238](https://github.com/nodejs/node/pull/11238) +* [[`30d9202f54`](https://github.com/nodejs/node/commit/30d9202f54)] - **doc**: improve consistency in documentation titles (Vse Mozhet Byt) [#11230](https://github.com/nodejs/node/pull/11230) +* [[`10afa8befc`](https://github.com/nodejs/node/commit/10afa8befc)] - **doc**: drop "and io.js" from release section (Ben Noordhuis) [#11054](https://github.com/nodejs/node/pull/11054) +* [[`6f1db35e27`](https://github.com/nodejs/node/commit/6f1db35e27)] - **doc**: update email and add personal pronoun (JungMinu) [#11318](https://github.com/nodejs/node/pull/11318) +* [[`61ac3346ba`](https://github.com/nodejs/node/commit/61ac3346ba)] - **doc**: update code examples in domain.md (Vse Mozhet Byt) [#11110](https://github.com/nodejs/node/pull/11110) +* [[`0c9ea4fe8b`](https://github.com/nodejs/node/commit/0c9ea4fe8b)] - **doc**: dns examples implied string args were arrays (Sam Roberts) [#11350](https://github.com/nodejs/node/pull/11350) +* [[`485ec6c180`](https://github.com/nodejs/node/commit/485ec6c180)] - **doc**: change STYLE-GUIDE to STYLE_GUIDE (Dean Coakley) [#11460](https://github.com/nodejs/node/pull/11460) +* [[`41bf266b0a`](https://github.com/nodejs/node/commit/41bf266b0a)] - **doc**: add STYLE_GUIDE (moved from nodejs/docs) (Gibson Fahnestock) [#11321](https://github.com/nodejs/node/pull/11321) +* [[`6abfcd560b`](https://github.com/nodejs/node/commit/6abfcd560b)] - **doc**: add comment for net.Server's error event (QianJin2013) [#11136](https://github.com/nodejs/node/pull/11136) +* [[`f4bc12dd11`](https://github.com/nodejs/node/commit/f4bc12dd11)] - **doc**: note message event listeners ref IPC channels (Diego Rodríguez Baquero) [#11494](https://github.com/nodejs/node/pull/11494) +* [[`09c9105a79`](https://github.com/nodejs/node/commit/09c9105a79)] - **doc**: argument types for assert methods (Amelia Clarke) [#11548](https://github.com/nodejs/node/pull/11548) +* [[`d622b67302`](https://github.com/nodejs/node/commit/d622b67302)] - **doc**: document clientRequest.aborted (Zach Bjornson) [#11544](https://github.com/nodejs/node/pull/11544) +* [[`d0dbf12884`](https://github.com/nodejs/node/commit/d0dbf12884)] - **doc**: update TheAlphaNerd to MylesBorins (Myles Borins) [#10586](https://github.com/nodejs/node/pull/10586) +* [[`05273c5a4e`](https://github.com/nodejs/node/commit/05273c5a4e)] - **doc**: update AUTHORS list to fix name (Noah Rose Ledesma) [#10945](https://github.com/nodejs/node/pull/10945) +* [[`79f700c891`](https://github.com/nodejs/node/commit/79f700c891)] - **doc**: add TimothyGu to collaborators (Timothy Gu) [#10954](https://github.com/nodejs/node/pull/10954) +* [[`e656a4244a`](https://github.com/nodejs/node/commit/e656a4244a)] - **doc**: add edsadr to collaborators (Adrian Estrada) [#10883](https://github.com/nodejs/node/pull/10883) +* [[`6d0e1621e5`](https://github.com/nodejs/node/commit/6d0e1621e5)] - **doc**: clarifying variables in fs.write() (Jessica Quynh Tran) [#9792](https://github.com/nodejs/node/pull/9792) +* [[`7287dddd69`](https://github.com/nodejs/node/commit/7287dddd69)] - **doc**: add links for zlib convenience methods (Anna Henningsen) [#10829](https://github.com/nodejs/node/pull/10829) +* [[`b10842ac77`](https://github.com/nodejs/node/commit/b10842ac77)] - **doc**: sort require statements in tests (Sam Roberts) [#10616](https://github.com/nodejs/node/pull/10616) +* [[`8f0e31b2d9`](https://github.com/nodejs/node/commit/8f0e31b2d9)] - **doc**: add test naming information to guide (Rich Trott) [#10584](https://github.com/nodejs/node/pull/10584) +* [[`56b779db93`](https://github.com/nodejs/node/commit/56b779db93)] - **doc**: "s/git apply/git am -3" in V8 guide (Myles Borins) [#10665](https://github.com/nodejs/node/pull/10665) +* [[`3be7a7adb5`](https://github.com/nodejs/node/commit/3be7a7adb5)] - **doc**: update LTS info for current releases (Evan Lucas) [#10720](https://github.com/nodejs/node/pull/10720) +* [[`530adfdb2a`](https://github.com/nodejs/node/commit/530adfdb2a)] - **doc**: improve rinfo object documentation (Matt Crummey) [#10050](https://github.com/nodejs/node/pull/10050) +* [[`48b5097ea8`](https://github.com/nodejs/node/commit/48b5097ea8)] - **http**: make request.abort() destroy the socket (Luigi Pinca) [#10818](https://github.com/nodejs/node/pull/10818) +* [[`15231aa6e5`](https://github.com/nodejs/node/commit/15231aa6e5)] - **http**: reject control characters in http.request() (Ben Noordhuis) [#8923](https://github.com/nodejs/node/pull/8923) +* [[`fc2cd63998`](https://github.com/nodejs/node/commit/fc2cd63998)] - **lib,src**: support values \> 4GB in heap statistics (Ben Noordhuis) [#10186](https://github.com/nodejs/node/pull/10186) +* [[`533d2bf0a9`](https://github.com/nodejs/node/commit/533d2bf0a9)] - **meta**: add explicit deprecation and semver-major policy (James M Snell) [#7964](https://github.com/nodejs/node/pull/7964) +* [[`923309adef`](https://github.com/nodejs/node/commit/923309adef)] - **meta**: remove Chris Dickinson from CTC (Chris Dickinson) [#11267](https://github.com/nodejs/node/pull/11267) +* [[`342c3e2bb4`](https://github.com/nodejs/node/commit/342c3e2bb4)] - **meta**: adding Italo A. Casas PGP Fingerprint (Italo A. Casas) [#11202](https://github.com/nodejs/node/pull/11202) +* [[`434b00be8a`](https://github.com/nodejs/node/commit/434b00be8a)] - **meta**: decharter the http working group (James M Snell) [#10604](https://github.com/nodejs/node/pull/10604) +* [[`a7df345921`](https://github.com/nodejs/node/commit/a7df345921)] - **net**: prefer === to == (Arseniy Maximov) [#11513](https://github.com/nodejs/node/pull/11513) +* [[`396688f075`](https://github.com/nodejs/node/commit/396688f075)] - **readline**: refactor construct Interface (Jackson Tian) [#4740](https://github.com/nodejs/node/pull/4740) +* [[`a40f8429e6`](https://github.com/nodejs/node/commit/a40f8429e6)] - **readline**: update 6 comparions to strict (Umair Ishaq) [#11078](https://github.com/nodejs/node/pull/11078) +* [[`90d8e118fb`](https://github.com/nodejs/node/commit/90d8e118fb)] - **src**: add a missing space in node_os.cc (Alexey Orlenko) [#10931](https://github.com/nodejs/node/pull/10931) +* [[`279cb09cc3`](https://github.com/nodejs/node/commit/279cb09cc3)] - **src**: enable writev for pipe handles on Unix (Alexey Orlenko) [#10677](https://github.com/nodejs/node/pull/10677) +* [[`a557d6ce1d`](https://github.com/nodejs/node/commit/a557d6ce1d)] - **src**: unconsume stream fix in internal http impl (Roee Kasher) [#11015](https://github.com/nodejs/node/pull/11015) +* [[`c4e1af712e`](https://github.com/nodejs/node/commit/c4e1af712e)] - **src**: remove unused typedef (Ben Noordhuis) [#11322](https://github.com/nodejs/node/pull/11322) +* [[`da2adb7133`](https://github.com/nodejs/node/commit/da2adb7133)] - **src**: update http-parser link (Daniel Bevenius) [#11477](https://github.com/nodejs/node/pull/11477) +* [[`2f48001574`](https://github.com/nodejs/node/commit/2f48001574)] - **src**: use ABORT() macro instead of abort() (Evan Lucas) [#9613](https://github.com/nodejs/node/pull/9613) +* [[`a9eb093ce3`](https://github.com/nodejs/node/commit/a9eb093ce3)] - **src**: fix memory leak introduced in 34febfbf4 (Ben Noordhuis) [#9604](https://github.com/nodejs/node/pull/9604) +* [[`f854d8c789`](https://github.com/nodejs/node/commit/f854d8c789)] - **test**: increase setMulticastLoopback() coverage (cjihrig) [#11277](https://github.com/nodejs/node/pull/11277) +* [[`1df09f9d37`](https://github.com/nodejs/node/commit/1df09f9d37)] - **test**: add known_issues test for #10223 (AnnaMag) [#11024](https://github.com/nodejs/node/pull/11024) +* [[`be34b629de`](https://github.com/nodejs/node/commit/be34b629de)] - **test**: increase coverage for stream's duplex (abouthiroppy) [#10963](https://github.com/nodejs/node/pull/10963) +* [[`dc24127e5c`](https://github.com/nodejs/node/commit/dc24127e5c)] - **test**: allow for slow hosts in spawnSync() test (Rich Trott) [#10998](https://github.com/nodejs/node/pull/10998) +* [[`2f4b6bda97`](https://github.com/nodejs/node/commit/2f4b6bda97)] - **test**: expand test coverage of fs.js (Vinícius do Carmo) [#10947](https://github.com/nodejs/node/pull/10947) +* [[`3f6a2dbc2f`](https://github.com/nodejs/node/commit/3f6a2dbc2f)] - **test**: enhance test-timers (Rich Trott) [#10960](https://github.com/nodejs/node/pull/10960) +* [[`6ca9901d8b`](https://github.com/nodejs/node/commit/6ca9901d8b)] - **test**: add process.assert's test (abouthiroppy) [#10911](https://github.com/nodejs/node/pull/10911) +* [[`d8af5a7431`](https://github.com/nodejs/node/commit/d8af5a7431)] - **test**: improve code in test-crypto-verify (Adrian Estrada) [#10845](https://github.com/nodejs/node/pull/10845) +* [[`4d1f7b1df8`](https://github.com/nodejs/node/commit/4d1f7b1df8)] - **test**: add dgram.Socket.prototype.bind's test (abouthiroppy) [#10894](https://github.com/nodejs/node/pull/10894) +* [[`6c1d82c68a`](https://github.com/nodejs/node/commit/6c1d82c68a)] - **test**: improving coverage for dgram (abouthiroppy) [#10783](https://github.com/nodejs/node/pull/10783) +* [[`017afd48fd`](https://github.com/nodejs/node/commit/017afd48fd)] - **test**: improve code in test-console-instance (Adrian Estrada) [#10813](https://github.com/nodejs/node/pull/10813) +* [[`1b1ba741c3`](https://github.com/nodejs/node/commit/1b1ba741c3)] - **test**: improve code in test-domain-multi (Adrian Estrada) [#10798](https://github.com/nodejs/node/pull/10798) +* [[`ee27917a65`](https://github.com/nodejs/node/commit/ee27917a65)] - **test**: improve test-stream2-large-read-stall (stefan judis) [#10725](https://github.com/nodejs/node/pull/10725) +* [[`9ac2316595`](https://github.com/nodejs/node/commit/9ac2316595)] - **test**: improve code in test-http-host-headers (Adrian Estrada) [#10830](https://github.com/nodejs/node/pull/10830) +* [[`a9278a063f`](https://github.com/nodejs/node/commit/a9278a063f)] - **test**: refactor cluster-preload.js (abouthiroppy) [#10701](https://github.com/nodejs/node/pull/10701) +* [[`db60d92e15`](https://github.com/nodejs/node/commit/db60d92e15)] - **test**: test hmac binding robustness (Sam Roberts) [#10923](https://github.com/nodejs/node/pull/10923) +* [[`a1a850f066`](https://github.com/nodejs/node/commit/a1a850f066)] - **test**: don't connect to :: (use localhost instead) (Gibson Fahnestock) +* [[`b3a8e95af3`](https://github.com/nodejs/node/commit/b3a8e95af3)] - **test**: improve test-assert (richnologies) [#10916](https://github.com/nodejs/node/pull/10916) +* [[`56970efe51`](https://github.com/nodejs/node/commit/56970efe51)] - **test**: increase coverage for punycode's decode (abouthiroppy) [#10940](https://github.com/nodejs/node/pull/10940) +* [[`df69c2148a`](https://github.com/nodejs/node/commit/df69c2148a)] - **test**: check fd 0,1,2 are used, not access mode (John Barboza) [#10339](https://github.com/nodejs/node/pull/10339) +* [[`7bceb4fb48`](https://github.com/nodejs/node/commit/7bceb4fb48)] - **test**: add message verification on assert.throws (Travis Meisenheimer) [#10890](https://github.com/nodejs/node/pull/10890) +* [[`1c223ecc70`](https://github.com/nodejs/node/commit/1c223ecc70)] - **test**: add http-common's test (abouthiroppy) [#10832](https://github.com/nodejs/node/pull/10832) +* [[`89e9da6b6d`](https://github.com/nodejs/node/commit/89e9da6b6d)] - **test**: tests for _readableStream.awaitDrain (Mark) [#8914](https://github.com/nodejs/node/pull/8914) +* [[`53b0f413cd`](https://github.com/nodejs/node/commit/53b0f413cd)] - **test**: improve the code in test-process-cpuUsage (Adrian Estrada) [#10714](https://github.com/nodejs/node/pull/10714) +* [[`b3d1700d1f`](https://github.com/nodejs/node/commit/b3d1700d1f)] - **test**: improve tests in pummel/test-exec (Chase Starr) [#10757](https://github.com/nodejs/node/pull/10757) +* [[`6e7dfb1f45`](https://github.com/nodejs/node/commit/6e7dfb1f45)] - **test**: fix temp-dir option in tools/test.py (Gibson Fahnestock) [#10723](https://github.com/nodejs/node/pull/10723) +* [[`9abde3ac6e`](https://github.com/nodejs/node/commit/9abde3ac6e)] - **test**: use realpath for NODE_TEST_DIR in common.js (Gibson Fahnestock) [#10723](https://github.com/nodejs/node/pull/10723) +* [[`f86c64a13a`](https://github.com/nodejs/node/commit/f86c64a13a)] - **test**: refactor the code of test-keep-alive.js (sivaprasanna) [#10684](https://github.com/nodejs/node/pull/10684) +* [[`4d51db87dc`](https://github.com/nodejs/node/commit/4d51db87dc)] - **test**: refactor test-doctool-html.js (abouthiroppy) [#10696](https://github.com/nodejs/node/pull/10696) +* [[`ab65429e44`](https://github.com/nodejs/node/commit/ab65429e44)] - **test**: refactor test-watch-file.js (sivaprasanna) [#10679](https://github.com/nodejs/node/pull/10679) +* [[`4453c0c1dc`](https://github.com/nodejs/node/commit/4453c0c1dc)] - **test**: refactor the code in test-child-process-spawn-loop.js (sivaprasanna) [#10605](https://github.com/nodejs/node/pull/10605) +* [[`42b86ea968`](https://github.com/nodejs/node/commit/42b86ea968)] - **test**: improve test-http-chunked-304 (Adrian Estrada) [#10462](https://github.com/nodejs/node/pull/10462) +* [[`1ae95e64ee`](https://github.com/nodejs/node/commit/1ae95e64ee)] - **test**: improve test-fs-readfile-zero-byte-liar (Adrian Estrada) [#10570](https://github.com/nodejs/node/pull/10570) +* [[`3f3c78d785`](https://github.com/nodejs/node/commit/3f3c78d785)] - **test**: refactor test-fs-utimes (Junshu Okamoto) [#9290](https://github.com/nodejs/node/pull/9290) +* [[`50a868b3f7`](https://github.com/nodejs/node/commit/50a868b3f7)] - **test**: require handler to be run in sigwinch test (Rich Trott) [#11068](https://github.com/nodejs/node/pull/11068) +* [[`c1f45ec2d0`](https://github.com/nodejs/node/commit/c1f45ec2d0)] - **test**: add 2nd argument to throws in test-assert (Marlena Compton) [#11061](https://github.com/nodejs/node/pull/11061) +* [[`f24aa7e071`](https://github.com/nodejs/node/commit/f24aa7e071)] - **test**: improve error messages in test-npm-install (Gonen Dukas) [#11027](https://github.com/nodejs/node/pull/11027) +* [[`1db89d4009`](https://github.com/nodejs/node/commit/1db89d4009)] - **test**: improve coverage on removeListeners functions (matsuda-koushi) [#11140](https://github.com/nodejs/node/pull/11140) +* [[`c532c16e53`](https://github.com/nodejs/node/commit/c532c16e53)] - **test**: increase specificity in dgram test (Rich Trott) [#11187](https://github.com/nodejs/node/pull/11187) +* [[`cb81ae8eea`](https://github.com/nodejs/node/commit/cb81ae8eea)] - **test**: add vm module edge cases (Franziska Hinkelmann) [#11265](https://github.com/nodejs/node/pull/11265) +* [[`8629c956c3`](https://github.com/nodejs/node/commit/8629c956c3)] - **test**: improve punycode test coverage (Sebastian Van Sande) [#11144](https://github.com/nodejs/node/pull/11144) +* [[`caf1ba15f9`](https://github.com/nodejs/node/commit/caf1ba15f9)] - **test**: add coverage for dgram _createSocketHandle() (cjihrig) [#11291](https://github.com/nodejs/node/pull/11291) +* [[`d729e52ef3`](https://github.com/nodejs/node/commit/d729e52ef3)] - **test**: improve crypto coverage (Akito Ito) [#11280](https://github.com/nodejs/node/pull/11280) +* [[`d1a8588cab`](https://github.com/nodejs/node/commit/d1a8588cab)] - **test**: improve message in net-connect-local-error (Rich Trott) [#11393](https://github.com/nodejs/node/pull/11393) +* [[`f2fb4143b4`](https://github.com/nodejs/node/commit/f2fb4143b4)] - **test**: refactor test-dgram-membership (Rich Trott) [#11388](https://github.com/nodejs/node/pull/11388) +* [[`bf4703d66f`](https://github.com/nodejs/node/commit/bf4703d66f)] - **test**: remove unused args and comparison fix (Alexander) [#11396](https://github.com/nodejs/node/pull/11396) +* [[`28471c23ff`](https://github.com/nodejs/node/commit/28471c23ff)] - **test**: refactor test-http-response-splitting (Arseniy Maximov) [#11429](https://github.com/nodejs/node/pull/11429) +* [[`cd3e17e248`](https://github.com/nodejs/node/commit/cd3e17e248)] - **test**: improve coverage in test-crypto.dh (Eric Christie) [#11253](https://github.com/nodejs/node/pull/11253) +* [[`fa681ea55a`](https://github.com/nodejs/node/commit/fa681ea55a)] - **test**: add regex check to test-module-loading (Tarang Hirani) [#11413](https://github.com/nodejs/node/pull/11413) +* [[`f0eee61a93`](https://github.com/nodejs/node/commit/f0eee61a93)] - **test**: throw check in test-zlib-write-after-close (Jason Wilson) [#11482](https://github.com/nodejs/node/pull/11482) +* [[`f0c7c7fad4`](https://github.com/nodejs/node/commit/f0c7c7fad4)] - **test**: fix flaky test-vm-timeout-rethrow (Kunal Pathak) [#11530](https://github.com/nodejs/node/pull/11530) +* [[`53f2848dc8`](https://github.com/nodejs/node/commit/53f2848dc8)] - **test**: favor assertions over console logging (Rich Trott) [#11547](https://github.com/nodejs/node/pull/11547) +* [[`0109321fd8`](https://github.com/nodejs/node/commit/0109321fd8)] - **test**: refactor test-https-truncate (Rich Trott) [#10225](https://github.com/nodejs/node/pull/10225) +* [[`536733697c`](https://github.com/nodejs/node/commit/536733697c)] - **test**: simplify test-http-client-unescaped-path (Rod Vagg) [#9649](https://github.com/nodejs/node/pull/9649) +* [[`4ce9bfb4e7`](https://github.com/nodejs/node/commit/4ce9bfb4e7)] - **test**: exclude pseudo-tty test pertinent to #11541 (Gireesh Punathil) [#11602](https://github.com/nodejs/node/pull/11602) +* [[`53dd1a8539`](https://github.com/nodejs/node/commit/53dd1a8539)] - **tls**: do not crash on STARTTLS when OCSP requested (Fedor Indutny) [#10706](https://github.com/nodejs/node/pull/10706) +* [[`e607ff52fa`](https://github.com/nodejs/node/commit/e607ff52fa)] - **tools**: rename eslintrc to an undeprecated format (Sakthipriyan Vairamani) [#7699](https://github.com/nodejs/node/pull/7699) +* [[`6648b729b7`](https://github.com/nodejs/node/commit/6648b729b7)] - **tools**: add compile_commands.json gyp generator (Ben Noordhuis) [#7986](https://github.com/nodejs/node/pull/7986) +* [[`8f49962f47`](https://github.com/nodejs/node/commit/8f49962f47)] - **tools**: suggest python2 command in configure (Roman Reiss) [#11375](https://github.com/nodejs/node/pull/11375) +* [[`4b83a83c06`](https://github.com/nodejs/node/commit/4b83a83c06)] - **tools,doc**: add Google Analytics tracking. (Phillip Johnsen) [#6601](https://github.com/nodejs/node/pull/6601) +* [[`ef63af6006`](https://github.com/nodejs/node/commit/ef63af6006)] - **tty**: avoid oob warning in TTYWrap::GetWindowSize() (Dmitry Tsvettsikh) [#11454](https://github.com/nodejs/node/pull/11454) +* [[`2c84601062`](https://github.com/nodejs/node/commit/2c84601062)] - **util**: don't init Debug if it's not needed yet (Bryan English) [#8452](https://github.com/nodejs/node/pull/8452) + ## 2017-02-21, Version 4.8.0 'Argon' (LTS), @MylesBorins From 2569c909bae0699e62d99bf1488e09e874a647a8 Mon Sep 17 00:00:00 2001 From: Myles Borins Date: Wed, 8 Mar 2017 17:19:12 -0800 Subject: [PATCH 021/198] 2017-03-21, Version 6.10.1 'Boron' (LTS) Notable changes * performance: The performance of several APIs has been improved. - `Buffer.compare()` is up to 35% faster on average. (Brian White) https://github.com/nodejs/node/pull/10927 - `buffer.toJSON()` is up to 2859% faster on average. (Brian White) https://github.com/nodejs/node/pull/10895 - `fs.*statSync()` functions are now up to 9.3% faster on average. (Brian White) https://github.com/nodejs/node/pull/11522 - `os.loadavg` is up to 151% faster. (Brian White) https://github.com/nodejs/node/pull/11516 - `process.memoryUsage()` is up to 34% faster. (Brian White) https://github.com/nodejs/node/pull/11497 - `querystring.unescape()` for `Buffer`s is 15% faster on average. (Brian White) https://github.com/nodejs/node/pull/10837 - `querystring.stringify()` is up to 7.8% faster on average. (Brian White) https://github.com/nodejs/node/pull/10852 - `querystring.parse()` is up to 21% faster on average. (Brian White) https://github.com/nodejs/node/pull/10874 * IPC: - Batched writes have been enabled for process IPC on platforms that support Unix Domain Sockets. (Alexey Orlenko) https://github.com/nodejs/node/pull/10677 - Performance gains may be up to 40% for some workloads. * child_process: - `spawnSync` now returns a null `status` when child is terminated by a signal. (cjihrig) https://github.com/nodejs/node/pull/11288 - This fixes the behavior to act like `spawn()` does. * http: - Control characters are now always rejected when using `http.request()`. (Ben Noordhuis) https://github.com/nodejs/node/pull/8923 - Debug messages have been added for cases when headers contain invalid values. (Evan Lucas) https://github.com/nodejs/node/pull/9195 * node: - Heap statistics now support values larger than 4GB. (Ben Noordhuis) https://github.com/nodejs/node/pull/10186 * timers: - Timer callbacks now always maintain order when interacting with domain error handling. (John Barboza) https://github.com/nodejs/node/pull/10522 PR-URL: https://github.com/nodejs/node/pull/11759 --- CHANGELOG.md | 3 +- doc/changelogs/CHANGELOG_V6.md | 328 +++++++++++++++++++++++++++++++++ 2 files changed, 330 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50bbe217ed..f410890014 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,7 +42,8 @@ release. 7.0.0
-6.10.0
+6.10.1
+6.10.0
6.9.5
6.9.4
6.9.3
diff --git a/doc/changelogs/CHANGELOG_V6.md b/doc/changelogs/CHANGELOG_V6.md index b355732983..ab2ab616d3 100644 --- a/doc/changelogs/CHANGELOG_V6.md +++ b/doc/changelogs/CHANGELOG_V6.md @@ -7,6 +7,7 @@ +6.10.1
6.10.0
6.9.5
6.9.4
@@ -46,6 +47,333 @@ [Node.js Long Term Support Plan](https://github.com/nodejs/LTS) and will be supported actively until April 2018 and maintained until April 2019. + +## 2017-03-21, Version 6.10.1 'Boron' (LTS), @MylesBorins + +This LTS release comes with 297 commits. This includes 124 which are test related, +79 which are doc related, 16 which are build / tool related and 4 commits which are updates to dependencies. + +### Notable changes + +* **performance**: The performance of several APIs has been improved. + - `Buffer.compare()` is up to 35% faster on average. (Brian White) [#10927](https://github.com/nodejs/node/pull/10927) + - `buffer.toJSON()` is up to 2859% faster on average. (Brian White) [#10895](https://github.com/nodejs/node/pull/10895) + - `fs.*statSync()` functions are now up to 9.3% faster on average. (Brian White) [#11522](https://github.com/nodejs/node/pull/11522) + - `os.loadavg` is up to 151% faster. (Brian White) [#11516](https://github.com/nodejs/node/pull/11516) + - `process.memoryUsage()` is up to 34% faster. (Brian White) [#11497](https://github.com/nodejs/node/pull/11497) + - `querystring.unescape()` for `Buffer`s is 15% faster on average. (Brian White) [#10837](https://github.com/nodejs/node/pull/10837) + - `querystring.stringify()` is up to 7.8% faster on average. (Brian White) [#10852](https://github.com/nodejs/node/pull/10852) + - `querystring.parse()` is up to 21% faster on average. (Brian White) [#10874](https://github.com/nodejs/node/pull/10874) +* **IPC**: Batched writes have been enabled for process IPC on platforms that support Unix Domain Sockets. (Alexey Orlenko) [#10677](https://github.com/nodejs/node/pull/10677) + - Performance gains may be up to 40% for some workloads. +* **child_process**: `spawnSync` now returns a null `status` when child is terminated by a signal. (cjihrig) [#11288](https://github.com/nodejs/node/pull/11288) + - This fixes the behavior to act like `spawn()` does. +* **http**: + - Control characters are now always rejected when using `http.request()`. (Ben Noordhuis) [#8923](https://github.com/nodejs/node/pull/8923) + - Debug messages have been added for cases when headers contain invalid values. (Evan Lucas) [#9195](https://github.com/nodejs/node/pull/9195) +* **node**: Heap statistics now support values larger than 4GB. (Ben Noordhuis) [#10186](https://github.com/nodejs/node/pull/10186) +* **timers**: Timer callbacks now always maintain order when interacting with domain error handling. (John Barboza) [#10522](https://github.com/nodejs/node/pull/10522) + +### Commits + +* [[`fb75bed078`](https://github.com/nodejs/node/commit/fb75bed078)] - **assert**: unlock the assert API (Rich Trott) [#11304](https://github.com/nodejs/node/pull/11304) +* [[`32b264c33b`](https://github.com/nodejs/node/commit/32b264c33b)] - **assert**: remove unneeded condition (Rich Trott) [#11314](https://github.com/nodejs/node/pull/11314) +* [[`a0c705ef79`](https://github.com/nodejs/node/commit/a0c705ef79)] - **assert**: apply minor refactoring (Rich Trott) [#11511](https://github.com/nodejs/node/pull/11511) +* [[`7ecfe4971a`](https://github.com/nodejs/node/commit/7ecfe4971a)] - **assert**: update comments (Kai Cataldo) [#10579](https://github.com/nodejs/node/pull/10579) +* [[`4d6fa8d040`](https://github.com/nodejs/node/commit/4d6fa8d040)] - **benchmark**: add more thorough timers benchmarks (Jeremiah Senkpiel) [#10925](https://github.com/nodejs/node/pull/10925) +* [[`406e623b13`](https://github.com/nodejs/node/commit/406e623b13)] - **benchmark**: add benchmark for object properties (Michaël Zasso) [#10949](https://github.com/nodejs/node/pull/10949) +* [[`7ee04c6015`](https://github.com/nodejs/node/commit/7ee04c6015)] - **benchmark**: don't lint autogenerated modules (Brian White) [#10756](https://github.com/nodejs/node/pull/10756) +* [[`d22d7cce7c`](https://github.com/nodejs/node/commit/d22d7cce7c)] - **benchmark**: move punycode benchmark out of net (Brian White) [#10446](https://github.com/nodejs/node/pull/10446) +* [[`6b361611c3`](https://github.com/nodejs/node/commit/6b361611c3)] - **benchmark**: move setImmediate benchmarks to timers (Joshua Colvin) [#11010](https://github.com/nodejs/node/pull/11010) +* [[`a469ce5826`](https://github.com/nodejs/node/commit/a469ce5826)] - **benchmark**: add assert.deep\[Strict\]Equal benchmarks (Joyee Cheung) [#11092](https://github.com/nodejs/node/pull/11092) +* [[`eca1e80722`](https://github.com/nodejs/node/commit/eca1e80722)] - **benchmark**: add dgram bind(+/- params) benchmark (Vse Mozhet Byt) [#11313](https://github.com/nodejs/node/pull/11313) +* [[`06c339dcce`](https://github.com/nodejs/node/commit/06c339dcce)] - **benchmark**: improve readability of net benchmarks (Brian White) [#10446](https://github.com/nodejs/node/pull/10446) +* [[`b4cf8c4036`](https://github.com/nodejs/node/commit/b4cf8c4036)] - **benchmark,lib,test**: adjust for linting (Rich Trott) [#10561](https://github.com/nodejs/node/pull/10561) +* [[`e397e6f94a`](https://github.com/nodejs/node/commit/e397e6f94a)] - **buffer**: improve compare() performance (Brian White) [#10927](https://github.com/nodejs/node/pull/10927) +* [[`2b52859535`](https://github.com/nodejs/node/commit/2b52859535)] - **buffer**: fix comments in bidirectionalIndexOf (dcposch@dcpos.ch) [#10162](https://github.com/nodejs/node/pull/10162) +* [[`f7879d98f8`](https://github.com/nodejs/node/commit/f7879d98f8)] - **buffer**: improve toJSON() performance (Brian White) [#10895](https://github.com/nodejs/node/pull/10895) +* [[`f83d035c50`](https://github.com/nodejs/node/commit/f83d035c50)] - **buffer**: convert offset & length to int properly (Sakthipriyan Vairamani (thefourtheye)) [#11176](https://github.com/nodejs/node/pull/11176) +* [[`cda593774f`](https://github.com/nodejs/node/commit/cda593774f)] - **build**: sort sources alphabetically (Daniel Bevenius) [#10892](https://github.com/nodejs/node/pull/10892) +* [[`2d31fd8bf7`](https://github.com/nodejs/node/commit/2d31fd8bf7)] - **build**: move source files from headers section (Daniel Bevenius) [#10850](https://github.com/nodejs/node/pull/10850) +* [[`b7c5295437`](https://github.com/nodejs/node/commit/b7c5295437)] - **build**: don't squash signal handlers with --shared (Stewart X Addison) [#10539](https://github.com/nodejs/node/pull/10539) +* [[`6772b1d81c`](https://github.com/nodejs/node/commit/6772b1d81c)] - **build**: disable C4267 conversion compiler warning (Ben Noordhuis) [#11205](https://github.com/nodejs/node/pull/11205) +* [[`93416e9b7a`](https://github.com/nodejs/node/commit/93416e9b7a)] - **build**: fix newlines in addon build output (Brian White) [#11466](https://github.com/nodejs/node/pull/11466) +* [[`2d5cb3b870`](https://github.com/nodejs/node/commit/2d5cb3b870)] - **build**: fail on CI if leftover processes (Rich Trott) [#11269](https://github.com/nodejs/node/pull/11269) +* [[`edcca78f10`](https://github.com/nodejs/node/commit/edcca78f10)] - **build**: add rule to clean addon tests build (Joyee Cheung) [#11519](https://github.com/nodejs/node/pull/11519) +* [[`0200a5a74e`](https://github.com/nodejs/node/commit/0200a5a74e)] - **build**: fix node_g target (Daniel Bevenius) [#10153](https://github.com/nodejs/node/pull/10153) +* [[`f44c0a5d7a`](https://github.com/nodejs/node/commit/f44c0a5d7a)] - **build**: Don't regenerate node symlink (sxa555) [#9827](https://github.com/nodejs/node/pull/9827) +* [[`947d07bd87`](https://github.com/nodejs/node/commit/947d07bd87)] - **child_process**: exit spawnSync with null on signal (cjihrig) [#11288](https://github.com/nodejs/node/pull/11288) +* [[`4179c7050f`](https://github.com/nodejs/node/commit/4179c7050f)] - **child_process**: move anonymous class to top level (Jackson Tian) [#11147](https://github.com/nodejs/node/pull/11147) +* [[`818cef848e`](https://github.com/nodejs/node/commit/818cef848e)] - **child_process**: remove empty if condition (cjihrig) [#11427](https://github.com/nodejs/node/pull/11427) +* [[`c371fdcf34`](https://github.com/nodejs/node/commit/c371fdcf34)] - **child_process**: refactor internal/child_process.js (Arseniy Maximov) [#11366](https://github.com/nodejs/node/pull/11366) +* [[`b662c117cb`](https://github.com/nodejs/node/commit/b662c117cb)] - **crypto**: return the retval of HMAC_Update (Travis Meisenheimer) [#10891](https://github.com/nodejs/node/pull/10891) +* [[`44510197dd`](https://github.com/nodejs/node/commit/44510197dd)] - **crypto**: freelist_max_len is gone in OpenSSL 1.1.0 (Adam Langley) [#10859](https://github.com/nodejs/node/pull/10859) +* [[`34614af53b`](https://github.com/nodejs/node/commit/34614af53b)] - **crypto**: add cert check issued by StartCom/WoSign (Shigeki Ohtsu) [#9469](https://github.com/nodejs/node/pull/9469) +* [[`b4b3bb4c5d`](https://github.com/nodejs/node/commit/b4b3bb4c5d)] - **crypto**: Remove expired certs from CNNIC whitelist (Shigeki Ohtsu) [#9469](https://github.com/nodejs/node/pull/9469) +* [[`1f44922e34`](https://github.com/nodejs/node/commit/1f44922e34)] - **crypto**: use CHECK_NE instead of ABORT or abort (Sam Roberts) [#10413](https://github.com/nodejs/node/pull/10413) +* [[`ccb6045f2d`](https://github.com/nodejs/node/commit/ccb6045f2d)] - **crypto,tls**: fix mutability of return values (Rich Trott) [#10795](https://github.com/nodejs/node/pull/10795) +* [[`3ab070d4e1`](https://github.com/nodejs/node/commit/3ab070d4e1)] - **deps**: backport dfb8d33 from V8 upstream (Michaël Zasso) [#11483](https://github.com/nodejs/node/pull/11483) +* [[`3fc6a2247f`](https://github.com/nodejs/node/commit/3fc6a2247f)] - **deps**: cherry-pick a814b8a from upstream V8 (ishell@chromium.org) [#10733](https://github.com/nodejs/node/pull/10733) +* [[`254cb1cb77`](https://github.com/nodejs/node/commit/254cb1cb77)] - **deps**: back-port 73ee7943 from v8 upstream (Ben Noordhuis) [#9293](https://github.com/nodejs/node/pull/9293) +* [[`e774de1685`](https://github.com/nodejs/node/commit/e774de1685)] - **deps**: back-port 306c412c from v8 upstream (Ben Noordhuis) [#9293](https://github.com/nodejs/node/pull/9293) +* [[`e5d1e273d7`](https://github.com/nodejs/node/commit/e5d1e273d7)] - **dgram**: fix possibly deoptimizing use of arguments (Vse Mozhet Byt) [#11242](https://github.com/nodejs/node/pull/11242) +* [[`c7257e716f`](https://github.com/nodejs/node/commit/c7257e716f)] - **dgram**: remove this aliases (cjihrig) [#11243](https://github.com/nodejs/node/pull/11243) +* [[`227cc1e810`](https://github.com/nodejs/node/commit/227cc1e810)] - **doc**: restrict the ES.Next features usage in tests (DavidCai) [#11452](https://github.com/nodejs/node/pull/11452) +* [[`23246768fb`](https://github.com/nodejs/node/commit/23246768fb)] - **doc**: add missing entry in v6 changelog table (Luigi Pinca) [#11534](https://github.com/nodejs/node/pull/11534) +* [[`ff9a86a73e`](https://github.com/nodejs/node/commit/ff9a86a73e)] - **doc**: remove Chris Dickinson from active releasers (Ben Noordhuis) [#11011](https://github.com/nodejs/node/pull/11011) +* [[`313d1a3009`](https://github.com/nodejs/node/commit/313d1a3009)] - **doc**: for style, remove "isn't" contraction (Sam Roberts) [#10981](https://github.com/nodejs/node/pull/10981) +* [[`ab7587ed6c`](https://github.com/nodejs/node/commit/ab7587ed6c)] - **doc**: update http.md for consistency and clarity (Lance Ball) [#10715](https://github.com/nodejs/node/pull/10715) +* [[`21a94ab78c`](https://github.com/nodejs/node/commit/21a94ab78c)] - **doc**: clarify Buffer.indexOf/lastIndexOf edge cases (dcposch@dcpos.ch) [#10162](https://github.com/nodejs/node/pull/10162) +* [[`8c487de736`](https://github.com/nodejs/node/commit/8c487de736)] - **doc**: document argument variant in the repl.md (Vse Mozhet Byt) [#10221](https://github.com/nodejs/node/pull/10221) +* [[`130710476b`](https://github.com/nodejs/node/commit/130710476b)] - **doc**: DEFAULT_ECDH_CURVE was added in 0.11.13 (Sam Roberts) [#10983](https://github.com/nodejs/node/pull/10983) +* [[`5118e05b15`](https://github.com/nodejs/node/commit/5118e05b15)] - **doc**: HTTP response getHeader doc fix (Faiz Halde) [#10817](https://github.com/nodejs/node/pull/10817) +* [[`243652abbe`](https://github.com/nodejs/node/commit/243652abbe)] - **doc**: remove duplicate properties bullet in readme (Javis Sullivan) [#10741](https://github.com/nodejs/node/pull/10741) +* [[`fa8a394e51`](https://github.com/nodejs/node/commit/fa8a394e51)] - **doc**: specify sorted requires in tests (Sam Roberts) [#10716](https://github.com/nodejs/node/pull/10716) +* [[`1660311056`](https://github.com/nodejs/node/commit/1660311056)] - **doc**: fix typo in http.md (Peter Mescalchin) [#10975](https://github.com/nodejs/node/pull/10975) +* [[`8936814a70`](https://github.com/nodejs/node/commit/8936814a70)] - **doc**: add who to CC list for dgram (cjihrig) [#11035](https://github.com/nodejs/node/pull/11035) +* [[`b934058128`](https://github.com/nodejs/node/commit/b934058128)] - **doc**: correct and complete dgram's Socket.bind docs (Alex Jordan) [#11025](https://github.com/nodejs/node/pull/11025) +* [[`faa55fbe09`](https://github.com/nodejs/node/commit/faa55fbe09)] - **doc**: edit CONTRIBUTING.md for clarity (Rich Trott) [#11045](https://github.com/nodejs/node/pull/11045) +* [[`c26258e1fd`](https://github.com/nodejs/node/commit/c26258e1fd)] - **doc**: fix confusing example in dns.md (Vse Mozhet Byt) [#11022](https://github.com/nodejs/node/pull/11022) +* [[`8bf7f9f202`](https://github.com/nodejs/node/commit/8bf7f9f202)] - **doc**: add personal pronouns option (Rich Trott) [#11089](https://github.com/nodejs/node/pull/11089) +* [[`7c22a52a74`](https://github.com/nodejs/node/commit/7c22a52a74)] - **doc**: clarify msg when doc/api/cli.md not updated (Stewart X Addison) [#10872](https://github.com/nodejs/node/pull/10872) +* [[`d404d8b673`](https://github.com/nodejs/node/commit/d404d8b673)] - **doc**: edit stability text for clarity and style (Rich Trott) [#11112](https://github.com/nodejs/node/pull/11112) +* [[`38938e1ba9`](https://github.com/nodejs/node/commit/38938e1ba9)] - **doc**: remove assertions about assert (Rich Trott) [#11113](https://github.com/nodejs/node/pull/11113) +* [[`89d30908f2`](https://github.com/nodejs/node/commit/89d30908f2)] - **doc**: fix "initial delay" link in http.md (Timo Tijhof) [#11108](https://github.com/nodejs/node/pull/11108) +* [[`c0072f8d71`](https://github.com/nodejs/node/commit/c0072f8d71)] - **doc**: typographical fixes in COLLABORATOR_GUIDE.md (Anna Henningsen) [#11163](https://github.com/nodejs/node/pull/11163) +* [[`207142d050`](https://github.com/nodejs/node/commit/207142d050)] - **doc**: add not-an-aardvark as ESLint contact (Rich Trott) [#11169](https://github.com/nodejs/node/pull/11169) +* [[`3746eee19d`](https://github.com/nodejs/node/commit/3746eee19d)] - **doc**: improve testing guide (Joyee Cheung) [#11150](https://github.com/nodejs/node/pull/11150) +* [[`6cadc7160f`](https://github.com/nodejs/node/commit/6cadc7160f)] - **doc**: remove extraneous paragraph from assert doc (Rich Trott) [#11174](https://github.com/nodejs/node/pull/11174) +* [[`d5d8a8d7b5`](https://github.com/nodejs/node/commit/d5d8a8d7b5)] - **doc**: fix typo in dgram doc (Rich Trott) [#11186](https://github.com/nodejs/node/pull/11186) +* [[`59a1d00906`](https://github.com/nodejs/node/commit/59a1d00906)] - **doc**: add and fix System Error properties (Daiki Arai) [#10986](https://github.com/nodejs/node/pull/10986) +* [[`72adba4317`](https://github.com/nodejs/node/commit/72adba4317)] - **doc**: add links between cork() and uncork() (Matteo Collina) [#11222](https://github.com/nodejs/node/pull/11222) +* [[`1cd526c253`](https://github.com/nodejs/node/commit/1cd526c253)] - **doc**: clarify the behavior of Buffer.byteLength (Nikolai Vavilov) [#11238](https://github.com/nodejs/node/pull/11238) +* [[`b1bda165ce`](https://github.com/nodejs/node/commit/b1bda165ce)] - **doc**: edit maxBuffer/Unicode paragraph for clarity (Rich Trott) [#11228](https://github.com/nodejs/node/pull/11228) +* [[`1150af00f7`](https://github.com/nodejs/node/commit/1150af00f7)] - **doc**: improve consistency in documentation titles (Vse Mozhet Byt) [#11230](https://github.com/nodejs/node/pull/11230) +* [[`ade39cdf9c`](https://github.com/nodejs/node/commit/ade39cdf9c)] - **doc**: drop "and io.js" from release section (Ben Noordhuis) [#11054](https://github.com/nodejs/node/pull/11054) +* [[`c79d9f95d1`](https://github.com/nodejs/node/commit/c79d9f95d1)] - **doc**: update email and add personal pronoun (JungMinu) [#11318](https://github.com/nodejs/node/pull/11318) +* [[`7df4ee8d49`](https://github.com/nodejs/node/commit/7df4ee8d49)] - **doc**: update link to V8 Embedder's guide (Franziska Hinkelmann) [#11336](https://github.com/nodejs/node/pull/11336) +* [[`8468d823a8`](https://github.com/nodejs/node/commit/8468d823a8)] - **doc**: update code examples in domain.md (Vse Mozhet Byt) [#11110](https://github.com/nodejs/node/pull/11110) +* [[`10a497cdcb`](https://github.com/nodejs/node/commit/10a497cdcb)] - **doc**: describe when stdout/err is sync (Sam Roberts) [#10884](https://github.com/nodejs/node/pull/10884) +* [[`53d5002ef9`](https://github.com/nodejs/node/commit/53d5002ef9)] - **doc**: dns examples implied string args were arrays (Sam Roberts) [#11350](https://github.com/nodejs/node/pull/11350) +* [[`42304de4f7`](https://github.com/nodejs/node/commit/42304de4f7)] - **doc**: change STYLE-GUIDE to STYLE_GUIDE (Dean Coakley) [#11460](https://github.com/nodejs/node/pull/11460) +* [[`13a9ba9523`](https://github.com/nodejs/node/commit/13a9ba9523)] - **doc**: add STYLE_GUIDE (moved from nodejs/docs) (Gibson Fahnestock) [#11321](https://github.com/nodejs/node/pull/11321) +* [[`0164d9263e`](https://github.com/nodejs/node/commit/0164d9263e)] - **doc**: improve test/README.md (Joyee Cheung) [#11237](https://github.com/nodejs/node/pull/11237) +* [[`e0868aa529`](https://github.com/nodejs/node/commit/e0868aa529)] - **doc**: add comment for net.Server's error event (QianJin2013) [#11136](https://github.com/nodejs/node/pull/11136) +* [[`9a684a1511`](https://github.com/nodejs/node/commit/9a684a1511)] - **doc**: note message event listeners ref IPC channels (Diego Rodríguez Baquero) [#11494](https://github.com/nodejs/node/pull/11494) +* [[`bfa3989584`](https://github.com/nodejs/node/commit/bfa3989584)] - **doc**: argument types for assert methods (Amelia Clarke) [#11548](https://github.com/nodejs/node/pull/11548) +* [[`fc41a1d34d`](https://github.com/nodejs/node/commit/fc41a1d34d)] - **doc**: document clientRequest.aborted (Zach Bjornson) [#11544](https://github.com/nodejs/node/pull/11544) +* [[`ff77425eba`](https://github.com/nodejs/node/commit/ff77425eba)] - **doc**: link to readable and writeable stream section (Sebastian Van Sande) [#11517](https://github.com/nodejs/node/pull/11517) +* [[`4850b503dd`](https://github.com/nodejs/node/commit/4850b503dd)] - **doc**: update TheAlphaNerd to MylesBorins (Myles Borins) [#10586](https://github.com/nodejs/node/pull/10586) +* [[`d04de226a1`](https://github.com/nodejs/node/commit/d04de226a1)] - **doc**: update examples in api/crypto.md (Vse Mozhet Byt) [#10909](https://github.com/nodejs/node/pull/10909) +* [[`a045af3b95`](https://github.com/nodejs/node/commit/a045af3b95)] - **doc**: update AUTHORS list to fix name (Noah Rose Ledesma) [#10945](https://github.com/nodejs/node/pull/10945) +* [[`d266759b99`](https://github.com/nodejs/node/commit/d266759b99)] - **doc**: add TimothyGu to collaborators (Timothy Gu) [#10954](https://github.com/nodejs/node/pull/10954) +* [[`42a5989b39`](https://github.com/nodejs/node/commit/42a5989b39)] - **doc**: mention moderation repo in onboarding doc (Anna Henningsen) [#10869](https://github.com/nodejs/node/pull/10869) +* [[`cdc981f6e1`](https://github.com/nodejs/node/commit/cdc981f6e1)] - **doc**: add edsadr to collaborators (Adrian Estrada) [#10883](https://github.com/nodejs/node/pull/10883) +* [[`787d4ec197`](https://github.com/nodejs/node/commit/787d4ec197)] - **doc**: clarifying variables in fs.write() (Jessica Quynh Tran) [#9792](https://github.com/nodejs/node/pull/9792) +* [[`f48c86ce48`](https://github.com/nodejs/node/commit/f48c86ce48)] - **doc**: add links for zlib convenience methods (Anna Henningsen) [#10829](https://github.com/nodejs/node/pull/10829) +* [[`1dbb366611`](https://github.com/nodejs/node/commit/1dbb366611)] - **doc**: add missing `added:` tag for `zlib.constants` (Anna Henningsen) [#10826](https://github.com/nodejs/node/pull/10826) +* [[`867b4d87dc`](https://github.com/nodejs/node/commit/867b4d87dc)] - **doc**: fix broken internal link in process.md (Anna Henningsen) [#10828](https://github.com/nodejs/node/pull/10828) +* [[`6d726c07aa`](https://github.com/nodejs/node/commit/6d726c07aa)] - **doc**: update writable.write return value (Nathan Phillip Brink) [#10582](https://github.com/nodejs/node/pull/10582) +* [[`1975f82168`](https://github.com/nodejs/node/commit/1975f82168)] - **doc**: edit writing-tests.md (Rich Trott) [#10585](https://github.com/nodejs/node/pull/10585) +* [[`494ee5163f`](https://github.com/nodejs/node/commit/494ee5163f)] - **doc**: fix misleading language in vm docs (Alexey Orlenko) [#10708](https://github.com/nodejs/node/pull/10708) +* [[`8e807f6552`](https://github.com/nodejs/node/commit/8e807f6552)] - **doc**: mention cc-ing nodejs/url team for reviews (Anna Henningsen) [#10652](https://github.com/nodejs/node/pull/10652) +* [[`f9bd4a5645`](https://github.com/nodejs/node/commit/f9bd4a5645)] - **doc**: sort require statements in tests (Sam Roberts) [#10616](https://github.com/nodejs/node/pull/10616) +* [[`032d73841d`](https://github.com/nodejs/node/commit/032d73841d)] - **doc**: handle backpressure when write() return false (Matteo Collina) [#10631](https://github.com/nodejs/node/pull/10631) +* [[`af991c7a98`](https://github.com/nodejs/node/commit/af991c7a98)] - **doc**: add test naming information to guide (Rich Trott) [#10584](https://github.com/nodejs/node/pull/10584) +* [[`b5fd61d77a`](https://github.com/nodejs/node/commit/b5fd61d77a)] - **doc**: fix missing negation in stream.md (Johannes Rieken) [#10712](https://github.com/nodejs/node/pull/10712) +* [[`7e5a59e6fc`](https://github.com/nodejs/node/commit/7e5a59e6fc)] - **doc**: "s/git apply/git am -3" in V8 guide (Myles Borins) [#10665](https://github.com/nodejs/node/pull/10665) +* [[`789bafd693`](https://github.com/nodejs/node/commit/789bafd693)] - **doc**: update LTS info for current releases (Evan Lucas) [#10720](https://github.com/nodejs/node/pull/10720) +* [[`fef978584a`](https://github.com/nodejs/node/commit/fef978584a)] - **doc**: update BUILDING.md (Lukasz Gasior) [#10669](https://github.com/nodejs/node/pull/10669) +* [[`f2ddc72b62`](https://github.com/nodejs/node/commit/f2ddc72b62)] - **doc**: document use of Refs: for references (Gibson Fahnestock) [#10670](https://github.com/nodejs/node/pull/10670) +* [[`0a1d15fba6`](https://github.com/nodejs/node/commit/0a1d15fba6)] - **doc**: clarify information about ABI version (Rich Trott) [#10419](https://github.com/nodejs/node/pull/10419) +* [[`22f3813b3e`](https://github.com/nodejs/node/commit/22f3813b3e)] - **doc**: clarify the statement in vm.createContext() (AnnaMag) [#10519](https://github.com/nodejs/node/pull/10519) +* [[`38d63e49eb`](https://github.com/nodejs/node/commit/38d63e49eb)] - **doc**: improve rinfo object documentation (Matt Crummey) [#10050](https://github.com/nodejs/node/pull/10050) +* [[`998fd1e7e1`](https://github.com/nodejs/node/commit/998fd1e7e1)] - **doc**: add tls.DEFAULT_ECDH_CURVE (Sam Roberts) [#10264](https://github.com/nodejs/node/pull/10264) +* [[`4995a819e0`](https://github.com/nodejs/node/commit/4995a819e0)] - **doc**: fix a wrong note in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795) +* [[`6d3c2d6212`](https://github.com/nodejs/node/commit/6d3c2d6212)] - **doc**: fix examples in buffer.md to avoid confusion (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795) +* [[`020c90eb2d`](https://github.com/nodejs/node/commit/020c90eb2d)] - **doc**: remove a wrong remark in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795) +* [[`8af811f90e`](https://github.com/nodejs/node/commit/8af811f90e)] - **doc**: fix copy-paste artifacts in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795) +* [[`a2b40ad6a4`](https://github.com/nodejs/node/commit/a2b40ad6a4)] - **doc**: fix wrong function arguments in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795) +* [[`e94abaec1c`](https://github.com/nodejs/node/commit/e94abaec1c)] - **doc**: fix a syntax error in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795) +* [[`b36c315423`](https://github.com/nodejs/node/commit/b36c315423)] - **doc**: var =\> const/let in the buffer.md (Vse Mozhet Byt) [#9795](https://github.com/nodejs/node/pull/9795) +* [[`b503824b81`](https://github.com/nodejs/node/commit/b503824b81)] - **doc,test**: args to `buffer.copy` can be Uint8Arrays (Anna Henningsen) [#11486](https://github.com/nodejs/node/pull/11486) +* [[`c8d2ca7a78`](https://github.com/nodejs/node/commit/c8d2ca7a78)] - **fs**: improve performance for sync stat() functions (Brian White) [#11522](https://github.com/nodejs/node/pull/11522) +* [[`b4dc7a778f`](https://github.com/nodejs/node/commit/b4dc7a778f)] - **http**: make request.abort() destroy the socket (Luigi Pinca) [#10818](https://github.com/nodejs/node/pull/10818) +* [[`d777da27bc`](https://github.com/nodejs/node/commit/d777da27bc)] - **http**: reject control characters in http.request() (Ben Noordhuis) [#8923](https://github.com/nodejs/node/pull/8923) +* [[`bad0d9367e`](https://github.com/nodejs/node/commit/bad0d9367e)] - **http**: add debug message for invalid header value (Evan Lucas) [#9195](https://github.com/nodejs/node/pull/9195) +* [[`bde1a7e09e`](https://github.com/nodejs/node/commit/bde1a7e09e)] - **lib**: remove unnecessary parameter for assertCrypto() (Jackson Tian) [#10834](https://github.com/nodejs/node/pull/10834) +* [[`a2aa2f7de4`](https://github.com/nodejs/node/commit/a2aa2f7de4)] - **lib**: refactor bootstrap_node.js regular expression (Rich Trott) [#10749](https://github.com/nodejs/node/pull/10749) +* [[`797d9ee924`](https://github.com/nodejs/node/commit/797d9ee924)] - **lib**: refactor crypto cipher/hash/curve getters (Rich Trott) [#10682](https://github.com/nodejs/node/pull/10682) +* [[`69327f5e72`](https://github.com/nodejs/node/commit/69327f5e72)] - **lib**: rename kMaxCallbacksUntilQueueIsShortened (JungMinu) [#11473](https://github.com/nodejs/node/pull/11473) +* [[`a6b2dfa43c`](https://github.com/nodejs/node/commit/a6b2dfa43c)] - **lib**: add constant kMaxCallbacksUntilQueueIsShortened (Daniel Bevenius) [#11199](https://github.com/nodejs/node/pull/11199) +* [[`a3ad63b9b3`](https://github.com/nodejs/node/commit/a3ad63b9b3)] - **lib,src**: support values \> 4GB in heap statistics (Ben Noordhuis) [#10186](https://github.com/nodejs/node/pull/10186) +* [[`8b5dd35ae8`](https://github.com/nodejs/node/commit/8b5dd35ae8)] - **meta**: add explicit deprecation and semver-major policy (James M Snell) [#7964](https://github.com/nodejs/node/pull/7964) +* [[`4df850ba59`](https://github.com/nodejs/node/commit/4df850ba59)] - **meta**: remove Chris Dickinson from CTC (Chris Dickinson) [#11267](https://github.com/nodejs/node/pull/11267) +* [[`8863360a21`](https://github.com/nodejs/node/commit/8863360a21)] - **meta**: adding Italo A. Casas PGP Fingerprint (Italo A. Casas) [#11202](https://github.com/nodejs/node/pull/11202) +* [[`8287d03adf`](https://github.com/nodejs/node/commit/8287d03adf)] - **meta**: decharter the http working group (James M Snell) [#10604](https://github.com/nodejs/node/pull/10604) +* [[`742ec6213f`](https://github.com/nodejs/node/commit/742ec6213f)] - **net**: prefer === to == (Arseniy Maximov) [#11513](https://github.com/nodejs/node/pull/11513) +* [[`5bfa43d8f0`](https://github.com/nodejs/node/commit/5bfa43d8f0)] - **os**: improve loadavg() performance (Brian White) [#11516](https://github.com/nodejs/node/pull/11516) +* [[`b7088a9355`](https://github.com/nodejs/node/commit/b7088a9355)] - **process**: improve memoryUsage() performance (Brian White) [#11497](https://github.com/nodejs/node/pull/11497) +* [[`02e5f5c57e`](https://github.com/nodejs/node/commit/02e5f5c57e)] - **process**: fix typo in comments (levsthings) [#11503](https://github.com/nodejs/node/pull/11503) +* [[`db45bf850a`](https://github.com/nodejs/node/commit/db45bf850a)] - **querystring**: improve unescapeBuffer performance (Brian White) [#10837](https://github.com/nodejs/node/pull/10837) +* [[`32cdbca2dc`](https://github.com/nodejs/node/commit/32cdbca2dc)] - **querystring**: improve stringify() performance (Brian White) [#10852](https://github.com/nodejs/node/pull/10852) +* [[`23f3f20963`](https://github.com/nodejs/node/commit/23f3f20963)] - **querystring**: improve parse() performance (Brian White) [#10874](https://github.com/nodejs/node/pull/10874) +* [[`dc88b6572d`](https://github.com/nodejs/node/commit/dc88b6572d)] - **readline**: refactor construct Interface (Jackson Tian) [#4740](https://github.com/nodejs/node/pull/4740) +* [[`f7c6ad2df9`](https://github.com/nodejs/node/commit/f7c6ad2df9)] - **readline**: update 6 comparions to strict (Umair Ishaq) [#11078](https://github.com/nodejs/node/pull/11078) +* [[`b5a0d46c55`](https://github.com/nodejs/node/commit/b5a0d46c55)] - **src**: add NODE_NO_WARNINGS to --help output (cjihrig) [#10918](https://github.com/nodejs/node/pull/10918) +* [[`566e2fea48`](https://github.com/nodejs/node/commit/566e2fea48)] - **src**: remove unnecessary req_wrap_obj (Daniel Bevenius) [#10942](https://github.com/nodejs/node/pull/10942) +* [[`c7436df889`](https://github.com/nodejs/node/commit/c7436df889)] - **src**: add a missing space in node_os.cc (Alexey Orlenko) [#10931](https://github.com/nodejs/node/pull/10931) +* [[`4358c6096c`](https://github.com/nodejs/node/commit/4358c6096c)] - **src**: enable writev for pipe handles on Unix (Alexey Orlenko) [#10677](https://github.com/nodejs/node/pull/10677) +* [[`28102edbc8`](https://github.com/nodejs/node/commit/28102edbc8)] - **src**: unconsume stream fix in internal http impl (Roee Kasher) [#11015](https://github.com/nodejs/node/pull/11015) +* [[`587857e301`](https://github.com/nodejs/node/commit/587857e301)] - **src**: fix delete operator on vm context (Franziska Hinkelmann) [#11266](https://github.com/nodejs/node/pull/11266) +* [[`b7cbb8002c`](https://github.com/nodejs/node/commit/b7cbb8002c)] - **src**: support UTF-8 in compiled-in JS source files (Ben Noordhuis) [#11129](https://github.com/nodejs/node/pull/11129) +* [[`ce01372b68`](https://github.com/nodejs/node/commit/ce01372b68)] - **src**: remove unused typedef (Ben Noordhuis) [#11322](https://github.com/nodejs/node/pull/11322) +* [[`1dddfeccb2`](https://github.com/nodejs/node/commit/1dddfeccb2)] - **src**: remove usage of deprecated debug API (Yang Guo) [#11437](https://github.com/nodejs/node/pull/11437) +* [[`7f273c6f6e`](https://github.com/nodejs/node/commit/7f273c6f6e)] - **src**: update http-parser link (Daniel Bevenius) [#11477](https://github.com/nodejs/node/pull/11477) +* [[`214b514efe`](https://github.com/nodejs/node/commit/214b514efe)] - **src**: use ABORT() macro instead of abort() (Evan Lucas) [#9613](https://github.com/nodejs/node/pull/9613) +* [[`412f380903`](https://github.com/nodejs/node/commit/412f380903)] - **stream**: move legacy to lib/internal dir (yorkie) [#8197](https://github.com/nodejs/node/pull/8197) +* [[`336f1bd842`](https://github.com/nodejs/node/commit/336f1bd842)] - **test**: increase setMulticastLoopback() coverage (cjihrig) [#11277](https://github.com/nodejs/node/pull/11277) +* [[`b29165f249`](https://github.com/nodejs/node/commit/b29165f249)] - **test**: increase dgram ref()/unref() coverage (cjihrig) [#11240](https://github.com/nodejs/node/pull/11240) +* [[`22d4ed2484`](https://github.com/nodejs/node/commit/22d4ed2484)] - **test**: add an exception test to http-write-head (Yuta Hiroto) [#11034](https://github.com/nodejs/node/pull/11034) +* [[`9edd342e81`](https://github.com/nodejs/node/commit/9edd342e81)] - **test**: add known_issues test for #10223 (AnnaMag) [#11024](https://github.com/nodejs/node/pull/11024) +* [[`646f82520c`](https://github.com/nodejs/node/commit/646f82520c)] - **test**: guarantee test runs in test-readline-keys (Rich Trott) [#11023](https://github.com/nodejs/node/pull/11023) +* [[`d8eed12d31`](https://github.com/nodejs/node/commit/d8eed12d31)] - **test**: check error message in test-http-outgoing-proto (Alex Ling) [#10943](https://github.com/nodejs/node/pull/10943) +* [[`174bef182a`](https://github.com/nodejs/node/commit/174bef182a)] - **test**: increase coverage for stream's duplex (abouthiroppy) [#10963](https://github.com/nodejs/node/pull/10963) +* [[`8ff15a262d`](https://github.com/nodejs/node/commit/8ff15a262d)] - **test**: allow for slow hosts in spawnSync() test (Rich Trott) [#10998](https://github.com/nodejs/node/pull/10998) +* [[`62f6749cd6`](https://github.com/nodejs/node/commit/62f6749cd6)] - **test**: expand test coverage of fs.js (Vinícius do Carmo) [#10947](https://github.com/nodejs/node/pull/10947) +* [[`5cea2239d8`](https://github.com/nodejs/node/commit/5cea2239d8)] - **test**: expand test coverage of events.js (Vinícius do Carmo) [#10947](https://github.com/nodejs/node/pull/10947) +* [[`a1751864e2`](https://github.com/nodejs/node/commit/a1751864e2)] - **test**: check noAssert option in buf.write*() (larissayvette) [#10790](https://github.com/nodejs/node/pull/10790) +* [[`0b5f2b45f9`](https://github.com/nodejs/node/commit/0b5f2b45f9)] - **test**: expand test coverage of fs.js (Vinícius do Carmo) [#10972](https://github.com/nodejs/node/pull/10972) +* [[`d9362efb6c`](https://github.com/nodejs/node/commit/d9362efb6c)] - **test**: enhance test-timers (Rich Trott) [#10960](https://github.com/nodejs/node/pull/10960) +* [[`b9615b3abc`](https://github.com/nodejs/node/commit/b9615b3abc)] - **test**: increase coverage for exec() functions (cjihrig) [#10919](https://github.com/nodejs/node/pull/10919) +* [[`b45280671a`](https://github.com/nodejs/node/commit/b45280671a)] - **test**: add process.assert's test (abouthiroppy) [#10911](https://github.com/nodejs/node/pull/10911) +* [[`6584ea0715`](https://github.com/nodejs/node/commit/6584ea0715)] - **test**: update Buffer.lastIndexOf (dcposch@dcpos.ch) [#10162](https://github.com/nodejs/node/pull/10162) +* [[`0c60540014`](https://github.com/nodejs/node/commit/0c60540014)] - **test**: improve code in test-crypto-verify (Adrian Estrada) [#10845](https://github.com/nodejs/node/pull/10845) +* [[`2a52a68a96`](https://github.com/nodejs/node/commit/2a52a68a96)] - **test**: add dgram.Socket.prototype.bind's test (abouthiroppy) [#10894](https://github.com/nodejs/node/pull/10894) +* [[`2494d8ac68`](https://github.com/nodejs/node/commit/2494d8ac68)] - **test**: update V8 flag in test (Franziska Hinkelmann) [#10917](https://github.com/nodejs/node/pull/10917) +* [[`9ac22cdcaf`](https://github.com/nodejs/node/commit/9ac22cdcaf)] - **test**: increase coverage of string-decoder (abouthiroppy) [#10863](https://github.com/nodejs/node/pull/10863) +* [[`d766f5e0ad`](https://github.com/nodejs/node/commit/d766f5e0ad)] - **test**: improving coverage of dns-lookup (abouthiroppy) [#10844](https://github.com/nodejs/node/pull/10844) +* [[`8f984c3a8a`](https://github.com/nodejs/node/commit/8f984c3a8a)] - **test**: refactor test-fs-read-zero-length.js (abouthiroppy) [#10729](https://github.com/nodejs/node/pull/10729) +* [[`c0e24f9029`](https://github.com/nodejs/node/commit/c0e24f9029)] - **test**: improving coverage for dgram (abouthiroppy) [#10783](https://github.com/nodejs/node/pull/10783) +* [[`c91d873115`](https://github.com/nodejs/node/commit/c91d873115)] - **test**: improve code in test-console-instance (Adrian Estrada) [#10813](https://github.com/nodejs/node/pull/10813) +* [[`a434f451d9`](https://github.com/nodejs/node/commit/a434f451d9)] - **test**: improve code in test-domain-multi (Adrian Estrada) [#10798](https://github.com/nodejs/node/pull/10798) +* [[`b01db3a73f`](https://github.com/nodejs/node/commit/b01db3a73f)] - **test**: improve test-stream2-large-read-stall (stefan judis) [#10725](https://github.com/nodejs/node/pull/10725) +* [[`76f0556c4a`](https://github.com/nodejs/node/commit/76f0556c4a)] - **test**: improve code in test-http-host-headers (Adrian Estrada) [#10830](https://github.com/nodejs/node/pull/10830) +* [[`c740cb6667`](https://github.com/nodejs/node/commit/c740cb6667)] - **test**: add test case to test-http-response-statuscode.js (abouthiroppy) [#10808](https://github.com/nodejs/node/pull/10808) +* [[`872354563c`](https://github.com/nodejs/node/commit/872354563c)] - **test**: refactor cluster-preload.js (abouthiroppy) [#10701](https://github.com/nodejs/node/pull/10701) +* [[`04dc1cdfcb`](https://github.com/nodejs/node/commit/04dc1cdfcb)] - **test**: improve test-fs-write-file-sync (Adrian Estrada) [#10624](https://github.com/nodejs/node/pull/10624) +* [[`0d25d056a4`](https://github.com/nodejs/node/commit/0d25d056a4)] - **test**: test hmac binding robustness (Sam Roberts) [#10923](https://github.com/nodejs/node/pull/10923) +* [[`99a234c97e`](https://github.com/nodejs/node/commit/99a234c97e)] - **test**: refactor the code in test-fs-watch.js (sivaprasanna) [#10357](https://github.com/nodejs/node/pull/10357) +* [[`c13f01c94d`](https://github.com/nodejs/node/commit/c13f01c94d)] - **test**: reduce unmanaged parallelism in domain test (Joyee Cheung) [#10329](https://github.com/nodejs/node/pull/10329) +* [[`ed76b4a8e9`](https://github.com/nodejs/node/commit/ed76b4a8e9)] - **test**: add dgram.Socket.prototype.sendto's test (abouthiroppy) [#10901](https://github.com/nodejs/node/pull/10901) +* [[`5365501a2f`](https://github.com/nodejs/node/commit/5365501a2f)] - **test**: add regression test for V8 parse error (Michaël Zasso) [#11483](https://github.com/nodejs/node/pull/11483) +* [[`b5fb9f4098`](https://github.com/nodejs/node/commit/b5fb9f4098)] - **test**: increase timeout in break-on-uncaught (Sakthipriyan Vairamani (thefourtheye)) [#10822](https://github.com/nodejs/node/pull/10822) +* [[`443dd508d2`](https://github.com/nodejs/node/commit/443dd508d2)] - **test**: fix process.title expectation (Sakthipriyan Vairamani (thefourtheye)) [#10597](https://github.com/nodejs/node/pull/10597) +* [[`ae338daf06`](https://github.com/nodejs/node/commit/ae338daf06)] - **test**: refactor test-debugger-remote (Sakthipriyan Vairamani (thefourtheye)) [#10455](https://github.com/nodejs/node/pull/10455) +* [[`34e0bc6d16`](https://github.com/nodejs/node/commit/34e0bc6d16)] - **test**: fix and improve debugger-client test (Sakthipriyan Vairamani (thefourtheye)) [#10371](https://github.com/nodejs/node/pull/10371) +* [[`da874590a6`](https://github.com/nodejs/node/commit/da874590a6)] - **test**: improve test-assert (richnologies) [#10916](https://github.com/nodejs/node/pull/10916) +* [[`a15ecd269d`](https://github.com/nodejs/node/commit/a15ecd269d)] - **test**: increase coverage for punycode's decode (abouthiroppy) [#10940](https://github.com/nodejs/node/pull/10940) +* [[`98e32db207`](https://github.com/nodejs/node/commit/98e32db207)] - **test**: check fd 0,1,2 are used, not access mode (John Barboza) [#10339](https://github.com/nodejs/node/pull/10339) +* [[`e59697c695`](https://github.com/nodejs/node/commit/e59697c695)] - **test**: fix flaky test-regress-GH-897 (Rich Trott) [#10903](https://github.com/nodejs/node/pull/10903) +* [[`a08c7f6d87`](https://github.com/nodejs/node/commit/a08c7f6d87)] - **test**: don't connect to :: (use localhost instead) (Gibson Fahnestock) [#10854](https://github.com/nodejs/node/pull/10854) +* [[`ca53866333`](https://github.com/nodejs/node/commit/ca53866333)] - **test**: add message verification on assert.throws (Travis Meisenheimer) [#10890](https://github.com/nodejs/node/pull/10890) +* [[`38b123c918`](https://github.com/nodejs/node/commit/38b123c918)] - **test**: refactor test-repl-tab-complete (Rich Trott) [#10879](https://github.com/nodejs/node/pull/10879) +* [[`68fc4d3a1c`](https://github.com/nodejs/node/commit/68fc4d3a1c)] - **test**: simplify array initialization (Rich Trott) [#10860](https://github.com/nodejs/node/pull/10860) +* [[`a26d752e77`](https://github.com/nodejs/node/commit/a26d752e77)] - **test**: add http-common's test (abouthiroppy) [#10832](https://github.com/nodejs/node/pull/10832) +* [[`80e2ff9bff`](https://github.com/nodejs/node/commit/80e2ff9bff)] - **test**: tests for _readableStream.awaitDrain (Mark) [#8914](https://github.com/nodejs/node/pull/8914) +* [[`e4e9f675d2`](https://github.com/nodejs/node/commit/e4e9f675d2)] - **test**: improve the code in test-process-cpuUsage (Adrian Estrada) [#10714](https://github.com/nodejs/node/pull/10714) +* [[`73c0c46cf2`](https://github.com/nodejs/node/commit/73c0c46cf2)] - **test**: increase test-crypto.js strictness (Rich Trott) [#10784](https://github.com/nodejs/node/pull/10784) +* [[`e316fafbd4`](https://github.com/nodejs/node/commit/e316fafbd4)] - **test**: delete duplicate test of noAssert in readUInt* (larissayvette) [#10791](https://github.com/nodejs/node/pull/10791) +* [[`896fb63173`](https://github.com/nodejs/node/commit/896fb63173)] - **test**: add http_incoming's matchKnownFields test (abouthiroppy) [#10811](https://github.com/nodejs/node/pull/10811) +* [[`c086bdc2de`](https://github.com/nodejs/node/commit/c086bdc2de)] - **test**: check error msg test-writeint.js (Irene Li) [#10755](https://github.com/nodejs/node/pull/10755) +* [[`2eb0c25aa1`](https://github.com/nodejs/node/commit/2eb0c25aa1)] - **test**: no unused args test-fs-watch-file.js (istinson) [#10758](https://github.com/nodejs/node/pull/10758) +* [[`2f026f6668`](https://github.com/nodejs/node/commit/2f026f6668)] - **test**: improve tests in pummel/test-exec (Chase Starr) [#10757](https://github.com/nodejs/node/pull/10757) +* [[`93877c87cc`](https://github.com/nodejs/node/commit/93877c87cc)] - **test**: fix temp-dir option in tools/test.py (Gibson Fahnestock) [#10723](https://github.com/nodejs/node/pull/10723) +* [[`0f3677dd5d`](https://github.com/nodejs/node/commit/0f3677dd5d)] - **test**: use realpath for NODE_TEST_DIR in common.js (Gibson Fahnestock) [#10723](https://github.com/nodejs/node/pull/10723) +* [[`5d0cc617bb`](https://github.com/nodejs/node/commit/5d0cc617bb)] - **test**: move resource intensive test to sequential (Rich Trott) [#10744](https://github.com/nodejs/node/pull/10744) +* [[`cd4bb067ad`](https://github.com/nodejs/node/commit/cd4bb067ad)] - **test**: add test for noAssert option in buf.read*() (larissayvette) [#10713](https://github.com/nodejs/node/pull/10713) +* [[`5b55689b2c`](https://github.com/nodejs/node/commit/5b55689b2c)] - **test**: refactor test-crypto-padding-aes256 (adelmann) [#10622](https://github.com/nodejs/node/pull/10622) +* [[`119e512db3`](https://github.com/nodejs/node/commit/119e512db3)] - **test**: refactor the code of test-keep-alive.js (sivaprasanna) [#10684](https://github.com/nodejs/node/pull/10684) +* [[`ef3d889ee7`](https://github.com/nodejs/node/commit/ef3d889ee7)] - **test**: validate 'expected' argument to mustCall() (Nathan Friedly) [#10692](https://github.com/nodejs/node/pull/10692) +* [[`21704a3b6b`](https://github.com/nodejs/node/commit/21704a3b6b)] - **test**: fix misplaced ) in http response statuscode test (Nathan Friedly) [#10692](https://github.com/nodejs/node/pull/10692) +* [[`8565a06b09`](https://github.com/nodejs/node/commit/8565a06b09)] - **test**: refactor test-doctool-html.js (abouthiroppy) [#10696](https://github.com/nodejs/node/pull/10696) +* [[`168f3e4bf8`](https://github.com/nodejs/node/commit/168f3e4bf8)] - **test**: improve the code in test-process-hrtime (Adrian Estrada) [#10667](https://github.com/nodejs/node/pull/10667) +* [[`9acc86f578`](https://github.com/nodejs/node/commit/9acc86f578)] - **test**: refactor test-watch-file.js (sivaprasanna) [#10679](https://github.com/nodejs/node/pull/10679) +* [[`86e39367d6`](https://github.com/nodejs/node/commit/86e39367d6)] - **test**: improve zlib-from-gzip-with-trailing-garbage (Michael Lefkowitz) [#10674](https://github.com/nodejs/node/pull/10674) +* [[`3135455cd9`](https://github.com/nodejs/node/commit/3135455cd9)] - **test**: refactor the code in test-child-process-spawn-loop.js (sivaprasanna) [#10605](https://github.com/nodejs/node/pull/10605) +* [[`f43a8765a2`](https://github.com/nodejs/node/commit/f43a8765a2)] - **test**: allow testing uid and gid separately (cjihrig) [#10647](https://github.com/nodejs/node/pull/10647) +* [[`2f1d231c0d`](https://github.com/nodejs/node/commit/2f1d231c0d)] - **test**: improve test-http-chunked-304 (Adrian Estrada) [#10462](https://github.com/nodejs/node/pull/10462) +* [[`ec8a9962ce`](https://github.com/nodejs/node/commit/ec8a9962ce)] - **test**: improve test-fs-readfile-zero-byte-liar (Adrian Estrada) [#10570](https://github.com/nodejs/node/pull/10570) +* [[`12746af524`](https://github.com/nodejs/node/commit/12746af524)] - **test**: refactor test-fs-utimes (Junshu Okamoto) [#9290](https://github.com/nodejs/node/pull/9290) +* [[`e81b1cc1ae`](https://github.com/nodejs/node/commit/e81b1cc1ae)] - **test**: provide duration/interval to timers (Rich Trott) [#9472](https://github.com/nodejs/node/pull/9472) +* [[`17a63e15e6`](https://github.com/nodejs/node/commit/17a63e15e6)] - **test**: improve test-event-emitter-modify-in-emit (Adrian Estrada) [#10600](https://github.com/nodejs/node/pull/10600) +* [[`50ee4e6dad`](https://github.com/nodejs/node/commit/50ee4e6dad)] - **test**: require handler to be run in sigwinch test (Rich Trott) [#11068](https://github.com/nodejs/node/pull/11068) +* [[`8cce29587c`](https://github.com/nodejs/node/commit/8cce29587c)] - **test**: add 2nd argument to throws in test-assert (Marlena Compton) [#11061](https://github.com/nodejs/node/pull/11061) +* [[`b14d7b3aa1`](https://github.com/nodejs/node/commit/b14d7b3aa1)] - **test**: improve error messages in test-npm-install (Gonen Dukas) [#11027](https://github.com/nodejs/node/pull/11027) +* [[`87488ba2ff`](https://github.com/nodejs/node/commit/87488ba2ff)] - **test**: add path.join's test (Yuta Hiroto) [#11063](https://github.com/nodejs/node/pull/11063) +* [[`232664a10d`](https://github.com/nodejs/node/commit/232664a10d)] - **test**: fix timing sensitivity in debugger test (Ali Ijaz Sheikh) [#11008](https://github.com/nodejs/node/pull/11008) +* [[`c16160418b`](https://github.com/nodejs/node/commit/c16160418b)] - **test**: improve coverage on removeListeners functions (matsuda-koushi) [#11140](https://github.com/nodejs/node/pull/11140) +* [[`898276b1b4`](https://github.com/nodejs/node/commit/898276b1b4)] - **test**: simplify output handling in repl tests (Rich Trott) [#11124](https://github.com/nodejs/node/pull/11124) +* [[`3248cdb2e6`](https://github.com/nodejs/node/commit/3248cdb2e6)] - **test**: improve crypto.setEngine coverage to check for errors (Sebastian Van Sande) [#11143](https://github.com/nodejs/node/pull/11143) +* [[`28111f9eb2`](https://github.com/nodejs/node/commit/28111f9eb2)] - **test**: increase specificity in dgram test (Rich Trott) [#11187](https://github.com/nodejs/node/pull/11187) +* [[`c5e8ccab63`](https://github.com/nodejs/node/commit/c5e8ccab63)] - **test**: remove obsolete comment from dgram test (ALJCepeda) [#8689](https://github.com/nodejs/node/pull/8689) +* [[`7aebc6907c`](https://github.com/nodejs/node/commit/7aebc6907c)] - **test**: improve checks in test-path-parse-format (cjihrig) [#11223](https://github.com/nodejs/node/pull/11223) +* [[`baec432c93`](https://github.com/nodejs/node/commit/baec432c93)] - **test**: add coverage for string array dgram send() (cjihrig) [#11247](https://github.com/nodejs/node/pull/11247) +* [[`6694c26420`](https://github.com/nodejs/node/commit/6694c26420)] - **test**: adapt test-debugger-pid to localized Windows (Vse Mozhet Byt) [#11270](https://github.com/nodejs/node/pull/11270) +* [[`2db4c3c453`](https://github.com/nodejs/node/commit/2db4c3c453)] - **test**: add vm module edge cases (Franziska Hinkelmann) [#11265](https://github.com/nodejs/node/pull/11265) +* [[`759604912a`](https://github.com/nodejs/node/commit/759604912a)] - **test**: refactor test-dgram-setBroadcast.js (cjihrig) [#11252](https://github.com/nodejs/node/pull/11252) +* [[`3185fa1249`](https://github.com/nodejs/node/commit/3185fa1249)] - **test**: querystring.escape with multibyte characters (Daijiro Wachi) [#11251](https://github.com/nodejs/node/pull/11251) +* [[`460a3e1f7a`](https://github.com/nodejs/node/commit/460a3e1f7a)] - **test**: improve test-assert.js (jobala) [#11193](https://github.com/nodejs/node/pull/11193) +* [[`1adfca4b5e`](https://github.com/nodejs/node/commit/1adfca4b5e)] - **test**: refactor test-repl-sigint (Rich Trott) [#11309](https://github.com/nodejs/node/pull/11309) +* [[`c539325d89`](https://github.com/nodejs/node/commit/c539325d89)] - **test**: improve punycode test coverage (Sebastian Van Sande) [#11144](https://github.com/nodejs/node/pull/11144) +* [[`8db3c770be`](https://github.com/nodejs/node/commit/8db3c770be)] - **test**: refactor test-repl-sigint-nested-eval (Rich Trott) [#11303](https://github.com/nodejs/node/pull/11303) +* [[`874ef9d312`](https://github.com/nodejs/node/commit/874ef9d312)] - **test**: add coverage for dgram _createSocketHandle() (cjihrig) [#11291](https://github.com/nodejs/node/pull/11291) +* [[`92f6919532`](https://github.com/nodejs/node/commit/92f6919532)] - **test**: improve crypto coverage (Akito Ito) [#11280](https://github.com/nodejs/node/pull/11280) +* [[`d9deb1fb62`](https://github.com/nodejs/node/commit/d9deb1fb62)] - **test**: improve message in net-connect-local-error (Rich Trott) [#11393](https://github.com/nodejs/node/pull/11393) +* [[`6677c113aa`](https://github.com/nodejs/node/commit/6677c113aa)] - **test**: refactor test-dgram-membership (Rich Trott) [#11388](https://github.com/nodejs/node/pull/11388) +* [[`e7b7d7279c`](https://github.com/nodejs/node/commit/e7b7d7279c)] - **test**: cases to querystring related to empty string (Daijiro Wachi) [#11329](https://github.com/nodejs/node/pull/11329) +* [[`5a92fc25a1`](https://github.com/nodejs/node/commit/5a92fc25a1)] - **test**: consolidate buffer.read() in a file (larissayvette) [#11297](https://github.com/nodejs/node/pull/11297) +* [[`607158ab6e`](https://github.com/nodejs/node/commit/607158ab6e)] - **test**: improve crypto coverage (樋口 彰) [#11279](https://github.com/nodejs/node/pull/11279) +* [[`27f302d94f`](https://github.com/nodejs/node/commit/27f302d94f)] - **test**: remove unused args and comparison fix (Alexander) [#11396](https://github.com/nodejs/node/pull/11396) +* [[`8da156d68f`](https://github.com/nodejs/node/commit/8da156d68f)] - **test**: add coverage for utf8CheckIncomplete() (xiaoyu) [#11419](https://github.com/nodejs/node/pull/11419) +* [[`0ddad76813`](https://github.com/nodejs/node/commit/0ddad76813)] - **test**: fix over-dependence on native promise impl (Ali Ijaz Sheikh) [#11437](https://github.com/nodejs/node/pull/11437) +* [[`34444580f6`](https://github.com/nodejs/node/commit/34444580f6)] - **test**: add test cases for path (Yuta Hiroto) [#11453](https://github.com/nodejs/node/pull/11453) +* [[`4bcf1a0387`](https://github.com/nodejs/node/commit/4bcf1a0387)] - **test**: refactor test-http-response-splitting (Arseniy Maximov) [#11429](https://github.com/nodejs/node/pull/11429) +* [[`7836807178`](https://github.com/nodejs/node/commit/7836807178)] - **test**: add error checking in callback (Rich Trott) [#11446](https://github.com/nodejs/node/pull/11446) +* [[`13b7856444`](https://github.com/nodejs/node/commit/13b7856444)] - **test**: improve coverage in test-crypto.dh (Eric Christie) [#11253](https://github.com/nodejs/node/pull/11253) +* [[`b2f7e7a5ad`](https://github.com/nodejs/node/commit/b2f7e7a5ad)] - **test**: add regex check to test-module-loading (Tarang Hirani) [#11413](https://github.com/nodejs/node/pull/11413) +* [[`6bf936644e`](https://github.com/nodejs/node/commit/6bf936644e)] - **test**: increase coverage of vm (DavidCai) [#11377](https://github.com/nodejs/node/pull/11377) +* [[`6202f14583`](https://github.com/nodejs/node/commit/6202f14583)] - **test**: throw check in test-zlib-write-after-close (Jason Wilson) [#11482](https://github.com/nodejs/node/pull/11482) +* [[`f8884dd1b5`](https://github.com/nodejs/node/commit/f8884dd1b5)] - **test**: add cases for unescape & unescapeBuffer (Daijiro Wachi) [#11326](https://github.com/nodejs/node/pull/11326) +* [[`05909d045b`](https://github.com/nodejs/node/commit/05909d045b)] - **test**: fix flaky test-vm-timeout-rethrow (Kunal Pathak) [#11530](https://github.com/nodejs/node/pull/11530) +* [[`6e5f6e3c02`](https://github.com/nodejs/node/commit/6e5f6e3c02)] - **test**: favor assertions over console logging (Rich Trott) [#11547](https://github.com/nodejs/node/pull/11547) +* [[`2c4aa39021`](https://github.com/nodejs/node/commit/2c4aa39021)] - **test**: mark test-tty-wrap as flaky for AIX (Michael Dawson) [#10618](https://github.com/nodejs/node/pull/10618) +* [[`cb03e74037`](https://github.com/nodejs/node/commit/cb03e74037)] - **test**: improve test-fs-null-bytes (Adrian Estrada) [#10521](https://github.com/nodejs/node/pull/10521) +* [[`69b55f35f7`](https://github.com/nodejs/node/commit/69b55f35f7)] - **test**: refactor test-https-truncate (Rich Trott) [#10225](https://github.com/nodejs/node/pull/10225) +* [[`ada7166dfd`](https://github.com/nodejs/node/commit/ada7166dfd)] - **test**: simplify test-http-client-unescaped-path (Rod Vagg) [#9649](https://github.com/nodejs/node/pull/9649) +* [[`1b85989fb2`](https://github.com/nodejs/node/commit/1b85989fb2)] - **test**: move long-running test to sequential (Rich Trott) [#11176](https://github.com/nodejs/node/pull/11176) +* [[`87760cc346`](https://github.com/nodejs/node/commit/87760cc346)] - **test**: add new.target add-on regression test (Ben Noordhuis) [#9689](https://github.com/nodejs/node/pull/9689) +* [[`73283060ad`](https://github.com/nodejs/node/commit/73283060ad)] - **test,repl**: add coverage for repl .clear+useGlobal (Rich Trott) [#10777](https://github.com/nodejs/node/pull/10777) +* [[`4a87aee532`](https://github.com/nodejs/node/commit/4a87aee532)] - **test,util**: remove lint workarounds (Rich Trott) [#10785](https://github.com/nodejs/node/pull/10785) +* [[`3e9ce770f7`](https://github.com/nodejs/node/commit/3e9ce770f7)] - **test-console**: streamline arrow fn and refine regex (John Maguire) [#11039](https://github.com/nodejs/node/pull/11039) +* [[`b90a141cc7`](https://github.com/nodejs/node/commit/b90a141cc7)] - **timer**: remove duplicated word in comment (asafdav2) [#11323](https://github.com/nodejs/node/pull/11323) +* [[`d71ebb90ec`](https://github.com/nodejs/node/commit/d71ebb90ec)] - **timer,domain**: maintain order of timer callbacks (John Barboza) [#10522](https://github.com/nodejs/node/pull/10522) +* [[`2a168917cb`](https://github.com/nodejs/node/commit/2a168917cb)] - **tls**: do not crash on STARTTLS when OCSP requested (Fedor Indutny) [#10706](https://github.com/nodejs/node/pull/10706) +* [[`f33684ac5f`](https://github.com/nodejs/node/commit/f33684ac5f)] - **tools**: remove custom align-function-arguments rule (Rich Trott) [#10561](https://github.com/nodejs/node/pull/10561) +* [[`fb2f449acc`](https://github.com/nodejs/node/commit/fb2f449acc)] - **tools**: update ESLint to current version (Rich Trott) [#10561](https://github.com/nodejs/node/pull/10561) +* [[`83a3aef873`](https://github.com/nodejs/node/commit/83a3aef873)] - **tools**: rename eslintrc to an undeprecated format (Sakthipriyan Vairamani) [#7699](https://github.com/nodejs/node/pull/7699) +* [[`e4f7f5c630`](https://github.com/nodejs/node/commit/e4f7f5c630)] - **tools**: add lint rule to enforce timer arguments (Rich Trott) [#9472](https://github.com/nodejs/node/pull/9472) +* [[`a13bb54466`](https://github.com/nodejs/node/commit/a13bb54466)] - **tools**: add compile_commands.json gyp generator (Ben Noordhuis) [#7986](https://github.com/nodejs/node/pull/7986) +* [[`b38d8d6e06`](https://github.com/nodejs/node/commit/b38d8d6e06)] - **tools**: suggest python2 command in configure (Roman Reiss) [#11375](https://github.com/nodejs/node/pull/11375) +* [[`291346ea51`](https://github.com/nodejs/node/commit/291346ea51)] - **tools,doc**: add Google Analytics tracking. (Phillip Johnsen) [#6601](https://github.com/nodejs/node/pull/6601) +* [[`1ed47d3f33`](https://github.com/nodejs/node/commit/1ed47d3f33)] - **tty**: avoid oob warning in TTYWrap::GetWindowSize() (Dmitry Tsvettsikh) [#11454](https://github.com/nodejs/node/pull/11454) +* [[`9e6fcbb34c`](https://github.com/nodejs/node/commit/9e6fcbb34c)] - **url**: fix surrogate handling in encodeAuth() (Timothy Gu) [#11387](https://github.com/nodejs/node/pull/11387) +* [[`53213004eb`](https://github.com/nodejs/node/commit/53213004eb)] - **util**: improve readability of normalizeEncoding (Joyee Cheung) [#10439](https://github.com/nodejs/node/pull/10439) +* [[`e54b433c8d`](https://github.com/nodejs/node/commit/e54b433c8d)] - **util**: use ES2015+ Object.is to check negative zero (Shinnosuke Watanabe) [#11332](https://github.com/nodejs/node/pull/11332) +* [[`2e15d48447`](https://github.com/nodejs/node/commit/2e15d48447)] - **v8**: drop v8::FunctionCallbackInfo\::NewTarget() (Ben Noordhuis) [#9293](https://github.com/nodejs/node/pull/9293) +* [[`fd1ffe4f5a`](https://github.com/nodejs/node/commit/fd1ffe4f5a)] - **v8**: fix --always-opt bug (Ben Noordhuis) [#9293](https://github.com/nodejs/node/pull/9293) +* [[`a55af77fc5`](https://github.com/nodejs/node/commit/a55af77fc5)] - **vm**: refactor vm module (James M Snell) [#11392](https://github.com/nodejs/node/pull/11392) + ## 2017-02-21, Version 6.10.0 'Boron' (LTS), @MylesBorins From 7e6e7d34f31679062605c9093bab86020748af4f Mon Sep 17 00:00:00 2001 From: cjihrig Date: Tue, 21 Mar 2017 13:57:11 -0400 Subject: [PATCH 022/198] 2017-03-21, Version 7.7.4 (Current) Notable changes: * deps: Add node-inspect 1.10.6 (Jan Krems) https://github.com/nodejs/node/pull/11869 * inspector: proper WS URLs when bound to 0.0.0.0 (Eugene Ostroukhov) https://github.com/nodejs/node/pull/11850 * tls: fix segfault on destroy after partial read. (Ben Noordhuis) https://github.com/nodejs/node/pull/11898 PR-URL: https://github.com/nodejs/node/pull/11941 --- CHANGELOG.md | 3 +- doc/changelogs/CHANGELOG_V7.md | 61 ++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f410890014..cbc244efe0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,7 +28,8 @@ release. -7.7.3
+7.7.4
+7.7.3
7.7.2
7.7.1
7.7.0
diff --git a/doc/changelogs/CHANGELOG_V7.md b/doc/changelogs/CHANGELOG_V7.md index 45dda5d2ed..b0edcc8263 100644 --- a/doc/changelogs/CHANGELOG_V7.md +++ b/doc/changelogs/CHANGELOG_V7.md @@ -6,6 +6,7 @@ +7.7.4
7.7.3
7.7.2
7.7.1
@@ -31,6 +32,66 @@ * [io.js](CHANGELOG_IOJS.md) * [Archive](CHANGELOG_ARCHIVE.md) + +## 2017-03-21, Version 7.7.4 (Current), @cjihrig + +### Notable changes + +Thank you to @italoacasas for preparing the majority of this release. + +* **deps**: Add node-inspect 1.10.6 (Jan Krems) [#11869](https://github.com/nodejs/node/pull/11869) +* **inspector**: proper WS URLs when bound to 0.0.0.0 (Eugene Ostroukhov) [#11850](https://github.com/nodejs/node/pull/11850) +* **tls**: fix segfault on destroy after partial read. (Ben Noordhuis) [#11898](https://github.com/nodejs/node/pull/11898) + +### Commits + +* [[`f48763c5b9`](https://github.com/nodejs/node/commit/f48763c5b9)] - **benchmark**: remove benchmarks forced optimizations (Bartosz Sosnowski) +* [[`dcac2d8f04`](https://github.com/nodejs/node/commit/dcac2d8f04)] - **benchmark**: benchmark comparing forEach with for (James M Snell) [#11582](https://github.com/nodejs/node/pull/11582) +* [[`80949f3d88`](https://github.com/nodejs/node/commit/80949f3d88)] - **build**: add cpp linting to windows build (liusi) [#11856](https://github.com/nodejs/node/pull/11856) +* [[`5244ee346b`](https://github.com/nodejs/node/commit/5244ee346b)] - **build**: mac OBJ_DIR should point to obj.target (Daniel Bevenius) [#11857](https://github.com/nodejs/node/pull/11857) +* [[`5b1d61ce09`](https://github.com/nodejs/node/commit/5b1d61ce09)] - **child_process**: fix deoptimizing use of arguments (Vse Mozhet Byt) [#11748](https://github.com/nodejs/node/pull/11748) +* [[`ca319862fd`](https://github.com/nodejs/node/commit/ca319862fd)] - **deps**: cherry-pick ca0f9573 from V8 upstream (Ali Ijaz Sheikh) +* [[`a7e4b029da`](https://github.com/nodejs/node/commit/a7e4b029da)] - **deps**: Add node-inspect 1.10.6 (Jan Krems) [#11869](https://github.com/nodejs/node/pull/11869) +* [[`0c00b655d8`](https://github.com/nodejs/node/commit/0c00b655d8)] - **doc**: Fix #7065: cli help documentation for --inspect (Noj Vek) [#11660](https://github.com/nodejs/node/pull/11660) +* [[`60ad7af65e`](https://github.com/nodejs/node/commit/60ad7af65e)] - **doc**: deprecate debug protocol (Jan Krems) [#10320](https://github.com/nodejs/node/pull/10320) +* [[`a5f7393541`](https://github.com/nodejs/node/commit/a5f7393541)] - **doc**: add vsemozhetbyt to collaborators (Vse Mozhet Byt) [#11932](https://github.com/nodejs/node/pull/11932) +* [[`0c091262bd`](https://github.com/nodejs/node/commit/0c091262bd)] - **doc**: add note that vm module is not a security mechanism (Ruslan Bekenev) [#11557](https://github.com/nodejs/node/pull/11557) +* [[`6d6a65e2ad`](https://github.com/nodejs/node/commit/6d6a65e2ad)] - **doc**: linkable commit message guidelines (Sam Roberts) [#11792](https://github.com/nodejs/node/pull/11792) +* [[`7c7228ed4b`](https://github.com/nodejs/node/commit/7c7228ed4b)] - **doc**: gcc version is at least 4.8.5 in BUILDING.md (detailyang) [#11840](https://github.com/nodejs/node/pull/11840) +* [[`9861ec93d4`](https://github.com/nodejs/node/commit/9861ec93d4)] - **doc**: increase Buffer.concat() documentation (cjihrig) [#11845](https://github.com/nodejs/node/pull/11845) +* [[`54879ab7d1`](https://github.com/nodejs/node/commit/54879ab7d1)] - **doc**: fix mistakes in stream doc (object mode) (Christian d'Heureuse) [#11807](https://github.com/nodejs/node/pull/11807) +* [[`78ca15dd78`](https://github.com/nodejs/node/commit/78ca15dd78)] - **doc**: argument types for dns methods (Amelia Clarke) [#11764](https://github.com/nodejs/node/pull/11764) +* [[`e84e33c87c`](https://github.com/nodejs/node/commit/e84e33c87c)] - **doc**: fix a typo in api/process.md (Gaara) [#11780](https://github.com/nodejs/node/pull/11780) +* [[`75fcf53173`](https://github.com/nodejs/node/commit/75fcf53173)] - **doc**: missing argument types for events methods (Amelia Clarke) [#11802](https://github.com/nodejs/node/pull/11802) +* [[`ae52b63df2`](https://github.com/nodejs/node/commit/ae52b63df2)] - **doc**: correct comment error in stream.md (Alexander) [#11804](https://github.com/nodejs/node/pull/11804) +* [[`e6f113d3d5`](https://github.com/nodejs/node/commit/e6f113d3d5)] - **doc**: console.log() -> console.error() in events.md (Vse Mozhet Byt) [#11810](https://github.com/nodejs/node/pull/11810) +* [[`cde5d71db1`](https://github.com/nodejs/node/commit/cde5d71db1)] - **doc**: var -> let / const in events.md (Vse Mozhet Byt) [#11810](https://github.com/nodejs/node/pull/11810) +* [[`d0fb578d64`](https://github.com/nodejs/node/commit/d0fb578d64)] - **fs**: avoid using forEach (James M Snell) [#11582](https://github.com/nodejs/node/pull/11582) +* [[`14e3ad0c5e`](https://github.com/nodejs/node/commit/14e3ad0c5e)] - **inspector**: proper WS URLs when bound to 0.0.0.0 (Eugene Ostroukhov) [#11850](https://github.com/nodejs/node/pull/11850) +* [[`fbbcd1aa89`](https://github.com/nodejs/node/commit/fbbcd1aa89)] - **lib**: Fix swallowed events in inspect integration (Jan Krems) [#11869](https://github.com/nodejs/node/pull/11869) +* [[`9cc712ca18`](https://github.com/nodejs/node/commit/9cc712ca18)] - **lib**: remove unused msg parameter in debug_agent (mr-spd) [#11833](https://github.com/nodejs/node/pull/11833) +* [[`77c69f7ace`](https://github.com/nodejs/node/commit/77c69f7ace)] - **lib, test**: add duplicate symbol checking in E() (DavidCai) [#11829](https://github.com/nodejs/node/pull/11829) +* [[`7e230727fc`](https://github.com/nodejs/node/commit/7e230727fc)] - **module**: avoid using forEach (James M Snell) [#11582](https://github.com/nodejs/node/pull/11582) +* [[`c0a2e02f51`](https://github.com/nodejs/node/commit/c0a2e02f51)] - **net**: avoid using forEach (James M Snell) [#11582](https://github.com/nodejs/node/pull/11582) +* [[`a0b1aa1161`](https://github.com/nodejs/node/commit/a0b1aa1161)] - **readline**: avoid using forEach (James M Snell) [#11582](https://github.com/nodejs/node/pull/11582) +* [[`e19ca8ba11`](https://github.com/nodejs/node/commit/e19ca8ba11)] - **readline**: remove unneeded eslint-disable comment (Rich Trott) [#11836](https://github.com/nodejs/node/pull/11836) +* [[`62e726109a`](https://github.com/nodejs/node/commit/62e726109a)] - **repl**: avoid using forEach (James M Snell) [#11582](https://github.com/nodejs/node/pull/11582) +* [[`90be5a1f19`](https://github.com/nodejs/node/commit/90be5a1f19)] - **stream**: avoid using forEach (James M Snell) [#11582](https://github.com/nodejs/node/pull/11582) +* [[`2cab00aec0`](https://github.com/nodejs/node/commit/2cab00aec0)] - **test**: fix assertion in vm test (AnnaMag) [#11862](https://github.com/nodejs/node/pull/11862) +* [[`8bda7b8d39`](https://github.com/nodejs/node/commit/8bda7b8d39)] - **test**: add coverage for child_process bounds check (Rich Trott) [#11800](https://github.com/nodejs/node/pull/11800) +* [[`3ae58acd29`](https://github.com/nodejs/node/commit/3ae58acd29)] - **test**: failing behaviour on sandboxed Proxy (AnnaMag) [#11671](https://github.com/nodejs/node/pull/11671) +* [[`560d8eed9a`](https://github.com/nodejs/node/commit/560d8eed9a)] - **test**: delay child exit in AIX for pseudo-tty tests (Gireesh Punathil) [#11715](https://github.com/nodejs/node/pull/11715) +* [[`f9c831f4b1`](https://github.com/nodejs/node/commit/f9c831f4b1)] - **test**: fix flaky test-domain-abort-on-uncaught (Rich Trott) [#11817](https://github.com/nodejs/node/pull/11817) +* [[`2649dab274`](https://github.com/nodejs/node/commit/2649dab274)] - **test**: added test for indexed properties (AnnaMag) [#11769](https://github.com/nodejs/node/pull/11769) +* [[`2df662c95a`](https://github.com/nodejs/node/commit/2df662c95a)] - **test**: test resolveObject with an empty path (Daijiro Wachi) [#11811](https://github.com/nodejs/node/pull/11811) +* [[`d2c9111614`](https://github.com/nodejs/node/commit/d2c9111614)] - **test**: fix repl-function-redefinition-edge-case (Alexey Orlenko) [#11772](https://github.com/nodejs/node/pull/11772) +* [[`c9cf922248`](https://github.com/nodejs/node/commit/c9cf922248)] - **test**: add regex to assert.throws (Matej Krajčovič) [#11815](https://github.com/nodejs/node/pull/11815) +* [[`5f6025ba68`](https://github.com/nodejs/node/commit/5f6025ba68)] - **test**: fail when child dies in fork-net (Joyee Cheung) [#11684](https://github.com/nodejs/node/pull/11684) +* [[`c626734409`](https://github.com/nodejs/node/commit/c626734409)] - **tls**: fix segfault on destroy after partial read (Ben Noordhuis) [#11898](https://github.com/nodejs/node/pull/11898) +* [[`646ee559df`](https://github.com/nodejs/node/commit/646ee559df)] - **tls**: avoid using forEach (James M Snell) [#11582](https://github.com/nodejs/node/pull/11582) +* [[`540830116b`](https://github.com/nodejs/node/commit/540830116b)] - **tls**: keep track of stream that is closed (jBarz) [#11776](https://github.com/nodejs/node/pull/11776) +* [[`9a59913039`](https://github.com/nodejs/node/commit/9a59913039)] - **util**: avoid using forEach (James M Snell) [#11582](https://github.com/nodejs/node/pull/11582) + ## 2017-03-14, Version 7.7.3 (Current), @italoacasas From a1028d5e3ee18dbf135c744b16d3d55068f6efc1 Mon Sep 17 00:00:00 2001 From: Gibson Fahnestock Date: Wed, 22 Mar 2017 00:15:03 +0000 Subject: [PATCH 023/198] build: remove cares headers from tarball The bundled c-ares isn't very suitable for consumption by addons, isn't kept stable, and isn't exported on windows. PR-URL: https://github.com/nodejs/node/pull/10283 Refs: https://github.com/nodejs/node-gyp/pull/1055 Reviewed-By: Ben Noordhuis Reviewed-By: James M Snell Reviewed-By: Michael Dawson Reviewed-By: Colin Ihrig --- tools/install.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/install.py b/tools/install.py index d1100352c6..fdaf2b2e7a 100755 --- a/tools/install.py +++ b/tools/install.py @@ -159,9 +159,6 @@ def headers(action): subdir_files('deps/v8/include', 'include/node/', action) - if 'false' == variables.get('node_shared_cares'): - subdir_files('deps/cares/include', 'include/node/', action) - if 'false' == variables.get('node_shared_libuv'): subdir_files('deps/uv/include', 'include/node/', action) From c98a8022b77234f6257359ecc361fcb9248b2d42 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Tue, 14 Mar 2017 20:54:13 -0700 Subject: [PATCH 024/198] querystring: move isHexTable to internal PR-URL: https://github.com/nodejs/node/pull/11858 Reviewed-By: James M Snell Reviewed-By: Joyee Cheung Reviewed-By: Daijiro Wachi --- lib/internal/querystring.js | 20 ++++++++++++++++++++ lib/querystring.js | 25 +++++-------------------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/lib/internal/querystring.js b/lib/internal/querystring.js index 2f8d77d3e9..c5dc0f63c7 100644 --- a/lib/internal/querystring.js +++ b/lib/internal/querystring.js @@ -4,6 +4,25 @@ const hexTable = new Array(256); for (var i = 0; i < 256; ++i) hexTable[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase(); +const isHexTable = [ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 32 - 47 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 64 - 79 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80 - 95 + 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 96 - 111 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 112 - 127 + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 128 ... + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // ... 256 +]; + // Instantiating this is faster than explicitly calling `Object.create(null)` // to get a "clean" empty object (tested with v8 v4.9). function StorageObject() {} @@ -11,5 +30,6 @@ StorageObject.prototype = Object.create(null); module.exports = { hexTable, + isHexTable, StorageObject }; diff --git a/lib/querystring.js b/lib/querystring.js index 80e4584203..1533c8d87b 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -24,7 +24,11 @@ 'use strict'; const { Buffer } = require('buffer'); -const { StorageObject, hexTable } = require('internal/querystring'); +const { + StorageObject, + hexTable, + isHexTable +} = require('internal/querystring'); const QueryString = module.exports = { unescapeBuffer, // `unescape()` is a JS global, so we need to use a different local name @@ -264,25 +268,6 @@ function stringify(obj, sep, eq, options) { return ''; } -const isHexTable = [ - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 0 - 15 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 16 - 31 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 32 - 47 - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, // 48 - 63 - 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 64 - 79 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 80 - 95 - 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 96 - 111 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 112 - 127 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 128 ... - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // ... 256 -]; - function charCodes(str) { if (str.length === 0) return []; if (str.length === 1) return [str.charCodeAt(0)]; From c515a985ea77495986391dada7baaffcc144b197 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Tue, 14 Mar 2017 21:01:04 -0700 Subject: [PATCH 025/198] url: spec-compliant URLSearchParams parser The entire `URLSearchParams` class is now fully spec-compliant. PR-URL: https://github.com/nodejs/node/pull/11858 Fixes: https://github.com/nodejs/node/issues/10821 Reviewed-By: James M Snell Reviewed-By: Joyee Cheung Reviewed-By: Daijiro Wachi --- ...legacy-vs-whatwg-url-searchparams-parse.js | 2 +- lib/internal/url.js | 115 +++++++++++++++--- test/fixtures/url-searchparams.js | 68 +++++++++++ test/parallel/test-whatwg-url-searchparams.js | 29 ++++- 4 files changed, 197 insertions(+), 17 deletions(-) create mode 100644 test/fixtures/url-searchparams.js diff --git a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js index 86714df6c1..b4a80af4e5 100644 --- a/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js +++ b/benchmark/url/legacy-vs-whatwg-url-searchparams-parse.js @@ -7,7 +7,7 @@ const inputs = require('../fixtures/url-inputs.js').searchParams; const bench = common.createBenchmark(main, { type: Object.keys(inputs), method: ['legacy', 'whatwg'], - n: [1e5] + n: [1e6] }); function useLegacy(n, input) { diff --git a/lib/internal/url.js b/lib/internal/url.js index 91b0640b50..040771c228 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -1,7 +1,11 @@ 'use strict'; const util = require('util'); -const { hexTable, StorageObject } = require('internal/querystring'); +const { + hexTable, + isHexTable, + StorageObject +} = require('internal/querystring'); const binding = process.binding('url'); const context = Symbol('context'); const cannotBeBase = Symbol('cannot-be-base'); @@ -585,23 +589,106 @@ function initSearchParams(url, init) { url[searchParams] = []; return; } - url[searchParams] = getParamsFromObject(querystring.parse(init)); + url[searchParams] = parseParams(init); } -function getParamsFromObject(obj) { - const keys = Object.keys(obj); - const values = []; - for (var i = 0; i < keys.length; i++) { - const name = keys[i]; - const value = obj[name]; - if (Array.isArray(value)) { - for (const item of value) - values.push(name, item); - } else { - values.push(name, value); +// application/x-www-form-urlencoded parser +// Ref: https://url.spec.whatwg.org/#concept-urlencoded-parser +function parseParams(qs) { + const out = []; + var pairStart = 0; + var lastPos = 0; + var seenSep = false; + var buf = ''; + var encoded = false; + var encodeCheck = 0; + var i; + for (i = 0; i < qs.length; ++i) { + const code = qs.charCodeAt(i); + + // Try matching key/value pair separator + if (code === 38/*&*/) { + if (pairStart === i) { + // We saw an empty substring between pair separators + lastPos = pairStart = i + 1; + continue; + } + + if (lastPos < i) + buf += qs.slice(lastPos, i); + if (encoded) + buf = querystring.unescape(buf); + out.push(buf); + + // If `buf` is the key, add an empty value. + if (!seenSep) + out.push(''); + + seenSep = false; + buf = ''; + encoded = false; + encodeCheck = 0; + lastPos = pairStart = i + 1; + continue; + } + + // Try matching key/value separator (e.g. '=') if we haven't already + if (!seenSep && code === 61/*=*/) { + // Key/value separator match! + if (lastPos < i) + buf += qs.slice(lastPos, i); + if (encoded) + buf = querystring.unescape(buf); + out.push(buf); + + seenSep = true; + buf = ''; + encoded = false; + encodeCheck = 0; + lastPos = i + 1; + continue; + } + + // Handle + and percent decoding. + if (code === 43/*+*/) { + if (lastPos < i) + buf += qs.slice(lastPos, i); + buf += ' '; + lastPos = i + 1; + } else if (!encoded) { + // Try to match an (valid) encoded byte (once) to minimize unnecessary + // calls to string decoding functions + if (code === 37/*%*/) { + encodeCheck = 1; + } else if (encodeCheck > 0) { + // eslint-disable-next-line no-extra-boolean-cast + if (!!isHexTable[code]) { + if (++encodeCheck === 3) + encoded = true; + } else { + encodeCheck = 0; + } + } } } - return values; + + // Deal with any leftover key or value data + + // There is a trailing &. No more processing is needed. + if (pairStart === i) + return out; + + if (lastPos < i) + buf += qs.slice(lastPos, i); + if (encoded) + buf = querystring.unescape(buf); + out.push(buf); + + // If `buf` is the key, add an empty value. + if (!seenSep) + out.push(''); + + return out; } // Adapted from querystring's implementation. diff --git a/test/fixtures/url-searchparams.js b/test/fixtures/url-searchparams.js new file mode 100644 index 0000000000..3b186fc97b --- /dev/null +++ b/test/fixtures/url-searchparams.js @@ -0,0 +1,68 @@ +module.exports = [ + ['', '', []], + [ + 'foo=918854443121279438895193', + 'foo=918854443121279438895193', + [['foo', '918854443121279438895193']] + ], + ['foo=bar', 'foo=bar', [['foo', 'bar']]], + ['foo=bar&foo=quux', 'foo=bar&foo=quux', [['foo', 'bar'], ['foo', 'quux']]], + ['foo=1&bar=2', 'foo=1&bar=2', [['foo', '1'], ['bar', '2']]], + [ + "my%20weird%20field=q1!2%22'w%245%267%2Fz8)%3F", + 'my+weird+field=q1%212%22%27w%245%267%2Fz8%29%3F', + [['my weird field', 'q1!2"\'w$5&7/z8)?']] + ], + ['foo%3Dbaz=bar', 'foo%3Dbaz=bar', [['foo=baz', 'bar']]], + ['foo=baz=bar', 'foo=baz%3Dbar', [['foo', 'baz=bar']]], + [ + 'str=foo&arr=1&somenull&arr=2&undef=&arr=3', + 'str=foo&arr=1&somenull=&arr=2&undef=&arr=3', + [ + ['str', 'foo'], + ['arr', '1'], + ['somenull', ''], + ['arr', '2'], + ['undef', ''], + ['arr', '3'] + ] + ], + [' foo = bar ', '+foo+=+bar+', [[' foo ', ' bar ']]], + ['foo=%zx', 'foo=%25zx', [['foo', '%zx']]], + ['foo=%EF%BF%BD', 'foo=%EF%BF%BD', [['foo', '\ufffd']]], + // See: https://github.com/joyent/node/issues/3058 + ['foo&bar=baz', 'foo=&bar=baz', [['foo', ''], ['bar', 'baz']]], + ['a=b&c&d=e', 'a=b&c=&d=e', [['a', 'b'], ['c', ''], ['d', 'e']]], + ['a=b&c=&d=e', 'a=b&c=&d=e', [['a', 'b'], ['c', ''], ['d', 'e']]], + ['a=b&=c&d=e', 'a=b&=c&d=e', [['a', 'b'], ['', 'c'], ['d', 'e']]], + ['a=b&=&d=e', 'a=b&=&d=e', [['a', 'b'], ['', ''], ['d', 'e']]], + ['&&foo=bar&&', 'foo=bar', [['foo', 'bar']]], + ['&', '', []], + ['&&&&', '', []], + ['&=&', '=', [['', '']]], + ['&=&=', '=&=', [['', ''], ['', '']]], + ['=', '=', [['', '']]], + ['+', '+=', [[' ', '']]], + ['+=', '+=', [[' ', '']]], + ['=+', '=+', [['', ' ']]], + ['+=&', '+=', [[' ', '']]], + ['a&&b', 'a=&b=', [['a', ''], ['b', '']]], + ['a=a&&b=b', 'a=a&b=b', [['a', 'a'], ['b', 'b']]], + ['&a', 'a=', [['a', '']]], + ['&=', '=', [['', '']]], + ['a&a&', 'a=&a=', [['a', ''], ['a', '']]], + ['a&a&a&', 'a=&a=&a=', [['a', ''], ['a', ''], ['a', '']]], + ['a&a&a&a&', 'a=&a=&a=&a=', [['a', ''], ['a', ''], ['a', ''], ['a', '']]], + ['a=&a=value&a=', 'a=&a=value&a=', [['a', ''], ['a', 'value'], ['a', '']]], + ['foo%20bar=baz%20quux', 'foo+bar=baz+quux', [['foo bar', 'baz quux']]], + ['+foo=+bar', '+foo=+bar', [[' foo', ' bar']]], + [ + // fake percent encoding + 'foo=%©ar&baz=%A©uux&xyzzy=%©ud', + 'foo=%25%C2%A9ar&baz=%25A%C2%A9uux&xyzzy=%25%C2%A9ud', + [['foo', '%©ar'], ['baz', '%A©uux'], ['xyzzy', '%©ud']] + ], + // always preserve order of key-value pairs + ['a=1&b=2&a=3', 'a=1&b=2&a=3', [['a', '1'], ['b', '2'], ['a', '3']]], + ['?a', '%3Fa=', [['?a', '']]] +]; diff --git a/test/parallel/test-whatwg-url-searchparams.js b/test/parallel/test-whatwg-url-searchparams.js index 7d6df64640..c7acb7d909 100644 --- a/test/parallel/test-whatwg-url-searchparams.js +++ b/test/parallel/test-whatwg-url-searchparams.js @@ -1,8 +1,9 @@ 'use strict'; -require('../common'); +const common = require('../common'); const assert = require('assert'); -const URL = require('url').URL; +const path = require('path'); +const { URL, URLSearchParams } = require('url'); // Tests below are not from WPT. const serialized = 'a=a&a=1&a=true&a=undefined&a=null&a=%EF%BF%BD' + @@ -77,3 +78,27 @@ assert.throws(() => sp.forEach(1), m.search = '?a=a&b=b'; assert.strictEqual(sp.toString(), 'a=a&b=b'); + +const tests = require(path.join(common.fixturesDir, 'url-searchparams.js')); + +for (const [input, expected, parsed] of tests) { + if (input[0] !== '?') { + const sp = new URLSearchParams(input); + assert.strictEqual(String(sp), expected); + assert.deepStrictEqual(Array.from(sp), parsed); + + m.search = input; + assert.strictEqual(String(m.searchParams), expected); + assert.deepStrictEqual(Array.from(m.searchParams), parsed); + } + + { + const sp = new URLSearchParams(`?${input}`); + assert.strictEqual(String(sp), expected); + assert.deepStrictEqual(Array.from(sp), parsed); + + m.search = `?${input}`; + assert.strictEqual(String(m.searchParams), expected); + assert.deepStrictEqual(Array.from(m.searchParams), parsed); + } +} From d23123643d98165c67ad51d1fdecf06486b1c6d9 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Thu, 16 Mar 2017 16:46:12 -0700 Subject: [PATCH 026/198] src: make PercentDecode return void It only returns 0, nor is it likely to have any error conditions in the future. PR-URL: https://github.com/nodejs/node/pull/11922 Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig Reviewed-By: Joyee Cheung Reviewed-By: James M Snell --- src/node_url.cc | 3 +-- src/node_url.h | 11 +++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/node_url.cc b/src/node_url.cc index 1aae557115..6a9f8f3ca9 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -368,8 +368,7 @@ namespace url { } // First, we have to percent decode - if (PercentDecode(input, length, &decoded) < 0) - goto end; + PercentDecode(input, length, &decoded); // Then we have to punycode toASCII if (!ToASCII(&decoded, &decoded)) diff --git a/src/node_url.h b/src/node_url.h index 198c29938b..ba05cd6fed 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -376,11 +376,11 @@ static inline unsigned hex2bin(const char ch) { return static_cast(-1); } -static inline int PercentDecode(const char* input, - size_t len, - std::string* dest) { +static inline void PercentDecode(const char* input, + size_t len, + std::string* dest) { if (len == 0) - return 0; + return; dest->reserve(len); const char* pointer = input; const char* end = input + len; @@ -399,11 +399,10 @@ static inline int PercentDecode(const char* input, unsigned a = hex2bin(pointer[1]); unsigned b = hex2bin(pointer[2]); char c = static_cast(a * 16 + b); - *dest += static_cast(c); + *dest += c; pointer += 3; } } - return 0; } #define SPECIALS(XX) \ From 7bc893f0c667528c8f82e79cbff73ac09eafb8a4 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sat, 18 Mar 2017 20:02:00 -0700 Subject: [PATCH 027/198] test: fix flaky test-tls-socket-close Replace timer/timeout race with event-based ordering, eliminating test flakiness. PR-URL: https://github.com/nodejs/node/pull/11921 Fixes: https://github.com/nodejs/node/issues/11912 Reviewed-By: Colin Ihrig Reviewed-By: Santiago Gimeno Reviewed-By: James M Snell --- test/parallel/test-tls-socket-close.js | 45 ++++++++++++++++---------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/test/parallel/test-tls-socket-close.js b/test/parallel/test-tls-socket-close.js index 4e7382f340..617062a4f2 100644 --- a/test/parallel/test-tls-socket-close.js +++ b/test/parallel/test-tls-socket-close.js @@ -13,35 +13,46 @@ const net = require('net'); const key = fs.readFileSync(common.fixturesDir + '/keys/agent2-key.pem'); const cert = fs.readFileSync(common.fixturesDir + '/keys/agent2-cert.pem'); -const T = 100; - +let tlsSocket; // tls server const tlsServer = tls.createServer({ cert, key }, (socket) => { - setTimeout(() => { - socket.on('error', (error) => { - assert.strictEqual(error.code, 'EINVAL'); - tlsServer.close(); - netServer.close(); - }); - socket.write('bar'); - }, T * 2); + tlsSocket = socket; + socket.on('error', common.mustCall((error) => { + assert.strictEqual(error.code, 'EINVAL'); + tlsServer.close(); + netServer.close(); + })); }); +let netSocket; // plain tcp server const netServer = net.createServer((socket) => { - // if client wants to use tls + // if client wants to use tls tlsServer.emit('connection', socket); - socket.setTimeout(T, () => { - // this breaks if TLSSocket is already managing the socket: - socket.destroy(); - }); + netSocket = socket; }).listen(0, common.mustCall(function() { - // connect client tls.connect({ host: 'localhost', port: this.address().port, rejectUnauthorized: false - }).write('foo'); + }).write('foo', 'utf8', common.mustCall(() => { + assert(netSocket); + netSocket.setTimeout(1, common.mustCall(() => { + assert(tlsSocket); + // this breaks if TLSSocket is already managing the socket: + netSocket.destroy(); + const interval = setInterval(() => { + // Checking this way allows us to do the write at a time that causes a + // segmentation fault (not always, but often) in Node.js 7.7.3 and + // earlier. If we instead, for example, wait on the `close` event, then + // it will not segmentation fault, which is what this test is all about. + if (tlsSocket._handle._parent.bytesRead === 0) { + tlsSocket.write('bar'); + clearInterval(interval); + } + }, 1); + })); + })); })); From 1d82adc8c7ff4a04a9b8ef3fdbbf28515967cdcb Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Sun, 19 Mar 2017 14:36:09 -0700 Subject: [PATCH 028/198] test: add test for child_process.execFile() While `child_process.execFile()` gets called in places in the test suite, there are no explicit test for it and there are parts of the implementation that are not covered by tests. This adds a minimal test that increases (but does not complete) coverage for the implementation. PR-URL: https://github.com/nodejs/node/pull/11929 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Yuta Hiroto --- test/parallel/test-child-process-execfile.js | 21 ++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/parallel/test-child-process-execfile.js diff --git a/test/parallel/test-child-process-execfile.js b/test/parallel/test-child-process-execfile.js new file mode 100644 index 0000000000..ab36aa7b15 --- /dev/null +++ b/test/parallel/test-child-process-execfile.js @@ -0,0 +1,21 @@ +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const execFile = require('child_process').execFile; +const path = require('path'); + +const fixture = path.join(common.fixturesDir, 'exit.js'); + +{ + execFile( + process.execPath, + [fixture, 42], + common.mustCall((e) => { + // Check that arguments are included in message + assert.strictEqual(e.message.trim(), + `Command failed: ${process.execPath} ${fixture} 42`); + assert.strictEqual(e.code, 42); + }) + ); +} From 4fb9b1226f3b80bf1e4661fd3be6e91283b8531b Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 19 Mar 2017 13:35:47 -0700 Subject: [PATCH 029/198] src, buffer: do not segfault on out-of-range index Also add test cases for partial writes and invalid indices. PR-URL: https://github.com/nodejs/node/pull/11927 Fixes: https://github.com/nodejs/node/issues/8724 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen --- src/node_buffer.cc | 28 ++++++--- test/parallel/test-buffer-write-noassert.js | 63 ++++++++++++++++++--- 2 files changed, 75 insertions(+), 16 deletions(-) diff --git a/src/node_buffer.cc b/src/node_buffer.cc index dc8afd5783..04c0161edd 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -169,7 +169,8 @@ void CallbackInfo::WeakCallback(Isolate* isolate) { // Parse index for external array data. inline MUST_USE_RESULT bool ParseArrayIndex(Local arg, size_t def, - size_t* ret) { + size_t* ret, + size_t needed = 0) { if (arg->IsUndefined()) { *ret = def; return true; @@ -183,7 +184,7 @@ inline MUST_USE_RESULT bool ParseArrayIndex(Local arg, // Check that the result fits in a size_t. const uint64_t kSizeMax = static_cast(static_cast(-1)); // coverity[pointless_expression] - if (static_cast(tmp_i) > kSizeMax) + if (static_cast(tmp_i) > kSizeMax - needed) return false; *ret = static_cast(tmp_i); @@ -815,17 +816,28 @@ void WriteFloatGeneric(const FunctionCallbackInfo& args) { CHECK_NE(ts_obj_data, nullptr); T val = args[1]->NumberValue(env->context()).FromMaybe(0); - size_t offset = args[2]->IntegerValue(env->context()).FromMaybe(0); size_t memcpy_num = sizeof(T); + size_t offset; - if (should_assert) { - THROW_AND_RETURN_IF_OOB(offset + memcpy_num >= memcpy_num); - THROW_AND_RETURN_IF_OOB(offset + memcpy_num <= ts_obj_length); + // If the offset is negative or larger than the size of the ArrayBuffer, + // throw an error (if needed) and return directly. + if (!ParseArrayIndex(args[2], 0, &offset, memcpy_num) || + offset >= ts_obj_length) { + if (should_assert) + THROW_AND_RETURN_IF_OOB(false); + return; } - if (offset + memcpy_num > ts_obj_length) - memcpy_num = ts_obj_length - offset; + // If the offset is too large for the entire value, but small enough to fit + // part of the value, throw an error and return only if should_assert is + // true. Otherwise, write the part of the value that fits. + if (offset + memcpy_num > ts_obj_length) { + if (should_assert) + THROW_AND_RETURN_IF_OOB(false); + else + memcpy_num = ts_obj_length - offset; + } union NoAlias { T val; diff --git a/test/parallel/test-buffer-write-noassert.js b/test/parallel/test-buffer-write-noassert.js index 7423e462ca..10e9fd8b76 100644 --- a/test/parallel/test-buffer-write-noassert.js +++ b/test/parallel/test-buffer-write-noassert.js @@ -4,6 +4,8 @@ const assert = require('assert'); // testing buffer write functions +const outOfRange = /^RangeError: (?:Index )?out of range(?: index)?$/; + function write(funx, args, result, res) { { const buf = Buffer.alloc(9); @@ -11,14 +13,8 @@ function write(funx, args, result, res) { assert.deepStrictEqual(buf, res); } - { - const invalidArgs = Array.from(args); - invalidArgs[1] = -1; - assert.throws( - () => Buffer.alloc(9)[funx](...invalidArgs), - /^RangeError: (?:Index )?out of range(?: index)?$/ - ); - } + writeInvalidOffset(-1); + writeInvalidOffset(9); if (!/Int/.test(funx)) { assert.throws( @@ -33,6 +29,15 @@ function write(funx, args, result, res) { assert.deepStrictEqual(buf2, res); } + function writeInvalidOffset(offset) { + const newArgs = Array.from(args); + newArgs[1] = offset; + assert.throws(() => Buffer.alloc(9)[funx](...newArgs), outOfRange); + + const buf = Buffer.alloc(9); + buf[funx](...newArgs, true); + assert.deepStrictEqual(buf, Buffer.alloc(9)); + } } write('writeInt8', [1, 0], 1, Buffer.from([1, 0, 0, 0, 0, 0, 0, 0, 0])); @@ -53,3 +58,45 @@ write('writeDoubleBE', [1, 1], 9, Buffer.from([0, 63, 240, 0, 0, 0, 0, 0, 0])); write('writeDoubleLE', [1, 1], 9, Buffer.from([0, 0, 0, 0, 0, 0, 0, 240, 63])); write('writeFloatBE', [1, 1], 5, Buffer.from([0, 63, 128, 0, 0, 0, 0, 0, 0])); write('writeFloatLE', [1, 1], 5, Buffer.from([0, 0, 0, 128, 63, 0, 0, 0, 0])); + +function writePartial(funx, args, result, res) { + assert.throws(() => Buffer.alloc(9)[funx](...args), outOfRange); + const buf = Buffer.alloc(9); + assert.strictEqual(buf[funx](...args, true), result); + assert.deepStrictEqual(buf, res); +} + +// Test partial writes (cases where the buffer isn't large enough to hold the +// entire value, but is large enough to hold parts of it). +writePartial('writeIntBE', [0x0eadbeef, 6, 4], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0x0e, 0xad, 0xbe])); +writePartial('writeIntLE', [0x0eadbeef, 6, 4], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0xef, 0xbe, 0xad])); +writePartial('writeInt16BE', [0x1234, 8], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0x12])); +writePartial('writeInt16LE', [0x1234, 8], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0x34])); +writePartial('writeInt32BE', [0x0eadbeef, 6], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0x0e, 0xad, 0xbe])); +writePartial('writeInt32LE', [0x0eadbeef, 6], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0xef, 0xbe, 0xad])); +writePartial('writeUIntBE', [0xdeadbeef, 6, 4], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0xde, 0xad, 0xbe])); +writePartial('writeUIntLE', [0xdeadbeef, 6, 4], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0xef, 0xbe, 0xad])); +writePartial('writeUInt16BE', [0x1234, 8], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0x12])); +writePartial('writeUInt16LE', [0x1234, 8], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0x34])); +writePartial('writeUInt32BE', [0xdeadbeef, 6], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0xde, 0xad, 0xbe])); +writePartial('writeUInt32LE', [0xdeadbeef, 6], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0xef, 0xbe, 0xad])); +writePartial('writeDoubleBE', [1, 2], 10, + Buffer.from([0, 0, 63, 240, 0, 0, 0, 0, 0])); +writePartial('writeDoubleLE', [1, 2], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 240])); +writePartial('writeFloatBE', [1, 6], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 63, 128, 0])); +writePartial('writeFloatLE', [1, 6], 10, + Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 128])); From 4b841cb0b6d765813a02f9b348f9ff04854ee969 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Sun, 19 Mar 2017 15:02:17 +0200 Subject: [PATCH 030/198] benchmark: harmonize progress bar + stderr output Add a space for minimal readability. PR-URL: https://github.com/nodejs/node/pull/11925 Reviewed-By: Joyee Cheung Reviewed-By: James M Snell --- benchmark/_benchmark_progress.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/benchmark/_benchmark_progress.js b/benchmark/_benchmark_progress.js index 4b42248f24..4afae2f77d 100644 --- a/benchmark/_benchmark_progress.js +++ b/benchmark/_benchmark_progress.js @@ -104,7 +104,7 @@ class BenchmarkProgress { `| ${fraction(completedFiles, scheduledFiles)} files ` + `| ${fraction(completedRunsForFile, runsPerFile)} runs ` + `| ${fraction(completedConfig, scheduledConfig)} configs]` + - `: ${caption}`; + `: ${caption} `; } updateProgress(finished) { From ae8a8691e65c90053c3e996c14fd221b61f3effc Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Sun, 19 Mar 2017 12:32:39 +0200 Subject: [PATCH 031/198] benchmark: add final clean-up to module-loader.js PR-URL: https://github.com/nodejs/node/pull/11924 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell --- benchmark/module/module-loader.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/benchmark/module/module-loader.js b/benchmark/module/module-loader.js index 090f7b7854..d7e03cfee4 100644 --- a/benchmark/module/module-loader.js +++ b/benchmark/module/module-loader.js @@ -35,6 +35,8 @@ function main(conf) { measureFull(n, conf.useCache === 'true'); else measureDir(n, conf.useCache === 'true'); + + rmrf(tmpDirectory); } function measureFull(n, useCache) { From eed87b1637d64340856bb7f77db899f5283ca84f Mon Sep 17 00:00:00 2001 From: Luca Maraschi Date: Fri, 17 Mar 2017 17:07:19 +0100 Subject: [PATCH 032/198] fs: (+/-)Infinity and NaN invalid unixtimestamp Infinity and NaN are currently considered valid input when generating a unix time stamp but are defaulted arbitrarly to Date.now()/1000. This PR removes this behaviour and throw an exception like all the other invalid input types. PR-URL: https://github.com/nodejs/node/pull/11919 Reviewed-By: Colin Ihrig Reviewed-By: Matteo Collina Reviewed-By: James M Snell --- doc/api/fs.md | 3 +-- lib/fs.js | 4 ++-- test/parallel/test-fs-timestamp-parsing-error.js | 7 ++++--- test/parallel/test-fs-utimes.js | 10 ++++------ 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/doc/api/fs.md b/doc/api/fs.md index c6046d2731..a527e94896 100644 --- a/doc/api/fs.md +++ b/doc/api/fs.md @@ -1880,8 +1880,7 @@ follow these rules: returns milliseconds, so it should be divided by 1000 before passing it in. - If the value is a numeric string like `'123456789'`, the value will get converted to the corresponding number. -- If the value is `NaN` or `Infinity`, the value will get converted to - `Date.now() / 1000`. +- If the value is `NaN`, `Infinity` or `-Infinity`, an Error will be thrown. ## fs.utimesSync(path, atime, mtime) - -Streams can be either [Readable][], [Writable][], or both ([Duplex][]). - -All streams are EventEmitters, but they also have other custom methods -and properties depending on whether they are Readable, Writable, or -Duplex. - -If a stream is both Readable and Writable, then it implements all of -the methods and events. So, a [Duplex][] or [Transform][] stream is -fully described by this API, though their implementation may be -somewhat different. - -It is not necessary to implement Stream interfaces in order to consume -streams in your programs. If you **are** implementing streaming -interfaces in your own program, please also refer to -[API for Stream Implementors][]. - -Almost all Node.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an Node.js program: - -```js -const http = require('http'); - -var server = http.createServer( (req, res) => { - // req is an http.IncomingMessage, which is a Readable Stream - // res is an http.ServerResponse, which is a Writable Stream - - var body = ''; - // we want to get the data as utf8 strings - // If you don't set an encoding, then you'll get Buffer objects - req.setEncoding('utf8'); - - // Readable streams emit 'data' events once a listener is added - req.on('data', (chunk) => { - body += chunk; - }); - - // the end event tells you that you have entire body - req.on('end', () => { - try { - var data = JSON.parse(body); - } catch (er) { - // uh oh! bad json! - res.statusCode = 400; - return res.end(`error: ${er.message}`); - } - - // write back something interesting to the user: - res.write(typeof data); - res.end(); - }); -}); - -server.listen(1337); - -// $ curl localhost:1337 -d '{}' -// object -// $ curl localhost:1337 -d '"foo"' -// string -// $ curl localhost:1337 -d 'not json' -// error: Unexpected token o -``` - -### Class: stream.Duplex - -Duplex streams are streams that implement both the [Readable][] and -[Writable][] interfaces. - -Examples of Duplex streams include: - -* [TCP sockets][] -* [zlib streams][zlib] -* [crypto streams][crypto] - -### Class: stream.Readable - - - -The Readable stream interface is the abstraction for a *source* of -data that you are reading from. In other words, data comes *out* of a -Readable stream. - -A Readable stream will not start emitting data until you indicate that -you are ready to receive it. - -Readable streams have two "modes": a **flowing mode** and a **paused -mode**. When in flowing mode, data is read from the underlying system -and provided to your program as fast as possible. In paused mode, you -must explicitly call [`stream.read()`][stream-read] to get chunks of data out. -Streams start out in paused mode. - -**Note**: If no data event handlers are attached, and there are no -[`stream.pipe()`][] destinations, and the stream is switched into flowing -mode, then data will be lost. - -You can switch to flowing mode by doing any of the following: - -* Adding a [`'data'`][] event handler to listen for data. -* Calling the [`stream.resume()`][stream-resume] method to explicitly open the - flow. -* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. - -You can switch back to paused mode by doing either of the following: - -* If there are no pipe destinations, by calling the - [`stream.pause()`][stream-pause] method. -* If there are pipe destinations, by removing any [`'data'`][] event - handlers, and removing all pipe destinations by calling the - [`stream.unpipe()`][] method. - -Note that, for backwards compatibility reasons, removing [`'data'`][] -event handlers will **not** automatically pause the stream. Also, if -there are piped destinations, then calling [`stream.pause()`][stream-pause] will -not guarantee that the stream will *remain* paused once those -destinations drain and ask for more data. - -Examples of readable streams include: - -* [HTTP responses, on the client][http-incoming-message] -* [HTTP requests, on the server][http-incoming-message] -* [fs read streams][] -* [zlib streams][zlib] -* [crypto streams][crypto] -* [TCP sockets][] -* [child process stdout and stderr][] -* [`process.stdin`][] - -#### Event: 'close' - -Emitted when the stream and any of its underlying resources (a file -descriptor, for example) have been closed. The event indicates that -no more events will be emitted, and no further computation will occur. - -Not all streams will emit the `'close'` event. - -#### Event: 'data' - -* `chunk` {Buffer|String} The chunk of data. - -Attaching a `'data'` event listener to a stream that has not been -explicitly paused will switch the stream into flowing mode. Data will -then be passed as soon as it is available. - -If you just want to get all the data out of the stream as fast as -possible, this is the best way to do so. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); -}); -``` - -#### Event: 'end' - -This event fires when there will be no more data to read. - -Note that the `'end'` event **will not fire** unless the data is -completely consumed. This can be done by switching into flowing mode, -or by calling [`stream.read()`][stream-read] repeatedly until you get to the -end. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); -}); -readable.on('end', () => { - console.log('there will be no more data.'); -}); -``` - -#### Event: 'error' - -* {Error Object} - -Emitted if there was an error receiving data. - -#### Event: 'readable' - -When a chunk of data can be read from the stream, it will emit a -`'readable'` event. - -In some cases, listening for a `'readable'` event will cause some data -to be read into the internal buffer from the underlying system, if it -hadn't already. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', () => { - // there is some data to read now -}); -``` - -Once the internal buffer is drained, a `'readable'` event will fire -again when more data is available. - -The `'readable'` event is not emitted in the "flowing" mode with the -sole exception of the last one, on end-of-stream. - -The `'readable'` event indicates that the stream has new information: -either new data is available or the end of the stream has been reached. -In the former case, [`stream.read()`][stream-read] will return that data. In the -latter case, [`stream.read()`][stream-read] will return null. For instance, in -the following example, `foo.txt` is an empty file: - -```js -const fs = require('fs'); -var rr = fs.createReadStream('foo.txt'); -rr.on('readable', () => { - console.log('readable:', rr.read()); -}); -rr.on('end', () => { - console.log('end'); -}); -``` - -The output of running this script is: - -``` -$ node test.js -readable: null -end -``` - -#### readable.isPaused() - -* Return: {Boolean} - -This method returns whether or not the `readable` has been **explicitly** -paused by client code (using [`stream.pause()`][stream-pause] without a -corresponding [`stream.resume()`][stream-resume]). - -```js -var readable = new stream.Readable - -readable.isPaused() // === false -readable.pause() -readable.isPaused() // === true -readable.resume() -readable.isPaused() // === false -``` - -#### readable.pause() - -* Return: `this` - -This method will cause a stream in flowing mode to stop emitting -[`'data'`][] events, switching out of flowing mode. Any data that becomes -available will remain in the internal buffer. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); - readable.pause(); - console.log('there will be no more data for 1 second'); - setTimeout(() => { - console.log('now data will start flowing again'); - readable.resume(); - }, 1000); -}); -``` - -#### readable.pipe(destination[, options]) - -* `destination` {stream.Writable} The destination for writing data -* `options` {Object} Pipe options - * `end` {Boolean} End the writer when the reader ends. Default = `true` - -This method pulls all the data out of a readable stream, and writes it -to the supplied destination, automatically managing the flow so that -the destination is not overwhelmed by a fast readable stream. - -Multiple destinations can be piped to safely. - -```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt' -readable.pipe(writable); -``` - -This function returns the destination stream, so you can set up pipe -chains like so: - -```js -var r = fs.createReadStream('file.txt'); -var z = zlib.createGzip(); -var w = fs.createWriteStream('file.txt.gz'); -r.pipe(z).pipe(w); -``` - -For example, emulating the Unix `cat` command: - -```js -process.stdin.pipe(process.stdout); -``` - -By default [`stream.end()`][stream-end] is called on the destination when the -source stream emits [`'end'`][], so that `destination` is no longer writable. -Pass `{ end: false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. - -```js -reader.pipe(writer, { end: false }); -reader.on('end', () => { - writer.end('Goodbye\n'); -}); -``` - -Note that [`process.stderr`][] and [`process.stdout`][] are never closed until -the process exits, regardless of the specified options. - -#### readable.read([size]) - -* `size` {Number} Optional argument to specify how much data to read. -* Return {String|Buffer|Null} - -The `read()` method pulls some data out of the internal buffer and -returns it. If there is no data available, then it will return -`null`. - -If you pass in a `size` argument, then it will return that many -bytes. If `size` bytes are not available, then it will return `null`, -unless we've ended, in which case it will return the data remaining -in the buffer. - -If you do not specify a `size` argument, then it will return all the -data in the internal buffer. - -This method should only be called in paused mode. In flowing mode, -this method is called automatically until the internal buffer is -drained. - -```js -var readable = getReadableStreamSomehow(); -readable.on('readable', () => { - var chunk; - while (null !== (chunk = readable.read())) { - console.log('got %d bytes of data', chunk.length); - } -}); -``` - -If this method returns a data chunk, then it will also trigger the -emission of a [`'data'`][] event. - -Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] -event has been triggered will return `null`. No runtime error will be raised. - -#### readable.resume() - -* Return: `this` - -This method will cause the readable stream to resume emitting [`'data'`][] -events. - -This method will switch the stream into flowing mode. If you do *not* -want to consume the data from a stream, but you *do* want to get to -its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open -the flow of data. - -```js -var readable = getReadableStreamSomehow(); -readable.resume(); -readable.on('end', () => { - console.log('got to the end, but did not read anything'); -}); -``` - -#### readable.setEncoding(encoding) - -* `encoding` {String} The encoding to use. -* Return: `this` - -Call this function to cause the stream to return strings of the specified -encoding instead of Buffer objects. For example, if you do -`readable.setEncoding('utf8')`, then the output data will be interpreted as -UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, -then the data will be encoded in hexadecimal string format. - -This properly handles multi-byte characters that would otherwise be -potentially mangled if you simply pulled the Buffers directly and -called [`buf.toString(encoding)`][] on them. If you want to read the data -as strings, always use this method. - -Also you can disable any encoding at all with `readable.setEncoding(null)`. -This approach is very useful if you deal with binary data or with large -multi-byte strings spread out over multiple chunks. - -```js -var readable = getReadableStreamSomehow(); -readable.setEncoding('utf8'); -readable.on('data', (chunk) => { - assert.equal(typeof chunk, 'string'); - console.log('got %d characters of string data', chunk.length); -}); -``` - -#### readable.unpipe([destination]) - -* `destination` {stream.Writable} Optional specific stream to unpipe - -This method will remove the hooks set up for a previous [`stream.pipe()`][] -call. - -If the destination is not specified, then all pipes are removed. - -If the destination is specified, but no pipe is set up for it, then -this is a no-op. - -```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt', -// but only for the first second -readable.pipe(writable); -setTimeout(() => { - console.log('stop writing to file.txt'); - readable.unpipe(writable); - console.log('manually close the file stream'); - writable.end(); -}, 1000); -``` - -#### readable.unshift(chunk) - -* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue - -This is useful in certain cases where a stream is being consumed by a -parser, which needs to "un-consume" some data that it has -optimistically pulled out of the source, so that the stream can be -passed on to some other party. - -Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event -has been triggered; a runtime error will be raised. - -If you find that you must often call `stream.unshift(chunk)` in your -programs, consider implementing a [Transform][] stream instead. (See [API -for Stream Implementors][].) - -```js -// Pull off a header delimited by \n\n -// use unshift() if we get too much -// Call the callback with (error, header, stream) -const StringDecoder = require('string_decoder').StringDecoder; -function parseHeader(stream, callback) { - stream.on('error', callback); - stream.on('readable', onReadable); - var decoder = new StringDecoder('utf8'); - var header = ''; - function onReadable() { - var chunk; - while (null !== (chunk = stream.read())) { - var str = decoder.write(chunk); - if (str.match(/\n\n/)) { - // found the header boundary - var split = str.split(/\n\n/); - header += split.shift(); - var remaining = split.join('\n\n'); - var buf = new Buffer(remaining, 'utf8'); - if (buf.length) - stream.unshift(buf); - stream.removeListener('error', callback); - stream.removeListener('readable', onReadable); - // now the body of the message can be read from the stream. - callback(null, header, stream); - } else { - // still reading the header. - header += str; - } - } - } -} -``` - -Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` -will not end the reading process by resetting the internal reading state of the -stream. This can cause unexpected results if `unshift()` is called during a -read (i.e. from within a [`stream._read()`][stream-_read] implementation on a -custom stream). Following the call to `unshift()` with an immediate -[`stream.push('')`][stream-push] will reset the reading state appropriately, -however it is best to simply avoid calling `unshift()` while in the process of -performing a read. - -#### readable.wrap(stream) - -* `stream` {Stream} An "old style" readable stream - -Versions of Node.js prior to v0.10 had streams that did not implement the -entire Streams API as it is today. (See [Compatibility][] for -more information.) - -If you are using an older Node.js library that emits [`'data'`][] events and -has a [`stream.pause()`][stream-pause] method that is advisory only, then you -can use the `wrap()` method to create a [Readable][] stream that uses the old -stream as its data source. - -You will very rarely ever need to call this function, but it exists -as a convenience for interacting with old Node.js programs and libraries. - -For example: - -```js -const OldReader = require('./old-api-module.js').OldReader; -const Readable = require('stream').Readable; -const oreader = new OldReader; -const myReader = new Readable().wrap(oreader); - -myReader.on('readable', () => { - myReader.read(); // etc. -}); -``` - -### Class: stream.Transform - -Transform streams are [Duplex][] streams where the output is in some way -computed from the input. They implement both the [Readable][] and -[Writable][] interfaces. - -Examples of Transform streams include: - -* [zlib streams][zlib] -* [crypto streams][crypto] - -### Class: stream.Writable - - - -The Writable stream interface is an abstraction for a *destination* -that you are writing data *to*. - -Examples of writable streams include: - -* [HTTP requests, on the client][] -* [HTTP responses, on the server][] -* [fs write streams][] -* [zlib streams][zlib] -* [crypto streams][crypto] -* [TCP sockets][] -* [child process stdin][] -* [`process.stdout`][], [`process.stderr`][] - -#### Event: 'drain' - -If a [`stream.write(chunk)`][stream-write] call returns `false`, then the -`'drain'` event will indicate when it is appropriate to begin writing more data -to the stream. - -```js -// Write the data to the supplied writable stream one million times. -// Be attentive to back-pressure. -function writeOneMillionTimes(writer, data, encoding, callback) { - var i = 1000000; - write(); - function write() { - var ok = true; - do { - i -= 1; - if (i === 0) { - // last time! - writer.write(data, encoding, callback); - } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. - ok = writer.write(data, encoding); - } - } while (i > 0 && ok); - if (i > 0) { - // had to stop early! - // write some more once it drains - writer.once('drain', write); - } - } -} -``` - -#### Event: 'error' - -* {Error} - -Emitted if there was an error when writing or piping data. - -#### Event: 'finish' - -When the [`stream.end()`][stream-end] method has been called, and all data has -been flushed to the underlying system, this event is emitted. - -```javascript -var writer = getWritableStreamSomehow(); -for (var i = 0; i < 100; i ++) { - writer.write('hello, #${i}!\n'); -} -writer.end('this is the end\n'); -writer.on('finish', () => { - console.error('all writes are now complete.'); -}); -``` - -#### Event: 'pipe' - -* `src` {stream.Readable} source stream that is piping to this writable - -This is emitted whenever the [`stream.pipe()`][] method is called on a readable -stream, adding this writable to its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('pipe', (src) => { - console.error('something is piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -``` - -#### Event: 'unpipe' - -* `src` {[Readable][] Stream} The source stream that - [unpiped][`stream.unpipe()`] this writable - -This is emitted whenever the [`stream.unpipe()`][] method is called on a -readable stream, removing this writable from its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('unpipe', (src) => { - console.error('something has stopped piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -reader.unpipe(writer); -``` - -#### writable.cork() - -Forces buffering of all writes. - -Buffered data will be flushed either at [`stream.uncork()`][] or at -[`stream.end()`][stream-end] call. - -#### writable.end([chunk][, encoding][, callback]) - -* `chunk` {String|Buffer} Optional data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Optional callback for when the stream is finished - -Call this method when no more data will be written to the stream. If supplied, -the callback is attached as a listener on the [`'finish'`][] event. - -Calling [`stream.write()`][stream-write] after calling -[`stream.end()`][stream-end] will raise an error. - -```js -// write 'hello, ' and then end with 'world!' -var file = fs.createWriteStream('example.txt'); -file.write('hello, '); -file.end('world!'); -// writing more now is not allowed! -``` - -#### writable.setDefaultEncoding(encoding) - -* `encoding` {String} The new default encoding - -Sets the default encoding for a writable stream. - -#### writable.uncork() - -Flush all data, buffered since [`stream.cork()`][] call. - -#### writable.write(chunk[, encoding][, callback]) - -* `chunk` {String|Buffer} The data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} `true` if the data was handled completely. - -This method writes some data to the underlying system, and calls the -supplied callback once the data has been fully handled. - -The return value indicates if you should continue writing right now. -If the data had to be buffered internally, then it will return -`false`. Otherwise, it will return `true`. - -This return value is strictly advisory. You MAY continue to write, -even if it returns `false`. However, writes will be buffered in -memory, so it is best not to do this excessively. Instead, wait for -the [`'drain'`][] event before writing more data. - - -## API for Stream Implementors - - - -To implement any sort of stream, the pattern is the same: - -1. Extend the appropriate parent class in your own subclass. (The - [`util.inherits()`][] method is particularly helpful for this.) -2. Call the appropriate parent class constructor in your constructor, - to be sure that the internal mechanisms are set up properly. -3. Implement one or more specific methods, as detailed below. - -The class to extend and the method(s) to implement depend on the sort -of stream class you are writing: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Use-case

-
-

Class

-
-

Method(s) to implement

-
-

Reading only

-
-

[Readable](#stream_class_stream_readable_1)

-
-

[_read][stream-_read]

-
-

Writing only

-
-

[Writable](#stream_class_stream_writable_1)

-
-

[_write][stream-_write], [_writev][stream-_writev]

-
-

Reading and writing

-
-

[Duplex](#stream_class_stream_duplex_1)

-
-

[_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

-
-

Operate on written data, then read the result

-
-

[Transform](#stream_class_stream_transform_1)

-
-

[_transform][stream-_transform], [_flush][stream-_flush]

-
- -In your implementation code, it is very important to never call the methods -described in [API for Stream Consumers][]. Otherwise, you can potentially cause -adverse side effects in programs that consume your streaming interfaces. - -### Class: stream.Duplex - - - -A "duplex" stream is one that is both Readable and Writable, such as a TCP -socket connection. - -Note that `stream.Duplex` is an abstract class designed to be extended -with an underlying implementation of the [`stream._read(size)`][stream-_read] -and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you -would with a Readable or Writable stream class. - -Since JavaScript doesn't have multiple prototypal inheritance, this class -prototypally inherits from Readable, and then parasitically from Writable. It is -thus up to the user to implement both the low-level -[`stream._read(n)`][stream-_read] method as well as the low-level -[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension -duplex classes. - -#### new stream.Duplex(options) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then - the stream will automatically end the readable side when the - writable side ends and vice versa. - * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for readable side of the stream. Has no effect if `objectMode` - is `true`. - * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for writable side of the stream. Has no effect if `objectMode` - is `true`. - -In classes that extend the Duplex class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -### Class: stream.PassThrough - -This is a trivial implementation of a [Transform][] stream that simply -passes the input bytes across to the output. Its purpose is mainly -for examples and testing, but there are occasionally use cases where -it can come in handy as a building block for novel sorts of streams. - -### Class: stream.Readable - - - -`stream.Readable` is an abstract class designed to be extended with an -underlying implementation of the [`stream._read(size)`][stream-_read] method. - -Please see [API for Stream Consumers][] for how to consume -streams in your programs. What follows is an explanation of how to -implement Readable streams in your programs. - -#### new stream.Readable([options]) - -* `options` {Object} - * `highWaterMark` {Number} The maximum number of bytes to store in - the internal buffer before ceasing to read from the underlying - resource. Default = `16384` (16kb), or `16` for `objectMode` streams - * `encoding` {String} If specified, then buffers will be decoded to - strings using the specified encoding. Default = `null` - * `objectMode` {Boolean} Whether this stream should behave - as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns - a single value instead of a Buffer of size n. Default = `false` - * `read` {Function} Implementation for the [`stream._read()`][stream-_read] - method. - -In classes that extend the Readable class, make sure to call the -Readable constructor so that the buffering settings can be properly -initialized. - -#### readable.\_read(size) - -* `size` {Number} Number of bytes to read asynchronously - -Note: **Implement this method, but do NOT call it directly.** - -This method is prefixed with an underscore because it is internal to the -class that defines it and should only be called by the internal Readable -class methods. All Readable stream implementations must provide a \_read -method to fetch data from the underlying resource. - -When `_read()` is called, if data is available from the resource, the `_read()` -implementation should start pushing that data into the read queue by calling -[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from -the resource and pushing data until push returns `false`, at which point it -should stop reading from the resource. Only when `_read()` is called again after -it has stopped should it start reading more data from the resource and pushing -that data onto the queue. - -Note: once the `_read()` method is called, it will not be called again until -the [`stream.push()`][stream-push] method is called. - -The `size` argument is advisory. Implementations where a "read" is a -single call that returns data can use this to know how much data to -fetch. Implementations where that is not relevant, such as TCP or -TLS, may ignore this argument, and simply provide data whenever it -becomes available. There is no need, for example to "wait" until -`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. - -#### readable.push(chunk[, encoding]) - - -* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue -* `encoding` {String} Encoding of String chunks. Must be a valid - Buffer encoding, such as `'utf8'` or `'ascii'` -* return {Boolean} Whether or not more pushes should be performed - -Note: **This method should be called by Readable implementors, NOT -by consumers of Readable streams.** - -If a value other than null is passed, The `push()` method adds a chunk of data -into the queue for subsequent stream processors to consume. If `null` is -passed, it signals the end of the stream (EOF), after which no more data -can be written. - -The data added with `push()` can be pulled out by calling the -[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. - -This API is designed to be as flexible as possible. For example, -you may be wrapping a lower-level source which has some sort of -pause/resume mechanism, and a data callback. In those cases, you -could wrap the low-level source object by doing something like this: - -```js -// source is an object with readStop() and readStart() methods, -// and an `ondata` member that gets called when it has data, and -// an `onend` member that gets called when the data is over. - -util.inherits(SourceWrapper, Readable); - -function SourceWrapper(options) { - Readable.call(this, options); - - this._source = getLowlevelSourceObject(); - - // Every time there's data, we push it into the internal buffer. - this._source.ondata = (chunk) => { - // if push() returns false, then we need to stop reading from source - if (!this.push(chunk)) - this._source.readStop(); - }; - - // When the source ends, we push the EOF-signaling `null` chunk - this._source.onend = () => { - this.push(null); - }; -} - -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -SourceWrapper.prototype._read = function(size) { - this._source.readStart(); -}; -``` - -#### Example: A Counting Stream - - - -This is a basic example of a Readable stream. It emits the numerals -from 1 to 1,000,000 in ascending order, and then ends. - -```js -const Readable = require('stream').Readable; -const util = require('util'); -util.inherits(Counter, Readable); - -function Counter(opt) { - Readable.call(this, opt); - this._max = 1000000; - this._index = 1; -} - -Counter.prototype._read = function() { - var i = this._index++; - if (i > this._max) - this.push(null); - else { - var str = '' + i; - var buf = new Buffer(str, 'ascii'); - this.push(buf); - } -}; -``` - -#### Example: SimpleProtocol v1 (Sub-optimal) - -This is similar to the `parseHeader` function described -[here](#stream_readable_unshift_chunk), but implemented as a custom stream. -Also, note that this implementation does not convert the incoming data to a -string. - -However, this would be better implemented as a [Transform][] stream. See -[SimpleProtocol v2][] for a better implementation. - -```js -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// NOTE: This can be done more simply as a Transform stream! -// Using Readable directly for this is sub-optimal. See the -// alternative example below under the Transform section. - -const Readable = require('stream').Readable; -const util = require('util'); - -util.inherits(SimpleProtocol, Readable); - -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(source, options); - - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - - // source is a readable stream, such as a socket or file - this._source = source; - - var self = this; - source.on('end', () => { - self.push(null); - }); - - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', () => { - self.read(0); - }); - - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - // calling unshift by itself does not reset the reading state - // of the stream; since we're inside _read, doing an additional - // push('') will reset the state appropriately. - this.push(''); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); - } -}; - -// Usage: -// var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - -### Class: stream.Transform - -A "transform" stream is a duplex stream where the output is causally -connected in some way to the input, such as a [zlib][] stream or a -[crypto][] stream. - -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will produce output -that is either much smaller or much larger than its input. - -Rather than implement the [`stream._read()`][stream-_read] and -[`stream._write()`][stream-_write] methods, Transform classes must implement the -[`stream._transform()`][stream-_transform] method, and may optionally -also implement the [`stream._flush()`][stream-_flush] method. (See below.) - -#### new stream.Transform([options]) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `transform` {Function} Implementation for the - [`stream._transform()`][stream-_transform] method. - * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] - method. - -In classes that extend the Transform class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### Events: 'finish' and 'end' - -The [`'finish'`][] and [`'end'`][] events are from the parent Writable -and Readable classes respectively. The `'finish'` event is fired after -[`stream.end()`][stream-end] is called and all chunks have been processed by -[`stream._transform()`][stream-_transform], `'end'` is fired after all data has -been output which is after the callback in [`stream._flush()`][stream-_flush] -has been called. - -#### transform.\_flush(callback) - -* `callback` {Function} Call this function (optionally with an error - argument) when you are done flushing any remaining data. - -Note: **This function MUST NOT be called directly.** It MAY be implemented -by child classes, and if so, will be called by the internal Transform -class methods only. - -In some cases, your transform operation may need to emit a bit more -data at the end of the stream. For example, a `Zlib` compression -stream will store up some internal state so that it can optimally -compress the output. At the end, however, it needs to do the best it -can with what is left, so that the data will be complete. - -In those cases, you can implement a `_flush()` method, which will be -called at the very end, after all the written data is consumed, but -before emitting [`'end'`][] to signal the end of the readable side. Just -like with [`stream._transform()`][stream-_transform], call -`transform.push(chunk)` zero or more times, as appropriate, and call `callback` -when the flush operation is complete. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### transform.\_transform(chunk, encoding, callback) - -* `chunk` {Buffer|String} The chunk to be transformed. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument and data) when you are done processing the supplied chunk. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. - -All Transform stream implementations must provide a `_transform()` -method to accept input and produce output. - -`_transform()` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. - -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. - -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. If you supply a second argument to the callback -it will be passed to the push method. In other words the following are -equivalent: - -```js -transform.prototype._transform = function (data, encoding, callback) { - this.push(data); - callback(); -}; - -transform.prototype._transform = function (data, encoding, callback) { - callback(null, data); -}; -``` - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### Example: `SimpleProtocol` parser v2 - -The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple -protocol parser can be implemented simply by using the higher level -[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol -v1` examples. - -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic Node.js stream -approach. - -```javascript -const util = require('util'); -const Transform = require('stream').Transform; -util.inherits(SimpleProtocol, Transform); - -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); - - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); - - // now, because we got some extra data, emit this first. - this.push(chunk.slice(split)); - } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(chunk); - } - done(); -}; - -// Usage: -// var parser = new SimpleProtocol(); -// source.pipe(parser) -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - -### Class: stream.Writable - - - -`stream.Writable` is an abstract class designed to be extended with an -underlying implementation of the -[`stream._write(chunk, encoding, callback)`][stream-_write] method. - -Please see [API for Stream Consumers][] for how to consume -writable streams in your programs. What follows is an explanation of -how to implement Writable streams in your programs. - -#### new stream.Writable([options]) - -* `options` {Object} - * `highWaterMark` {Number} Buffer level when - [`stream.write()`][stream-write] starts returning `false`. Default = `16384` - (16kb), or `16` for `objectMode` streams. - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to [`stream._write()`][stream-_write]. - Default = `true` - * `objectMode` {Boolean} Whether or not the - [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can - write arbitrary data instead of only `Buffer` / `String` data. - Default = `false` - * `write` {Function} Implementation for the - [`stream._write()`][stream-_write] method. - * `writev` {Function} Implementation for the - [`stream._writev()`][stream-_writev] method. - -In classes that extend the Writable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### writable.\_write(chunk, encoding, callback) - -* `chunk` {Buffer|String} The chunk to be written. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. - -All Writable stream implementations must provide a -[`stream._write()`][stream-_write] method to send data to the underlying -resource. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Writable -class methods only. - -Call the callback using the standard `callback(error)` pattern to -signal that the write completed successfully or with an error. - -If the `decodeStrings` flag is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the sort of string that it is. This is to support -implementations that have an optimized handling for certain string -data encodings. If you do not explicitly set the `decodeStrings` -option to `false`, then you can safely ignore the `encoding` argument, -and assume that `chunk` will always be a Buffer. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### writable.\_writev(chunks, callback) - -* `chunks` {Array} The chunks to be written. Each chunk has following - format: `{ chunk: ..., encoding: ... }`. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunks. - -Note: **This function MUST NOT be called directly.** It may be -implemented by child classes, and called by the internal Writable -class methods only. - -This function is completely optional to implement. In most cases it is -unnecessary. If implemented, it will be called with all the chunks -that are buffered in the write queue. - - -## Simplified Constructor API - - - -In simple cases there is now the added benefit of being able to construct a -stream without inheritance. - -This can be done by passing the appropriate methods as constructor options: - -Examples: - -### Duplex - -```js -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - write: function(chunk, encoding, next) { - // sets this._write under the hood - - // An optional error can be passed as the first argument - next() - } -}); - -// or - -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - writev: function(chunks, next) { - // sets this._writev under the hood - - // An optional error can be passed as the first argument - next() - } -}); -``` - -### Readable - -```js -var readable = new stream.Readable({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - } -}); -``` - -### Transform - -```js -var transform = new stream.Transform({ - transform: function(chunk, encoding, next) { - // sets this._transform under the hood - - // generate output as many times as needed - // this.push(chunk); - - // call when the current chunk is consumed - next(); - }, - flush: function(done) { - // sets this._flush under the hood - - // generate output as many times as needed - // this.push(chunk); - - done(); - } -}); -``` - -### Writable - -```js -var writable = new stream.Writable({ - write: function(chunk, encoding, next) { - // sets this._write under the hood - - // An optional error can be passed as the first argument - next() - } -}); - -// or - -var writable = new stream.Writable({ - writev: function(chunks, next) { - // sets this._writev under the hood - - // An optional error can be passed as the first argument - next() - } -}); -``` - -## Streams: Under the Hood - - - -### Buffering - - - -Both Writable and Readable streams will buffer data on an internal -object which can be retrieved from `_writableState.getBuffer()` or -`_readableState.buffer`, respectively. - -The amount of data that will potentially be buffered depends on the -`highWaterMark` option which is passed into the constructor. - -Buffering in Readable streams happens when the implementation calls -[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not -call [`stream.read()`][stream-read], then the data will sit in the internal -queue until it is consumed. - -Buffering in Writable streams happens when the user calls -[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. - -The purpose of streams, especially with the [`stream.pipe()`][] method, is to -limit the buffering of data to acceptable levels, so that sources and -destinations of varying speed will not overwhelm the available memory. - -### Compatibility with Older Node.js Versions - - - -In versions of Node.js prior to v0.10, the Readable stream interface was -simpler, but also less powerful and less useful. - -* Rather than waiting for you to call the [`stream.read()`][stream-read] method, - [`'data'`][] events would start emitting immediately. If you needed to do - some I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. -* The [`stream.pause()`][stream-pause] method was advisory, rather than - guaranteed. This meant that you still had to be prepared to receive - [`'data'`][] events even when the stream was in a paused state. - -In Node.js v0.10, the [Readable][] class was added. -For backwards compatibility with older Node.js programs, Readable streams -switch into "flowing mode" when a [`'data'`][] event handler is added, or -when the [`stream.resume()`][stream-resume] method is called. The effect is -that, even if you are not using the new [`stream.read()`][stream-read] method -and [`'readable'`][] event, you no longer have to worry about losing -[`'data'`][] chunks. - -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: - -* No [`'data'`][] event handler is added. -* The [`stream.resume()`][stream-resume] method is never called. -* The stream is not piped to any writable destination. - -For example, consider the following code: - -```js -// WARNING! BROKEN! -net.createServer((socket) => { - - // we add an 'end' method, but never consume the data - socket.on('end', () => { - // It will never get here. - socket.end('I got your message (but didnt read it)\n'); - }); - -}).listen(1337); -``` - -In versions of Node.js prior to v0.10, the incoming message data would be -simply discarded. However, in Node.js v0.10 and beyond, -the socket will remain paused forever. - -The workaround in this situation is to call the -[`stream.resume()`][stream-resume] method to start the flow of data: - -```js -// Workaround -net.createServer((socket) => { - - socket.on('end', () => { - socket.end('I got your message (but didnt read it)\n'); - }); - - // start the flow of data, discarding it. - socket.resume(); - -}).listen(1337); -``` - -In addition to new Readable streams switching into flowing mode, -pre-v0.10 style streams can be wrapped in a Readable class using the -[`stream.wrap()`][] method. - - -### Object Mode - - - -Normally, Streams operate on Strings and Buffers exclusively. - -Streams that are in **object mode** can emit generic JavaScript values -other than Buffers and Strings. - -A Readable stream in object mode will always return a single item from -a call to [`stream.read(size)`][stream-read], regardless of what the size -argument is. - -A Writable stream in object mode will always ignore the `encoding` -argument to [`stream.write(data, encoding)`][stream-write]. - -The special value `null` still retains its special value for object -mode streams. That is, for object mode readable streams, `null` as a -return value from [`stream.read()`][stream-read] indicates that there is no more -data, and [`stream.push(null)`][stream-push] will signal the end of stream data -(`EOF`). - -No streams in Node.js core are object mode streams. This pattern is only -used by userland streaming libraries. - -You should set `objectMode` in your stream child class constructor on -the options object. Setting `objectMode` mid-stream is not safe. - -For Duplex streams `objectMode` can be set exclusively for readable or -writable side with `readableObjectMode` and `writableObjectMode` -respectively. These options can be used to implement parsers and -serializers with Transform streams. - -```js -const util = require('util'); -const StringDecoder = require('string_decoder').StringDecoder; -const Transform = require('stream').Transform; -util.inherits(JSONParseStream, Transform); - -// Gets \n-delimited JSON string data, and emits the parsed objects -function JSONParseStream() { - if (!(this instanceof JSONParseStream)) - return new JSONParseStream(); - - Transform.call(this, { readableObjectMode : true }); - - this._buffer = ''; - this._decoder = new StringDecoder('utf8'); -} - -JSONParseStream.prototype._transform = function(chunk, encoding, cb) { - this._buffer += this._decoder.write(chunk); - // split on newlines - var lines = this._buffer.split(/\r?\n/); - // keep the last partial line buffered - this._buffer = lines.pop(); - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - try { - var obj = JSON.parse(line); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; - -JSONParseStream.prototype._flush = function(cb) { - // Just handle any leftover - var rem = this._buffer.trim(); - if (rem) { - try { - var obj = JSON.parse(rem); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; -``` - -### `stream.read(0)` - -There are some cases where you want to trigger a refresh of the -underlying readable stream mechanisms, without actually consuming any -data. In that case, you can call `stream.read(0)`, which will always -return null. - -If the internal read buffer is below the `highWaterMark`, and the -stream is not currently reading, then calling `stream.read(0)` will trigger -a low-level [`stream._read()`][stream-_read] call. - -There is almost never a need to do this. However, you will see some -cases in Node.js's internals where this is done, particularly in the -Readable stream class internals. - -### `stream.push('')` - -Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an -interesting side effect. Because it *is* a call to -[`stream.push()`][stream-push], it will end the `reading` process. However, it -does *not* add any data to the readable buffer, so there's nothing for -a user to consume. - -Very rarely, there are cases where you have no data to provide now, -but the consumer of your stream (or, perhaps, another bit of your own -code) will know when to check again, by calling [`stream.read(0)`][stream-read]. -In those cases, you *may* call `stream.push('')`. - -So far, the only use case for this functionality is in the -[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you -find that you have to use `stream.push('')`, please consider another -approach, because it almost certainly indicates that something is -horribly wrong. - -[`'data'`]: #stream_event_data -[`'drain'`]: #stream_event_drain -[`'end'`]: #stream_event_end -[`'finish'`]: #stream_event_finish -[`'readable'`]: #stream_event_readable -[`buf.toString(encoding)`]: https://nodejs.org/docs/v5.8.0/api/buffer.html#buffer_buf_tostring_encoding_start_end -[`EventEmitter`]: https://nodejs.org/docs/v5.8.0/api/events.html#events_class_eventemitter -[`process.stderr`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stderr -[`process.stdin`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdin -[`process.stdout`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdout -[`stream.cork()`]: #stream_writable_cork -[`stream.pipe()`]: #stream_readable_pipe_destination_options -[`stream.uncork()`]: #stream_writable_uncork -[`stream.unpipe()`]: #stream_readable_unpipe_destination -[`stream.wrap()`]: #stream_readable_wrap_stream -[`tls.CryptoStream`]: https://nodejs.org/docs/v5.8.0/api/tls.html#tls_class_cryptostream -[`util.inherits()`]: https://nodejs.org/docs/v5.8.0/api/util.html#util_util_inherits_constructor_superconstructor -[API for Stream Consumers]: #stream_api_for_stream_consumers -[API for Stream Implementors]: #stream_api_for_stream_implementors -[child process stdin]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdin -[child process stdout and stderr]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdout -[Compatibility]: #stream_compatibility_with_older_node_js_versions -[crypto]: crypto.html -[Duplex]: #stream_class_stream_duplex -[fs read streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_readstream -[fs write streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_writestream -[HTTP requests, on the client]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_clientrequest -[HTTP responses, on the server]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_serverresponse -[http-incoming-message]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_incomingmessage -[Object mode]: #stream_object_mode -[Readable]: #stream_class_stream_readable -[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 -[stream-_flush]: #stream_transform_flush_callback -[stream-_read]: #stream_readable_read_size_1 -[stream-_transform]: #stream_transform_transform_chunk_encoding_callback -[stream-_write]: #stream_writable_write_chunk_encoding_callback_1 -[stream-_writev]: #stream_writable_writev_chunks_callback -[stream-end]: #stream_writable_end_chunk_encoding_callback -[stream-pause]: #stream_readable_pause -[stream-push]: #stream_readable_push_chunk_encoding -[stream-read]: #stream_readable_read_size -[stream-resume]: #stream_readable_resume -[stream-write]: #stream_writable_write_chunk_encoding_callback -[TCP sockets]: https://nodejs.org/docs/v5.8.0/api/net.html#net_class_net_socket -[Transform]: #stream_class_stream_transform -[Writable]: #stream_class_stream_writable -[zlib]: zlib.html diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index c141a99c26..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,58 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af876..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 736693b840..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,75 +0,0 @@ -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index d06f71f186..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,26 +0,0 @@ -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index 54a9d5c553..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,880 +0,0 @@ -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var isArray = require('isarray'); -/**/ - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Readable.ReadableState = ReadableState; - -var EE = require('events'); - -/**/ -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ - -var Buffer = require('buffer').Buffer; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = undefined; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -var Duplex; -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -var Duplex; -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); - stream.emit('error', e); - } else { - var skipAdd; - if (state.decoder && !addToFront && !encoding) { - chunk = state.decoder.write(chunk); - skipAdd = !state.objectMode && chunk.length === 0; - } - - if (!addToFront) state.reading = false; - - // Don't add to the buffer if we've decoded to an empty string chunk and - // we're not in object mode - if (!skipAdd) { - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) return 0; - - if (state.objectMode) return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; - } - - if (n <= 0) return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } - - return n; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; - - if (typeof n !== 'number' || n > 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } - - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } - - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) n = howMuchToRead(nOrig, state); - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } - - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) endReadable(this); - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function chunkInvalid(state, chunk) { - var er = null; - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error]; - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var _i = 0; _i < len; _i++) { - dests[_i].emit('unpipe', this); - }return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && !this._readableState.endEmitted) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function (ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; -}; - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) return null; - - if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = new Buffer(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; - var cpy = Math.min(n - c, buf.length); - - if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); - - if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); - - c += cpy; - } - } - } - - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('endReadable called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 625cdc1769..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,180 +0,0 @@ -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - -function TransformState(stream) { - this.afterTransform = function (er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; - this.writeencoding = null; -} - -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) stream.push(data); - - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = new TransformState(this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - this.once('prefinish', function () { - if (typeof this._flush === 'function') this._flush(function (er) { - done(stream, er); - });else done(stream); - }); -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -function done(stream, er) { - if (er) return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; - - if (ws.length) throw new Error('calling transform done when ws.length != 0'); - - if (ts.transforming) throw new Error('calling transform done when still transforming'); - - return stream.push(null); -} \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index 95916c992a..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,516 +0,0 @@ -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -module.exports = Writable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; -/**/ - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ - -var Buffer = require('buffer').Buffer; - -util.inherits(Writable, Stream); - -function nop() {} - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -var Duplex; -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // create the two objects needed to store the corked requests - // they are not a linked list, as no new elements are inserted in there - this.corkedRequestsFree = new CorkedRequest(this); - this.corkedRequestsFree.next = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') - }); - } catch (_) {} -})(); - -var Duplex; -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe. Not readable.')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - var er = new TypeError('Invalid non-string/buffer chunk'); - stream.emit('error', er); - processNextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = new Buffer(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - - if (Buffer.isBuffer(chunk)) encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) processNextTick(cb, er);else cb(er); - - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - while (entry) { - buffer[count] = entry; - entry = entry.next; - count += 1; - } - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequestCount = 0; - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} - -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) processNextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - - this.finish = function (err) { - var entry = _this.entry; - _this.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = _this; - } else { - state.corkedRequestsFree = _this; - } - }; -} \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE deleted file mode 100644 index d8d7f9437d..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md deleted file mode 100644 index 5a76b4149c..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# core-util-is - -The `util.is*` functions introduced in Node v0.12. diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch deleted file mode 100644 index a06d5c05f7..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/float.patch +++ /dev/null @@ -1,604 +0,0 @@ -diff --git a/lib/util.js b/lib/util.js -index a03e874..9074e8e 100644 ---- a/lib/util.js -+++ b/lib/util.js -@@ -19,430 +19,6 @@ - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - --var formatRegExp = /%[sdj%]/g; --exports.format = function(f) { -- if (!isString(f)) { -- var objects = []; -- for (var i = 0; i < arguments.length; i++) { -- objects.push(inspect(arguments[i])); -- } -- return objects.join(' '); -- } -- -- var i = 1; -- var args = arguments; -- var len = args.length; -- var str = String(f).replace(formatRegExp, function(x) { -- if (x === '%%') return '%'; -- if (i >= len) return x; -- switch (x) { -- case '%s': return String(args[i++]); -- case '%d': return Number(args[i++]); -- case '%j': -- try { -- return JSON.stringify(args[i++]); -- } catch (_) { -- return '[Circular]'; -- } -- default: -- return x; -- } -- }); -- for (var x = args[i]; i < len; x = args[++i]) { -- if (isNull(x) || !isObject(x)) { -- str += ' ' + x; -- } else { -- str += ' ' + inspect(x); -- } -- } -- return str; --}; -- -- --// Mark that a method should not be used. --// Returns a modified function which warns once by default. --// If --no-deprecation is set, then it is a no-op. --exports.deprecate = function(fn, msg) { -- // Allow for deprecating things in the process of starting up. -- if (isUndefined(global.process)) { -- return function() { -- return exports.deprecate(fn, msg).apply(this, arguments); -- }; -- } -- -- if (process.noDeprecation === true) { -- return fn; -- } -- -- var warned = false; -- function deprecated() { -- if (!warned) { -- if (process.throwDeprecation) { -- throw new Error(msg); -- } else if (process.traceDeprecation) { -- console.trace(msg); -- } else { -- console.error(msg); -- } -- warned = true; -- } -- return fn.apply(this, arguments); -- } -- -- return deprecated; --}; -- -- --var debugs = {}; --var debugEnviron; --exports.debuglog = function(set) { -- if (isUndefined(debugEnviron)) -- debugEnviron = process.env.NODE_DEBUG || ''; -- set = set.toUpperCase(); -- if (!debugs[set]) { -- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { -- var pid = process.pid; -- debugs[set] = function() { -- var msg = exports.format.apply(exports, arguments); -- console.error('%s %d: %s', set, pid, msg); -- }; -- } else { -- debugs[set] = function() {}; -- } -- } -- return debugs[set]; --}; -- -- --/** -- * Echos the value of a value. Trys to print the value out -- * in the best way possible given the different types. -- * -- * @param {Object} obj The object to print out. -- * @param {Object} opts Optional options object that alters the output. -- */ --/* legacy: obj, showHidden, depth, colors*/ --function inspect(obj, opts) { -- // default options -- var ctx = { -- seen: [], -- stylize: stylizeNoColor -- }; -- // legacy... -- if (arguments.length >= 3) ctx.depth = arguments[2]; -- if (arguments.length >= 4) ctx.colors = arguments[3]; -- if (isBoolean(opts)) { -- // legacy... -- ctx.showHidden = opts; -- } else if (opts) { -- // got an "options" object -- exports._extend(ctx, opts); -- } -- // set default options -- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; -- if (isUndefined(ctx.depth)) ctx.depth = 2; -- if (isUndefined(ctx.colors)) ctx.colors = false; -- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; -- if (ctx.colors) ctx.stylize = stylizeWithColor; -- return formatValue(ctx, obj, ctx.depth); --} --exports.inspect = inspect; -- -- --// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics --inspect.colors = { -- 'bold' : [1, 22], -- 'italic' : [3, 23], -- 'underline' : [4, 24], -- 'inverse' : [7, 27], -- 'white' : [37, 39], -- 'grey' : [90, 39], -- 'black' : [30, 39], -- 'blue' : [34, 39], -- 'cyan' : [36, 39], -- 'green' : [32, 39], -- 'magenta' : [35, 39], -- 'red' : [31, 39], -- 'yellow' : [33, 39] --}; -- --// Don't use 'blue' not visible on cmd.exe --inspect.styles = { -- 'special': 'cyan', -- 'number': 'yellow', -- 'boolean': 'yellow', -- 'undefined': 'grey', -- 'null': 'bold', -- 'string': 'green', -- 'date': 'magenta', -- // "name": intentionally not styling -- 'regexp': 'red' --}; -- -- --function stylizeWithColor(str, styleType) { -- var style = inspect.styles[styleType]; -- -- if (style) { -- return '\u001b[' + inspect.colors[style][0] + 'm' + str + -- '\u001b[' + inspect.colors[style][1] + 'm'; -- } else { -- return str; -- } --} -- -- --function stylizeNoColor(str, styleType) { -- return str; --} -- -- --function arrayToHash(array) { -- var hash = {}; -- -- array.forEach(function(val, idx) { -- hash[val] = true; -- }); -- -- return hash; --} -- -- --function formatValue(ctx, value, recurseTimes) { -- // Provide a hook for user-specified inspect functions. -- // Check that value is an object with an inspect function on it -- if (ctx.customInspect && -- value && -- isFunction(value.inspect) && -- // Filter out the util module, it's inspect function is special -- value.inspect !== exports.inspect && -- // Also filter out any prototype objects using the circular check. -- !(value.constructor && value.constructor.prototype === value)) { -- var ret = value.inspect(recurseTimes, ctx); -- if (!isString(ret)) { -- ret = formatValue(ctx, ret, recurseTimes); -- } -- return ret; -- } -- -- // Primitive types cannot have properties -- var primitive = formatPrimitive(ctx, value); -- if (primitive) { -- return primitive; -- } -- -- // Look up the keys of the object. -- var keys = Object.keys(value); -- var visibleKeys = arrayToHash(keys); -- -- if (ctx.showHidden) { -- keys = Object.getOwnPropertyNames(value); -- } -- -- // Some type of object without properties can be shortcutted. -- if (keys.length === 0) { -- if (isFunction(value)) { -- var name = value.name ? ': ' + value.name : ''; -- return ctx.stylize('[Function' + name + ']', 'special'); -- } -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } -- if (isDate(value)) { -- return ctx.stylize(Date.prototype.toString.call(value), 'date'); -- } -- if (isError(value)) { -- return formatError(value); -- } -- } -- -- var base = '', array = false, braces = ['{', '}']; -- -- // Make Array say that they are Array -- if (isArray(value)) { -- array = true; -- braces = ['[', ']']; -- } -- -- // Make functions say that they are functions -- if (isFunction(value)) { -- var n = value.name ? ': ' + value.name : ''; -- base = ' [Function' + n + ']'; -- } -- -- // Make RegExps say that they are RegExps -- if (isRegExp(value)) { -- base = ' ' + RegExp.prototype.toString.call(value); -- } -- -- // Make dates with properties first say the date -- if (isDate(value)) { -- base = ' ' + Date.prototype.toUTCString.call(value); -- } -- -- // Make error with message first say the error -- if (isError(value)) { -- base = ' ' + formatError(value); -- } -- -- if (keys.length === 0 && (!array || value.length == 0)) { -- return braces[0] + base + braces[1]; -- } -- -- if (recurseTimes < 0) { -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } else { -- return ctx.stylize('[Object]', 'special'); -- } -- } -- -- ctx.seen.push(value); -- -- var output; -- if (array) { -- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); -- } else { -- output = keys.map(function(key) { -- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); -- }); -- } -- -- ctx.seen.pop(); -- -- return reduceToSingleString(output, base, braces); --} -- -- --function formatPrimitive(ctx, value) { -- if (isUndefined(value)) -- return ctx.stylize('undefined', 'undefined'); -- if (isString(value)) { -- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') -- .replace(/'/g, "\\'") -- .replace(/\\"/g, '"') + '\''; -- return ctx.stylize(simple, 'string'); -- } -- if (isNumber(value)) { -- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, -- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . -- if (value === 0 && 1 / value < 0) -- return ctx.stylize('-0', 'number'); -- return ctx.stylize('' + value, 'number'); -- } -- if (isBoolean(value)) -- return ctx.stylize('' + value, 'boolean'); -- // For some reason typeof null is "object", so special case here. -- if (isNull(value)) -- return ctx.stylize('null', 'null'); --} -- -- --function formatError(value) { -- return '[' + Error.prototype.toString.call(value) + ']'; --} -- -- --function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { -- var output = []; -- for (var i = 0, l = value.length; i < l; ++i) { -- if (hasOwnProperty(value, String(i))) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- String(i), true)); -- } else { -- output.push(''); -- } -- } -- keys.forEach(function(key) { -- if (!key.match(/^\d+$/)) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- key, true)); -- } -- }); -- return output; --} -- -- --function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { -- var name, str, desc; -- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; -- if (desc.get) { -- if (desc.set) { -- str = ctx.stylize('[Getter/Setter]', 'special'); -- } else { -- str = ctx.stylize('[Getter]', 'special'); -- } -- } else { -- if (desc.set) { -- str = ctx.stylize('[Setter]', 'special'); -- } -- } -- if (!hasOwnProperty(visibleKeys, key)) { -- name = '[' + key + ']'; -- } -- if (!str) { -- if (ctx.seen.indexOf(desc.value) < 0) { -- if (isNull(recurseTimes)) { -- str = formatValue(ctx, desc.value, null); -- } else { -- str = formatValue(ctx, desc.value, recurseTimes - 1); -- } -- if (str.indexOf('\n') > -1) { -- if (array) { -- str = str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n').substr(2); -- } else { -- str = '\n' + str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n'); -- } -- } -- } else { -- str = ctx.stylize('[Circular]', 'special'); -- } -- } -- if (isUndefined(name)) { -- if (array && key.match(/^\d+$/)) { -- return str; -- } -- name = JSON.stringify('' + key); -- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { -- name = name.substr(1, name.length - 2); -- name = ctx.stylize(name, 'name'); -- } else { -- name = name.replace(/'/g, "\\'") -- .replace(/\\"/g, '"') -- .replace(/(^"|"$)/g, "'"); -- name = ctx.stylize(name, 'string'); -- } -- } -- -- return name + ': ' + str; --} -- -- --function reduceToSingleString(output, base, braces) { -- var numLinesEst = 0; -- var length = output.reduce(function(prev, cur) { -- numLinesEst++; -- if (cur.indexOf('\n') >= 0) numLinesEst++; -- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; -- }, 0); -- -- if (length > 60) { -- return braces[0] + -- (base === '' ? '' : base + '\n ') + -- ' ' + -- output.join(',\n ') + -- ' ' + -- braces[1]; -- } -- -- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; --} -- -- - // NOTE: These type checking functions intentionally don't use `instanceof` - // because it is fragile and can be easily faked with `Object.create()`. - function isArray(ar) { -@@ -522,166 +98,10 @@ function isPrimitive(arg) { - exports.isPrimitive = isPrimitive; - - function isBuffer(arg) { -- return arg instanceof Buffer; -+ return Buffer.isBuffer(arg); - } - exports.isBuffer = isBuffer; - - function objectToString(o) { - return Object.prototype.toString.call(o); --} -- -- --function pad(n) { -- return n < 10 ? '0' + n.toString(10) : n.toString(10); --} -- -- --var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', -- 'Oct', 'Nov', 'Dec']; -- --// 26 Feb 16:19:34 --function timestamp() { -- var d = new Date(); -- var time = [pad(d.getHours()), -- pad(d.getMinutes()), -- pad(d.getSeconds())].join(':'); -- return [d.getDate(), months[d.getMonth()], time].join(' '); --} -- -- --// log is just a thin wrapper to console.log that prepends a timestamp --exports.log = function() { -- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); --}; -- -- --/** -- * Inherit the prototype methods from one constructor into another. -- * -- * The Function.prototype.inherits from lang.js rewritten as a standalone -- * function (not on Function.prototype). NOTE: If this file is to be loaded -- * during bootstrapping this function needs to be rewritten using some native -- * functions as prototype setup using normal JavaScript does not work as -- * expected during bootstrapping (see mirror.js in r114903). -- * -- * @param {function} ctor Constructor function which needs to inherit the -- * prototype. -- * @param {function} superCtor Constructor function to inherit prototype from. -- */ --exports.inherits = function(ctor, superCtor) { -- ctor.super_ = superCtor; -- ctor.prototype = Object.create(superCtor.prototype, { -- constructor: { -- value: ctor, -- enumerable: false, -- writable: true, -- configurable: true -- } -- }); --}; -- --exports._extend = function(origin, add) { -- // Don't do anything if add isn't an object -- if (!add || !isObject(add)) return origin; -- -- var keys = Object.keys(add); -- var i = keys.length; -- while (i--) { -- origin[keys[i]] = add[keys[i]]; -- } -- return origin; --}; -- --function hasOwnProperty(obj, prop) { -- return Object.prototype.hasOwnProperty.call(obj, prop); --} -- -- --// Deprecated old stuff. -- --exports.p = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- console.error(exports.inspect(arguments[i])); -- } --}, 'util.p: Use console.error() instead'); -- -- --exports.exec = exports.deprecate(function() { -- return require('child_process').exec.apply(this, arguments); --}, 'util.exec is now called `child_process.exec`.'); -- -- --exports.print = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(String(arguments[i])); -- } --}, 'util.print: Use console.log instead'); -- -- --exports.puts = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(arguments[i] + '\n'); -- } --}, 'util.puts: Use console.log instead'); -- -- --exports.debug = exports.deprecate(function(x) { -- process.stderr.write('DEBUG: ' + x + '\n'); --}, 'util.debug: Use console.error instead'); -- -- --exports.error = exports.deprecate(function(x) { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stderr.write(arguments[i] + '\n'); -- } --}, 'util.error: Use console.error instead'); -- -- --exports.pump = exports.deprecate(function(readStream, writeStream, callback) { -- var callbackCalled = false; -- -- function call(a, b, c) { -- if (callback && !callbackCalled) { -- callback(a, b, c); -- callbackCalled = true; -- } -- } -- -- readStream.addListener('data', function(chunk) { -- if (writeStream.write(chunk) === false) readStream.pause(); -- }); -- -- writeStream.addListener('drain', function() { -- readStream.resume(); -- }); -- -- readStream.addListener('end', function() { -- writeStream.end(); -- }); -- -- readStream.addListener('close', function() { -- call(); -- }); -- -- readStream.addListener('error', function(err) { -- writeStream.end(); -- call(err); -- }); -- -- writeStream.addListener('error', function(err) { -- readStream.destroy(); -- call(err); -- }); --}, 'util.pump(): Use readableStream.pipe() instead'); -- -- --var uv; --exports._errnoException = function(err, syscall) { -- if (isUndefined(uv)) uv = process.binding('uv'); -- var errname = uv.errname(err); -- var e = new Error(syscall + ' ' + errname); -- e.code = errname; -- e.errno = errname; -- e.syscall = syscall; -- return e; --}; -+} \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js deleted file mode 100644 index ff4c851c07..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. - -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = Buffer.isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json deleted file mode 100644 index f2794488b0..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/package.json +++ /dev/null @@ -1,94 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "core-util-is@~1.0.0", - "scope": null, - "escapedName": "core-util-is", - "name": "core-util-is", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream" - ] - ], - "_from": "core-util-is@>=1.0.0 <1.1.0", - "_id": "core-util-is@1.0.2", - "_inCache": true, - "_location": "/mississippi/concat-stream/readable-stream/core-util-is", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "3.3.2", - "_phantomChildren": {}, - "_requested": { - "raw": "core-util-is@~1.0.0", - "scope": null, - "escapedName": "core-util-is", - "name": "core-util-is", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/concat-stream/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "_shrinkwrap": null, - "_spec": "core-util-is@~1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "dependencies": {}, - "description": "The `util.is*` functions introduced in Node v0.12.", - "devDependencies": { - "tap": "^2.3.0" - }, - "directories": {}, - "dist": { - "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "tarball": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" - }, - "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", - "homepage": "https://github.com/isaacs/core-util-is#readme", - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" - ], - "license": "MIT", - "main": "lib/util.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "core-util-is", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" - }, - "scripts": { - "test": "tap test.js" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js deleted file mode 100644 index 1a490c65ac..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/core-util-is/test.js +++ /dev/null @@ -1,68 +0,0 @@ -var assert = require('tap'); - -var t = require('./lib/util'); - -assert.equal(t.isArray([]), true); -assert.equal(t.isArray({}), false); - -assert.equal(t.isBoolean(null), false); -assert.equal(t.isBoolean(true), true); -assert.equal(t.isBoolean(false), true); - -assert.equal(t.isNull(null), true); -assert.equal(t.isNull(undefined), false); -assert.equal(t.isNull(false), false); -assert.equal(t.isNull(), false); - -assert.equal(t.isNullOrUndefined(null), true); -assert.equal(t.isNullOrUndefined(undefined), true); -assert.equal(t.isNullOrUndefined(false), false); -assert.equal(t.isNullOrUndefined(), true); - -assert.equal(t.isNumber(null), false); -assert.equal(t.isNumber('1'), false); -assert.equal(t.isNumber(1), true); - -assert.equal(t.isString(null), false); -assert.equal(t.isString('1'), true); -assert.equal(t.isString(1), false); - -assert.equal(t.isSymbol(null), false); -assert.equal(t.isSymbol('1'), false); -assert.equal(t.isSymbol(1), false); -assert.equal(t.isSymbol(Symbol()), true); - -assert.equal(t.isUndefined(null), false); -assert.equal(t.isUndefined(undefined), true); -assert.equal(t.isUndefined(false), false); -assert.equal(t.isUndefined(), true); - -assert.equal(t.isRegExp(null), false); -assert.equal(t.isRegExp('1'), false); -assert.equal(t.isRegExp(new RegExp()), true); - -assert.equal(t.isObject({}), true); -assert.equal(t.isObject([]), true); -assert.equal(t.isObject(new RegExp()), true); -assert.equal(t.isObject(new Date()), true); - -assert.equal(t.isDate(null), false); -assert.equal(t.isDate('1'), false); -assert.equal(t.isDate(new Date()), true); - -assert.equal(t.isError(null), false); -assert.equal(t.isError({ err: true }), false); -assert.equal(t.isError(new Error()), true); - -assert.equal(t.isFunction(null), false); -assert.equal(t.isFunction({ }), false); -assert.equal(t.isFunction(function() {}), true); - -assert.equal(t.isPrimitive(null), true); -assert.equal(t.isPrimitive(''), true); -assert.equal(t.isPrimitive(0), true); -assert.equal(t.isPrimitive(new Date()), false); - -assert.equal(t.isBuffer(null), false); -assert.equal(t.isBuffer({}), false); -assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile deleted file mode 100644 index 0ecc29c402..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @node_modules/.bin/tape test.js - -.PHONY: test diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md deleted file mode 100644 index 16d2c59c61..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/README.md +++ /dev/null @@ -1,60 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) -[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) - -[![browser support](https://ci.testling.com/juliangruber/isarray.png) -](https://ci.testling.com/juliangruber/isarray) - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json deleted file mode 100644 index 9e31b68388..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js deleted file mode 100644 index a57f634959..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json deleted file mode 100644 index 529beb69b7..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/package.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "isarray@~1.0.0", - "scope": null, - "escapedName": "isarray", - "name": "isarray", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream" - ] - ], - "_from": "isarray@>=1.0.0 <1.1.0", - "_id": "isarray@1.0.0", - "_inCache": true, - "_location": "/mississippi/concat-stream/readable-stream/isarray", - "_nodeVersion": "5.1.0", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "_npmVersion": "3.3.12", - "_phantomChildren": {}, - "_requested": { - "raw": "isarray@~1.0.0", - "scope": null, - "escapedName": "isarray", - "name": "isarray", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/concat-stream/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", - "_shrinkwrap": null, - "_spec": "isarray@~1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "dependencies": {}, - "description": "Array#isArray for older browsers", - "devDependencies": { - "tape": "~2.13.4" - }, - "directories": {}, - "dist": { - "shasum": "bb935d48582cba168c06834957a54a3e07124f11", - "tarball": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", - "homepage": "https://github.com/juliangruber/isarray", - "keywords": [ - "browser", - "isarray", - "array" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "name": "isarray", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "scripts": { - "test": "tape test.js" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/8..latest", - "firefox/17..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js deleted file mode 100644 index f7f7bcd19f..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js +++ /dev/null @@ -1,19 +0,0 @@ -var isArray = require('./'); -var test = require('tape'); - -test('is array', function(t){ - t.ok(isArray([])); - t.notOk(isArray({})); - t.notOk(isArray(null)); - t.notOk(isArray(false)); - - var obj = {}; - obj[0] = true; - t.notOk(isArray(obj)); - - var arr = []; - arr.foo = 'bar'; - t.ok(isArray(arr)); - - t.end(); -}); diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml deleted file mode 100644 index 36201b1001..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" - - "0.12" - - "1.7.1" - - 1 - - 2 - - 3 - - 4 - - 5 diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js deleted file mode 100644 index a4f40f845f..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/index.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -if (!process.version || - process.version.indexOf('v0.') === 0 || - process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { - module.exports = nextTick; -} else { - module.exports = process.nextTick; -} - -function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== 'function') { - throw new TypeError('"callback" argument must be a function'); - } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - return process.nextTick(function afterTick() { - fn.apply(null, args); - }); - } -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json deleted file mode 100644 index c9d5f61669..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ /dev/null @@ -1,83 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "process-nextick-args@~1.0.6", - "scope": null, - "escapedName": "process-nextick-args", - "name": "process-nextick-args", - "rawSpec": "~1.0.6", - "spec": ">=1.0.6 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream" - ] - ], - "_from": "process-nextick-args@>=1.0.6 <1.1.0", - "_id": "process-nextick-args@1.0.7", - "_inCache": true, - "_location": "/mississippi/concat-stream/readable-stream/process-nextick-args", - "_nodeVersion": "5.11.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/process-nextick-args-1.0.7.tgz_1462394251778_0.36989671061746776" - }, - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "_npmVersion": "3.8.6", - "_phantomChildren": {}, - "_requested": { - "raw": "process-nextick-args@~1.0.6", - "scope": null, - "escapedName": "process-nextick-args", - "name": "process-nextick-args", - "rawSpec": "~1.0.6", - "spec": ">=1.0.6 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/concat-stream/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "_shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", - "_shrinkwrap": null, - "_spec": "process-nextick-args@~1.0.6", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream", - "author": "", - "bugs": { - "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" - }, - "dependencies": {}, - "description": "process.nextTick but always with args", - "devDependencies": { - "tap": "~0.2.6" - }, - "directories": {}, - "dist": { - "shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", - "tarball": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" - }, - "gitHead": "5c00899ab01dd32f93ad4b5743da33da91404f39", - "homepage": "https://github.com/calvinmetcalf/process-nextick-args", - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "name": "process-nextick-args", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.7" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md deleted file mode 100644 index 78e7cfaeb7..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -process-nextick-args -===== - -[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) - -```bash -npm install --save process-nextick-args -``` - -Always be able to pass arguments to process.nextTick, no matter the platform - -```js -var nextTick = require('process-nextick-args'); - -nextTick(function (a, b, c) { - console.log(a, b, c); -}, 'step', 3, 'profit'); -``` diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js deleted file mode 100644 index ef15721584..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/test.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require("tap").test; -var nextTick = require('./'); - -test('should work', function (t) { - t.plan(5); - nextTick(function (a) { - t.ok(a); - nextTick(function (thing) { - t.equals(thing, 7); - }, 7); - }, true); - nextTick(function (a, b, c) { - t.equals(a, 'step'); - t.equals(b, 3); - t.equals(c, 'profit'); - }, 'step', 3, 'profit'); -}); - -test('correct number of arguments', function (t) { - t.plan(1); - nextTick(function () { - t.equals(2, arguments.length, 'correct number'); - }, 1, 2); -}); diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore deleted file mode 100644 index 206320cc1d..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -build -test diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE deleted file mode 100644 index 6de584a48f..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md deleted file mode 100644 index 4d2aa00150..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/README.md +++ /dev/null @@ -1,7 +0,0 @@ -**string_decoder.js** (`require('string_decoder')`) from Node.js core - -Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. - -Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** - -The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js deleted file mode 100644 index b00e54fb79..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/index.js +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var Buffer = require('buffer').Buffer; - -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - } - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -var StringDecoder = exports.StringDecoder = function(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -}; - - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json deleted file mode 100644 index 4bc4749854..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/string_decoder/package.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "string_decoder@~0.10.x", - "scope": null, - "escapedName": "string_decoder", - "name": "string_decoder", - "rawSpec": "~0.10.x", - "spec": ">=0.10.0 <0.11.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream" - ] - ], - "_from": "string_decoder@>=0.10.0 <0.11.0", - "_id": "string_decoder@0.10.31", - "_inCache": true, - "_location": "/mississippi/concat-stream/readable-stream/string_decoder", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "_npmVersion": "1.4.23", - "_phantomChildren": {}, - "_requested": { - "raw": "string_decoder@~0.10.x", - "scope": null, - "escapedName": "string_decoder", - "name": "string_decoder", - "rawSpec": "~0.10.x", - "spec": ">=0.10.0 <0.11.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/concat-stream/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_shrinkwrap": null, - "_spec": "string_decoder@~0.10.x", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/rvagg/string_decoder/issues" - }, - "dependencies": {}, - "description": "The string_decoder module from Node core", - "devDependencies": { - "tap": "~0.4.8" - }, - "directories": {}, - "dist": { - "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", - "homepage": "https://github.com/rvagg/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "name": "string_decoder", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "version": "0.10.31" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md deleted file mode 100644 index acc8675372..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,16 +0,0 @@ - -1.0.2 / 2015-10-07 -================== - - * use try/catch when checking `localStorage` (#3, @kumavis) - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE deleted file mode 100644 index 6a60e8c225..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md deleted file mode 100644 index 75622fa7c2..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -util-deprecate -============== -### The Node.js `util.deprecate()` function with browser support - -In Node.js, this module simply re-exports the `util.deprecate()` function. - -In the web browser (i.e. via browserify), a browser-specific implementation -of the `util.deprecate()` function is used. - - -## API - -A `deprecate()` function is the only thing exposed by this module. - -``` javascript -// setup: -exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); - - -// users see: -foo(); -// foo() is deprecated, use bar() instead -foo(); -foo(); -``` - - -## License - -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js deleted file mode 100644 index 549ae2f065..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,67 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - // accessing global.localStorage can trigger a DOMException in sandboxed iframes - try { - if (!global.localStorage) return false; - } catch (_) { - return false; - } - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js deleted file mode 100644 index 5e6fcff5dd..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/node.js +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -module.exports = require('util').deprecate; diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json deleted file mode 100644 index d350c79f1b..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "util-deprecate@~1.0.1", - "scope": null, - "escapedName": "util-deprecate", - "name": "util-deprecate", - "rawSpec": "~1.0.1", - "spec": ">=1.0.1 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream" - ] - ], - "_from": "util-deprecate@>=1.0.1 <1.1.0", - "_id": "util-deprecate@1.0.2", - "_inCache": true, - "_location": "/mississippi/concat-stream/readable-stream/util-deprecate", - "_nodeVersion": "4.1.2", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - "_npmVersion": "2.14.4", - "_phantomChildren": {}, - "_requested": { - "raw": "util-deprecate@~1.0.1", - "scope": null, - "escapedName": "util-deprecate", - "name": "util-deprecate", - "rawSpec": "~1.0.1", - "spec": ">=1.0.1 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/concat-stream/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "_shrinkwrap": null, - "_spec": "util-deprecate@~1.0.1", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "dependencies": {}, - "description": "The Node.js `util.deprecate()` function with browser support", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "tarball": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - }, - "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", - "homepage": "https://github.com/TooTallNate/util-deprecate", - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "license": "MIT", - "main": "node.js", - "maintainers": [ - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - } - ], - "name": "util-deprecate", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/package.json b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/package.json deleted file mode 100644 index df563e8365..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/package.json +++ /dev/null @@ -1,113 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "readable-stream@~2.0.0", - "scope": null, - "escapedName": "readable-stream", - "name": "readable-stream", - "rawSpec": "~2.0.0", - "spec": ">=2.0.0 <2.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream" - ] - ], - "_from": "readable-stream@>=2.0.0 <2.1.0", - "_id": "readable-stream@2.0.6", - "_inCache": true, - "_location": "/mississippi/concat-stream/readable-stream", - "_nodeVersion": "5.7.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" - }, - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "_npmVersion": "3.6.0", - "_phantomChildren": {}, - "_requested": { - "raw": "readable-stream@~2.0.0", - "scope": null, - "escapedName": "readable-stream", - "name": "readable-stream", - "rawSpec": "~2.0.0", - "spec": ">=2.0.0 <2.1.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/concat-stream" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", - "_shrinkwrap": null, - "_spec": "readable-stream@~2.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream", - "browser": { - "util": false - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - }, - "description": "Streams3, a user-land copy of the stream library from Node.js", - "devDependencies": { - "tap": "~0.2.6", - "tape": "~4.5.1", - "zuul": "~3.9.0" - }, - "directories": {}, - "dist": { - "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", - "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" - }, - "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e", - "homepage": "https://github.com/nodejs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - }, - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "name": "readable-stream", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "browser": "npm run write-zuul && zuul -- test/browser.js", - "test": "tap test/parallel/*.js test/ours/*.js", - "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" - }, - "version": "2.0.6" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a551..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/readable.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/readable.js deleted file mode 100644 index 6222a57986..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,12 +0,0 @@ -var Stream = (function (){ - try { - return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify - } catch(_){} -}()); -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream || exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/transform.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f0780..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/writable.js b/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efdf3c..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/package.json b/deps/npm/node_modules/mississippi/node_modules/concat-stream/package.json index abbb3d4362..cd01702872 100644 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/concat-stream/package.json @@ -14,22 +14,20 @@ ] ], "_from": "concat-stream@>=1.5.0 <2.0.0", - "_id": "concat-stream@1.5.2", + "_id": "concat-stream@1.6.0", "_inCache": true, "_location": "/mississippi/concat-stream", - "_nodeVersion": "4.4.3", + "_nodeVersion": "4.6.2", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/concat-stream-1.5.2.tgz_1472715196934_0.010375389130786061" + "tmp": "tmp/concat-stream-1.6.0.tgz_1482162257023_0.2988202746491879" }, "_npmUser": { "name": "mafintosh", "email": "mathiasbuus@gmail.com" }, - "_npmVersion": "2.15.9", - "_phantomChildren": { - "inherits": "2.0.3" - }, + "_npmVersion": "2.15.11", + "_phantomChildren": {}, "_requested": { "raw": "concat-stream@^1.5.0", "scope": null, @@ -42,8 +40,8 @@ "_requiredBy": [ "/mississippi" ], - "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", - "_shasum": "708978624d856af41a5a741defdd261da752c266", + "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz", + "_shasum": "0aac662fd52be78964d5532f694784e70110acf7", "_shrinkwrap": null, "_spec": "concat-stream@^1.5.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", @@ -55,18 +53,18 @@ "url": "http://github.com/maxogden/concat-stream/issues" }, "dependencies": { - "inherits": "~2.0.1", - "readable-stream": "~2.0.0", - "typedarray": "~0.0.5" + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" }, "description": "writable stream that concatenates strings or binary data and calls a callback with the result", "devDependencies": { - "tape": "~2.3.2" + "tape": "^4.6.3" }, "directories": {}, "dist": { - "shasum": "708978624d856af41a5a741defdd261da752c266", - "tarball": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz" + "shasum": "0aac662fd52be78964d5532f694784e70110acf7", + "tarball": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.0.tgz" }, "engines": [ "node >= 0.8" @@ -74,8 +72,8 @@ "files": [ "index.js" ], - "gitHead": "731fedd137eae89d066c249fdca070f8f16afbb8", - "homepage": "https://github.com/maxogden/concat-stream#readme", + "gitHead": "e482281642c1e011fc158f5749ef40a71c77a426", + "homepage": "https://github.com/maxogden/concat-stream", "license": "MIT", "main": "index.js", "maintainers": [ @@ -120,5 +118,5 @@ "android-browser/4.2..latest" ] }, - "version": "1.5.2" + "version": "1.6.0" } diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/readme.md b/deps/npm/node_modules/mississippi/node_modules/concat-stream/readme.md index a2e1d2b151..9478721990 100644 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/readme.md +++ b/deps/npm/node_modules/mississippi/node_modules/concat-stream/readme.md @@ -16,7 +16,7 @@ There are also `objectMode` streams that emit things other than Buffers, and you ## Related -`stream-each` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. +`concat-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one. ### examples diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/README.md b/deps/npm/node_modules/mississippi/node_modules/duplexify/README.md index 6ed497b4ad..27669f6b6b 100644 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/README.md +++ b/deps/npm/node_modules/mississippi/node_modules/duplexify/README.md @@ -3,7 +3,7 @@ Turn a writeable and readable stream into a single streams2 duplex stream. Similar to [duplexer2](https://github.com/deoxxa/duplexer2) except it supports both streams2 and streams1 as input -and it allows you to set the readable and writable part asynchroniously using `setReadable(stream)` and `setWritable(stream)` +and it allows you to set the readable and writable part asynchronously using `setReadable(stream)` and `setWritable(stream)` ``` npm install duplexify @@ -27,7 +27,7 @@ dup.on('data', function(data) { }) ``` -You can also set the readable and writable parts asynchroniously +You can also set the readable and writable parts asynchronously ``` js var dup = duplexify() diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/index.js b/deps/npm/node_modules/mississippi/node_modules/duplexify/index.js index 377eb60ad7..a04f124fa9 100644 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/index.js +++ b/deps/npm/node_modules/mississippi/node_modules/duplexify/index.js @@ -158,7 +158,8 @@ Duplexify.prototype._forward = function() { var data - while ((data = shift(this._readable2)) !== null) { + while (this._drained && (data = shift(this._readable2)) !== null) { + if (this.destroyed) continue this._drained = this.push(data) } diff --git a/deps/npm/node_modules/mississippi/node_modules/duplexify/package.json b/deps/npm/node_modules/mississippi/node_modules/duplexify/package.json index 485f0312ea..a8de9a133f 100644 --- a/deps/npm/node_modules/mississippi/node_modules/duplexify/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/duplexify/package.json @@ -14,13 +14,13 @@ ] ], "_from": "duplexify@>=3.4.2 <4.0.0", - "_id": "duplexify@3.4.5", + "_id": "duplexify@3.5.0", "_inCache": true, "_location": "/mississippi/duplexify", - "_nodeVersion": "4.4.3", + "_nodeVersion": "4.6.1", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/duplexify-3.4.5.tgz_1468011872327_0.44416941492818296" + "tmp": "tmp/duplexify-3.5.0.tgz_1477317448157_0.2257942291907966" }, "_npmUser": { "name": "mafintosh", @@ -43,8 +43,8 @@ "/mississippi", "/mississippi/pumpify" ], - "_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.4.5.tgz", - "_shasum": "0e7e287a775af753bf57e6e7b7f21f183f6c3a53", + "_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz", + "_shasum": "1aa773002e1578457e9d9d4a50b0ccaaebcbd604", "_shrinkwrap": null, "_spec": "duplexify@^3.4.2", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", @@ -60,7 +60,7 @@ "readable-stream": "^2.0.0", "stream-shift": "^1.0.0" }, - "description": "Turn a writeable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input", + "description": "Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input", "devDependencies": { "concat-stream": "^1.4.6", "tape": "^2.13.3", @@ -68,10 +68,10 @@ }, "directories": {}, "dist": { - "shasum": "0e7e287a775af753bf57e6e7b7f21f183f6c3a53", - "tarball": "https://registry.npmjs.org/duplexify/-/duplexify-3.4.5.tgz" + "shasum": "1aa773002e1578457e9d9d4a50b0ccaaebcbd604", + "tarball": "https://registry.npmjs.org/duplexify/-/duplexify-3.5.0.tgz" }, - "gitHead": "338de6776ce9b25d7ab6e91d766166245a8f070a", + "gitHead": "97f525d36ce275e52435611d70b3a77a7234eaa1", "homepage": "https://github.com/mafintosh/duplexify", "keywords": [ "duplex", @@ -100,5 +100,5 @@ "scripts": { "test": "tape test.js" }, - "version": "3.4.5" + "version": "3.5.0" } diff --git a/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/.npmignore b/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/.npmignore index 3c3629e647..3e70011a19 100644 --- a/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/.npmignore +++ b/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/.npmignore @@ -1 +1,3 @@ node_modules +bundle.js +test.html diff --git a/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/example.js b/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/example.js new file mode 100644 index 0000000000..fa6b5dab25 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/example.js @@ -0,0 +1,22 @@ +var writer = require('./') + +var ws = writer(write, flush) + +ws.on('finish', function () { + console.log('finished') +}) + +ws.write('hello') +ws.write('world') +ws.end() + +function write (data, enc, cb) { + // i am your normal ._write method + console.log('writing', data.toString()) + cb() +} + +function flush (cb) { + // i am called before finish is emitted + setTimeout(cb, 1000) // wait 1 sec +} diff --git a/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/index.js b/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/index.js index d7715734b4..e82e126126 100644 --- a/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/index.js +++ b/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/index.js @@ -1,5 +1,5 @@ var stream = require('readable-stream') -var util = require('util') +var inherits = require('inherits') var SIGNAL_FLUSH = new Buffer([0]) @@ -21,7 +21,7 @@ function WriteStream (opts, write, flush) { this._flush = flush || null } -util.inherits(WriteStream, stream.Writable) +inherits(WriteStream, stream.Writable) WriteStream.obj = function (opts, worker, flush) { if (typeof opts === 'function') return WriteStream.obj(null, opts, worker) @@ -47,6 +47,6 @@ WriteStream.prototype.end = function (data, enc, cb) { WriteStream.prototype.destroy = function (err) { if (this.destroyed) return this.destroyed = true - if (err) this.emit('error') + if (err) this.emit('error', err) this.emit('close') } diff --git a/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/package.json b/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/package.json index a73eaeb36e..cd239a22b5 100644 --- a/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/package.json @@ -14,15 +14,19 @@ ] ], "_from": "flush-write-stream@>=1.0.0 <2.0.0", - "_id": "flush-write-stream@1.0.0", + "_id": "flush-write-stream@1.0.2", "_inCache": true, "_location": "/mississippi/flush-write-stream", - "_nodeVersion": "4.1.1", + "_nodeVersion": "4.2.6", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/flush-write-stream-1.0.2.tgz_1476614807882_0.22224654001183808" + }, "_npmUser": { "name": "mafintosh", "email": "mathiasbuus@gmail.com" }, - "_npmVersion": "2.14.4", + "_npmVersion": "2.14.12", "_phantomChildren": {}, "_requested": { "raw": "flush-write-stream@^1.0.0", @@ -36,8 +40,8 @@ "_requiredBy": [ "/mississippi" ], - "_resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.0.tgz", - "_shasum": "cc4fc24f4b4c973f80027f27cc095841639965a7", + "_resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.2.tgz", + "_shasum": "c81b90d8746766f1a609a46809946c45dd8ae417", "_shrinkwrap": null, "_spec": "flush-write-stream@^1.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", @@ -49,6 +53,7 @@ "url": "https://github.com/mafintosh/flush-write-stream/issues" }, "dependencies": { + "inherits": "^2.0.1", "readable-stream": "^2.0.4" }, "description": "A write stream constructor that supports a flush function that is called before finish is emitted", @@ -57,10 +62,10 @@ }, "directories": {}, "dist": { - "shasum": "cc4fc24f4b4c973f80027f27cc095841639965a7", - "tarball": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.0.tgz" + "shasum": "c81b90d8746766f1a609a46809946c45dd8ae417", + "tarball": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.2.tgz" }, - "gitHead": "50e81d8eeee8a9666c7d5105775a6c89b7ae9dfa", + "gitHead": "d35a4071dacbcc60fc40d798fa58fc425cba3efc", "homepage": "https://github.com/mafintosh/flush-write-stream", "license": "MIT", "main": "index.js", @@ -80,5 +85,5 @@ "scripts": { "test": "tape test.js" }, - "version": "1.0.0" + "version": "1.0.2" } diff --git a/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/test.js b/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/test.js index 7383acede6..6cd0c20e1f 100644 --- a/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/test.js +++ b/deps/npm/node_modules/mississippi/node_modules/flush-write-stream/test.js @@ -70,3 +70,16 @@ tape('can pass options', function (t) { process.nextTick(cb) } }) + +tape('emits error on destroy', function (t) { + var expected = new Error() + + var ws = writer({objectMode: true}, function () {}) + + ws.on('error', function (err) { + t.equal(err, expected) + }) + ws.on('close', t.end) + + ws.destroy(expected) +}) diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.npmignore b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/.npmignore similarity index 100% rename from deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.npmignore rename to deps/npm/node_modules/mississippi/node_modules/parallel-transform/.npmignore diff --git a/deps/npm/node_modules/mississippi/node_modules/parallel-transform/LICENSE b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/LICENSE new file mode 100644 index 0000000000..4b30ed5d95 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/LICENSE @@ -0,0 +1,20 @@ +Copyright 2013 Mathias Buus + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/parallel-transform/README.md b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/README.md new file mode 100644 index 0000000000..f53e130849 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/README.md @@ -0,0 +1,54 @@ +# parallel-transform + +[Transform stream](http://nodejs.org/api/stream.html#stream_class_stream_transform_1) for Node.js that allows you to run your transforms +in parallel without changing the order of the output. + + npm install parallel-transform + +It is easy to use + +``` js +var transform = require('parallel-transform'); + +var stream = transform(10, function(data, callback) { // 10 is the parallism level + setTimeout(function() { + callback(null, data); + }, Math.random() * 1000); +}); + +for (var i = 0; i < 10; i++) { + stream.write(''+i); +} +stream.end(); + +stream.on('data', function(data) { + console.log(data); // prints 0,1,2,... +}); +stream.on('end', function() { + console.log('stream has ended'); +}); +``` + +If you run the above example you'll notice that it runs in parallel +(does not take ~1 second between each print) and that the order is preserved + +## Stream options + +All transforms are Node 0.10 streams. Per default they are created with the options `{objectMode:true}`. +If you want to use your own stream options pass them as the second parameter + +``` js +var stream = transform(10, {objectMode:false}, function(data, callback) { + // data is now a buffer + callback(null, data); +}); + +fs.createReadStream('filename').pipe(stream).pipe(process.stdout); +``` + +### Unordered +Passing the option `{ordered:false}` will output the data as soon as it's processed by a transform, without waiting to respect the order. + +## License + +MIT \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/parallel-transform/index.js b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/index.js new file mode 100644 index 0000000000..77329e4ccf --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/index.js @@ -0,0 +1,105 @@ +var Transform = require('readable-stream').Transform; +var inherits = require('inherits'); +var cyclist = require('cyclist'); +var util = require('util'); + +var ParallelTransform = function(maxParallel, opts, ontransform) { + if (!(this instanceof ParallelTransform)) return new ParallelTransform(maxParallel, opts, ontransform); + + if (typeof maxParallel === 'function') { + ontransform = maxParallel; + opts = null; + maxParallel = 1; + } + if (typeof opts === 'function') { + ontransform = opts; + opts = null; + } + + if (!opts) opts = {}; + if (!opts.highWaterMark) opts.highWaterMark = Math.max(maxParallel, 16); + if (opts.objectMode !== false) opts.objectMode = true; + + Transform.call(this, opts); + + this._maxParallel = maxParallel; + this._ontransform = ontransform; + this._destroyed = false; + this._flushed = false; + this._ordered = opts.ordered !== false; + this._buffer = this._ordered ? cyclist(maxParallel) : []; + this._top = 0; + this._bottom = 0; + this._ondrain = null; +}; + +inherits(ParallelTransform, Transform); + +ParallelTransform.prototype.destroy = function() { + if (this._destroyed) return; + this._destroyed = true; + this.emit('close'); +}; + +ParallelTransform.prototype._transform = function(chunk, enc, callback) { + var self = this; + var pos = this._top++; + + this._ontransform(chunk, function(err, data) { + if (self._destroyed) return; + if (err) { + self.emit('error', err); + self.push(null); + self.destroy(); + return; + } + if (self._ordered) { + self._buffer.put(pos, (data === undefined || data === null) ? null : data); + } + else { + self._buffer.push(data); + } + self._drain(); + }); + + if (this._top - this._bottom < this._maxParallel) return callback(); + this._ondrain = callback; +}; + +ParallelTransform.prototype._flush = function(callback) { + this._flushed = true; + this._ondrain = callback; + this._drain(); +}; + +ParallelTransform.prototype._drain = function() { + if (this._ordered) { + while (this._buffer.get(this._bottom) !== undefined) { + var data = this._buffer.del(this._bottom++); + if (data === null) continue; + this.push(data); + } + } + else { + while (this._buffer.length > 0) { + var data = this._buffer.pop(); + this._bottom++; + if (data === null) continue; + this.push(data); + } + } + + + if (!this._drained() || !this._ondrain) return; + + var ondrain = this._ondrain; + this._ondrain = null; + ondrain(); +}; + +ParallelTransform.prototype._drained = function() { + var diff = this._top - this._bottom; + return this._flushed ? !diff : diff < this._maxParallel; +}; + +module.exports = ParallelTransform; diff --git a/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/.npmignore b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/.npmignore new file mode 100644 index 0000000000..ba99195bae --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/.npmignore @@ -0,0 +1 @@ +bench diff --git a/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/README.md b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/README.md new file mode 100644 index 0000000000..50c35cc5fd --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/README.md @@ -0,0 +1,39 @@ +# Cyclist + +Cyclist is an efficient [cyclic list](http://en.wikipedia.org/wiki/Circular_buffer) implemention for Javascript. +It is available through npm + + npm install cyclist + +## What? + +Cyclist allows you to create a list of fixed size that is cyclic. +In a cyclist list the element following the last one is the first one. +This property can be really useful when for example trying to order data +packets that can arrive out of order over a network stream. + +## Usage + +``` js +var cyclist = require('cyclist'); +var list = cyclist(4); // if size (4) is not a power of 2 it will be the follwing power of 2 + // this buffer can now hold 4 elements in total + +list.put(42, 'hello 42'); // store something and index 42 +list.put(43, 'hello 43'); // store something and index 43 + +console.log(list.get(42)); // prints hello 42 +console.log(list.get(46)); // prints hello 42 again since 46 - 42 == list.size +``` + +## API + +* `cyclist(size)` creates a new buffer +* `cyclist#get(index)` get an object stored in the buffer +* `cyclist#put(index,value)` insert an object into the buffer +* `cyclist#del(index)` delete an object from an index +* `cyclist#size` property containing current size of buffer + +## License + +MIT diff --git a/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/index.js b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/index.js new file mode 100644 index 0000000000..baf710c3a9 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/index.js @@ -0,0 +1,33 @@ +var ensureTwoPower = function(n) { + if (n && !(n & (n - 1))) return n; + var p = 1; + while (p < n) p <<= 1; + return p; +}; + +var Cyclist = function(size) { + if (!(this instanceof Cyclist)) return new Cyclist(size); + size = ensureTwoPower(size); + this.mask = size-1; + this.size = size; + this.values = new Array(size); +}; + +Cyclist.prototype.put = function(index, val) { + var pos = index & this.mask; + this.values[pos] = val; + return pos; +}; + +Cyclist.prototype.get = function(index) { + return this.values[index & this.mask]; +}; + +Cyclist.prototype.del = function(index) { + var pos = index & this.mask; + var val = this.values[pos]; + this.values[pos] = undefined; + return val; +}; + +module.exports = Cyclist; \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/package.json b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/package.json new file mode 100644 index 0000000000..ad045eb971 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/node_modules/cyclist/package.json @@ -0,0 +1,80 @@ +{ + "_args": [ + [ + { + "raw": "cyclist@~0.2.2", + "scope": null, + "escapedName": "cyclist", + "name": "cyclist", + "rawSpec": "~0.2.2", + "spec": ">=0.2.2 <0.3.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/parallel-transform" + ] + ], + "_from": "cyclist@>=0.2.2 <0.3.0", + "_id": "cyclist@0.2.2", + "_inCache": true, + "_location": "/mississippi/parallel-transform/cyclist", + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "1.3.5", + "_phantomChildren": {}, + "_requested": { + "raw": "cyclist@~0.2.2", + "scope": null, + "escapedName": "cyclist", + "name": "cyclist", + "rawSpec": "~0.2.2", + "spec": ">=0.2.2 <0.3.0", + "type": "range" + }, + "_requiredBy": [ + "/mississippi/parallel-transform" + ], + "_resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", + "_shasum": "1b33792e11e914a2fd6d6ed6447464444e5fa640", + "_shrinkwrap": null, + "_spec": "cyclist@~0.2.2", + "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/parallel-transform", + "author": { + "name": "Mathias Buus Madsen", + "email": "mathiasbuus@gmail.com" + }, + "bugs": { + "url": "https://github.com/mafintosh/cyclist/issues" + }, + "dependencies": {}, + "description": "Cyclist is an efficient cyclic list implemention.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "1b33792e11e914a2fd6d6ed6447464444e5fa640", + "tarball": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz" + }, + "homepage": "https://github.com/mafintosh/cyclist#readme", + "keywords": [ + "circular", + "buffer", + "ring", + "cyclic", + "data" + ], + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "cyclist", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/cyclist.git" + }, + "version": "0.2.2" +} diff --git a/deps/npm/node_modules/mississippi/node_modules/parallel-transform/package.json b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/package.json new file mode 100644 index 0000000000..357b4898a6 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/parallel-transform/package.json @@ -0,0 +1,92 @@ +{ + "_args": [ + [ + { + "raw": "parallel-transform@^1.1.0", + "scope": null, + "escapedName": "parallel-transform", + "name": "parallel-transform", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/mississippi" + ] + ], + "_from": "parallel-transform@>=1.1.0 <2.0.0", + "_id": "parallel-transform@1.1.0", + "_inCache": true, + "_location": "/mississippi/parallel-transform", + "_nodeVersion": "4.6.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/parallel-transform-1.1.0.tgz_1478596056784_0.9169374129269272" + }, + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": {}, + "_requested": { + "raw": "parallel-transform@^1.1.0", + "scope": null, + "escapedName": "parallel-transform", + "name": "parallel-transform", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/mississippi" + ], + "_resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "_shasum": "d410f065b05da23081fcd10f28854c29bda33b06", + "_shrinkwrap": null, + "_spec": "parallel-transform@^1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", + "author": { + "name": "Mathias Buus Madsen", + "email": "mathiasbuus@gmail.com" + }, + "bugs": { + "url": "https://github.com/mafintosh/parallel-transform/issues" + }, + "dependencies": { + "cyclist": "~0.2.2", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + }, + "description": "Transform stream that allows you to run your transforms in parallel without changing the order", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "d410f065b05da23081fcd10f28854c29bda33b06", + "tarball": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz" + }, + "gitHead": "1b4919bc318eb0cbd6e8ee08c4d56f405d74e643", + "homepage": "https://github.com/mafintosh/parallel-transform", + "keywords": [ + "transform", + "stream", + "parallel", + "preserve", + "order" + ], + "license": "MIT", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "parallel-transform", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mafintosh/parallel-transform.git" + }, + "scripts": {}, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/mississippi/node_modules/pump/index.js b/deps/npm/node_modules/mississippi/node_modules/pump/index.js index 843da727ef..060ce5f4fd 100644 --- a/deps/npm/node_modules/mississippi/node_modules/pump/index.js +++ b/deps/npm/node_modules/mississippi/node_modules/pump/index.js @@ -9,6 +9,7 @@ var isFn = function (fn) { } var isFS = function (stream) { + if (!fs) return false // browser return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close) } diff --git a/deps/npm/node_modules/mississippi/node_modules/pump/package.json b/deps/npm/node_modules/mississippi/node_modules/pump/package.json index 2457d2f00d..2226426b52 100644 --- a/deps/npm/node_modules/mississippi/node_modules/pump/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/pump/package.json @@ -14,15 +14,19 @@ ] ], "_from": "pump@>=1.0.0 <2.0.0", - "_id": "pump@1.0.1", + "_id": "pump@1.0.2", "_inCache": true, "_location": "/mississippi/pump", - "_nodeVersion": "4.1.1", + "_nodeVersion": "4.6.2", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/pump-1.0.2.tgz_1482243286673_0.09530888125300407" + }, "_npmUser": { "name": "mafintosh", "email": "mathiasbuus@gmail.com" }, - "_npmVersion": "2.14.4", + "_npmVersion": "2.15.11", "_phantomChildren": {}, "_requested": { "raw": "pump@^1.0.0", @@ -37,8 +41,8 @@ "/mississippi", "/mississippi/pumpify" ], - "_resolved": "https://registry.npmjs.org/pump/-/pump-1.0.1.tgz", - "_shasum": "f1f1409fb9bd1085bbdb576b43b84ec4b5eadc1a", + "_resolved": "https://registry.npmjs.org/pump/-/pump-1.0.2.tgz", + "_shasum": "3b3ee6512f94f0e575538c17995f9f16990a5d51", "_shrinkwrap": null, "_spec": "pump@^1.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", @@ -46,6 +50,9 @@ "name": "Mathias Buus Madsen", "email": "mathiasbuus@gmail.com" }, + "browser": { + "fs": false + }, "bugs": { "url": "https://github.com/mafintosh/pump/issues" }, @@ -57,10 +64,10 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "f1f1409fb9bd1085bbdb576b43b84ec4b5eadc1a", - "tarball": "https://registry.npmjs.org/pump/-/pump-1.0.1.tgz" + "shasum": "3b3ee6512f94f0e575538c17995f9f16990a5d51", + "tarball": "https://registry.npmjs.org/pump/-/pump-1.0.2.tgz" }, - "gitHead": "6abb030191e1ccb12c5f735a4f39162307f93b90", + "gitHead": "90ed7ae8923ade7c7589e3db28c29fbc5c2d42ca", "homepage": "https://github.com/mafintosh/pump", "keywords": [ "streams", @@ -85,5 +92,5 @@ "scripts": { "test": "node test.js" }, - "version": "1.0.1" + "version": "1.0.2" } diff --git a/deps/npm/node_modules/mississippi/node_modules/pump/test-browser.js b/deps/npm/node_modules/mississippi/node_modules/pump/test-browser.js new file mode 100644 index 0000000000..80e852c7dc --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/pump/test-browser.js @@ -0,0 +1,58 @@ +var stream = require('stream') +var pump = require('./index') + +var rs = new stream.Readable() +var ws = new stream.Writable() + +rs._read = function (size) { + this.push(Buffer(size).fill('abc')) +} + +ws._write = function (chunk, encoding, cb) { + setTimeout(function () { + cb() + }, 100) +} + +var toHex = function () { + var reverse = new (require('stream').Transform)() + + reverse._transform = function (chunk, enc, callback) { + reverse.push(chunk.toString('hex')) + callback() + } + + return reverse +} + +var wsClosed = false +var rsClosed = false +var callbackCalled = false + +var check = function () { + if (wsClosed && rsClosed && callbackCalled) console.log('done') +} + +ws.on('finish', function () { + wsClosed = true + check() +}) + +rs.on('end', function () { + rsClosed = true + check() +}) + +pump(rs, toHex(), toHex(), toHex(), ws, function () { + callbackCalled = true + check() +}) + +setTimeout(function () { + rs.push(null) + rs.emit('close') +}, 1000) + +setTimeout(function () { + if (!check()) throw new Error('timeout') +}, 5000) diff --git a/deps/npm/node_modules/mississippi/node_modules/stream-each/index.js b/deps/npm/node_modules/mississippi/node_modules/stream-each/index.js index ea8d112f98..2c07e957a3 100644 --- a/deps/npm/node_modules/mississippi/node_modules/stream-each/index.js +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/index.js @@ -1,4 +1,5 @@ var eos = require('end-of-stream') +var shift = require('stream-shift') module.exports = each @@ -41,7 +42,7 @@ function each (stream, fn, cb) { if (ended || running) return want = false - var data = stream.read() + var data = shift(stream) if (!data) { want = true return diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/.npmignore b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.npmignore similarity index 100% rename from deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/.npmignore rename to deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.npmignore diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.travis.yml b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.travis.yml similarity index 58% rename from deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.travis.yml rename to deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.travis.yml index cc4dba29d9..ecd4193f60 100644 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/.travis.yml +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/.travis.yml @@ -1,4 +1,6 @@ language: node_js node_js: - - "0.8" - "0.10" + - "0.12" + - "4" + - "6" diff --git a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/LICENSE similarity index 79% rename from deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md rename to deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/LICENSE index c67e3532b5..bae9da7bfa 100644 --- a/deps/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream/node_modules/process-nextick-args/license.md +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/LICENSE @@ -1,4 +1,6 @@ -# Copyright (c) 2015 Calvin Metcalf +The MIT License (MIT) + +Copyright (c) 2016 Mathias Buus Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -7,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. -**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.** +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/README.md b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/README.md new file mode 100644 index 0000000000..d9cc2d945f --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/README.md @@ -0,0 +1,25 @@ +# stream-shift + +Returns the next buffer/object in a stream's readable queue + +``` +npm install stream-shift +``` + +[![build status](http://img.shields.io/travis/mafintosh/stream-shift.svg?style=flat)](http://travis-ci.org/mafintosh/stream-shift) + +## Usage + +``` js +var shift = require('stream-shift') + +console.log(shift(someStream)) // first item in its buffer +``` + +## Credit + +Thanks [@dignifiedquire](https://github.com/dignifiedquire) for making this work on node 6 + +## License + +MIT diff --git a/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/index.js b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/index.js new file mode 100644 index 0000000000..c4b18b9c2a --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/index.js @@ -0,0 +1,20 @@ +module.exports = shift + +function shift (stream) { + var rs = stream._readableState + if (!rs) return null + return rs.objectMode ? stream.read() : stream.read(getStateLength(rs)) +} + +function getStateLength (state) { + if (state.buffer.length) { + // Since node 6.3.0 state.buffer is a BufferList not an array + if (state.buffer.head) { + return state.buffer.head.data.length + } + + return state.buffer[0].length + } + + return state.length +} diff --git a/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/package.json b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/package.json new file mode 100644 index 0000000000..54bd23eb8e --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/package.json @@ -0,0 +1,100 @@ +{ + "_args": [ + [ + { + "raw": "stream-shift@^1.0.0", + "scope": null, + "escapedName": "stream-shift", + "name": "stream-shift", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/duplexify" + ], + [ + { + "raw": "stream-shift@^1.0.0", + "scope": null, + "escapedName": "stream-shift", + "name": "stream-shift", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/stream-each" + ] + ], + "_from": "stream-shift@^1.0.0", + "_id": "stream-shift@1.0.0", + "_inCache": true, + "_location": "/mississippi/stream-each/stream-shift", + "_nodeVersion": "4.4.3", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/stream-shift-1.0.0.tgz_1468011662152_0.6510484367609024" + }, + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": {}, + "_requested": { + "raw": "stream-shift@^1.0.0", + "scope": null, + "escapedName": "stream-shift", + "name": "stream-shift", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/mississippi/stream-each" + ], + "_resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "_shasum": "d5c752825e5367e786f78e18e445ea223a155952", + "_shrinkwrap": null, + "_spec": "stream-shift@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/stream-each", + "author": { + "name": "Mathias Buus", + "url": "@mafintosh" + }, + "bugs": { + "url": "https://github.com/mafintosh/stream-shift/issues" + }, + "dependencies": {}, + "description": "Returns the next buffer/object in a stream's readable queue", + "devDependencies": { + "standard": "^7.1.2", + "tape": "^4.6.0", + "through2": "^2.0.1" + }, + "directories": {}, + "dist": { + "shasum": "d5c752825e5367e786f78e18e445ea223a155952", + "tarball": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz" + }, + "gitHead": "2ea5f7dcd8ac6babb08324e6e603a3269252a2c4", + "homepage": "https://github.com/mafintosh/stream-shift", + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "stream-shift", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mafintosh/stream-shift.git" + }, + "scripts": { + "test": "standard && tape test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/test.js b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/test.js new file mode 100644 index 0000000000..c0222c37d5 --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/node_modules/stream-shift/test.js @@ -0,0 +1,48 @@ +var tape = require('tape') +var through = require('through2') +var stream = require('stream') +var shift = require('./') + +tape('shifts next', function (t) { + var passthrough = through() + + passthrough.write('hello') + passthrough.write('world') + + t.same(shift(passthrough), Buffer('hello')) + t.same(shift(passthrough), Buffer('world')) + t.end() +}) + +tape('shifts next with core', function (t) { + var passthrough = stream.PassThrough() + + passthrough.write('hello') + passthrough.write('world') + + t.same(shift(passthrough), Buffer('hello')) + t.same(shift(passthrough), Buffer('world')) + t.end() +}) + +tape('shifts next with object mode', function (t) { + var passthrough = through({objectMode: true}) + + passthrough.write({hello: 1}) + passthrough.write({world: 1}) + + t.same(shift(passthrough), {hello: 1}) + t.same(shift(passthrough), {world: 1}) + t.end() +}) + +tape('shifts next with object mode with core', function (t) { + var passthrough = stream.PassThrough({objectMode: true}) + + passthrough.write({hello: 1}) + passthrough.write({world: 1}) + + t.same(shift(passthrough), {hello: 1}) + t.same(shift(passthrough), {world: 1}) + t.end() +}) diff --git a/deps/npm/node_modules/mississippi/node_modules/stream-each/package.json b/deps/npm/node_modules/mississippi/node_modules/stream-each/package.json index d73cd30d82..f8594afda6 100644 --- a/deps/npm/node_modules/mississippi/node_modules/stream-each/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/stream-each/package.json @@ -14,19 +14,19 @@ ] ], "_from": "stream-each@>=1.1.0 <2.0.0", - "_id": "stream-each@1.1.2", + "_id": "stream-each@1.2.0", "_inCache": true, "_location": "/mississippi/stream-each", - "_nodeVersion": "4.2.3", + "_nodeVersion": "4.6.1", "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/stream-each-1.1.2.tgz_1454600601831_0.7560806761030108" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/stream-each-1.2.0.tgz_1478427484733_0.5437065886799246" }, "_npmUser": { "name": "mafintosh", "email": "mathiasbuus@gmail.com" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.15.9", "_phantomChildren": {}, "_requested": { "raw": "stream-each@^1.1.0", @@ -40,8 +40,8 @@ "_requiredBy": [ "/mississippi" ], - "_resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.1.2.tgz", - "_shasum": "7d4f887f24c721ab0155b12a34263d8732ad8d39", + "_resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.0.tgz", + "_shasum": "1e95d47573f580d814dc0ff8cd0f66f1ce53c991", "_shrinkwrap": null, "_spec": "stream-each@^1.1.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", @@ -53,7 +53,8 @@ "url": "https://github.com/mafintosh/stream-each/issues" }, "dependencies": { - "end-of-stream": "^1.1.0" + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" }, "description": "Iterate all the data in a stream", "devDependencies": { @@ -63,10 +64,10 @@ }, "directories": {}, "dist": { - "shasum": "7d4f887f24c721ab0155b12a34263d8732ad8d39", - "tarball": "https://registry.npmjs.org/stream-each/-/stream-each-1.1.2.tgz" + "shasum": "1e95d47573f580d814dc0ff8cd0f66f1ce53c991", + "tarball": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.0.tgz" }, - "gitHead": "f0ef91ddbe95688e376598b9959cab463c733b57", + "gitHead": "2968bf4f195641f5eda594c781a0b590776bc702", "homepage": "https://github.com/mafintosh/stream-each", "license": "MIT", "main": "index.js", @@ -94,5 +95,5 @@ "scripts": { "test": "standard && tape test.js" }, - "version": "1.1.2" + "version": "1.2.0" } diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/LICENSE b/deps/npm/node_modules/mississippi/node_modules/through2/LICENSE deleted file mode 100644 index f6a0029de1..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/LICENSE +++ /dev/null @@ -1,39 +0,0 @@ -Copyright 2013, Rod Vagg (the "Original Author") -All rights reserved. - -MIT +no-false-attribs License - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -Distributions of all or part of the Software intended to be used -by the recipients as they would use the unmodified Software, -containing modifications that substantially alter, remove, or -disable functionality of the Software, outside of the documented -configuration mechanisms provided by the Software, shall be -modified such that the Original Author's bug reporting email -addresses and urls are either replaced with the contact information -of the parties responsible for the changes, or removed entirely. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. - - -Except where noted, this license applies to any and all software -programs and associated documentation files created by the -Original Author, when distributed with the Software. \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/LICENSE.html b/deps/npm/node_modules/mississippi/node_modules/through2/LICENSE.html new file mode 100644 index 0000000000..ac478189ea --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/through2/LICENSE.html @@ -0,0 +1,336 @@ + + + + + + + + + + + + + + +
+

The MIT License (MIT)

+

Copyright (c) 2016 Rod Vagg (the "Original Author") and additional contributors

+

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

+

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

+

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+
+
+ + \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/LICENSE.md b/deps/npm/node_modules/mississippi/node_modules/through2/LICENSE.md new file mode 100644 index 0000000000..7f0b93daaa --- /dev/null +++ b/deps/npm/node_modules/mississippi/node_modules/through2/LICENSE.md @@ -0,0 +1,9 @@ +# The MIT License (MIT) + +**Copyright (c) 2016 Rod Vagg (the "Original Author") and additional contributors** + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/README.md b/deps/npm/node_modules/mississippi/node_modules/through2/README.md index c84b3464ad..a916f15ef5 100644 --- a/deps/npm/node_modules/mississippi/node_modules/through2/README.md +++ b/deps/npm/node_modules/mississippi/node_modules/through2/README.md @@ -20,6 +20,9 @@ fs.createReadStream('ex.txt') callback() })) .pipe(fs.createWriteStream('out.txt')) + .on('finish', function () { + doSomethingSpecial() + }) ``` Or object streams: diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/.npmignore b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/.npmignore deleted file mode 100644 index 38344f87a6..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -build/ -test/ -examples/ -fs.js -zlib.js \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/.travis.yml deleted file mode 100644 index 1b82118460..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/.travis.yml +++ /dev/null @@ -1,52 +0,0 @@ -sudo: false -language: node_js -before_install: - - npm install -g npm@2 - - npm install -g npm -notifications: - email: false -matrix: - fast_finish: true - allow_failures: - - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" - include: - - node_js: '0.8' - env: TASK=test - - node_js: '0.10' - env: TASK=test - - node_js: '0.11' - env: TASK=test - - node_js: '0.12' - env: TASK=test - - node_js: 1 - env: TASK=test - - node_js: 2 - env: TASK=test - - node_js: 3 - env: TASK=test - - node_js: 4 - env: TASK=test - - node_js: 5 - env: TASK=test - - node_js: 5 - env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=ie BROWSER_VERSION="9..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=opera BROWSER_VERSION="11..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="-3..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="-3..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" -script: "npm run $TASK" -env: - global: - - secure: rE2Vvo7vnjabYNULNyLFxOyt98BoJexDqsiOnfiD6kLYYsiQGfr/sbZkPMOFm9qfQG7pjqx+zZWZjGSswhTt+626C0t/njXqug7Yps4c3dFblzGfreQHp7wNX5TFsvrxd6dAowVasMp61sJcRnB2w8cUzoe3RAYUDHyiHktwqMc= - - secure: g9YINaKAdMatsJ28G9jCGbSaguXCyxSTy+pBO6Ch0Cf57ZLOTka3HqDj8p3nV28LUIHZ3ut5WO43CeYKwt4AUtLpBS3a0dndHdY6D83uY6b2qh5hXlrcbeQTq2cvw2y95F7hm4D1kwrgZ7ViqaKggRcEupAL69YbJnxeUDKWEdI= diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/.zuul.yml b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/.zuul.yml deleted file mode 100644 index 96d9cfbd38..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/.zuul.yml +++ /dev/null @@ -1 +0,0 @@ -ui: tape diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/LICENSE b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/LICENSE deleted file mode 100644 index e3d4e695a4..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. All rights reserved. -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/README.md b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/README.md deleted file mode 100644 index 1a67c48cd0..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/README.md +++ /dev/null @@ -1,36 +0,0 @@ -# readable-stream - -***Node-core v5.8.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) - - -[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) -[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/) - - -[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream) - -```bash -npm install --save readable-stream -``` - -***Node-core streams for userland*** - -This package is a mirror of the Streams2 and Streams3 implementations in -Node-core, including [documentation](doc/stream.markdown). - -If you want to guarantee a stable streams base, regardless of what version of -Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). - -As of version 2.0.0 **readable-stream** uses semantic versioning. - -# Streams WG Team Members - -* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) <christopher.s.dickinson@gmail.com> - - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B -* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) <calvin.metcalf@gmail.com> - - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242 -* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) <rod@vagg.org> - - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D -* **Sam Newman** ([@sonewman](https://github.com/sonewman)) <newmansam@outlook.com> -* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) <mathiasbuus@gmail.com> -* **Domenic Denicola** ([@domenic](https://github.com/domenic)) <d@domenic.me> diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/doc/stream.markdown b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/doc/stream.markdown deleted file mode 100644 index 0bc3819e63..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/doc/stream.markdown +++ /dev/null @@ -1,1760 +0,0 @@ -# Stream - - Stability: 2 - Stable - -A stream is an abstract interface implemented by various objects in -Node.js. For example a [request to an HTTP server][http-incoming-message] is a -stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All -streams are instances of [`EventEmitter`][]. - -You can load the Stream base classes by doing `require('stream')`. -There are base classes provided for [Readable][] streams, [Writable][] -streams, [Duplex][] streams, and [Transform][] streams. - -This document is split up into 3 sections: - -1. The first section explains the parts of the API that you need to be - aware of to use streams in your programs. -2. The second section explains the parts of the API that you need to - use if you implement your own custom streams yourself. The API is designed to - make this easy for you to do. -3. The third section goes into more depth about how streams work, - including some of the internal mechanisms and functions that you - should probably not modify unless you definitely know what you are - doing. - - -## API for Stream Consumers - - - -Streams can be either [Readable][], [Writable][], or both ([Duplex][]). - -All streams are EventEmitters, but they also have other custom methods -and properties depending on whether they are Readable, Writable, or -Duplex. - -If a stream is both Readable and Writable, then it implements all of -the methods and events. So, a [Duplex][] or [Transform][] stream is -fully described by this API, though their implementation may be -somewhat different. - -It is not necessary to implement Stream interfaces in order to consume -streams in your programs. If you **are** implementing streaming -interfaces in your own program, please also refer to -[API for Stream Implementors][]. - -Almost all Node.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an Node.js program: - -```js -const http = require('http'); - -var server = http.createServer( (req, res) => { - // req is an http.IncomingMessage, which is a Readable Stream - // res is an http.ServerResponse, which is a Writable Stream - - var body = ''; - // we want to get the data as utf8 strings - // If you don't set an encoding, then you'll get Buffer objects - req.setEncoding('utf8'); - - // Readable streams emit 'data' events once a listener is added - req.on('data', (chunk) => { - body += chunk; - }); - - // the end event tells you that you have entire body - req.on('end', () => { - try { - var data = JSON.parse(body); - } catch (er) { - // uh oh! bad json! - res.statusCode = 400; - return res.end(`error: ${er.message}`); - } - - // write back something interesting to the user: - res.write(typeof data); - res.end(); - }); -}); - -server.listen(1337); - -// $ curl localhost:1337 -d '{}' -// object -// $ curl localhost:1337 -d '"foo"' -// string -// $ curl localhost:1337 -d 'not json' -// error: Unexpected token o -``` - -### Class: stream.Duplex - -Duplex streams are streams that implement both the [Readable][] and -[Writable][] interfaces. - -Examples of Duplex streams include: - -* [TCP sockets][] -* [zlib streams][zlib] -* [crypto streams][crypto] - -### Class: stream.Readable - - - -The Readable stream interface is the abstraction for a *source* of -data that you are reading from. In other words, data comes *out* of a -Readable stream. - -A Readable stream will not start emitting data until you indicate that -you are ready to receive it. - -Readable streams have two "modes": a **flowing mode** and a **paused -mode**. When in flowing mode, data is read from the underlying system -and provided to your program as fast as possible. In paused mode, you -must explicitly call [`stream.read()`][stream-read] to get chunks of data out. -Streams start out in paused mode. - -**Note**: If no data event handlers are attached, and there are no -[`stream.pipe()`][] destinations, and the stream is switched into flowing -mode, then data will be lost. - -You can switch to flowing mode by doing any of the following: - -* Adding a [`'data'`][] event handler to listen for data. -* Calling the [`stream.resume()`][stream-resume] method to explicitly open the - flow. -* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. - -You can switch back to paused mode by doing either of the following: - -* If there are no pipe destinations, by calling the - [`stream.pause()`][stream-pause] method. -* If there are pipe destinations, by removing any [`'data'`][] event - handlers, and removing all pipe destinations by calling the - [`stream.unpipe()`][] method. - -Note that, for backwards compatibility reasons, removing [`'data'`][] -event handlers will **not** automatically pause the stream. Also, if -there are piped destinations, then calling [`stream.pause()`][stream-pause] will -not guarantee that the stream will *remain* paused once those -destinations drain and ask for more data. - -Examples of readable streams include: - -* [HTTP responses, on the client][http-incoming-message] -* [HTTP requests, on the server][http-incoming-message] -* [fs read streams][] -* [zlib streams][zlib] -* [crypto streams][crypto] -* [TCP sockets][] -* [child process stdout and stderr][] -* [`process.stdin`][] - -#### Event: 'close' - -Emitted when the stream and any of its underlying resources (a file -descriptor, for example) have been closed. The event indicates that -no more events will be emitted, and no further computation will occur. - -Not all streams will emit the `'close'` event. - -#### Event: 'data' - -* `chunk` {Buffer|String} The chunk of data. - -Attaching a `'data'` event listener to a stream that has not been -explicitly paused will switch the stream into flowing mode. Data will -then be passed as soon as it is available. - -If you just want to get all the data out of the stream as fast as -possible, this is the best way to do so. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); -}); -``` - -#### Event: 'end' - -This event fires when there will be no more data to read. - -Note that the `'end'` event **will not fire** unless the data is -completely consumed. This can be done by switching into flowing mode, -or by calling [`stream.read()`][stream-read] repeatedly until you get to the -end. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); -}); -readable.on('end', () => { - console.log('there will be no more data.'); -}); -``` - -#### Event: 'error' - -* {Error Object} - -Emitted if there was an error receiving data. - -#### Event: 'readable' - -When a chunk of data can be read from the stream, it will emit a -`'readable'` event. - -In some cases, listening for a `'readable'` event will cause some data -to be read into the internal buffer from the underlying system, if it -hadn't already. - -```javascript -var readable = getReadableStreamSomehow(); -readable.on('readable', () => { - // there is some data to read now -}); -``` - -Once the internal buffer is drained, a `'readable'` event will fire -again when more data is available. - -The `'readable'` event is not emitted in the "flowing" mode with the -sole exception of the last one, on end-of-stream. - -The `'readable'` event indicates that the stream has new information: -either new data is available or the end of the stream has been reached. -In the former case, [`stream.read()`][stream-read] will return that data. In the -latter case, [`stream.read()`][stream-read] will return null. For instance, in -the following example, `foo.txt` is an empty file: - -```js -const fs = require('fs'); -var rr = fs.createReadStream('foo.txt'); -rr.on('readable', () => { - console.log('readable:', rr.read()); -}); -rr.on('end', () => { - console.log('end'); -}); -``` - -The output of running this script is: - -``` -$ node test.js -readable: null -end -``` - -#### readable.isPaused() - -* Return: {Boolean} - -This method returns whether or not the `readable` has been **explicitly** -paused by client code (using [`stream.pause()`][stream-pause] without a -corresponding [`stream.resume()`][stream-resume]). - -```js -var readable = new stream.Readable - -readable.isPaused() // === false -readable.pause() -readable.isPaused() // === true -readable.resume() -readable.isPaused() // === false -``` - -#### readable.pause() - -* Return: `this` - -This method will cause a stream in flowing mode to stop emitting -[`'data'`][] events, switching out of flowing mode. Any data that becomes -available will remain in the internal buffer. - -```js -var readable = getReadableStreamSomehow(); -readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); - readable.pause(); - console.log('there will be no more data for 1 second'); - setTimeout(() => { - console.log('now data will start flowing again'); - readable.resume(); - }, 1000); -}); -``` - -#### readable.pipe(destination[, options]) - -* `destination` {stream.Writable} The destination for writing data -* `options` {Object} Pipe options - * `end` {Boolean} End the writer when the reader ends. Default = `true` - -This method pulls all the data out of a readable stream, and writes it -to the supplied destination, automatically managing the flow so that -the destination is not overwhelmed by a fast readable stream. - -Multiple destinations can be piped to safely. - -```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt' -readable.pipe(writable); -``` - -This function returns the destination stream, so you can set up pipe -chains like so: - -```js -var r = fs.createReadStream('file.txt'); -var z = zlib.createGzip(); -var w = fs.createWriteStream('file.txt.gz'); -r.pipe(z).pipe(w); -``` - -For example, emulating the Unix `cat` command: - -```js -process.stdin.pipe(process.stdout); -``` - -By default [`stream.end()`][stream-end] is called on the destination when the -source stream emits [`'end'`][], so that `destination` is no longer writable. -Pass `{ end: false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. - -```js -reader.pipe(writer, { end: false }); -reader.on('end', () => { - writer.end('Goodbye\n'); -}); -``` - -Note that [`process.stderr`][] and [`process.stdout`][] are never closed until -the process exits, regardless of the specified options. - -#### readable.read([size]) - -* `size` {Number} Optional argument to specify how much data to read. -* Return {String|Buffer|Null} - -The `read()` method pulls some data out of the internal buffer and -returns it. If there is no data available, then it will return -`null`. - -If you pass in a `size` argument, then it will return that many -bytes. If `size` bytes are not available, then it will return `null`, -unless we've ended, in which case it will return the data remaining -in the buffer. - -If you do not specify a `size` argument, then it will return all the -data in the internal buffer. - -This method should only be called in paused mode. In flowing mode, -this method is called automatically until the internal buffer is -drained. - -```js -var readable = getReadableStreamSomehow(); -readable.on('readable', () => { - var chunk; - while (null !== (chunk = readable.read())) { - console.log('got %d bytes of data', chunk.length); - } -}); -``` - -If this method returns a data chunk, then it will also trigger the -emission of a [`'data'`][] event. - -Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] -event has been triggered will return `null`. No runtime error will be raised. - -#### readable.resume() - -* Return: `this` - -This method will cause the readable stream to resume emitting [`'data'`][] -events. - -This method will switch the stream into flowing mode. If you do *not* -want to consume the data from a stream, but you *do* want to get to -its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open -the flow of data. - -```js -var readable = getReadableStreamSomehow(); -readable.resume(); -readable.on('end', () => { - console.log('got to the end, but did not read anything'); -}); -``` - -#### readable.setEncoding(encoding) - -* `encoding` {String} The encoding to use. -* Return: `this` - -Call this function to cause the stream to return strings of the specified -encoding instead of Buffer objects. For example, if you do -`readable.setEncoding('utf8')`, then the output data will be interpreted as -UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, -then the data will be encoded in hexadecimal string format. - -This properly handles multi-byte characters that would otherwise be -potentially mangled if you simply pulled the Buffers directly and -called [`buf.toString(encoding)`][] on them. If you want to read the data -as strings, always use this method. - -Also you can disable any encoding at all with `readable.setEncoding(null)`. -This approach is very useful if you deal with binary data or with large -multi-byte strings spread out over multiple chunks. - -```js -var readable = getReadableStreamSomehow(); -readable.setEncoding('utf8'); -readable.on('data', (chunk) => { - assert.equal(typeof chunk, 'string'); - console.log('got %d characters of string data', chunk.length); -}); -``` - -#### readable.unpipe([destination]) - -* `destination` {stream.Writable} Optional specific stream to unpipe - -This method will remove the hooks set up for a previous [`stream.pipe()`][] -call. - -If the destination is not specified, then all pipes are removed. - -If the destination is specified, but no pipe is set up for it, then -this is a no-op. - -```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); -// All the data from readable goes into 'file.txt', -// but only for the first second -readable.pipe(writable); -setTimeout(() => { - console.log('stop writing to file.txt'); - readable.unpipe(writable); - console.log('manually close the file stream'); - writable.end(); -}, 1000); -``` - -#### readable.unshift(chunk) - -* `chunk` {Buffer|String} Chunk of data to unshift onto the read queue - -This is useful in certain cases where a stream is being consumed by a -parser, which needs to "un-consume" some data that it has -optimistically pulled out of the source, so that the stream can be -passed on to some other party. - -Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event -has been triggered; a runtime error will be raised. - -If you find that you must often call `stream.unshift(chunk)` in your -programs, consider implementing a [Transform][] stream instead. (See [API -for Stream Implementors][].) - -```js -// Pull off a header delimited by \n\n -// use unshift() if we get too much -// Call the callback with (error, header, stream) -const StringDecoder = require('string_decoder').StringDecoder; -function parseHeader(stream, callback) { - stream.on('error', callback); - stream.on('readable', onReadable); - var decoder = new StringDecoder('utf8'); - var header = ''; - function onReadable() { - var chunk; - while (null !== (chunk = stream.read())) { - var str = decoder.write(chunk); - if (str.match(/\n\n/)) { - // found the header boundary - var split = str.split(/\n\n/); - header += split.shift(); - var remaining = split.join('\n\n'); - var buf = new Buffer(remaining, 'utf8'); - if (buf.length) - stream.unshift(buf); - stream.removeListener('error', callback); - stream.removeListener('readable', onReadable); - // now the body of the message can be read from the stream. - callback(null, header, stream); - } else { - // still reading the header. - header += str; - } - } - } -} -``` - -Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` -will not end the reading process by resetting the internal reading state of the -stream. This can cause unexpected results if `unshift()` is called during a -read (i.e. from within a [`stream._read()`][stream-_read] implementation on a -custom stream). Following the call to `unshift()` with an immediate -[`stream.push('')`][stream-push] will reset the reading state appropriately, -however it is best to simply avoid calling `unshift()` while in the process of -performing a read. - -#### readable.wrap(stream) - -* `stream` {Stream} An "old style" readable stream - -Versions of Node.js prior to v0.10 had streams that did not implement the -entire Streams API as it is today. (See [Compatibility][] for -more information.) - -If you are using an older Node.js library that emits [`'data'`][] events and -has a [`stream.pause()`][stream-pause] method that is advisory only, then you -can use the `wrap()` method to create a [Readable][] stream that uses the old -stream as its data source. - -You will very rarely ever need to call this function, but it exists -as a convenience for interacting with old Node.js programs and libraries. - -For example: - -```js -const OldReader = require('./old-api-module.js').OldReader; -const Readable = require('stream').Readable; -const oreader = new OldReader; -const myReader = new Readable().wrap(oreader); - -myReader.on('readable', () => { - myReader.read(); // etc. -}); -``` - -### Class: stream.Transform - -Transform streams are [Duplex][] streams where the output is in some way -computed from the input. They implement both the [Readable][] and -[Writable][] interfaces. - -Examples of Transform streams include: - -* [zlib streams][zlib] -* [crypto streams][crypto] - -### Class: stream.Writable - - - -The Writable stream interface is an abstraction for a *destination* -that you are writing data *to*. - -Examples of writable streams include: - -* [HTTP requests, on the client][] -* [HTTP responses, on the server][] -* [fs write streams][] -* [zlib streams][zlib] -* [crypto streams][crypto] -* [TCP sockets][] -* [child process stdin][] -* [`process.stdout`][], [`process.stderr`][] - -#### Event: 'drain' - -If a [`stream.write(chunk)`][stream-write] call returns `false`, then the -`'drain'` event will indicate when it is appropriate to begin writing more data -to the stream. - -```js -// Write the data to the supplied writable stream one million times. -// Be attentive to back-pressure. -function writeOneMillionTimes(writer, data, encoding, callback) { - var i = 1000000; - write(); - function write() { - var ok = true; - do { - i -= 1; - if (i === 0) { - // last time! - writer.write(data, encoding, callback); - } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. - ok = writer.write(data, encoding); - } - } while (i > 0 && ok); - if (i > 0) { - // had to stop early! - // write some more once it drains - writer.once('drain', write); - } - } -} -``` - -#### Event: 'error' - -* {Error} - -Emitted if there was an error when writing or piping data. - -#### Event: 'finish' - -When the [`stream.end()`][stream-end] method has been called, and all data has -been flushed to the underlying system, this event is emitted. - -```javascript -var writer = getWritableStreamSomehow(); -for (var i = 0; i < 100; i ++) { - writer.write('hello, #${i}!\n'); -} -writer.end('this is the end\n'); -writer.on('finish', () => { - console.error('all writes are now complete.'); -}); -``` - -#### Event: 'pipe' - -* `src` {stream.Readable} source stream that is piping to this writable - -This is emitted whenever the [`stream.pipe()`][] method is called on a readable -stream, adding this writable to its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('pipe', (src) => { - console.error('something is piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -``` - -#### Event: 'unpipe' - -* `src` {[Readable][] Stream} The source stream that - [unpiped][`stream.unpipe()`] this writable - -This is emitted whenever the [`stream.unpipe()`][] method is called on a -readable stream, removing this writable from its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('unpipe', (src) => { - console.error('something has stopped piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -reader.unpipe(writer); -``` - -#### writable.cork() - -Forces buffering of all writes. - -Buffered data will be flushed either at [`stream.uncork()`][] or at -[`stream.end()`][stream-end] call. - -#### writable.end([chunk][, encoding][, callback]) - -* `chunk` {String|Buffer} Optional data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Optional callback for when the stream is finished - -Call this method when no more data will be written to the stream. If supplied, -the callback is attached as a listener on the [`'finish'`][] event. - -Calling [`stream.write()`][stream-write] after calling -[`stream.end()`][stream-end] will raise an error. - -```js -// write 'hello, ' and then end with 'world!' -var file = fs.createWriteStream('example.txt'); -file.write('hello, '); -file.end('world!'); -// writing more now is not allowed! -``` - -#### writable.setDefaultEncoding(encoding) - -* `encoding` {String} The new default encoding - -Sets the default encoding for a writable stream. - -#### writable.uncork() - -Flush all data, buffered since [`stream.cork()`][] call. - -#### writable.write(chunk[, encoding][, callback]) - -* `chunk` {String|Buffer} The data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} `true` if the data was handled completely. - -This method writes some data to the underlying system, and calls the -supplied callback once the data has been fully handled. - -The return value indicates if you should continue writing right now. -If the data had to be buffered internally, then it will return -`false`. Otherwise, it will return `true`. - -This return value is strictly advisory. You MAY continue to write, -even if it returns `false`. However, writes will be buffered in -memory, so it is best not to do this excessively. Instead, wait for -the [`'drain'`][] event before writing more data. - - -## API for Stream Implementors - - - -To implement any sort of stream, the pattern is the same: - -1. Extend the appropriate parent class in your own subclass. (The - [`util.inherits()`][] method is particularly helpful for this.) -2. Call the appropriate parent class constructor in your constructor, - to be sure that the internal mechanisms are set up properly. -3. Implement one or more specific methods, as detailed below. - -The class to extend and the method(s) to implement depend on the sort -of stream class you are writing: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

Use-case

-
-

Class

-
-

Method(s) to implement

-
-

Reading only

-
-

[Readable](#stream_class_stream_readable_1)

-
-

[_read][stream-_read]

-
-

Writing only

-
-

[Writable](#stream_class_stream_writable_1)

-
-

[_write][stream-_write], [_writev][stream-_writev]

-
-

Reading and writing

-
-

[Duplex](#stream_class_stream_duplex_1)

-
-

[_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

-
-

Operate on written data, then read the result

-
-

[Transform](#stream_class_stream_transform_1)

-
-

[_transform][stream-_transform], [_flush][stream-_flush]

-
- -In your implementation code, it is very important to never call the methods -described in [API for Stream Consumers][]. Otherwise, you can potentially cause -adverse side effects in programs that consume your streaming interfaces. - -### Class: stream.Duplex - - - -A "duplex" stream is one that is both Readable and Writable, such as a TCP -socket connection. - -Note that `stream.Duplex` is an abstract class designed to be extended -with an underlying implementation of the [`stream._read(size)`][stream-_read] -and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you -would with a Readable or Writable stream class. - -Since JavaScript doesn't have multiple prototypal inheritance, this class -prototypally inherits from Readable, and then parasitically from Writable. It is -thus up to the user to implement both the low-level -[`stream._read(n)`][stream-_read] method as well as the low-level -[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension -duplex classes. - -#### new stream.Duplex(options) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then - the stream will automatically end the readable side when the - writable side ends and vice versa. - * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for readable side of the stream. Has no effect if `objectMode` - is `true`. - * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for writable side of the stream. Has no effect if `objectMode` - is `true`. - -In classes that extend the Duplex class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -### Class: stream.PassThrough - -This is a trivial implementation of a [Transform][] stream that simply -passes the input bytes across to the output. Its purpose is mainly -for examples and testing, but there are occasionally use cases where -it can come in handy as a building block for novel sorts of streams. - -### Class: stream.Readable - - - -`stream.Readable` is an abstract class designed to be extended with an -underlying implementation of the [`stream._read(size)`][stream-_read] method. - -Please see [API for Stream Consumers][] for how to consume -streams in your programs. What follows is an explanation of how to -implement Readable streams in your programs. - -#### new stream.Readable([options]) - -* `options` {Object} - * `highWaterMark` {Number} The maximum number of bytes to store in - the internal buffer before ceasing to read from the underlying - resource. Default = `16384` (16kb), or `16` for `objectMode` streams - * `encoding` {String} If specified, then buffers will be decoded to - strings using the specified encoding. Default = `null` - * `objectMode` {Boolean} Whether this stream should behave - as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns - a single value instead of a Buffer of size n. Default = `false` - * `read` {Function} Implementation for the [`stream._read()`][stream-_read] - method. - -In classes that extend the Readable class, make sure to call the -Readable constructor so that the buffering settings can be properly -initialized. - -#### readable.\_read(size) - -* `size` {Number} Number of bytes to read asynchronously - -Note: **Implement this method, but do NOT call it directly.** - -This method is prefixed with an underscore because it is internal to the -class that defines it and should only be called by the internal Readable -class methods. All Readable stream implementations must provide a \_read -method to fetch data from the underlying resource. - -When `_read()` is called, if data is available from the resource, the `_read()` -implementation should start pushing that data into the read queue by calling -[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from -the resource and pushing data until push returns `false`, at which point it -should stop reading from the resource. Only when `_read()` is called again after -it has stopped should it start reading more data from the resource and pushing -that data onto the queue. - -Note: once the `_read()` method is called, it will not be called again until -the [`stream.push()`][stream-push] method is called. - -The `size` argument is advisory. Implementations where a "read" is a -single call that returns data can use this to know how much data to -fetch. Implementations where that is not relevant, such as TCP or -TLS, may ignore this argument, and simply provide data whenever it -becomes available. There is no need, for example to "wait" until -`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. - -#### readable.push(chunk[, encoding]) - - -* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue -* `encoding` {String} Encoding of String chunks. Must be a valid - Buffer encoding, such as `'utf8'` or `'ascii'` -* return {Boolean} Whether or not more pushes should be performed - -Note: **This method should be called by Readable implementors, NOT -by consumers of Readable streams.** - -If a value other than null is passed, The `push()` method adds a chunk of data -into the queue for subsequent stream processors to consume. If `null` is -passed, it signals the end of the stream (EOF), after which no more data -can be written. - -The data added with `push()` can be pulled out by calling the -[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. - -This API is designed to be as flexible as possible. For example, -you may be wrapping a lower-level source which has some sort of -pause/resume mechanism, and a data callback. In those cases, you -could wrap the low-level source object by doing something like this: - -```js -// source is an object with readStop() and readStart() methods, -// and an `ondata` member that gets called when it has data, and -// an `onend` member that gets called when the data is over. - -util.inherits(SourceWrapper, Readable); - -function SourceWrapper(options) { - Readable.call(this, options); - - this._source = getLowlevelSourceObject(); - - // Every time there's data, we push it into the internal buffer. - this._source.ondata = (chunk) => { - // if push() returns false, then we need to stop reading from source - if (!this.push(chunk)) - this._source.readStop(); - }; - - // When the source ends, we push the EOF-signaling `null` chunk - this._source.onend = () => { - this.push(null); - }; -} - -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -SourceWrapper.prototype._read = function(size) { - this._source.readStart(); -}; -``` - -#### Example: A Counting Stream - - - -This is a basic example of a Readable stream. It emits the numerals -from 1 to 1,000,000 in ascending order, and then ends. - -```js -const Readable = require('stream').Readable; -const util = require('util'); -util.inherits(Counter, Readable); - -function Counter(opt) { - Readable.call(this, opt); - this._max = 1000000; - this._index = 1; -} - -Counter.prototype._read = function() { - var i = this._index++; - if (i > this._max) - this.push(null); - else { - var str = '' + i; - var buf = new Buffer(str, 'ascii'); - this.push(buf); - } -}; -``` - -#### Example: SimpleProtocol v1 (Sub-optimal) - -This is similar to the `parseHeader` function described -[here](#stream_readable_unshift_chunk), but implemented as a custom stream. -Also, note that this implementation does not convert the incoming data to a -string. - -However, this would be better implemented as a [Transform][] stream. See -[SimpleProtocol v2][] for a better implementation. - -```js -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// NOTE: This can be done more simply as a Transform stream! -// Using Readable directly for this is sub-optimal. See the -// alternative example below under the Transform section. - -const Readable = require('stream').Readable; -const util = require('util'); - -util.inherits(SimpleProtocol, Readable); - -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(source, options); - - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - - // source is a readable stream, such as a socket or file - this._source = source; - - var self = this; - source.on('end', () => { - self.push(null); - }); - - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', () => { - self.read(0); - }); - - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - // calling unshift by itself does not reset the reading state - // of the stream; since we're inside _read, doing an additional - // push('') will reset the state appropriately. - this.push(''); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); - } -}; - -// Usage: -// var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - -### Class: stream.Transform - -A "transform" stream is a duplex stream where the output is causally -connected in some way to the input, such as a [zlib][] stream or a -[crypto][] stream. - -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will produce output -that is either much smaller or much larger than its input. - -Rather than implement the [`stream._read()`][stream-_read] and -[`stream._write()`][stream-_write] methods, Transform classes must implement the -[`stream._transform()`][stream-_transform] method, and may optionally -also implement the [`stream._flush()`][stream-_flush] method. (See below.) - -#### new stream.Transform([options]) - -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `transform` {Function} Implementation for the - [`stream._transform()`][stream-_transform] method. - * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] - method. - -In classes that extend the Transform class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### Events: 'finish' and 'end' - -The [`'finish'`][] and [`'end'`][] events are from the parent Writable -and Readable classes respectively. The `'finish'` event is fired after -[`stream.end()`][stream-end] is called and all chunks have been processed by -[`stream._transform()`][stream-_transform], `'end'` is fired after all data has -been output which is after the callback in [`stream._flush()`][stream-_flush] -has been called. - -#### transform.\_flush(callback) - -* `callback` {Function} Call this function (optionally with an error - argument) when you are done flushing any remaining data. - -Note: **This function MUST NOT be called directly.** It MAY be implemented -by child classes, and if so, will be called by the internal Transform -class methods only. - -In some cases, your transform operation may need to emit a bit more -data at the end of the stream. For example, a `Zlib` compression -stream will store up some internal state so that it can optimally -compress the output. At the end, however, it needs to do the best it -can with what is left, so that the data will be complete. - -In those cases, you can implement a `_flush()` method, which will be -called at the very end, after all the written data is consumed, but -before emitting [`'end'`][] to signal the end of the readable side. Just -like with [`stream._transform()`][stream-_transform], call -`transform.push(chunk)` zero or more times, as appropriate, and call `callback` -when the flush operation is complete. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### transform.\_transform(chunk, encoding, callback) - -* `chunk` {Buffer|String} The chunk to be transformed. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument and data) when you are done processing the supplied chunk. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. - -All Transform stream implementations must provide a `_transform()` -method to accept input and produce output. - -`_transform()` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. - -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. - -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. If you supply a second argument to the callback -it will be passed to the push method. In other words the following are -equivalent: - -```js -transform.prototype._transform = function (data, encoding, callback) { - this.push(data); - callback(); -}; - -transform.prototype._transform = function (data, encoding, callback) { - callback(null, data); -}; -``` - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### Example: `SimpleProtocol` parser v2 - -The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple -protocol parser can be implemented simply by using the higher level -[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol -v1` examples. - -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic Node.js stream -approach. - -```javascript -const util = require('util'); -const Transform = require('stream').Transform; -util.inherits(SimpleProtocol, Transform); - -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); - - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); - - // now, because we got some extra data, emit this first. - this.push(chunk.slice(split)); - } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(chunk); - } - done(); -}; - -// Usage: -// var parser = new SimpleProtocol(); -// source.pipe(parser) -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - -### Class: stream.Writable - - - -`stream.Writable` is an abstract class designed to be extended with an -underlying implementation of the -[`stream._write(chunk, encoding, callback)`][stream-_write] method. - -Please see [API for Stream Consumers][] for how to consume -writable streams in your programs. What follows is an explanation of -how to implement Writable streams in your programs. - -#### new stream.Writable([options]) - -* `options` {Object} - * `highWaterMark` {Number} Buffer level when - [`stream.write()`][stream-write] starts returning `false`. Default = `16384` - (16kb), or `16` for `objectMode` streams. - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to [`stream._write()`][stream-_write]. - Default = `true` - * `objectMode` {Boolean} Whether or not the - [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can - write arbitrary data instead of only `Buffer` / `String` data. - Default = `false` - * `write` {Function} Implementation for the - [`stream._write()`][stream-_write] method. - * `writev` {Function} Implementation for the - [`stream._writev()`][stream-_writev] method. - -In classes that extend the Writable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -#### writable.\_write(chunk, encoding, callback) - -* `chunk` {Buffer|String} The chunk to be written. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. - -All Writable stream implementations must provide a -[`stream._write()`][stream-_write] method to send data to the underlying -resource. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Writable -class methods only. - -Call the callback using the standard `callback(error)` pattern to -signal that the write completed successfully or with an error. - -If the `decodeStrings` flag is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the sort of string that it is. This is to support -implementations that have an optimized handling for certain string -data encodings. If you do not explicitly set the `decodeStrings` -option to `false`, then you can safely ignore the `encoding` argument, -and assume that `chunk` will always be a Buffer. - -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. - -#### writable.\_writev(chunks, callback) - -* `chunks` {Array} The chunks to be written. Each chunk has following - format: `{ chunk: ..., encoding: ... }`. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunks. - -Note: **This function MUST NOT be called directly.** It may be -implemented by child classes, and called by the internal Writable -class methods only. - -This function is completely optional to implement. In most cases it is -unnecessary. If implemented, it will be called with all the chunks -that are buffered in the write queue. - - -## Simplified Constructor API - - - -In simple cases there is now the added benefit of being able to construct a -stream without inheritance. - -This can be done by passing the appropriate methods as constructor options: - -Examples: - -### Duplex - -```js -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - write: function(chunk, encoding, next) { - // sets this._write under the hood - - // An optional error can be passed as the first argument - next() - } -}); - -// or - -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - writev: function(chunks, next) { - // sets this._writev under the hood - - // An optional error can be passed as the first argument - next() - } -}); -``` - -### Readable - -```js -var readable = new stream.Readable({ - read: function(n) { - // sets this._read under the hood - - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - } -}); -``` - -### Transform - -```js -var transform = new stream.Transform({ - transform: function(chunk, encoding, next) { - // sets this._transform under the hood - - // generate output as many times as needed - // this.push(chunk); - - // call when the current chunk is consumed - next(); - }, - flush: function(done) { - // sets this._flush under the hood - - // generate output as many times as needed - // this.push(chunk); - - done(); - } -}); -``` - -### Writable - -```js -var writable = new stream.Writable({ - write: function(chunk, encoding, next) { - // sets this._write under the hood - - // An optional error can be passed as the first argument - next() - } -}); - -// or - -var writable = new stream.Writable({ - writev: function(chunks, next) { - // sets this._writev under the hood - - // An optional error can be passed as the first argument - next() - } -}); -``` - -## Streams: Under the Hood - - - -### Buffering - - - -Both Writable and Readable streams will buffer data on an internal -object which can be retrieved from `_writableState.getBuffer()` or -`_readableState.buffer`, respectively. - -The amount of data that will potentially be buffered depends on the -`highWaterMark` option which is passed into the constructor. - -Buffering in Readable streams happens when the implementation calls -[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not -call [`stream.read()`][stream-read], then the data will sit in the internal -queue until it is consumed. - -Buffering in Writable streams happens when the user calls -[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. - -The purpose of streams, especially with the [`stream.pipe()`][] method, is to -limit the buffering of data to acceptable levels, so that sources and -destinations of varying speed will not overwhelm the available memory. - -### Compatibility with Older Node.js Versions - - - -In versions of Node.js prior to v0.10, the Readable stream interface was -simpler, but also less powerful and less useful. - -* Rather than waiting for you to call the [`stream.read()`][stream-read] method, - [`'data'`][] events would start emitting immediately. If you needed to do - some I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. -* The [`stream.pause()`][stream-pause] method was advisory, rather than - guaranteed. This meant that you still had to be prepared to receive - [`'data'`][] events even when the stream was in a paused state. - -In Node.js v0.10, the [Readable][] class was added. -For backwards compatibility with older Node.js programs, Readable streams -switch into "flowing mode" when a [`'data'`][] event handler is added, or -when the [`stream.resume()`][stream-resume] method is called. The effect is -that, even if you are not using the new [`stream.read()`][stream-read] method -and [`'readable'`][] event, you no longer have to worry about losing -[`'data'`][] chunks. - -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: - -* No [`'data'`][] event handler is added. -* The [`stream.resume()`][stream-resume] method is never called. -* The stream is not piped to any writable destination. - -For example, consider the following code: - -```js -// WARNING! BROKEN! -net.createServer((socket) => { - - // we add an 'end' method, but never consume the data - socket.on('end', () => { - // It will never get here. - socket.end('I got your message (but didnt read it)\n'); - }); - -}).listen(1337); -``` - -In versions of Node.js prior to v0.10, the incoming message data would be -simply discarded. However, in Node.js v0.10 and beyond, -the socket will remain paused forever. - -The workaround in this situation is to call the -[`stream.resume()`][stream-resume] method to start the flow of data: - -```js -// Workaround -net.createServer((socket) => { - - socket.on('end', () => { - socket.end('I got your message (but didnt read it)\n'); - }); - - // start the flow of data, discarding it. - socket.resume(); - -}).listen(1337); -``` - -In addition to new Readable streams switching into flowing mode, -pre-v0.10 style streams can be wrapped in a Readable class using the -[`stream.wrap()`][] method. - - -### Object Mode - - - -Normally, Streams operate on Strings and Buffers exclusively. - -Streams that are in **object mode** can emit generic JavaScript values -other than Buffers and Strings. - -A Readable stream in object mode will always return a single item from -a call to [`stream.read(size)`][stream-read], regardless of what the size -argument is. - -A Writable stream in object mode will always ignore the `encoding` -argument to [`stream.write(data, encoding)`][stream-write]. - -The special value `null` still retains its special value for object -mode streams. That is, for object mode readable streams, `null` as a -return value from [`stream.read()`][stream-read] indicates that there is no more -data, and [`stream.push(null)`][stream-push] will signal the end of stream data -(`EOF`). - -No streams in Node.js core are object mode streams. This pattern is only -used by userland streaming libraries. - -You should set `objectMode` in your stream child class constructor on -the options object. Setting `objectMode` mid-stream is not safe. - -For Duplex streams `objectMode` can be set exclusively for readable or -writable side with `readableObjectMode` and `writableObjectMode` -respectively. These options can be used to implement parsers and -serializers with Transform streams. - -```js -const util = require('util'); -const StringDecoder = require('string_decoder').StringDecoder; -const Transform = require('stream').Transform; -util.inherits(JSONParseStream, Transform); - -// Gets \n-delimited JSON string data, and emits the parsed objects -function JSONParseStream() { - if (!(this instanceof JSONParseStream)) - return new JSONParseStream(); - - Transform.call(this, { readableObjectMode : true }); - - this._buffer = ''; - this._decoder = new StringDecoder('utf8'); -} - -JSONParseStream.prototype._transform = function(chunk, encoding, cb) { - this._buffer += this._decoder.write(chunk); - // split on newlines - var lines = this._buffer.split(/\r?\n/); - // keep the last partial line buffered - this._buffer = lines.pop(); - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - try { - var obj = JSON.parse(line); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; - -JSONParseStream.prototype._flush = function(cb) { - // Just handle any leftover - var rem = this._buffer.trim(); - if (rem) { - try { - var obj = JSON.parse(rem); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; -``` - -### `stream.read(0)` - -There are some cases where you want to trigger a refresh of the -underlying readable stream mechanisms, without actually consuming any -data. In that case, you can call `stream.read(0)`, which will always -return null. - -If the internal read buffer is below the `highWaterMark`, and the -stream is not currently reading, then calling `stream.read(0)` will trigger -a low-level [`stream._read()`][stream-_read] call. - -There is almost never a need to do this. However, you will see some -cases in Node.js's internals where this is done, particularly in the -Readable stream class internals. - -### `stream.push('')` - -Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an -interesting side effect. Because it *is* a call to -[`stream.push()`][stream-push], it will end the `reading` process. However, it -does *not* add any data to the readable buffer, so there's nothing for -a user to consume. - -Very rarely, there are cases where you have no data to provide now, -but the consumer of your stream (or, perhaps, another bit of your own -code) will know when to check again, by calling [`stream.read(0)`][stream-read]. -In those cases, you *may* call `stream.push('')`. - -So far, the only use case for this functionality is in the -[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you -find that you have to use `stream.push('')`, please consider another -approach, because it almost certainly indicates that something is -horribly wrong. - -[`'data'`]: #stream_event_data -[`'drain'`]: #stream_event_drain -[`'end'`]: #stream_event_end -[`'finish'`]: #stream_event_finish -[`'readable'`]: #stream_event_readable -[`buf.toString(encoding)`]: https://nodejs.org/docs/v5.8.0/api/buffer.html#buffer_buf_tostring_encoding_start_end -[`EventEmitter`]: https://nodejs.org/docs/v5.8.0/api/events.html#events_class_eventemitter -[`process.stderr`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stderr -[`process.stdin`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdin -[`process.stdout`]: https://nodejs.org/docs/v5.8.0/api/process.html#process_process_stdout -[`stream.cork()`]: #stream_writable_cork -[`stream.pipe()`]: #stream_readable_pipe_destination_options -[`stream.uncork()`]: #stream_writable_uncork -[`stream.unpipe()`]: #stream_readable_unpipe_destination -[`stream.wrap()`]: #stream_readable_wrap_stream -[`tls.CryptoStream`]: https://nodejs.org/docs/v5.8.0/api/tls.html#tls_class_cryptostream -[`util.inherits()`]: https://nodejs.org/docs/v5.8.0/api/util.html#util_util_inherits_constructor_superconstructor -[API for Stream Consumers]: #stream_api_for_stream_consumers -[API for Stream Implementors]: #stream_api_for_stream_implementors -[child process stdin]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdin -[child process stdout and stderr]: https://nodejs.org/docs/v5.8.0/api/child_process.html#child_process_child_stdout -[Compatibility]: #stream_compatibility_with_older_node_js_versions -[crypto]: crypto.html -[Duplex]: #stream_class_stream_duplex -[fs read streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_readstream -[fs write streams]: https://nodejs.org/docs/v5.8.0/api/fs.html#fs_class_fs_writestream -[HTTP requests, on the client]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_clientrequest -[HTTP responses, on the server]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_serverresponse -[http-incoming-message]: https://nodejs.org/docs/v5.8.0/api/http.html#http_class_http_incomingmessage -[Object mode]: #stream_object_mode -[Readable]: #stream_class_stream_readable -[SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 -[stream-_flush]: #stream_transform_flush_callback -[stream-_read]: #stream_readable_read_size_1 -[stream-_transform]: #stream_transform_transform_chunk_encoding_callback -[stream-_write]: #stream_writable_write_chunk_encoding_callback_1 -[stream-_writev]: #stream_writable_writev_chunks_callback -[stream-end]: #stream_writable_end_chunk_encoding_callback -[stream-pause]: #stream_readable_pause -[stream-push]: #stream_readable_push_chunk_encoding -[stream-read]: #stream_readable_read_size -[stream-resume]: #stream_readable_resume -[stream-write]: #stream_writable_write_chunk_encoding_callback -[TCP sockets]: https://nodejs.org/docs/v5.8.0/api/net.html#net_class_net_socket -[Transform]: #stream_class_stream_transform -[Writable]: #stream_class_stream_writable -[zlib]: zlib.html diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md deleted file mode 100644 index c141a99c26..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ /dev/null @@ -1,58 +0,0 @@ -# streams WG Meeting 2015-01-30 - -## Links - -* **Google Hangouts Video**: http://www.youtube.com/watch?v=I9nDOSGfwZg -* **GitHub Issue**: https://github.com/iojs/readable-stream/issues/106 -* **Original Minutes Google Doc**: https://docs.google.com/document/d/17aTgLnjMXIrfjgNaTUnHQO7m3xgzHR2VXBTmi03Qii4/ - -## Agenda - -Extracted from https://github.com/iojs/readable-stream/labels/wg-agenda prior to meeting. - -* adopt a charter [#105](https://github.com/iojs/readable-stream/issues/105) -* release and versioning strategy [#101](https://github.com/iojs/readable-stream/issues/101) -* simpler stream creation [#102](https://github.com/iojs/readable-stream/issues/102) -* proposal: deprecate implicit flowing of streams [#99](https://github.com/iojs/readable-stream/issues/99) - -## Minutes - -### adopt a charter - -* group: +1's all around - -### What versioning scheme should be adopted? -* group: +1’s 3.0.0 -* domenic+group: pulling in patches from other sources where appropriate -* mikeal: version independently, suggesting versions for io.js -* mikeal+domenic: work with TC to notify in advance of changes -simpler stream creation - -### streamline creation of streams -* sam: streamline creation of streams -* domenic: nice simple solution posted - but, we lose the opportunity to change the model - may not be backwards incompatible (double check keys) - - **action item:** domenic will check - -### remove implicit flowing of streams on(‘data’) -* add isFlowing / isPaused -* mikeal: worrying that we’re documenting polyfill methods – confuses users -* domenic: more reflective API is probably good, with warning labels for users -* new section for mad scientists (reflective stream access) -* calvin: name the “third state” -* mikeal: maybe borrow the name from whatwg? -* domenic: we’re missing the “third state” -* consensus: kind of difficult to name the third state -* mikeal: figure out differences in states / compat -* mathias: always flow on data – eliminates third state - * explore what it breaks - -**action items:** -* ask isaac for ability to list packages by what public io.js APIs they use (esp. Stream) -* ask rod/build for infrastructure -* **chris**: explore the “flow on data” approach -* add isPaused/isFlowing -* add new docs section -* move isPaused to that section diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/duplex.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/duplex.js deleted file mode 100644 index ca807af876..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/duplex.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_duplex.js") diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js deleted file mode 100644 index 736693b840..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_duplex.js +++ /dev/null @@ -1,75 +0,0 @@ -// a duplex stream is just a stream that is both readable and writable. -// Since JS doesn't have multiple prototypal inheritance, this class -// prototypally inherits from Readable, and then parasitically from -// Writable. - -'use strict'; - -/**/ - -var objectKeys = Object.keys || function (obj) { - var keys = []; - for (var key in obj) { - keys.push(key); - }return keys; -}; -/**/ - -module.exports = Duplex; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -var Readable = require('./_stream_readable'); -var Writable = require('./_stream_writable'); - -util.inherits(Duplex, Readable); - -var keys = objectKeys(Writable.prototype); -for (var v = 0; v < keys.length; v++) { - var method = keys[v]; - if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; -} - -function Duplex(options) { - if (!(this instanceof Duplex)) return new Duplex(options); - - Readable.call(this, options); - Writable.call(this, options); - - if (options && options.readable === false) this.readable = false; - - if (options && options.writable === false) this.writable = false; - - this.allowHalfOpen = true; - if (options && options.allowHalfOpen === false) this.allowHalfOpen = false; - - this.once('end', onend); -} - -// the no-half-open enforcer -function onend() { - // if we allow half-open state, or if the writable side ended, - // then we're ok. - if (this.allowHalfOpen || this._writableState.ended) return; - - // no more data can be written. - // But allow more writes to happen in this tick. - processNextTick(onEndNT, this); -} - -function onEndNT(self) { - self.end(); -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js deleted file mode 100644 index d06f71f186..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_passthrough.js +++ /dev/null @@ -1,26 +0,0 @@ -// a passthrough stream. -// basically just the most minimal sort of Transform stream. -// Every written chunk gets output as-is. - -'use strict'; - -module.exports = PassThrough; - -var Transform = require('./_stream_transform'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(PassThrough, Transform); - -function PassThrough(options) { - if (!(this instanceof PassThrough)) return new PassThrough(options); - - Transform.call(this, options); -} - -PassThrough.prototype._transform = function (chunk, encoding, cb) { - cb(null, chunk); -}; \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js deleted file mode 100644 index 54a9d5c553..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_readable.js +++ /dev/null @@ -1,880 +0,0 @@ -'use strict'; - -module.exports = Readable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var isArray = require('isarray'); -/**/ - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Readable.ReadableState = ReadableState; - -var EE = require('events'); - -/**/ -var EElistenerCount = function (emitter, type) { - return emitter.listeners(type).length; -}; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ - -var Buffer = require('buffer').Buffer; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var debugUtil = require('util'); -var debug = undefined; -if (debugUtil && debugUtil.debuglog) { - debug = debugUtil.debuglog('stream'); -} else { - debug = function () {}; -} -/**/ - -var StringDecoder; - -util.inherits(Readable, Stream); - -var Duplex; -function ReadableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // object stream flag. Used to make read(n) ignore n and to - // make all the buffer merging and length checks go away - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.readableObjectMode; - - // the point at which it stops calling _read() to fill the buffer - // Note: 0 is a valid value, means "don't call _read preemptively ever" - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.buffer = []; - this.length = 0; - this.pipes = null; - this.pipesCount = 0; - this.flowing = null; - this.ended = false; - this.endEmitted = false; - this.reading = false; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // whenever we return null, then we set a flag to say - // that we're awaiting a 'readable' event emission. - this.needReadable = false; - this.emittedReadable = false; - this.readableListening = false; - this.resumeScheduled = false; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // when piping, we only care about 'readable' events that happen - // after read()ing all the bytes and not getting any pushback. - this.ranOut = false; - - // the number of writers that are awaiting a drain event in .pipe()s - this.awaitDrain = 0; - - // if true, a maybeReadMore has been scheduled - this.readingMore = false; - - this.decoder = null; - this.encoding = null; - if (options.encoding) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this.decoder = new StringDecoder(options.encoding); - this.encoding = options.encoding; - } -} - -var Duplex; -function Readable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - if (!(this instanceof Readable)) return new Readable(options); - - this._readableState = new ReadableState(options, this); - - // legacy - this.readable = true; - - if (options && typeof options.read === 'function') this._read = options.read; - - Stream.call(this); -} - -// Manually shove something into the read() buffer. -// This returns true if the highWaterMark has not been hit yet, -// similar to how Writable.write() returns true if you should -// write() some more. -Readable.prototype.push = function (chunk, encoding) { - var state = this._readableState; - - if (!state.objectMode && typeof chunk === 'string') { - encoding = encoding || state.defaultEncoding; - if (encoding !== state.encoding) { - chunk = new Buffer(chunk, encoding); - encoding = ''; - } - } - - return readableAddChunk(this, state, chunk, encoding, false); -}; - -// Unshift should *always* be something directly out of read() -Readable.prototype.unshift = function (chunk) { - var state = this._readableState; - return readableAddChunk(this, state, chunk, '', true); -}; - -Readable.prototype.isPaused = function () { - return this._readableState.flowing === false; -}; - -function readableAddChunk(stream, state, chunk, encoding, addToFront) { - var er = chunkInvalid(state, chunk); - if (er) { - stream.emit('error', er); - } else if (chunk === null) { - state.reading = false; - onEofChunk(stream, state); - } else if (state.objectMode || chunk && chunk.length > 0) { - if (state.ended && !addToFront) { - var e = new Error('stream.push() after EOF'); - stream.emit('error', e); - } else if (state.endEmitted && addToFront) { - var e = new Error('stream.unshift() after end event'); - stream.emit('error', e); - } else { - var skipAdd; - if (state.decoder && !addToFront && !encoding) { - chunk = state.decoder.write(chunk); - skipAdd = !state.objectMode && chunk.length === 0; - } - - if (!addToFront) state.reading = false; - - // Don't add to the buffer if we've decoded to an empty string chunk and - // we're not in object mode - if (!skipAdd) { - // if we want the data now, just emit it. - if (state.flowing && state.length === 0 && !state.sync) { - stream.emit('data', chunk); - stream.read(0); - } else { - // update the buffer info. - state.length += state.objectMode ? 1 : chunk.length; - if (addToFront) state.buffer.unshift(chunk);else state.buffer.push(chunk); - - if (state.needReadable) emitReadable(stream); - } - } - - maybeReadMore(stream, state); - } - } else if (!addToFront) { - state.reading = false; - } - - return needMoreData(state); -} - -// if it's past the high water mark, we can push in some more. -// Also, if we have no data yet, we can stand some -// more bytes. This is to work around cases where hwm=0, -// such as the repl. Also, if the push() triggered a -// readable event, and the user called read(largeNumber) such that -// needReadable was set, then we ought to push more, so that another -// 'readable' event will be triggered. -function needMoreData(state) { - return !state.ended && (state.needReadable || state.length < state.highWaterMark || state.length === 0); -} - -// backwards compatibility. -Readable.prototype.setEncoding = function (enc) { - if (!StringDecoder) StringDecoder = require('string_decoder/').StringDecoder; - this._readableState.decoder = new StringDecoder(enc); - this._readableState.encoding = enc; - return this; -}; - -// Don't raise the hwm > 8MB -var MAX_HWM = 0x800000; -function computeNewHighWaterMark(n) { - if (n >= MAX_HWM) { - n = MAX_HWM; - } else { - // Get the next highest power of 2 - n--; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; - n++; - } - return n; -} - -function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) return 0; - - if (state.objectMode) return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; - } - - if (n <= 0) return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. - if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } - } - - return n; -} - -// you can override either this method, or the async _read(n) below. -Readable.prototype.read = function (n) { - debug('read', n); - var state = this._readableState; - var nOrig = n; - - if (typeof n !== 'number' || n > 0) state.emittedReadable = false; - - // if we're doing read(0) to trigger a readable event, but we - // already have a bunch of data in the buffer, then just trigger - // the 'readable' event and move on. - if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) { - debug('read: emitReadable', state.length, state.ended); - if (state.length === 0 && state.ended) endReadable(this);else emitReadable(this); - return null; - } - - n = howMuchToRead(n, state); - - // if we've ended, and we're now clear, then finish it up. - if (n === 0 && state.ended) { - if (state.length === 0) endReadable(this); - return null; - } - - // All the actual chunk generation logic needs to be - // *below* the call to _read. The reason is that in certain - // synthetic stream cases, such as passthrough streams, _read - // may be a completely synchronous operation which may change - // the state of the read buffer, providing enough data when - // before there was *not* enough. - // - // So, the steps are: - // 1. Figure out what the state of things will be after we do - // a read from the buffer. - // - // 2. If that resulting state will trigger a _read, then call _read. - // Note that this may be asynchronous, or synchronous. Yes, it is - // deeply ugly to write APIs this way, but that still doesn't mean - // that the Readable class should behave improperly, as streams are - // designed to be sync/async agnostic. - // Take note if the _read call is sync or async (ie, if the read call - // has returned yet), so that we know whether or not it's safe to emit - // 'readable' etc. - // - // 3. Actually pull the requested chunks out of the buffer and return. - - // if we need a readable event, then we need to do some reading. - var doRead = state.needReadable; - debug('need readable', doRead); - - // if we currently have less than the highWaterMark, then also read some - if (state.length === 0 || state.length - n < state.highWaterMark) { - doRead = true; - debug('length less than watermark', doRead); - } - - // however, if we've ended, then there's no point, and if we're already - // reading, then it's unnecessary. - if (state.ended || state.reading) { - doRead = false; - debug('reading or ended', doRead); - } - - if (doRead) { - debug('do read'); - state.reading = true; - state.sync = true; - // if the length is currently zero, then we *need* a readable event. - if (state.length === 0) state.needReadable = true; - // call internal read method - this._read(state.highWaterMark); - state.sync = false; - } - - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) n = howMuchToRead(nOrig, state); - - var ret; - if (n > 0) ret = fromList(n, state);else ret = null; - - if (ret === null) { - state.needReadable = true; - n = 0; - } - - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) state.needReadable = true; - - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) endReadable(this); - - if (ret !== null) this.emit('data', ret); - - return ret; -}; - -function chunkInvalid(state, chunk) { - var er = null; - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - er = new TypeError('Invalid non-string/buffer chunk'); - } - return er; -} - -function onEofChunk(stream, state) { - if (state.ended) return; - if (state.decoder) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) { - state.buffer.push(chunk); - state.length += state.objectMode ? 1 : chunk.length; - } - } - state.ended = true; - - // emit 'readable' now to make sure it gets picked up. - emitReadable(stream); -} - -// Don't emit readable right away in sync mode, because this can trigger -// another read() call => stack overflow. This way, it might trigger -// a nextTick recursion warning, but that's not so bad. -function emitReadable(stream) { - var state = stream._readableState; - state.needReadable = false; - if (!state.emittedReadable) { - debug('emitReadable', state.flowing); - state.emittedReadable = true; - if (state.sync) processNextTick(emitReadable_, stream);else emitReadable_(stream); - } -} - -function emitReadable_(stream) { - debug('emit readable'); - stream.emit('readable'); - flow(stream); -} - -// at this point, the user has presumably seen the 'readable' event, -// and called read() to consume some data. that may have triggered -// in turn another _read(n) call, in which case reading = true if -// it's in progress. -// However, if we're not ended, or reading, and the length < hwm, -// then go ahead and try to read some more preemptively. -function maybeReadMore(stream, state) { - if (!state.readingMore) { - state.readingMore = true; - processNextTick(maybeReadMore_, stream, state); - } -} - -function maybeReadMore_(stream, state) { - var len = state.length; - while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) { - debug('maybeReadMore read 0'); - stream.read(0); - if (len === state.length) - // didn't get any data, stop spinning. - break;else len = state.length; - } - state.readingMore = false; -} - -// abstract method. to be overridden in specific implementation classes. -// call cb(er, data) where data is <= n in length. -// for virtual (non-string, non-buffer) streams, "length" is somewhat -// arbitrary, and perhaps not very meaningful. -Readable.prototype._read = function (n) { - this.emit('error', new Error('not implemented')); -}; - -Readable.prototype.pipe = function (dest, pipeOpts) { - var src = this; - var state = this._readableState; - - switch (state.pipesCount) { - case 0: - state.pipes = dest; - break; - case 1: - state.pipes = [state.pipes, dest]; - break; - default: - state.pipes.push(dest); - break; - } - state.pipesCount += 1; - debug('pipe count=%d opts=%j', state.pipesCount, pipeOpts); - - var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr; - - var endFn = doEnd ? onend : cleanup; - if (state.endEmitted) processNextTick(endFn);else src.once('end', endFn); - - dest.on('unpipe', onunpipe); - function onunpipe(readable) { - debug('onunpipe'); - if (readable === src) { - cleanup(); - } - } - - function onend() { - debug('onend'); - dest.end(); - } - - // when the dest drains, it reduces the awaitDrain counter - // on the source. This would be more elegant with a .once() - // handler in flow(), but adding and removing repeatedly is - // too slow. - var ondrain = pipeOnDrain(src); - dest.on('drain', ondrain); - - var cleanedUp = false; - function cleanup() { - debug('cleanup'); - // cleanup event handlers once the pipe is broken - dest.removeListener('close', onclose); - dest.removeListener('finish', onfinish); - dest.removeListener('drain', ondrain); - dest.removeListener('error', onerror); - dest.removeListener('unpipe', onunpipe); - src.removeListener('end', onend); - src.removeListener('end', cleanup); - src.removeListener('data', ondata); - - cleanedUp = true; - - // if the reader is waiting for a drain event from this - // specific writer, then it would cause it to never start - // flowing again. - // So, if this is awaiting a drain, then we just call it now. - // If we don't know, then assume that we are waiting for one. - if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); - } - - src.on('data', ondata); - function ondata(chunk) { - debug('ondata'); - var ret = dest.write(chunk); - if (false === ret) { - // If the user unpiped during `dest.write()`, it is possible - // to get stuck in a permanently paused state if that write - // also returned false. - if (state.pipesCount === 1 && state.pipes[0] === dest && src.listenerCount('data') === 1 && !cleanedUp) { - debug('false write response, pause', src._readableState.awaitDrain); - src._readableState.awaitDrain++; - } - src.pause(); - } - } - - // if the dest has an error, then stop piping into it. - // however, don't suppress the throwing behavior for this. - function onerror(er) { - debug('onerror', er); - unpipe(); - dest.removeListener('error', onerror); - if (EElistenerCount(dest, 'error') === 0) dest.emit('error', er); - } - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. - if (!dest._events || !dest._events.error) dest.on('error', onerror);else if (isArray(dest._events.error)) dest._events.error.unshift(onerror);else dest._events.error = [onerror, dest._events.error]; - - // Both close and finish should trigger unpipe, but only once. - function onclose() { - dest.removeListener('finish', onfinish); - unpipe(); - } - dest.once('close', onclose); - function onfinish() { - debug('onfinish'); - dest.removeListener('close', onclose); - unpipe(); - } - dest.once('finish', onfinish); - - function unpipe() { - debug('unpipe'); - src.unpipe(dest); - } - - // tell the dest that it's being piped to - dest.emit('pipe', src); - - // start the flow if it hasn't been started already. - if (!state.flowing) { - debug('pipe resume'); - src.resume(); - } - - return dest; -}; - -function pipeOnDrain(src) { - return function () { - var state = src._readableState; - debug('pipeOnDrain', state.awaitDrain); - if (state.awaitDrain) state.awaitDrain--; - if (state.awaitDrain === 0 && EElistenerCount(src, 'data')) { - state.flowing = true; - flow(src); - } - }; -} - -Readable.prototype.unpipe = function (dest) { - var state = this._readableState; - - // if we're not piping anywhere, then do nothing. - if (state.pipesCount === 0) return this; - - // just one destination. most common case. - if (state.pipesCount === 1) { - // passed in one, but it's not the right one. - if (dest && dest !== state.pipes) return this; - - if (!dest) dest = state.pipes; - - // got a match. - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - if (dest) dest.emit('unpipe', this); - return this; - } - - // slow case. multiple pipe destinations. - - if (!dest) { - // remove all. - var dests = state.pipes; - var len = state.pipesCount; - state.pipes = null; - state.pipesCount = 0; - state.flowing = false; - - for (var _i = 0; _i < len; _i++) { - dests[_i].emit('unpipe', this); - }return this; - } - - // try to find the right one. - var i = indexOf(state.pipes, dest); - if (i === -1) return this; - - state.pipes.splice(i, 1); - state.pipesCount -= 1; - if (state.pipesCount === 1) state.pipes = state.pipes[0]; - - dest.emit('unpipe', this); - - return this; -}; - -// set up data events if they are asked for -// Ensure readable listeners eventually get something -Readable.prototype.on = function (ev, fn) { - var res = Stream.prototype.on.call(this, ev, fn); - - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && !this._readableState.endEmitted) { - var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; - state.emittedReadable = false; - state.needReadable = true; - if (!state.reading) { - processNextTick(nReadingNextTick, this); - } else if (state.length) { - emitReadable(this, state); - } - } - } - - return res; -}; -Readable.prototype.addListener = Readable.prototype.on; - -function nReadingNextTick(self) { - debug('readable nexttick read 0'); - self.read(0); -} - -// pause() and resume() are remnants of the legacy readable stream API -// If the user uses them, then switch into old mode. -Readable.prototype.resume = function () { - var state = this._readableState; - if (!state.flowing) { - debug('resume'); - state.flowing = true; - resume(this, state); - } - return this; -}; - -function resume(stream, state) { - if (!state.resumeScheduled) { - state.resumeScheduled = true; - processNextTick(resume_, stream, state); - } -} - -function resume_(stream, state) { - if (!state.reading) { - debug('resume read 0'); - stream.read(0); - } - - state.resumeScheduled = false; - stream.emit('resume'); - flow(stream); - if (state.flowing && !state.reading) stream.read(0); -} - -Readable.prototype.pause = function () { - debug('call pause flowing=%j', this._readableState.flowing); - if (false !== this._readableState.flowing) { - debug('pause'); - this._readableState.flowing = false; - this.emit('pause'); - } - return this; -}; - -function flow(stream) { - var state = stream._readableState; - debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } -} - -// wrap an old-style stream as the async data source. -// This is *not* part of the readable stream interface. -// It is an ugly unfortunate mess of history. -Readable.prototype.wrap = function (stream) { - var state = this._readableState; - var paused = false; - - var self = this; - stream.on('end', function () { - debug('wrapped end'); - if (state.decoder && !state.ended) { - var chunk = state.decoder.end(); - if (chunk && chunk.length) self.push(chunk); - } - - self.push(null); - }); - - stream.on('data', function (chunk) { - debug('wrapped data'); - if (state.decoder) chunk = state.decoder.write(chunk); - - // don't skip over falsy values in objectMode - if (state.objectMode && (chunk === null || chunk === undefined)) return;else if (!state.objectMode && (!chunk || !chunk.length)) return; - - var ret = self.push(chunk); - if (!ret) { - paused = true; - stream.pause(); - } - }); - - // proxy all the other methods. - // important when wrapping filters and duplexes. - for (var i in stream) { - if (this[i] === undefined && typeof stream[i] === 'function') { - this[i] = function (method) { - return function () { - return stream[method].apply(stream, arguments); - }; - }(i); - } - } - - // proxy certain important events. - var events = ['error', 'close', 'destroy', 'pause', 'resume']; - forEach(events, function (ev) { - stream.on(ev, self.emit.bind(self, ev)); - }); - - // when we try to consume some more bytes, simply unpause the - // underlying stream. - self._read = function (n) { - debug('wrapped _read', n); - if (paused) { - paused = false; - stream.resume(); - } - }; - - return self; -}; - -// exposed for testing purposes only. -Readable._fromList = fromList; - -// Pluck off n bytes from an array of buffers. -// Length is the combined lengths of all the buffers in the list. -function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) return null; - - if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); - list.length = 0; - } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = new Buffer(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var buf = list[0]; - var cpy = Math.min(n - c, buf.length); - - if (stringMode) ret += buf.slice(0, cpy);else buf.copy(ret, c, 0, cpy); - - if (cpy < buf.length) list[0] = buf.slice(cpy);else list.shift(); - - c += cpy; - } - } - } - - return ret; -} - -function endReadable(stream) { - var state = stream._readableState; - - // If we get here before consuming all the bytes, then that is a - // bug in node. Should never happen. - if (state.length > 0) throw new Error('endReadable called on non-empty stream'); - - if (!state.endEmitted) { - state.ended = true; - processNextTick(endReadableNT, state, stream); - } -} - -function endReadableNT(state, stream) { - // Check that we didn't get one last unshift. - if (!state.endEmitted && state.length === 0) { - state.endEmitted = true; - stream.readable = false; - stream.emit('end'); - } -} - -function forEach(xs, f) { - for (var i = 0, l = xs.length; i < l; i++) { - f(xs[i], i); - } -} - -function indexOf(xs, x) { - for (var i = 0, l = xs.length; i < l; i++) { - if (xs[i] === x) return i; - } - return -1; -} \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js deleted file mode 100644 index 625cdc1769..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js +++ /dev/null @@ -1,180 +0,0 @@ -// a transform stream is a readable/writable stream where you do -// something with the data. Sometimes it's called a "filter", -// but that's not a great name for it, since that implies a thing where -// some bits pass through, and others are simply ignored. (That would -// be a valid example of a transform, of course.) -// -// While the output is causally related to the input, it's not a -// necessarily symmetric or synchronous transformation. For example, -// a zlib stream might take multiple plain-text writes(), and then -// emit a single compressed chunk some time in the future. -// -// Here's how this works: -// -// The Transform stream has all the aspects of the readable and writable -// stream classes. When you write(chunk), that calls _write(chunk,cb) -// internally, and returns false if there's a lot of pending writes -// buffered up. When you call read(), that calls _read(n) until -// there's enough pending readable data buffered up. -// -// In a transform stream, the written data is placed in a buffer. When -// _read(n) is called, it transforms the queued up data, calling the -// buffered _write cb's as it consumes chunks. If consuming a single -// written chunk would result in multiple output chunks, then the first -// outputted bit calls the readcb, and subsequent chunks just go into -// the read buffer, and will cause it to emit 'readable' if necessary. -// -// This way, back-pressure is actually determined by the reading side, -// since _read has to be called to start processing a new chunk. However, -// a pathological inflate type of transform can cause excessive buffering -// here. For example, imagine a stream where every byte of input is -// interpreted as an integer from 0-255, and then results in that many -// bytes of output. Writing the 4 bytes {ff,ff,ff,ff} would result in -// 1kb of data being output. In this case, you could write a very small -// amount of input, and end up with a very large amount of output. In -// such a pathological inflating mechanism, there'd be no way to tell -// the system to stop doing the transform. A single 4MB write could -// cause the system to run out of memory. -// -// However, even in such a pathological case, only a single written chunk -// would be consumed, and then the rest would wait (un-transformed) until -// the results of the previous transformed chunk were consumed. - -'use strict'; - -module.exports = Transform; - -var Duplex = require('./_stream_duplex'); - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -util.inherits(Transform, Duplex); - -function TransformState(stream) { - this.afterTransform = function (er, data) { - return afterTransform(stream, er, data); - }; - - this.needTransform = false; - this.transforming = false; - this.writecb = null; - this.writechunk = null; - this.writeencoding = null; -} - -function afterTransform(stream, er, data) { - var ts = stream._transformState; - ts.transforming = false; - - var cb = ts.writecb; - - if (!cb) return stream.emit('error', new Error('no writecb in Transform class')); - - ts.writechunk = null; - ts.writecb = null; - - if (data !== null && data !== undefined) stream.push(data); - - cb(er); - - var rs = stream._readableState; - rs.reading = false; - if (rs.needReadable || rs.length < rs.highWaterMark) { - stream._read(rs.highWaterMark); - } -} - -function Transform(options) { - if (!(this instanceof Transform)) return new Transform(options); - - Duplex.call(this, options); - - this._transformState = new TransformState(this); - - // when the writable side finishes, then flush out anything remaining. - var stream = this; - - // start out asking for a readable event once data is transformed. - this._readableState.needReadable = true; - - // we have implemented the _read method, and done the other things - // that Readable wants before the first _read call, so unset the - // sync guard flag. - this._readableState.sync = false; - - if (options) { - if (typeof options.transform === 'function') this._transform = options.transform; - - if (typeof options.flush === 'function') this._flush = options.flush; - } - - this.once('prefinish', function () { - if (typeof this._flush === 'function') this._flush(function (er) { - done(stream, er); - });else done(stream); - }); -} - -Transform.prototype.push = function (chunk, encoding) { - this._transformState.needTransform = false; - return Duplex.prototype.push.call(this, chunk, encoding); -}; - -// This is the part where you do stuff! -// override this function in implementation classes. -// 'chunk' is an input chunk. -// -// Call `push(newChunk)` to pass along transformed output -// to the readable side. You may call 'push' zero or more times. -// -// Call `cb(err)` when you are done with this chunk. If you pass -// an error, then that'll put the hurt on the whole operation. If you -// never call cb(), then you'll never get another chunk. -Transform.prototype._transform = function (chunk, encoding, cb) { - throw new Error('not implemented'); -}; - -Transform.prototype._write = function (chunk, encoding, cb) { - var ts = this._transformState; - ts.writecb = cb; - ts.writechunk = chunk; - ts.writeencoding = encoding; - if (!ts.transforming) { - var rs = this._readableState; - if (ts.needTransform || rs.needReadable || rs.length < rs.highWaterMark) this._read(rs.highWaterMark); - } -}; - -// Doesn't matter what the args are here. -// _transform does all the work. -// That we got here means that the readable side wants more data. -Transform.prototype._read = function (n) { - var ts = this._transformState; - - if (ts.writechunk !== null && ts.writecb && !ts.transforming) { - ts.transforming = true; - this._transform(ts.writechunk, ts.writeencoding, ts.afterTransform); - } else { - // mark that we need a transform, so that any data that comes in - // will get processed, now that we've asked for it. - ts.needTransform = true; - } -}; - -function done(stream, er) { - if (er) return stream.emit('error', er); - - // if there's nothing in the write buffer, then that means - // that nothing more will ever be provided - var ws = stream._writableState; - var ts = stream._transformState; - - if (ws.length) throw new Error('calling transform done when ws.length != 0'); - - if (ts.transforming) throw new Error('calling transform done when still transforming'); - - return stream.push(null); -} \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js deleted file mode 100644 index 95916c992a..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js +++ /dev/null @@ -1,516 +0,0 @@ -// A bit simpler than readable streams. -// Implement an async ._write(chunk, encoding, cb), and it'll handle all -// the drain event emission and buffering. - -'use strict'; - -module.exports = Writable; - -/**/ -var processNextTick = require('process-nextick-args'); -/**/ - -/**/ -var asyncWrite = !process.browser && ['v0.10', 'v0.9.'].indexOf(process.version.slice(0, 5)) > -1 ? setImmediate : processNextTick; -/**/ - -/**/ -var Buffer = require('buffer').Buffer; -/**/ - -Writable.WritableState = WritableState; - -/**/ -var util = require('core-util-is'); -util.inherits = require('inherits'); -/**/ - -/**/ -var internalUtil = { - deprecate: require('util-deprecate') -}; -/**/ - -/**/ -var Stream; -(function () { - try { - Stream = require('st' + 'ream'); - } catch (_) {} finally { - if (!Stream) Stream = require('events').EventEmitter; - } -})(); -/**/ - -var Buffer = require('buffer').Buffer; - -util.inherits(Writable, Stream); - -function nop() {} - -function WriteReq(chunk, encoding, cb) { - this.chunk = chunk; - this.encoding = encoding; - this.callback = cb; - this.next = null; -} - -var Duplex; -function WritableState(options, stream) { - Duplex = Duplex || require('./_stream_duplex'); - - options = options || {}; - - // object stream flag to indicate whether or not this stream - // contains buffers or objects. - this.objectMode = !!options.objectMode; - - if (stream instanceof Duplex) this.objectMode = this.objectMode || !!options.writableObjectMode; - - // the point at which write() starts returning false - // Note: 0 is a valid value, means that we always return false if - // the entire buffer is not flushed immediately on write() - var hwm = options.highWaterMark; - var defaultHwm = this.objectMode ? 16 : 16 * 1024; - this.highWaterMark = hwm || hwm === 0 ? hwm : defaultHwm; - - // cast to ints. - this.highWaterMark = ~ ~this.highWaterMark; - - this.needDrain = false; - // at the start of calling end() - this.ending = false; - // when end() has been called, and returned - this.ended = false; - // when 'finish' is emitted - this.finished = false; - - // should we decode strings into buffers before passing to _write? - // this is here so that some node-core streams can optimize string - // handling at a lower level. - var noDecode = options.decodeStrings === false; - this.decodeStrings = !noDecode; - - // Crypto is kind of old and crusty. Historically, its default string - // encoding is 'binary' so we have to make this configurable. - // Everything else in the universe uses 'utf8', though. - this.defaultEncoding = options.defaultEncoding || 'utf8'; - - // not an actual buffer we keep track of, but a measurement - // of how much we're waiting to get pushed to some underlying - // socket or file. - this.length = 0; - - // a flag to see when we're in the middle of a write. - this.writing = false; - - // when true all writes will be buffered until .uncork() call - this.corked = 0; - - // a flag to be able to tell if the onwrite cb is called immediately, - // or on a later tick. We set this to true at first, because any - // actions that shouldn't happen until "later" should generally also - // not happen before the first write call. - this.sync = true; - - // a flag to know if we're processing previously buffered items, which - // may call the _write() callback in the same tick, so that we don't - // end up in an overlapped onwrite situation. - this.bufferProcessing = false; - - // the callback that's passed to _write(chunk,cb) - this.onwrite = function (er) { - onwrite(stream, er); - }; - - // the callback that the user supplies to write(chunk,encoding,cb) - this.writecb = null; - - // the amount that is being written when _write is called. - this.writelen = 0; - - this.bufferedRequest = null; - this.lastBufferedRequest = null; - - // number of pending user-supplied write callbacks - // this must be 0 before 'finish' can be emitted - this.pendingcb = 0; - - // emit prefinish if the only thing we're waiting for is _write cbs - // This is relevant for synchronous Transform streams - this.prefinished = false; - - // True if the error was already emitted and should not be thrown again - this.errorEmitted = false; - - // count buffered requests - this.bufferedRequestCount = 0; - - // create the two objects needed to store the corked requests - // they are not a linked list, as no new elements are inserted in there - this.corkedRequestsFree = new CorkedRequest(this); - this.corkedRequestsFree.next = new CorkedRequest(this); -} - -WritableState.prototype.getBuffer = function writableStateGetBuffer() { - var current = this.bufferedRequest; - var out = []; - while (current) { - out.push(current); - current = current.next; - } - return out; -}; - -(function () { - try { - Object.defineProperty(WritableState.prototype, 'buffer', { - get: internalUtil.deprecate(function () { - return this.getBuffer(); - }, '_writableState.buffer is deprecated. Use _writableState.getBuffer ' + 'instead.') - }); - } catch (_) {} -})(); - -var Duplex; -function Writable(options) { - Duplex = Duplex || require('./_stream_duplex'); - - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); - - this._writableState = new WritableState(options, this); - - // legacy. - this.writable = true; - - if (options) { - if (typeof options.write === 'function') this._write = options.write; - - if (typeof options.writev === 'function') this._writev = options.writev; - } - - Stream.call(this); -} - -// Otherwise people can pipe Writable streams, which is just wrong. -Writable.prototype.pipe = function () { - this.emit('error', new Error('Cannot pipe. Not readable.')); -}; - -function writeAfterEnd(stream, cb) { - var er = new Error('write after end'); - // TODO: defer error events consistently everywhere, not just the cb - stream.emit('error', er); - processNextTick(cb, er); -} - -// If we get something that is not a buffer, string, null, or undefined, -// and we're not in objectMode, then that's an error. -// Otherwise stream chunks are all considered to be of length=1, and the -// watermarks determine how many objects to keep in the buffer, rather than -// how many bytes or characters. -function validChunk(stream, state, chunk, cb) { - var valid = true; - - if (!Buffer.isBuffer(chunk) && typeof chunk !== 'string' && chunk !== null && chunk !== undefined && !state.objectMode) { - var er = new TypeError('Invalid non-string/buffer chunk'); - stream.emit('error', er); - processNextTick(cb, er); - valid = false; - } - return valid; -} - -Writable.prototype.write = function (chunk, encoding, cb) { - var state = this._writableState; - var ret = false; - - if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (Buffer.isBuffer(chunk)) encoding = 'buffer';else if (!encoding) encoding = state.defaultEncoding; - - if (typeof cb !== 'function') cb = nop; - - if (state.ended) writeAfterEnd(this, cb);else if (validChunk(this, state, chunk, cb)) { - state.pendingcb++; - ret = writeOrBuffer(this, state, chunk, encoding, cb); - } - - return ret; -}; - -Writable.prototype.cork = function () { - var state = this._writableState; - - state.corked++; -}; - -Writable.prototype.uncork = function () { - var state = this._writableState; - - if (state.corked) { - state.corked--; - - if (!state.writing && !state.corked && !state.finished && !state.bufferProcessing && state.bufferedRequest) clearBuffer(this, state); - } -}; - -Writable.prototype.setDefaultEncoding = function setDefaultEncoding(encoding) { - // node::ParseEncoding() requires lower case. - if (typeof encoding === 'string') encoding = encoding.toLowerCase(); - if (!(['hex', 'utf8', 'utf-8', 'ascii', 'binary', 'base64', 'ucs2', 'ucs-2', 'utf16le', 'utf-16le', 'raw'].indexOf((encoding + '').toLowerCase()) > -1)) throw new TypeError('Unknown encoding: ' + encoding); - this._writableState.defaultEncoding = encoding; -}; - -function decodeChunk(state, chunk, encoding) { - if (!state.objectMode && state.decodeStrings !== false && typeof chunk === 'string') { - chunk = new Buffer(chunk, encoding); - } - return chunk; -} - -// if we're already writing something, then just put this -// in the queue, and wait our turn. Otherwise, call _write -// If we return false, then we need a drain event, so set that flag. -function writeOrBuffer(stream, state, chunk, encoding, cb) { - chunk = decodeChunk(state, chunk, encoding); - - if (Buffer.isBuffer(chunk)) encoding = 'buffer'; - var len = state.objectMode ? 1 : chunk.length; - - state.length += len; - - var ret = state.length < state.highWaterMark; - // we must ensure that previous needDrain will not be reset to false. - if (!ret) state.needDrain = true; - - if (state.writing || state.corked) { - var last = state.lastBufferedRequest; - state.lastBufferedRequest = new WriteReq(chunk, encoding, cb); - if (last) { - last.next = state.lastBufferedRequest; - } else { - state.bufferedRequest = state.lastBufferedRequest; - } - state.bufferedRequestCount += 1; - } else { - doWrite(stream, state, false, len, chunk, encoding, cb); - } - - return ret; -} - -function doWrite(stream, state, writev, len, chunk, encoding, cb) { - state.writelen = len; - state.writecb = cb; - state.writing = true; - state.sync = true; - if (writev) stream._writev(chunk, state.onwrite);else stream._write(chunk, encoding, state.onwrite); - state.sync = false; -} - -function onwriteError(stream, state, sync, er, cb) { - --state.pendingcb; - if (sync) processNextTick(cb, er);else cb(er); - - stream._writableState.errorEmitted = true; - stream.emit('error', er); -} - -function onwriteStateUpdate(state) { - state.writing = false; - state.writecb = null; - state.length -= state.writelen; - state.writelen = 0; -} - -function onwrite(stream, er) { - var state = stream._writableState; - var sync = state.sync; - var cb = state.writecb; - - onwriteStateUpdate(state); - - if (er) onwriteError(stream, state, sync, er, cb);else { - // Check if we're actually ready to finish, but don't emit yet - var finished = needFinish(state); - - if (!finished && !state.corked && !state.bufferProcessing && state.bufferedRequest) { - clearBuffer(stream, state); - } - - if (sync) { - /**/ - asyncWrite(afterWrite, stream, state, finished, cb); - /**/ - } else { - afterWrite(stream, state, finished, cb); - } - } -} - -function afterWrite(stream, state, finished, cb) { - if (!finished) onwriteDrain(stream, state); - state.pendingcb--; - cb(); - finishMaybe(stream, state); -} - -// Must force callback to be called on nextTick, so that we don't -// emit 'drain' before the write() consumer gets the 'false' return -// value, and has a chance to attach a 'drain' listener. -function onwriteDrain(stream, state) { - if (state.length === 0 && state.needDrain) { - state.needDrain = false; - stream.emit('drain'); - } -} - -// if there's something in the buffer waiting, then process it -function clearBuffer(stream, state) { - state.bufferProcessing = true; - var entry = state.bufferedRequest; - - if (stream._writev && entry && entry.next) { - // Fast case, write everything using _writev() - var l = state.bufferedRequestCount; - var buffer = new Array(l); - var holder = state.corkedRequestsFree; - holder.entry = entry; - - var count = 0; - while (entry) { - buffer[count] = entry; - entry = entry.next; - count += 1; - } - - doWrite(stream, state, true, state.length, buffer, '', holder.finish); - - // doWrite is always async, defer these to save a bit of time - // as the hot path ends with doWrite - state.pendingcb++; - state.lastBufferedRequest = null; - state.corkedRequestsFree = holder.next; - holder.next = null; - } else { - // Slow case, write chunks one-by-one - while (entry) { - var chunk = entry.chunk; - var encoding = entry.encoding; - var cb = entry.callback; - var len = state.objectMode ? 1 : chunk.length; - - doWrite(stream, state, false, len, chunk, encoding, cb); - entry = entry.next; - // if we didn't call the onwrite immediately, then - // it means that we need to wait until it does. - // also, that means that the chunk and cb are currently - // being processed, so move the buffer counter past them. - if (state.writing) { - break; - } - } - - if (entry === null) state.lastBufferedRequest = null; - } - - state.bufferedRequestCount = 0; - state.bufferedRequest = entry; - state.bufferProcessing = false; -} - -Writable.prototype._write = function (chunk, encoding, cb) { - cb(new Error('not implemented')); -}; - -Writable.prototype._writev = null; - -Writable.prototype.end = function (chunk, encoding, cb) { - var state = this._writableState; - - if (typeof chunk === 'function') { - cb = chunk; - chunk = null; - encoding = null; - } else if (typeof encoding === 'function') { - cb = encoding; - encoding = null; - } - - if (chunk !== null && chunk !== undefined) this.write(chunk, encoding); - - // .end() fully uncorks - if (state.corked) { - state.corked = 1; - this.uncork(); - } - - // ignore unnecessary end() calls. - if (!state.ending && !state.finished) endWritable(this, state, cb); -}; - -function needFinish(state) { - return state.ending && state.length === 0 && state.bufferedRequest === null && !state.finished && !state.writing; -} - -function prefinish(stream, state) { - if (!state.prefinished) { - state.prefinished = true; - stream.emit('prefinish'); - } -} - -function finishMaybe(stream, state) { - var need = needFinish(state); - if (need) { - if (state.pendingcb === 0) { - prefinish(stream, state); - state.finished = true; - stream.emit('finish'); - } else { - prefinish(stream, state); - } - } - return need; -} - -function endWritable(stream, state, cb) { - state.ending = true; - finishMaybe(stream, state); - if (cb) { - if (state.finished) processNextTick(cb);else stream.once('finish', cb); - } - state.ended = true; - stream.writable = false; -} - -// It seems a linked list but it is not -// there will be only 2 of these for each stream -function CorkedRequest(state) { - var _this = this; - - this.next = null; - this.entry = null; - - this.finish = function (err) { - var entry = _this.entry; - _this.entry = null; - while (entry) { - var cb = entry.callback; - state.pendingcb--; - cb(err); - entry = entry.next; - } - if (state.corkedRequestsFree) { - state.corkedRequestsFree.next = _this; - } else { - state.corkedRequestsFree = _this; - } - }; -} \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/LICENSE b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/LICENSE deleted file mode 100644 index d8d7f9437d..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright Node.js contributors. All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to -deal in the Software without restriction, including without limitation the -rights to use, copy, modify, merge, publish, distribute, sublicense, and/or -sell copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/README.md b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/README.md deleted file mode 100644 index 5a76b4149c..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/README.md +++ /dev/null @@ -1,3 +0,0 @@ -# core-util-is - -The `util.is*` functions introduced in Node v0.12. diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/float.patch b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/float.patch deleted file mode 100644 index a06d5c05f7..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/float.patch +++ /dev/null @@ -1,604 +0,0 @@ -diff --git a/lib/util.js b/lib/util.js -index a03e874..9074e8e 100644 ---- a/lib/util.js -+++ b/lib/util.js -@@ -19,430 +19,6 @@ - // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - // USE OR OTHER DEALINGS IN THE SOFTWARE. - --var formatRegExp = /%[sdj%]/g; --exports.format = function(f) { -- if (!isString(f)) { -- var objects = []; -- for (var i = 0; i < arguments.length; i++) { -- objects.push(inspect(arguments[i])); -- } -- return objects.join(' '); -- } -- -- var i = 1; -- var args = arguments; -- var len = args.length; -- var str = String(f).replace(formatRegExp, function(x) { -- if (x === '%%') return '%'; -- if (i >= len) return x; -- switch (x) { -- case '%s': return String(args[i++]); -- case '%d': return Number(args[i++]); -- case '%j': -- try { -- return JSON.stringify(args[i++]); -- } catch (_) { -- return '[Circular]'; -- } -- default: -- return x; -- } -- }); -- for (var x = args[i]; i < len; x = args[++i]) { -- if (isNull(x) || !isObject(x)) { -- str += ' ' + x; -- } else { -- str += ' ' + inspect(x); -- } -- } -- return str; --}; -- -- --// Mark that a method should not be used. --// Returns a modified function which warns once by default. --// If --no-deprecation is set, then it is a no-op. --exports.deprecate = function(fn, msg) { -- // Allow for deprecating things in the process of starting up. -- if (isUndefined(global.process)) { -- return function() { -- return exports.deprecate(fn, msg).apply(this, arguments); -- }; -- } -- -- if (process.noDeprecation === true) { -- return fn; -- } -- -- var warned = false; -- function deprecated() { -- if (!warned) { -- if (process.throwDeprecation) { -- throw new Error(msg); -- } else if (process.traceDeprecation) { -- console.trace(msg); -- } else { -- console.error(msg); -- } -- warned = true; -- } -- return fn.apply(this, arguments); -- } -- -- return deprecated; --}; -- -- --var debugs = {}; --var debugEnviron; --exports.debuglog = function(set) { -- if (isUndefined(debugEnviron)) -- debugEnviron = process.env.NODE_DEBUG || ''; -- set = set.toUpperCase(); -- if (!debugs[set]) { -- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { -- var pid = process.pid; -- debugs[set] = function() { -- var msg = exports.format.apply(exports, arguments); -- console.error('%s %d: %s', set, pid, msg); -- }; -- } else { -- debugs[set] = function() {}; -- } -- } -- return debugs[set]; --}; -- -- --/** -- * Echos the value of a value. Trys to print the value out -- * in the best way possible given the different types. -- * -- * @param {Object} obj The object to print out. -- * @param {Object} opts Optional options object that alters the output. -- */ --/* legacy: obj, showHidden, depth, colors*/ --function inspect(obj, opts) { -- // default options -- var ctx = { -- seen: [], -- stylize: stylizeNoColor -- }; -- // legacy... -- if (arguments.length >= 3) ctx.depth = arguments[2]; -- if (arguments.length >= 4) ctx.colors = arguments[3]; -- if (isBoolean(opts)) { -- // legacy... -- ctx.showHidden = opts; -- } else if (opts) { -- // got an "options" object -- exports._extend(ctx, opts); -- } -- // set default options -- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; -- if (isUndefined(ctx.depth)) ctx.depth = 2; -- if (isUndefined(ctx.colors)) ctx.colors = false; -- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; -- if (ctx.colors) ctx.stylize = stylizeWithColor; -- return formatValue(ctx, obj, ctx.depth); --} --exports.inspect = inspect; -- -- --// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics --inspect.colors = { -- 'bold' : [1, 22], -- 'italic' : [3, 23], -- 'underline' : [4, 24], -- 'inverse' : [7, 27], -- 'white' : [37, 39], -- 'grey' : [90, 39], -- 'black' : [30, 39], -- 'blue' : [34, 39], -- 'cyan' : [36, 39], -- 'green' : [32, 39], -- 'magenta' : [35, 39], -- 'red' : [31, 39], -- 'yellow' : [33, 39] --}; -- --// Don't use 'blue' not visible on cmd.exe --inspect.styles = { -- 'special': 'cyan', -- 'number': 'yellow', -- 'boolean': 'yellow', -- 'undefined': 'grey', -- 'null': 'bold', -- 'string': 'green', -- 'date': 'magenta', -- // "name": intentionally not styling -- 'regexp': 'red' --}; -- -- --function stylizeWithColor(str, styleType) { -- var style = inspect.styles[styleType]; -- -- if (style) { -- return '\u001b[' + inspect.colors[style][0] + 'm' + str + -- '\u001b[' + inspect.colors[style][1] + 'm'; -- } else { -- return str; -- } --} -- -- --function stylizeNoColor(str, styleType) { -- return str; --} -- -- --function arrayToHash(array) { -- var hash = {}; -- -- array.forEach(function(val, idx) { -- hash[val] = true; -- }); -- -- return hash; --} -- -- --function formatValue(ctx, value, recurseTimes) { -- // Provide a hook for user-specified inspect functions. -- // Check that value is an object with an inspect function on it -- if (ctx.customInspect && -- value && -- isFunction(value.inspect) && -- // Filter out the util module, it's inspect function is special -- value.inspect !== exports.inspect && -- // Also filter out any prototype objects using the circular check. -- !(value.constructor && value.constructor.prototype === value)) { -- var ret = value.inspect(recurseTimes, ctx); -- if (!isString(ret)) { -- ret = formatValue(ctx, ret, recurseTimes); -- } -- return ret; -- } -- -- // Primitive types cannot have properties -- var primitive = formatPrimitive(ctx, value); -- if (primitive) { -- return primitive; -- } -- -- // Look up the keys of the object. -- var keys = Object.keys(value); -- var visibleKeys = arrayToHash(keys); -- -- if (ctx.showHidden) { -- keys = Object.getOwnPropertyNames(value); -- } -- -- // Some type of object without properties can be shortcutted. -- if (keys.length === 0) { -- if (isFunction(value)) { -- var name = value.name ? ': ' + value.name : ''; -- return ctx.stylize('[Function' + name + ']', 'special'); -- } -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } -- if (isDate(value)) { -- return ctx.stylize(Date.prototype.toString.call(value), 'date'); -- } -- if (isError(value)) { -- return formatError(value); -- } -- } -- -- var base = '', array = false, braces = ['{', '}']; -- -- // Make Array say that they are Array -- if (isArray(value)) { -- array = true; -- braces = ['[', ']']; -- } -- -- // Make functions say that they are functions -- if (isFunction(value)) { -- var n = value.name ? ': ' + value.name : ''; -- base = ' [Function' + n + ']'; -- } -- -- // Make RegExps say that they are RegExps -- if (isRegExp(value)) { -- base = ' ' + RegExp.prototype.toString.call(value); -- } -- -- // Make dates with properties first say the date -- if (isDate(value)) { -- base = ' ' + Date.prototype.toUTCString.call(value); -- } -- -- // Make error with message first say the error -- if (isError(value)) { -- base = ' ' + formatError(value); -- } -- -- if (keys.length === 0 && (!array || value.length == 0)) { -- return braces[0] + base + braces[1]; -- } -- -- if (recurseTimes < 0) { -- if (isRegExp(value)) { -- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); -- } else { -- return ctx.stylize('[Object]', 'special'); -- } -- } -- -- ctx.seen.push(value); -- -- var output; -- if (array) { -- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); -- } else { -- output = keys.map(function(key) { -- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); -- }); -- } -- -- ctx.seen.pop(); -- -- return reduceToSingleString(output, base, braces); --} -- -- --function formatPrimitive(ctx, value) { -- if (isUndefined(value)) -- return ctx.stylize('undefined', 'undefined'); -- if (isString(value)) { -- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') -- .replace(/'/g, "\\'") -- .replace(/\\"/g, '"') + '\''; -- return ctx.stylize(simple, 'string'); -- } -- if (isNumber(value)) { -- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, -- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . -- if (value === 0 && 1 / value < 0) -- return ctx.stylize('-0', 'number'); -- return ctx.stylize('' + value, 'number'); -- } -- if (isBoolean(value)) -- return ctx.stylize('' + value, 'boolean'); -- // For some reason typeof null is "object", so special case here. -- if (isNull(value)) -- return ctx.stylize('null', 'null'); --} -- -- --function formatError(value) { -- return '[' + Error.prototype.toString.call(value) + ']'; --} -- -- --function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { -- var output = []; -- for (var i = 0, l = value.length; i < l; ++i) { -- if (hasOwnProperty(value, String(i))) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- String(i), true)); -- } else { -- output.push(''); -- } -- } -- keys.forEach(function(key) { -- if (!key.match(/^\d+$/)) { -- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, -- key, true)); -- } -- }); -- return output; --} -- -- --function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { -- var name, str, desc; -- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; -- if (desc.get) { -- if (desc.set) { -- str = ctx.stylize('[Getter/Setter]', 'special'); -- } else { -- str = ctx.stylize('[Getter]', 'special'); -- } -- } else { -- if (desc.set) { -- str = ctx.stylize('[Setter]', 'special'); -- } -- } -- if (!hasOwnProperty(visibleKeys, key)) { -- name = '[' + key + ']'; -- } -- if (!str) { -- if (ctx.seen.indexOf(desc.value) < 0) { -- if (isNull(recurseTimes)) { -- str = formatValue(ctx, desc.value, null); -- } else { -- str = formatValue(ctx, desc.value, recurseTimes - 1); -- } -- if (str.indexOf('\n') > -1) { -- if (array) { -- str = str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n').substr(2); -- } else { -- str = '\n' + str.split('\n').map(function(line) { -- return ' ' + line; -- }).join('\n'); -- } -- } -- } else { -- str = ctx.stylize('[Circular]', 'special'); -- } -- } -- if (isUndefined(name)) { -- if (array && key.match(/^\d+$/)) { -- return str; -- } -- name = JSON.stringify('' + key); -- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { -- name = name.substr(1, name.length - 2); -- name = ctx.stylize(name, 'name'); -- } else { -- name = name.replace(/'/g, "\\'") -- .replace(/\\"/g, '"') -- .replace(/(^"|"$)/g, "'"); -- name = ctx.stylize(name, 'string'); -- } -- } -- -- return name + ': ' + str; --} -- -- --function reduceToSingleString(output, base, braces) { -- var numLinesEst = 0; -- var length = output.reduce(function(prev, cur) { -- numLinesEst++; -- if (cur.indexOf('\n') >= 0) numLinesEst++; -- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; -- }, 0); -- -- if (length > 60) { -- return braces[0] + -- (base === '' ? '' : base + '\n ') + -- ' ' + -- output.join(',\n ') + -- ' ' + -- braces[1]; -- } -- -- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; --} -- -- - // NOTE: These type checking functions intentionally don't use `instanceof` - // because it is fragile and can be easily faked with `Object.create()`. - function isArray(ar) { -@@ -522,166 +98,10 @@ function isPrimitive(arg) { - exports.isPrimitive = isPrimitive; - - function isBuffer(arg) { -- return arg instanceof Buffer; -+ return Buffer.isBuffer(arg); - } - exports.isBuffer = isBuffer; - - function objectToString(o) { - return Object.prototype.toString.call(o); --} -- -- --function pad(n) { -- return n < 10 ? '0' + n.toString(10) : n.toString(10); --} -- -- --var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', -- 'Oct', 'Nov', 'Dec']; -- --// 26 Feb 16:19:34 --function timestamp() { -- var d = new Date(); -- var time = [pad(d.getHours()), -- pad(d.getMinutes()), -- pad(d.getSeconds())].join(':'); -- return [d.getDate(), months[d.getMonth()], time].join(' '); --} -- -- --// log is just a thin wrapper to console.log that prepends a timestamp --exports.log = function() { -- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); --}; -- -- --/** -- * Inherit the prototype methods from one constructor into another. -- * -- * The Function.prototype.inherits from lang.js rewritten as a standalone -- * function (not on Function.prototype). NOTE: If this file is to be loaded -- * during bootstrapping this function needs to be rewritten using some native -- * functions as prototype setup using normal JavaScript does not work as -- * expected during bootstrapping (see mirror.js in r114903). -- * -- * @param {function} ctor Constructor function which needs to inherit the -- * prototype. -- * @param {function} superCtor Constructor function to inherit prototype from. -- */ --exports.inherits = function(ctor, superCtor) { -- ctor.super_ = superCtor; -- ctor.prototype = Object.create(superCtor.prototype, { -- constructor: { -- value: ctor, -- enumerable: false, -- writable: true, -- configurable: true -- } -- }); --}; -- --exports._extend = function(origin, add) { -- // Don't do anything if add isn't an object -- if (!add || !isObject(add)) return origin; -- -- var keys = Object.keys(add); -- var i = keys.length; -- while (i--) { -- origin[keys[i]] = add[keys[i]]; -- } -- return origin; --}; -- --function hasOwnProperty(obj, prop) { -- return Object.prototype.hasOwnProperty.call(obj, prop); --} -- -- --// Deprecated old stuff. -- --exports.p = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- console.error(exports.inspect(arguments[i])); -- } --}, 'util.p: Use console.error() instead'); -- -- --exports.exec = exports.deprecate(function() { -- return require('child_process').exec.apply(this, arguments); --}, 'util.exec is now called `child_process.exec`.'); -- -- --exports.print = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(String(arguments[i])); -- } --}, 'util.print: Use console.log instead'); -- -- --exports.puts = exports.deprecate(function() { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stdout.write(arguments[i] + '\n'); -- } --}, 'util.puts: Use console.log instead'); -- -- --exports.debug = exports.deprecate(function(x) { -- process.stderr.write('DEBUG: ' + x + '\n'); --}, 'util.debug: Use console.error instead'); -- -- --exports.error = exports.deprecate(function(x) { -- for (var i = 0, len = arguments.length; i < len; ++i) { -- process.stderr.write(arguments[i] + '\n'); -- } --}, 'util.error: Use console.error instead'); -- -- --exports.pump = exports.deprecate(function(readStream, writeStream, callback) { -- var callbackCalled = false; -- -- function call(a, b, c) { -- if (callback && !callbackCalled) { -- callback(a, b, c); -- callbackCalled = true; -- } -- } -- -- readStream.addListener('data', function(chunk) { -- if (writeStream.write(chunk) === false) readStream.pause(); -- }); -- -- writeStream.addListener('drain', function() { -- readStream.resume(); -- }); -- -- readStream.addListener('end', function() { -- writeStream.end(); -- }); -- -- readStream.addListener('close', function() { -- call(); -- }); -- -- readStream.addListener('error', function(err) { -- writeStream.end(); -- call(err); -- }); -- -- writeStream.addListener('error', function(err) { -- readStream.destroy(); -- call(err); -- }); --}, 'util.pump(): Use readableStream.pipe() instead'); -- -- --var uv; --exports._errnoException = function(err, syscall) { -- if (isUndefined(uv)) uv = process.binding('uv'); -- var errname = uv.errname(err); -- var e = new Error(syscall + ' ' + errname); -- e.code = errname; -- e.errno = errname; -- e.syscall = syscall; -- return e; --}; -+} \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/lib/util.js deleted file mode 100644 index ff4c851c07..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/lib/util.js +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. - -function isArray(arg) { - if (Array.isArray) { - return Array.isArray(arg); - } - return objectToString(arg) === '[object Array]'; -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = Buffer.isBuffer; - -function objectToString(o) { - return Object.prototype.toString.call(o); -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/package.json deleted file mode 100644 index 4f65c18e22..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/package.json +++ /dev/null @@ -1,106 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "core-util-is@~1.0.0", - "scope": null, - "escapedName": "core-util-is", - "name": "core-util-is", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream" - ], - [ - { - "raw": "core-util-is@~1.0.0", - "scope": null, - "escapedName": "core-util-is", - "name": "core-util-is", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream" - ] - ], - "_from": "core-util-is@~1.0.0", - "_id": "core-util-is@1.0.2", - "_inCache": true, - "_location": "/mississippi/through2/readable-stream/core-util-is", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "_npmVersion": "3.3.2", - "_phantomChildren": {}, - "_requested": { - "raw": "core-util-is@~1.0.0", - "scope": null, - "escapedName": "core-util-is", - "name": "core-util-is", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/through2/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "_shrinkwrap": null, - "_spec": "core-util-is@~1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream", - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/core-util-is/issues" - }, - "dependencies": {}, - "description": "The `util.is*` functions introduced in Node v0.12.", - "devDependencies": { - "tap": "^2.3.0" - }, - "directories": {}, - "dist": { - "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "tarball": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" - }, - "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", - "homepage": "https://github.com/isaacs/core-util-is#readme", - "keywords": [ - "util", - "isBuffer", - "isArray", - "isNumber", - "isString", - "isRegExp", - "isThis", - "isThat", - "polyfill" - ], - "license": "MIT", - "main": "lib/util.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "core-util-is", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/core-util-is.git" - }, - "scripts": { - "test": "tap test.js" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/test.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/test.js deleted file mode 100644 index 1a490c65ac..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/core-util-is/test.js +++ /dev/null @@ -1,68 +0,0 @@ -var assert = require('tap'); - -var t = require('./lib/util'); - -assert.equal(t.isArray([]), true); -assert.equal(t.isArray({}), false); - -assert.equal(t.isBoolean(null), false); -assert.equal(t.isBoolean(true), true); -assert.equal(t.isBoolean(false), true); - -assert.equal(t.isNull(null), true); -assert.equal(t.isNull(undefined), false); -assert.equal(t.isNull(false), false); -assert.equal(t.isNull(), false); - -assert.equal(t.isNullOrUndefined(null), true); -assert.equal(t.isNullOrUndefined(undefined), true); -assert.equal(t.isNullOrUndefined(false), false); -assert.equal(t.isNullOrUndefined(), true); - -assert.equal(t.isNumber(null), false); -assert.equal(t.isNumber('1'), false); -assert.equal(t.isNumber(1), true); - -assert.equal(t.isString(null), false); -assert.equal(t.isString('1'), true); -assert.equal(t.isString(1), false); - -assert.equal(t.isSymbol(null), false); -assert.equal(t.isSymbol('1'), false); -assert.equal(t.isSymbol(1), false); -assert.equal(t.isSymbol(Symbol()), true); - -assert.equal(t.isUndefined(null), false); -assert.equal(t.isUndefined(undefined), true); -assert.equal(t.isUndefined(false), false); -assert.equal(t.isUndefined(), true); - -assert.equal(t.isRegExp(null), false); -assert.equal(t.isRegExp('1'), false); -assert.equal(t.isRegExp(new RegExp()), true); - -assert.equal(t.isObject({}), true); -assert.equal(t.isObject([]), true); -assert.equal(t.isObject(new RegExp()), true); -assert.equal(t.isObject(new Date()), true); - -assert.equal(t.isDate(null), false); -assert.equal(t.isDate('1'), false); -assert.equal(t.isDate(new Date()), true); - -assert.equal(t.isError(null), false); -assert.equal(t.isError({ err: true }), false); -assert.equal(t.isError(new Error()), true); - -assert.equal(t.isFunction(null), false); -assert.equal(t.isFunction({ }), false); -assert.equal(t.isFunction(function() {}), true); - -assert.equal(t.isPrimitive(null), true); -assert.equal(t.isPrimitive(''), true); -assert.equal(t.isPrimitive(0), true); -assert.equal(t.isPrimitive(new Date()), false); - -assert.equal(t.isBuffer(null), false); -assert.equal(t.isBuffer({}), false); -assert.equal(t.isBuffer(new Buffer(0)), true); diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/.travis.yml b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/.travis.yml deleted file mode 100644 index cc4dba29d9..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/Makefile deleted file mode 100644 index 0ecc29c402..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @node_modules/.bin/tape test.js - -.PHONY: test diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/README.md deleted file mode 100644 index 16d2c59c61..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/README.md +++ /dev/null @@ -1,60 +0,0 @@ - -# isarray - -`Array#isArray` for older browsers. - -[![build status](https://secure.travis-ci.org/juliangruber/isarray.svg)](http://travis-ci.org/juliangruber/isarray) -[![downloads](https://img.shields.io/npm/dm/isarray.svg)](https://www.npmjs.org/package/isarray) - -[![browser support](https://ci.testling.com/juliangruber/isarray.png) -](https://ci.testling.com/juliangruber/isarray) - -## Usage - -```js -var isArray = require('isarray'); - -console.log(isArray([])); // => true -console.log(isArray({})); // => false -``` - -## Installation - -With [npm](http://npmjs.org) do - -```bash -$ npm install isarray -``` - -Then bundle for the browser with -[browserify](https://github.com/substack/browserify). - -With [component](http://component.io) do - -```bash -$ component install juliangruber/isarray -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/component.json deleted file mode 100644 index 9e31b68388..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/component.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name" : "isarray", - "description" : "Array#isArray for older browsers", - "version" : "0.0.1", - "repository" : "juliangruber/isarray", - "homepage": "https://github.com/juliangruber/isarray", - "main" : "index.js", - "scripts" : [ - "index.js" - ], - "dependencies" : {}, - "keywords": ["browser","isarray","array"], - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "license": "MIT" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/index.js deleted file mode 100644 index a57f634959..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/index.js +++ /dev/null @@ -1,5 +0,0 @@ -var toString = {}.toString; - -module.exports = Array.isArray || function (arr) { - return toString.call(arr) == '[object Array]'; -}; diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/package.json deleted file mode 100644 index d3a2bda3c6..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "isarray@~1.0.0", - "scope": null, - "escapedName": "isarray", - "name": "isarray", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream" - ], - [ - { - "raw": "isarray@~1.0.0", - "scope": null, - "escapedName": "isarray", - "name": "isarray", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream" - ] - ], - "_from": "isarray@~1.0.0", - "_id": "isarray@1.0.0", - "_inCache": true, - "_location": "/mississippi/through2/readable-stream/isarray", - "_nodeVersion": "5.1.0", - "_npmUser": { - "name": "juliangruber", - "email": "julian@juliangruber.com" - }, - "_npmVersion": "3.3.12", - "_phantomChildren": {}, - "_requested": { - "raw": "isarray@~1.0.0", - "scope": null, - "escapedName": "isarray", - "name": "isarray", - "rawSpec": "~1.0.0", - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/through2/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", - "_shrinkwrap": null, - "_spec": "isarray@~1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream", - "author": { - "name": "Julian Gruber", - "email": "mail@juliangruber.com", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/isarray/issues" - }, - "dependencies": {}, - "description": "Array#isArray for older browsers", - "devDependencies": { - "tape": "~2.13.4" - }, - "directories": {}, - "dist": { - "shasum": "bb935d48582cba168c06834957a54a3e07124f11", - "tarball": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" - }, - "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", - "homepage": "https://github.com/juliangruber/isarray", - "keywords": [ - "browser", - "isarray", - "array" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "name": "isarray", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/isarray.git" - }, - "scripts": { - "test": "tape test.js" - }, - "testling": { - "files": "test.js", - "browsers": [ - "ie/8..latest", - "firefox/17..latest", - "firefox/nightly", - "chrome/22..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ] - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/test.js deleted file mode 100644 index f7f7bcd19f..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/isarray/test.js +++ /dev/null @@ -1,19 +0,0 @@ -var isArray = require('./'); -var test = require('tape'); - -test('is array', function(t){ - t.ok(isArray([])); - t.notOk(isArray({})); - t.notOk(isArray(null)); - t.notOk(isArray(false)); - - var obj = {}; - obj[0] = true; - t.notOk(isArray(obj)); - - var arr = []; - arr.foo = 'bar'; - t.ok(isArray(arr)); - - t.end(); -}); diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml deleted file mode 100644 index 36201b1001..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/.travis.yml +++ /dev/null @@ -1,12 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" - - "0.12" - - "1.7.1" - - 1 - - 2 - - 3 - - 4 - - 5 diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/index.js deleted file mode 100644 index a4f40f845f..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/index.js +++ /dev/null @@ -1,43 +0,0 @@ -'use strict'; - -if (!process.version || - process.version.indexOf('v0.') === 0 || - process.version.indexOf('v1.') === 0 && process.version.indexOf('v1.8.') !== 0) { - module.exports = nextTick; -} else { - module.exports = process.nextTick; -} - -function nextTick(fn, arg1, arg2, arg3) { - if (typeof fn !== 'function') { - throw new TypeError('"callback" argument must be a function'); - } - var len = arguments.length; - var args, i; - switch (len) { - case 0: - case 1: - return process.nextTick(fn); - case 2: - return process.nextTick(function afterTickOne() { - fn.call(null, arg1); - }); - case 3: - return process.nextTick(function afterTickTwo() { - fn.call(null, arg1, arg2); - }); - case 4: - return process.nextTick(function afterTickThree() { - fn.call(null, arg1, arg2, arg3); - }); - default: - args = new Array(len - 1); - i = 0; - while (i < args.length) { - args[i++] = arguments[i]; - } - return process.nextTick(function afterTick() { - fn.apply(null, args); - }); - } -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/license.md b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/license.md deleted file mode 100644 index c67e3532b5..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/license.md +++ /dev/null @@ -1,19 +0,0 @@ -# Copyright (c) 2015 Calvin Metcalf - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -**THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.** diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/package.json deleted file mode 100644 index f5d106537a..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "process-nextick-args@~1.0.6", - "scope": null, - "escapedName": "process-nextick-args", - "name": "process-nextick-args", - "rawSpec": "~1.0.6", - "spec": ">=1.0.6 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream" - ], - [ - { - "raw": "process-nextick-args@~1.0.6", - "scope": null, - "escapedName": "process-nextick-args", - "name": "process-nextick-args", - "rawSpec": "~1.0.6", - "spec": ">=1.0.6 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream" - ] - ], - "_from": "process-nextick-args@~1.0.6", - "_id": "process-nextick-args@1.0.7", - "_inCache": true, - "_location": "/mississippi/through2/readable-stream/process-nextick-args", - "_nodeVersion": "5.11.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/process-nextick-args-1.0.7.tgz_1462394251778_0.36989671061746776" - }, - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "_npmVersion": "3.8.6", - "_phantomChildren": {}, - "_requested": { - "raw": "process-nextick-args@~1.0.6", - "scope": null, - "escapedName": "process-nextick-args", - "name": "process-nextick-args", - "rawSpec": "~1.0.6", - "spec": ">=1.0.6 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/through2/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", - "_shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", - "_shrinkwrap": null, - "_spec": "process-nextick-args@~1.0.6", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream", - "author": "", - "bugs": { - "url": "https://github.com/calvinmetcalf/process-nextick-args/issues" - }, - "dependencies": {}, - "description": "process.nextTick but always with args", - "devDependencies": { - "tap": "~0.2.6" - }, - "directories": {}, - "dist": { - "shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", - "tarball": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" - }, - "gitHead": "5c00899ab01dd32f93ad4b5743da33da91404f39", - "homepage": "https://github.com/calvinmetcalf/process-nextick-args", - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "name": "process-nextick-args", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/calvinmetcalf/process-nextick-args.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.0.7" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/readme.md b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/readme.md deleted file mode 100644 index 78e7cfaeb7..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/readme.md +++ /dev/null @@ -1,18 +0,0 @@ -process-nextick-args -===== - -[![Build Status](https://travis-ci.org/calvinmetcalf/process-nextick-args.svg?branch=master)](https://travis-ci.org/calvinmetcalf/process-nextick-args) - -```bash -npm install --save process-nextick-args -``` - -Always be able to pass arguments to process.nextTick, no matter the platform - -```js -var nextTick = require('process-nextick-args'); - -nextTick(function (a, b, c) { - console.log(a, b, c); -}, 'step', 3, 'profit'); -``` diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/test.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/test.js deleted file mode 100644 index ef15721584..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/process-nextick-args/test.js +++ /dev/null @@ -1,24 +0,0 @@ -var test = require("tap").test; -var nextTick = require('./'); - -test('should work', function (t) { - t.plan(5); - nextTick(function (a) { - t.ok(a); - nextTick(function (thing) { - t.equals(thing, 7); - }, 7); - }, true); - nextTick(function (a, b, c) { - t.equals(a, 'step'); - t.equals(b, 3); - t.equals(c, 'profit'); - }, 'step', 3, 'profit'); -}); - -test('correct number of arguments', function (t) { - t.plan(1); - nextTick(function () { - t.equals(2, arguments.length, 'correct number'); - }, 1, 2); -}); diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/.npmignore deleted file mode 100644 index 206320cc1d..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -build -test diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/LICENSE deleted file mode 100644 index 6de584a48f..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/LICENSE +++ /dev/null @@ -1,20 +0,0 @@ -Copyright Joyent, Inc. and other Node contributors. - -Permission is hereby granted, free of charge, to any person obtaining a -copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to permit -persons to whom the Software is furnished to do so, subject to the -following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/README.md deleted file mode 100644 index 4d2aa00150..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/README.md +++ /dev/null @@ -1,7 +0,0 @@ -**string_decoder.js** (`require('string_decoder')`) from Node.js core - -Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. - -Version numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.** - -The *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version. \ No newline at end of file diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/index.js deleted file mode 100644 index b00e54fb79..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/index.js +++ /dev/null @@ -1,221 +0,0 @@ -// Copyright Joyent, Inc. and other Node contributors. -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the -// "Software"), to deal in the Software without restriction, including -// without limitation the rights to use, copy, modify, merge, publish, -// distribute, sublicense, and/or sell copies of the Software, and to permit -// persons to whom the Software is furnished to do so, subject to the -// following conditions: -// -// The above copyright notice and this permission notice shall be included -// in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -// USE OR OTHER DEALINGS IN THE SOFTWARE. - -var Buffer = require('buffer').Buffer; - -var isBufferEncoding = Buffer.isEncoding - || function(encoding) { - switch (encoding && encoding.toLowerCase()) { - case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; - default: return false; - } - } - - -function assertEncoding(encoding) { - if (encoding && !isBufferEncoding(encoding)) { - throw new Error('Unknown encoding: ' + encoding); - } -} - -// StringDecoder provides an interface for efficiently splitting a series of -// buffers into a series of JS strings without breaking apart multi-byte -// characters. CESU-8 is handled as part of the UTF-8 encoding. -// -// @TODO Handling all encodings inside a single object makes it very difficult -// to reason about this code, so it should be split up in the future. -// @TODO There should be a utf8-strict encoding that rejects invalid UTF-8 code -// points as used by CESU-8. -var StringDecoder = exports.StringDecoder = function(encoding) { - this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); - assertEncoding(encoding); - switch (this.encoding) { - case 'utf8': - // CESU-8 represents each of Surrogate Pair by 3-bytes - this.surrogateSize = 3; - break; - case 'ucs2': - case 'utf16le': - // UTF-16 represents each of Surrogate Pair by 2-bytes - this.surrogateSize = 2; - this.detectIncompleteChar = utf16DetectIncompleteChar; - break; - case 'base64': - // Base-64 stores 3 bytes in 4 chars, and pads the remainder. - this.surrogateSize = 3; - this.detectIncompleteChar = base64DetectIncompleteChar; - break; - default: - this.write = passThroughWrite; - return; - } - - // Enough space to store all bytes of a single character. UTF-8 needs 4 - // bytes, but CESU-8 may require up to 6 (3 bytes per surrogate). - this.charBuffer = new Buffer(6); - // Number of bytes received for the current incomplete multi-byte character. - this.charReceived = 0; - // Number of bytes expected for the current incomplete multi-byte character. - this.charLength = 0; -}; - - -// write decodes the given buffer and returns it as JS string that is -// guaranteed to not contain any partial multi-byte characters. Any partial -// character found at the end of the buffer is buffered up, and will be -// returned when calling write again with the remaining bytes. -// -// Note: Converting a Buffer containing an orphan surrogate to a String -// currently works, but converting a String to a Buffer (via `new Buffer`, or -// Buffer#write) will replace incomplete surrogates with the unicode -// replacement character. See https://codereview.chromium.org/121173009/ . -StringDecoder.prototype.write = function(buffer) { - var charStr = ''; - // if our last write ended with an incomplete multibyte character - while (this.charLength) { - // determine how many remaining bytes this buffer has to offer for this char - var available = (buffer.length >= this.charLength - this.charReceived) ? - this.charLength - this.charReceived : - buffer.length; - - // add the new bytes to the char buffer - buffer.copy(this.charBuffer, this.charReceived, 0, available); - this.charReceived += available; - - if (this.charReceived < this.charLength) { - // still not enough chars in this buffer? wait for more ... - return ''; - } - - // remove bytes belonging to the current character from the buffer - buffer = buffer.slice(available, buffer.length); - - // get the character that was split - charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); - - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - var charCode = charStr.charCodeAt(charStr.length - 1); - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - this.charLength += this.surrogateSize; - charStr = ''; - continue; - } - this.charReceived = this.charLength = 0; - - // if there are no more bytes in this buffer, just emit our char - if (buffer.length === 0) { - return charStr; - } - break; - } - - // determine and set charLength / charReceived - this.detectIncompleteChar(buffer); - - var end = buffer.length; - if (this.charLength) { - // buffer the incomplete character bytes we got - buffer.copy(this.charBuffer, 0, buffer.length - this.charReceived, end); - end -= this.charReceived; - } - - charStr += buffer.toString(this.encoding, 0, end); - - var end = charStr.length - 1; - var charCode = charStr.charCodeAt(end); - // CESU-8: lead surrogate (D800-DBFF) is also the incomplete character - if (charCode >= 0xD800 && charCode <= 0xDBFF) { - var size = this.surrogateSize; - this.charLength += size; - this.charReceived += size; - this.charBuffer.copy(this.charBuffer, size, 0, size); - buffer.copy(this.charBuffer, 0, 0, size); - return charStr.substring(0, end); - } - - // or just emit the charStr - return charStr; -}; - -// detectIncompleteChar determines if there is an incomplete UTF-8 character at -// the end of the given buffer. If so, it sets this.charLength to the byte -// length that character, and sets this.charReceived to the number of bytes -// that are available for this character. -StringDecoder.prototype.detectIncompleteChar = function(buffer) { - // determine how many bytes we have to check at the end of this buffer - var i = (buffer.length >= 3) ? 3 : buffer.length; - - // Figure out if one of the last i bytes of our buffer announces an - // incomplete char. - for (; i > 0; i--) { - var c = buffer[buffer.length - i]; - - // See http://en.wikipedia.org/wiki/UTF-8#Description - - // 110XXXXX - if (i == 1 && c >> 5 == 0x06) { - this.charLength = 2; - break; - } - - // 1110XXXX - if (i <= 2 && c >> 4 == 0x0E) { - this.charLength = 3; - break; - } - - // 11110XXX - if (i <= 3 && c >> 3 == 0x1E) { - this.charLength = 4; - break; - } - } - this.charReceived = i; -}; - -StringDecoder.prototype.end = function(buffer) { - var res = ''; - if (buffer && buffer.length) - res = this.write(buffer); - - if (this.charReceived) { - var cr = this.charReceived; - var buf = this.charBuffer; - var enc = this.encoding; - res += buf.slice(0, cr).toString(enc); - } - - return res; -}; - -function passThroughWrite(buffer) { - return buffer.toString(this.encoding); -} - -function utf16DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 2; - this.charLength = this.charReceived ? 2 : 0; -} - -function base64DetectIncompleteChar(buffer) { - this.charReceived = buffer.length % 3; - this.charLength = this.charReceived ? 3 : 0; -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/package.json deleted file mode 100644 index 36fa27f82b..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/string_decoder/package.json +++ /dev/null @@ -1,99 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "string_decoder@~0.10.x", - "scope": null, - "escapedName": "string_decoder", - "name": "string_decoder", - "rawSpec": "~0.10.x", - "spec": ">=0.10.0 <0.11.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream" - ], - [ - { - "raw": "string_decoder@~0.10.x", - "scope": null, - "escapedName": "string_decoder", - "name": "string_decoder", - "rawSpec": "~0.10.x", - "spec": ">=0.10.0 <0.11.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream" - ] - ], - "_from": "string_decoder@~0.10.x", - "_id": "string_decoder@0.10.31", - "_inCache": true, - "_location": "/mississippi/through2/readable-stream/string_decoder", - "_npmUser": { - "name": "rvagg", - "email": "rod@vagg.org" - }, - "_npmVersion": "1.4.23", - "_phantomChildren": {}, - "_requested": { - "raw": "string_decoder@~0.10.x", - "scope": null, - "escapedName": "string_decoder", - "name": "string_decoder", - "rawSpec": "~0.10.x", - "spec": ">=0.10.0 <0.11.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/through2/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "_shrinkwrap": null, - "_spec": "string_decoder@~0.10.x", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream", - "bugs": { - "url": "https://github.com/rvagg/string_decoder/issues" - }, - "dependencies": {}, - "description": "The string_decoder module from Node core", - "devDependencies": { - "tap": "~0.4.8" - }, - "directories": {}, - "dist": { - "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" - }, - "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", - "homepage": "https://github.com/rvagg/string_decoder", - "keywords": [ - "string", - "decoder", - "browser", - "browserify" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - } - ], - "name": "string_decoder", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/rvagg/string_decoder.git" - }, - "scripts": { - "test": "tap test/simple/*.js" - }, - "version": "0.10.31" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/History.md b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/History.md deleted file mode 100644 index acc8675372..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/History.md +++ /dev/null @@ -1,16 +0,0 @@ - -1.0.2 / 2015-10-07 -================== - - * use try/catch when checking `localStorage` (#3, @kumavis) - -1.0.1 / 2014-11-25 -================== - - * browser: use `console.warn()` for deprecation calls - * browser: more jsdocs - -1.0.0 / 2014-04-30 -================== - - * initial commit diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/LICENSE b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/LICENSE deleted file mode 100644 index 6a60e8c225..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/README.md b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/README.md deleted file mode 100644 index 75622fa7c2..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/README.md +++ /dev/null @@ -1,53 +0,0 @@ -util-deprecate -============== -### The Node.js `util.deprecate()` function with browser support - -In Node.js, this module simply re-exports the `util.deprecate()` function. - -In the web browser (i.e. via browserify), a browser-specific implementation -of the `util.deprecate()` function is used. - - -## API - -A `deprecate()` function is the only thing exposed by this module. - -``` javascript -// setup: -exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead'); - - -// users see: -foo(); -// foo() is deprecated, use bar() instead -foo(); -foo(); -``` - - -## License - -(The MIT License) - -Copyright (c) 2014 Nathan Rajlich - -Permission is hereby granted, free of charge, to any person -obtaining a copy of this software and associated documentation -files (the "Software"), to deal in the Software without -restriction, including without limitation the rights to use, -copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the -Software is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -OTHER DEALINGS IN THE SOFTWARE. diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/browser.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/browser.js deleted file mode 100644 index 549ae2f065..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/browser.js +++ /dev/null @@ -1,67 +0,0 @@ - -/** - * Module exports. - */ - -module.exports = deprecate; - -/** - * Mark that a method should not be used. - * Returns a modified function which warns once by default. - * - * If `localStorage.noDeprecation = true` is set, then it is a no-op. - * - * If `localStorage.throwDeprecation = true` is set, then deprecated functions - * will throw an Error when invoked. - * - * If `localStorage.traceDeprecation = true` is set, then deprecated functions - * will invoke `console.trace()` instead of `console.error()`. - * - * @param {Function} fn - the function to deprecate - * @param {String} msg - the string to print to the console when `fn` is invoked - * @returns {Function} a new "deprecated" version of `fn` - * @api public - */ - -function deprecate (fn, msg) { - if (config('noDeprecation')) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (config('throwDeprecation')) { - throw new Error(msg); - } else if (config('traceDeprecation')) { - console.trace(msg); - } else { - console.warn(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -} - -/** - * Checks `localStorage` for boolean values for the given `name`. - * - * @param {String} name - * @returns {Boolean} - * @api private - */ - -function config (name) { - // accessing global.localStorage can trigger a DOMException in sandboxed iframes - try { - if (!global.localStorage) return false; - } catch (_) { - return false; - } - var val = global.localStorage[name]; - if (null == val) return false; - return String(val).toLowerCase() === 'true'; -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/node.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/node.js deleted file mode 100644 index 5e6fcff5dd..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/node.js +++ /dev/null @@ -1,6 +0,0 @@ - -/** - * For Node.js, simply re-export the core `util.deprecate` function. - */ - -module.exports = require('util').deprecate; diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/package.json deleted file mode 100644 index 44061da89b..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "util-deprecate@~1.0.1", - "scope": null, - "escapedName": "util-deprecate", - "name": "util-deprecate", - "rawSpec": "~1.0.1", - "spec": ">=1.0.1 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream/node_modules/readable-stream" - ], - [ - { - "raw": "util-deprecate@~1.0.1", - "scope": null, - "escapedName": "util-deprecate", - "name": "util-deprecate", - "rawSpec": "~1.0.1", - "spec": ">=1.0.1 <1.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream" - ] - ], - "_from": "util-deprecate@~1.0.1", - "_id": "util-deprecate@1.0.2", - "_inCache": true, - "_location": "/mississippi/through2/readable-stream/util-deprecate", - "_nodeVersion": "4.1.2", - "_npmUser": { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - "_npmVersion": "2.14.4", - "_phantomChildren": {}, - "_requested": { - "raw": "util-deprecate@~1.0.1", - "scope": null, - "escapedName": "util-deprecate", - "name": "util-deprecate", - "rawSpec": "~1.0.1", - "spec": ">=1.0.1 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/through2/readable-stream" - ], - "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "_shrinkwrap": null, - "_spec": "util-deprecate@~1.0.1", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream", - "author": { - "name": "Nathan Rajlich", - "email": "nathan@tootallnate.net", - "url": "http://n8.io/" - }, - "browser": "browser.js", - "bugs": { - "url": "https://github.com/TooTallNate/util-deprecate/issues" - }, - "dependencies": {}, - "description": "The Node.js `util.deprecate()` function with browser support", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "tarball": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" - }, - "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", - "homepage": "https://github.com/TooTallNate/util-deprecate", - "keywords": [ - "util", - "deprecate", - "browserify", - "browser", - "node" - ], - "license": "MIT", - "main": "node.js", - "maintainers": [ - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - } - ], - "name": "util-deprecate", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/util-deprecate.git" - }, - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/package.json b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/package.json deleted file mode 100644 index ae39f5f97d..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/package.json +++ /dev/null @@ -1,125 +0,0 @@ -{ - "_args": [ - [ - { - "raw": "readable-stream@~2.0.0", - "scope": null, - "escapedName": "readable-stream", - "name": "readable-stream", - "rawSpec": "~2.0.0", - "spec": ">=2.0.0 <2.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/concat-stream" - ], - [ - { - "raw": "readable-stream@~2.0.0", - "scope": null, - "escapedName": "readable-stream", - "name": "readable-stream", - "rawSpec": "~2.0.0", - "spec": ">=2.0.0 <2.1.0", - "type": "range" - }, - "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2" - ] - ], - "_from": "readable-stream@~2.0.0", - "_id": "readable-stream@2.0.6", - "_inCache": true, - "_location": "/mississippi/through2/readable-stream", - "_nodeVersion": "5.7.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" - }, - "_npmUser": { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - }, - "_npmVersion": "3.6.0", - "_phantomChildren": {}, - "_requested": { - "raw": "readable-stream@~2.0.0", - "scope": null, - "escapedName": "readable-stream", - "name": "readable-stream", - "rawSpec": "~2.0.0", - "spec": ">=2.0.0 <2.1.0", - "type": "range" - }, - "_requiredBy": [ - "/mississippi/through2" - ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz", - "_shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", - "_shrinkwrap": null, - "_spec": "readable-stream@~2.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi/node_modules/through2", - "browser": { - "util": false - }, - "bugs": { - "url": "https://github.com/nodejs/readable-stream/issues" - }, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "~1.0.0", - "process-nextick-args": "~1.0.6", - "string_decoder": "~0.10.x", - "util-deprecate": "~1.0.1" - }, - "description": "Streams3, a user-land copy of the stream library from Node.js", - "devDependencies": { - "tap": "~0.2.6", - "tape": "~4.5.1", - "zuul": "~3.9.0" - }, - "directories": {}, - "dist": { - "shasum": "8f90341e68a53ccc928788dacfcd11b36eb9b78e", - "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.6.tgz" - }, - "gitHead": "01fb5608a970b42c900b96746cadc13d27dd9d7e", - "homepage": "https://github.com/nodejs/readable-stream#readme", - "keywords": [ - "readable", - "stream", - "pipe" - ], - "license": "MIT", - "main": "readable.js", - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "tootallnate", - "email": "nathan@tootallnate.net" - }, - { - "name": "rvagg", - "email": "rod@vagg.org" - }, - { - "name": "cwmma", - "email": "calvin.metcalf@gmail.com" - } - ], - "name": "readable-stream", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/nodejs/readable-stream.git" - }, - "scripts": { - "browser": "npm run write-zuul && zuul -- test/browser.js", - "test": "tap test/parallel/*.js test/ours/*.js", - "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" - }, - "version": "2.0.6" -} diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/passthrough.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/passthrough.js deleted file mode 100644 index 27e8d8a551..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/passthrough.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_passthrough.js") diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/readable.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/readable.js deleted file mode 100644 index 6222a57986..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/readable.js +++ /dev/null @@ -1,12 +0,0 @@ -var Stream = (function (){ - try { - return require('st' + 'ream'); // hack to fix a circular dependency issue when used with browserify - } catch(_){} -}()); -exports = module.exports = require('./lib/_stream_readable.js'); -exports.Stream = Stream || exports; -exports.Readable = exports; -exports.Writable = require('./lib/_stream_writable.js'); -exports.Duplex = require('./lib/_stream_duplex.js'); -exports.Transform = require('./lib/_stream_transform.js'); -exports.PassThrough = require('./lib/_stream_passthrough.js'); diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/transform.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/transform.js deleted file mode 100644 index 5d482f0780..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/transform.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_transform.js") diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/writable.js b/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/writable.js deleted file mode 100644 index e1e9efdf3c..0000000000 --- a/deps/npm/node_modules/mississippi/node_modules/through2/node_modules/readable-stream/writable.js +++ /dev/null @@ -1 +0,0 @@ -module.exports = require("./lib/_stream_writable.js") diff --git a/deps/npm/node_modules/mississippi/node_modules/through2/package.json b/deps/npm/node_modules/mississippi/node_modules/through2/package.json index c7413b9f91..a60bc8b192 100644 --- a/deps/npm/node_modules/mississippi/node_modules/through2/package.json +++ b/deps/npm/node_modules/mississippi/node_modules/through2/package.json @@ -14,22 +14,20 @@ ] ], "_from": "through2@>=2.0.0 <3.0.0", - "_id": "through2@2.0.1", + "_id": "through2@2.0.3", "_inCache": true, "_location": "/mississippi/through2", - "_nodeVersion": "5.5.0", + "_nodeVersion": "7.2.0", "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/through2-2.0.1.tgz_1454928418348_0.7339043114334345" + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/through2-2.0.3.tgz_1480373529377_0.264686161885038" }, "_npmUser": { "name": "rvagg", "email": "rod@vagg.org" }, - "_npmVersion": "3.6.0", - "_phantomChildren": { - "inherits": "2.0.3" - }, + "_npmVersion": "3.10.9", + "_phantomChildren": {}, "_requested": { "raw": "through2@^2.0.0", "scope": null, @@ -42,8 +40,8 @@ "_requiredBy": [ "/mississippi" ], - "_resolved": "https://registry.npmjs.org/through2/-/through2-2.0.1.tgz", - "_shasum": "384e75314d49f32de12eebb8136b8eb6b5d59da9", + "_resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "_shasum": "0004569b37c7c74ba39c43f3ced78d1ad94140be", "_shrinkwrap": null, "_spec": "through2@^2.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/mississippi", @@ -56,22 +54,22 @@ "url": "https://github.com/rvagg/through2/issues" }, "dependencies": { - "readable-stream": "~2.0.0", - "xtend": "~4.0.0" + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" }, "description": "A tiny wrapper around Node streams2 Transform to avoid explicit subclassing noise", "devDependencies": { - "bl": "~0.9.4", + "bl": "~1.1.2", "faucet": "0.0.1", "stream-spigot": "~3.0.5", - "tape": "~4.0.0" + "tape": "~4.6.2" }, "directories": {}, "dist": { - "shasum": "384e75314d49f32de12eebb8136b8eb6b5d59da9", - "tarball": "https://registry.npmjs.org/through2/-/through2-2.0.1.tgz" + "shasum": "0004569b37c7c74ba39c43f3ced78d1ad94140be", + "tarball": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz" }, - "gitHead": "6d52a1b77db13a741f2708cd5854a198e4ae3072", + "gitHead": "4383b10b2cb6a32ae215760715b317513abe609f", "homepage": "https://github.com/rvagg/through2#readme", "keywords": [ "stream", @@ -102,5 +100,5 @@ "test": "node test/test.js | faucet", "test-local": "brtapsauce-local test/basic-test.js" }, - "version": "2.0.1" + "version": "2.0.3" } diff --git a/deps/npm/node_modules/mississippi/package.json b/deps/npm/node_modules/mississippi/package.json index 3595472180..503a931104 100644 --- a/deps/npm/node_modules/mississippi/package.json +++ b/deps/npm/node_modules/mississippi/package.json @@ -2,50 +2,54 @@ "_args": [ [ { - "raw": "mississippi@~1.2.0", + "raw": "mississippi@1.3.0", "scope": null, "escapedName": "mississippi", "name": "mississippi", - "rawSpec": "~1.2.0", - "spec": ">=1.2.0 <1.3.0", - "type": "range" + "rawSpec": "1.3.0", + "spec": "1.3.0", + "type": "version" }, "/Users/zkat/Documents/code/npm" ] ], - "_from": "mississippi@>=1.2.0 <1.3.0", - "_id": "mississippi@1.2.0", + "_from": "mississippi@1.3.0", + "_id": "mississippi@1.3.0", "_inCache": true, "_location": "/mississippi", - "_nodeVersion": "4.2.3", + "_nodeVersion": "6.9.2", + "_npmOperationalInternal": { + "host": "packages-18-east.internal.npmjs.com", + "tmp": "tmp/mississippi-1.3.0.tgz_1484780252704_0.3479328122921288" + }, "_npmUser": { "name": "maxogden", "email": "max@maxogden.com" }, - "_npmVersion": "2.14.15", + "_npmVersion": "3.10.9", "_phantomChildren": { "inherits": "2.0.3", "once": "1.4.0", - "readable-stream": "2.1.5", + "readable-stream": "2.2.2", "wrappy": "1.0.2" }, "_requested": { - "raw": "mississippi@~1.2.0", + "raw": "mississippi@1.3.0", "scope": null, "escapedName": "mississippi", "name": "mississippi", - "rawSpec": "~1.2.0", - "spec": ">=1.2.0 <1.3.0", - "type": "range" + "rawSpec": "1.3.0", + "spec": "1.3.0", + "type": "version" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/mississippi/-/mississippi-1.2.0.tgz", - "_shasum": "cd51bb9bbad3ddb13dee3cf60f1d0929c7a7fa4c", + "_resolved": "https://registry.npmjs.org/mississippi/-/mississippi-1.3.0.tgz", + "_shasum": "d201583eb12327e3c5c1642a404a9cacf94e34f5", "_shrinkwrap": null, - "_spec": "mississippi@~1.2.0", + "_spec": "mississippi@1.3.0", "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "max ogden" @@ -59,6 +63,7 @@ "end-of-stream": "^1.1.0", "flush-write-stream": "^1.0.0", "from2": "^2.1.0", + "parallel-transform": "^1.1.0", "pump": "^1.0.0", "pumpify": "^1.3.3", "stream-each": "^1.1.0", @@ -68,10 +73,10 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "cd51bb9bbad3ddb13dee3cf60f1d0929c7a7fa4c", - "tarball": "https://registry.npmjs.org/mississippi/-/mississippi-1.2.0.tgz" + "shasum": "d201583eb12327e3c5c1642a404a9cacf94e34f5", + "tarball": "https://registry.npmjs.org/mississippi/-/mississippi-1.3.0.tgz" }, - "gitHead": "4aab2a2d4d98fd5e300a329048eb02a12df44c60", + "gitHead": "dd64841b932d06baf7859ee80db78d139c90b4c7", "homepage": "https://github.com/maxogden/mississippi#readme", "license": "BSD-2-Clause", "main": "index.js", @@ -91,5 +96,5 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "version": "1.2.0" + "version": "1.3.0" } diff --git a/deps/npm/node_modules/mississippi/readme.md b/deps/npm/node_modules/mississippi/readme.md index 9013bb0dc5..569803865c 100644 --- a/deps/npm/node_modules/mississippi/readme.md +++ b/deps/npm/node_modules/mississippi/readme.md @@ -21,6 +21,7 @@ var miss = require('mississippi') - [to](#to) - [concat](#concat) - [finished](#finished) +- [parallel](#parallel) ### pipe @@ -28,13 +29,13 @@ var miss = require('mississippi') Pipes streams together and destroys all of them if one of them closes. Calls `cb` with `(error)` if there was an error in any of the streams. -When using standard `source.pipe(destination)` the source will _not_ be destroyed if the destination emits close or error. You are also not able to provide a callback to tell when then pipe has finished. +When using standard `source.pipe(destination)` the source will _not_ be destroyed if the destination emits close or error. You are also not able to provide a callback to tell when the pipe has finished. `miss.pipe` does these two things for you, ensuring you handle stream errors 100% of the time (unhandled errors are probably the most common bug in most node streams code) #### original module -`miss.pipe` is provided by [`require('pump')`](https://npmjs.org/pump) +`miss.pipe` is provided by [`require('pump')`](https://www.npmjs.com/package/pump) #### example @@ -56,13 +57,13 @@ miss.pipe(read, write, function (err) { ##### `miss.each(stream, each, [done])` -Iterate the data in `stream` one chunk at a time. Your `each` function will be called with with `(data, next)` where data is a data chunk and next is a callback. Call `next` when you are ready to consume the next chunk. +Iterate the data in `stream` one chunk at a time. Your `each` function will be called with `(data, next)` where data is a data chunk and next is a callback. Call `next` when you are ready to consume the next chunk. Optionally you can call `next` with an error to destroy the stream. You can also pass the optional third argument, `done`, which is a function that will be called with `(err)` when the stream ends. The `err` argument will be populated with an error if the stream emitted an error. #### original module -`miss.each` is provided by [`require('stream-each')`](https://npmjs.org/stream-each) +`miss.each` is provided by [`require('stream-each')`](https://www.npmjs.com/package/stream-each) #### example @@ -97,7 +98,7 @@ If any of the streams in the pipeline emits an error or gets destroyed, or you d #### original module -`miss.pipeline` is provided by [`require('pumpify')`](https://npmjs.org/pumpify) +`miss.pipeline` is provided by [`require('pumpify')`](https://www.npmjs.com/package/pumpify) #### example @@ -136,7 +137,7 @@ You can either choose to supply the writable and the readable at the time you cr #### original module -`miss.duplex` is provided by [`require('duplexify')`](https://npmjs.org/duplexify) +`miss.duplex` is provided by [`require('duplexify')`](https://www.npmjs.com/package/duplexify) #### example @@ -165,7 +166,7 @@ The `flushFunction`, with signature `(cb)`, is called just before the stream is #### original module -`miss.through` is provided by [`require('through2')`](https://npmjs.org/through2) +`miss.through` is provided by [`require('through2')`](https://www.npmjs.com/package/through2) #### example @@ -178,10 +179,10 @@ var write = fs.createWriteStream('./AWESOMECASE.TXT') // Leaving out the options object var uppercaser = miss.through( function (chunk, enc, cb) { - cb(chunk.toString().toUpperCase()) + cb(null, chunk.toString().toUpperCase()) }, function (cb) { - cb('ONE LAST BIT OF UPPERCASE') + cb(null, 'ONE LAST BIT OF UPPERCASE') } ) @@ -206,7 +207,7 @@ Returns a readable stream that calls `read(size, next)` when data is requested f #### original module -`miss.from` is provided by [`require('from2')`](https://npmjs.org/from2) +`miss.from` is provided by [`require('from2')`](https://www.npmjs.com/package/from2) #### example @@ -252,7 +253,7 @@ Returns a writable stream that calls `write(data, enc, cb)` when data is written #### original module -`miss.to` is provided by [`require('flush-write-stream')`](https://npmjs.org/flush-write-stream) +`miss.to` is provided by [`require('flush-write-stream')`](https://www.npmjs.com/package/flush-write-stream) #### example @@ -294,13 +295,13 @@ finished Returns a writable stream that concatenates all data written to the stream and calls a callback with the single result. -Calling `miss.concat(cb)` returns a writable stream. `cb` is called when the writable stream is finished, e.g. when all data is done being written to it. `cb` is called with a single argument, `(data)`, which will containe the result of concatenating all the data written to the stream. +Calling `miss.concat(cb)` returns a writable stream. `cb` is called when the writable stream is finished, e.g. when all data is done being written to it. `cb` is called with a single argument, `(data)`, which will contain the result of concatenating all the data written to the stream. Note that `miss.concat` will not handle stream errors for you. To handle errors, use `miss.pipe` or handle the `error` event manually. #### original module -`miss.concat` is provided by [`require('concat-stream')`](https://npmjs.org/concat-stream) +`miss.concat` is provided by [`require('concat-stream')`](https://www.npmjs.com/package/concat-stream) #### example @@ -335,7 +336,7 @@ This function is useful for simplifying stream handling code as it lets you hand #### original module -`miss.finished` is provided by [`require('end-of-stream')`](https://npmjs.org/end-of-stream) +`miss.finished` is provided by [`require('end-of-stream')`](https://www.npmjs.com/package/end-of-stream) #### example @@ -350,3 +351,44 @@ miss.finished(copyDest, function(err) { console.log('write success') }) ``` + +### parallel + +#####`miss.parallel(concurrency, each)` + +This works like `through` except you can process items in parallel, while still preserving the original input order. + +This is handy if you wanna take advantage of node's async I/O and process streams of items in batches. With this module you can build your very own streaming parallel job queue. + +Note that `miss.parallel` preserves input ordering, if you don't need that then you can use [through2-concurrent](https://github.com/almost/through2-concurrent) instead, which is very similar to this otherwise. + +#### original module + +`miss.parallel` is provided by [`require('parallel-transform')`](https://npmjs.org/parallel-transform) + +#### example + +This example fetches the GET HTTP headers for a stream of input URLs 5 at a time in parallel. + +```js +function getResponse (item, cb) { + var r = request(item.url) + r.on('error', function (err) { + cb(err) + }) + r.on('response', function (re) { + cb(null, {url: item.url, date: new Date(), status: re.statusCode, headers: re.headers}) + r.abort() + }) +} + +miss.pipe( + fs.createReadStream('./urls.txt'), // one url per line + split(), + miss.parallel(5, getResponse), + miss.through(function (row, enc, next) { + console.log(JSON.stringify(row)) + next() + }) +) +``` diff --git a/deps/npm/node_modules/request/node_modules/form-data/README.md b/deps/npm/node_modules/request/node_modules/form-data/README.md new file mode 100644 index 0000000000..642a9d14a8 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/form-data/README.md @@ -0,0 +1,217 @@ +# Form-Data [![NPM Module](https://img.shields.io/npm/v/form-data.svg)](https://www.npmjs.com/package/form-data) [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) + +A library to create readable ```"multipart/form-data"``` streams. Can be used to submit forms and file uploads to other web applications. + +The API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd]. + +[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface + +[![Linux Build](https://img.shields.io/travis/form-data/form-data/v2.1.2.svg?label=linux:0.12-6.x)](https://travis-ci.org/form-data/form-data) +[![MacOS Build](https://img.shields.io/travis/form-data/form-data/v2.1.2.svg?label=macos:0.12-6.x)](https://travis-ci.org/form-data/form-data) +[![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/form-data/v2.1.2.svg?label=windows:0.12-6.x)](https://ci.appveyor.com/project/alexindigo/form-data) + +[![Coverage Status](https://img.shields.io/coveralls/form-data/form-data/v2.1.2.svg?label=code+coverage)](https://coveralls.io/github/form-data/form-data?branch=master) +[![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data) +[![bitHound Overall Score](https://www.bithound.io/github/form-data/form-data/badges/score.svg)](https://www.bithound.io/github/form-data/form-data) + +## Install + +``` +npm install --save form-data +``` + +## Usage + +In this example we are constructing a form with 3 fields that contain a string, +a buffer and a file stream. + +``` javascript +var FormData = require('form-data'); +var fs = require('fs'); + +var form = new FormData(); +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_file', fs.createReadStream('/foo/bar.jpg')); +``` + +Also you can use http-response stream: + +``` javascript +var FormData = require('form-data'); +var http = require('http'); + +var form = new FormData(); + +http.request('http://nodejs.org/images/logo.png', function(response) { + form.append('my_field', 'my value'); + form.append('my_buffer', new Buffer(10)); + form.append('my_logo', response); +}); +``` + +Or @mikeal's [request](https://github.com/request/request) stream: + +``` javascript +var FormData = require('form-data'); +var request = require('request'); + +var form = new FormData(); + +form.append('my_field', 'my value'); +form.append('my_buffer', new Buffer(10)); +form.append('my_logo', request('http://nodejs.org/images/logo.png')); +``` + +In order to submit this form to a web application, call ```submit(url, [callback])``` method: + +``` javascript +form.submit('http://example.org/', function(err, res) { + // res – response object (http.IncomingMessage) // + res.resume(); +}); + +``` + +For more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods. + +### Alternative submission methods + +You can use node's http client interface: + +``` javascript +var http = require('http'); + +var request = http.request({ + method: 'post', + host: 'example.org', + path: '/upload', + headers: form.getHeaders() +}); + +form.pipe(request); + +request.on('response', function(res) { + console.log(res.statusCode); +}); +``` + +Or if you would prefer the `'Content-Length'` header to be set for you: + +``` javascript +form.submit('example.org/upload', function(err, res) { + console.log(res.statusCode); +}); +``` + +To use custom headers and pre-known length in parts: + +``` javascript +var CRLF = '\r\n'; +var form = new FormData(); + +var options = { + header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF, + knownLength: 1 +}; + +form.append('my_buffer', buffer, options); + +form.submit('http://example.com/', function(err, res) { + if (err) throw err; + console.log('Done'); +}); +``` + +Form-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide "file"-related information manually: + +``` javascript +someModule.stream(function(err, stdout, stderr) { + if (err) throw err; + + var form = new FormData(); + + form.append('file', stdout, { + filename: 'unicycle.jpg', + contentType: 'image/jpg', + knownLength: 19806 + }); + + form.submit('http://example.com/', function(err, res) { + if (err) throw err; + console.log('Done'); + }); +}); +``` + +For edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter: + +``` javascript +form.submit({ + host: 'example.com', + path: '/probably.php?extra=params', + auth: 'username:password' +}, function(err, res) { + console.log(res.statusCode); +}); +``` + +In case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`: + +``` javascript +form.submit({ + host: 'example.com', + path: '/surelynot.php', + headers: {'x-test-header': 'test-header-value'} +}, function(err, res) { + console.log(res.statusCode); +}); +``` + +### Integration with other libraries + +#### Request + +Form submission using [request](https://github.com/request/request): + +```javascript +var formData = { + my_field: 'my_value', + my_file: fs.createReadStream(__dirname + '/unicycle.jpg'), +}; + +request.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) { + if (err) { + return console.error('upload failed:', err); + } + console.log('Upload successful! Server responded with:', body); +}); +``` + +For more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads). + +#### node-fetch + +You can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch): + +```javascript +var form = new FormData(); + +form.append('a', 1); + +fetch('http://example.com', { method: 'POST', body: form }) + .then(function(res) { + return res.json(); + }).then(function(json) { + console.log(json); + }); +``` + +## Notes + +- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround. +- Starting version `2.x` FormData has dropped support for `node@0.10.x`. + +## License + +Form-Data is released under the [MIT](License) license. diff --git a/deps/npm/package.json b/deps/npm/package.json index 4a15414a98..daed5a4747 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "4.1.2", + "version": "4.2.0", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -32,6 +32,7 @@ "dependencies": { "JSONStream": "~1.3.0", "abbrev": "~1.0.9", + "ansi-regex": "~2.1.1", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "aproba": "~1.0.4", @@ -62,7 +63,7 @@ "lodash.union": "~4.6.0", "lodash.uniq": "~4.5.0", "lodash.without": "~4.4.0", - "mississippi": "~1.2.0", + "mississippi": "~1.3.0", "mkdirp": "~0.5.1", "node-gyp": "~3.5.0", "nopt": "~4.0.1", diff --git a/deps/npm/test/tap/debug-logs.js b/deps/npm/test/tap/debug-logs.js new file mode 100644 index 0000000000..fbd244446e --- /dev/null +++ b/deps/npm/test/tap/debug-logs.js @@ -0,0 +1,101 @@ +'use strict' +var path = require('path') +var test = require('tap').test +var Tacks = require('tacks') +var glob = require('glob') +var asyncMap = require('slide').asyncMap +var File = Tacks.File +var Dir = Tacks.Dir +var extend = Object.assign || require('util')._extend +var common = require('../common-tap.js') + +var basedir = path.join(__dirname, path.basename(__filename, '.js')) +var testdir = path.join(basedir, 'testdir') +var cachedir = path.join(basedir, 'cache') +var globaldir = path.join(basedir, 'global') +var tmpdir = path.join(basedir, 'tmp') + +var conf = { + cwd: testdir, + env: extend(extend({}, process.env), { + npm_config_cache: cachedir, + npm_config_tmp: tmpdir, + npm_config_prefix: globaldir, + npm_config_registry: common.registry, + npm_config_loglevel: 'warn' + }) +} + +var fixture = new Tacks(Dir({ + cache: Dir(), + global: Dir(), + tmp: Dir(), + testdir: Dir({ + 'package.json': File({ + name: 'debug-logs', + version: '1.0.0', + scripts: { + true: 'node -e "process.exit(0)"', + false: 'node -e "process.exit(1)"' + } + }) + }) +})) + +function setup () { + cleanup() + fixture.create(basedir) +} + +function cleanup () { + fixture.remove(basedir) +} + +test('setup', function (t) { + setup() + t.done() +}) + +test('example', function (t) { + common.npm(['run', 'false'], conf, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 1, 'command errored') + var matches = stderr.match(/Please include the following file with any support request:.*\nnpm ERR! {5,5}(.*)/) + t.ok(matches, 'debug log mentioned in error message') + if (matches) { + var logfile = matches[1] + t.matches(path.relative(cachedir, logfile), /^_logs/, 'debug log is inside the cache in _logs') + } + + // we run a bunch concurrently, this will actually create > than our limit as the check is done + // when the command starts + var todo = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + asyncMap(todo, function (num, next) { + common.npm(['run', '--logs-max=10', 'false'], conf, function (err, code) { + if (err) throw err + t.is(code, 1, 'run #' + num + ' errored as expected') + next() + }) + }, function () { + // now we do one more and that should clean up the list + common.npm(['run', '--logs-max=10', 'false'], conf, function (err, code) { + if (err) throw err + t.is(code, 1, 'final run errored as expected') + var files = glob.sync(path.join(cachedir, '_logs', '*')) + t.is(files.length, 10, 'there should never be more than 10 log files') + common.npm(['run', '--logs-max=5', 'true'], conf, function (err, code) { + if (err) throw err + t.is(code, 0, 'success run is ok') + var files = glob.sync(path.join(cachedir, '_logs', '*')) + t.is(files.length, 4, 'after success there should be logs-max - 1 log files') + t.done() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) diff --git a/deps/npm/test/tap/gently-rm-overeager.js b/deps/npm/test/tap/gently-rm-overeager.js index c266f1c4dc..08fa72bc71 100644 --- a/deps/npm/test/tap/gently-rm-overeager.js +++ b/deps/npm/test/tap/gently-rm-overeager.js @@ -1,4 +1,4 @@ -var resolve = require('path').resolve +var path = require('path') var fs = require('graceful-fs') var test = require('tap').test var mkdirp = require('mkdirp') @@ -6,8 +6,8 @@ var rimraf = require('rimraf') var common = require('../common-tap.js') -var pkg = resolve(__dirname, 'gently-rm-overeager') -var dep = resolve(__dirname, 'test-whoops') +var pkg = path.join(__dirname, 'gently-rm-overeager') +var dep = path.join(__dirname, 'test-whoops') var EXEC_OPTS = { cwd: pkg } @@ -32,8 +32,7 @@ test('cache add', function (t) { t.ok(c, 'test-whoops install also failed') fs.readdir(pkg, function (er, files) { t.ifError(er, 'package directory is still there') - t.deepEqual(files, ['npm-debug.log'], 'only debug log remains') - + t.deepEqual(files, [], 'no files remain') t.end() }) }) @@ -53,7 +52,7 @@ function cleanup () { function setup () { mkdirp.sync(pkg) // so it doesn't try to install into npm's own node_modules - mkdirp.sync(resolve(pkg, 'node_modules')) + mkdirp.sync(path.join(pkg, 'node_modules')) mkdirp.sync(dep) - fs.writeFileSync(resolve(dep, 'package.json'), JSON.stringify(fixture)) + fs.writeFileSync(path.join(dep, 'package.json'), JSON.stringify(fixture)) } diff --git a/deps/npm/test/tap/run-script.js b/deps/npm/test/tap/run-script.js index 3892337cee..4dea9b8360 100644 --- a/deps/npm/test/tap/run-script.js +++ b/deps/npm/test/tap/run-script.js @@ -67,6 +67,14 @@ var preversionOnly = { } } +var exitCode = { + name: 'scripted', + version: '1.2.3', + scripts: { + 'start': 'node -e "process.exit(7)"' + } +} + function testOutput (t, command, er, code, stdout, stderr) { var lines @@ -323,6 +331,17 @@ test('npm run-script no-params (direct only)', function (t) { }) }) +test('npm run-script keep non-zero exit code', function (t) { + writeMetadata(exitCode) + + common.npm(['run-script', 'start'], opts, function (err, code, stdout, stderr) { + t.ifError(err, 'ran run-script without parameters without crashing') + t.equal(code, 7, 'got expected exit code') + t.ok(stderr, 'should generate errors') + t.end() + }) +}) + test('cleanup', function (t) { cleanup() t.end() diff --git a/deps/npm/test/tap/search.all-package-search.js b/deps/npm/test/tap/search.all-package-search.js new file mode 100644 index 0000000000..c70f4f8e7e --- /dev/null +++ b/deps/npm/test/tap/search.all-package-search.js @@ -0,0 +1,201 @@ +var path = require('path') +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var cacheFile = require('npm-cache-filename') +var test = require('tap').test +var Tacks = require('tacks') +var File = Tacks.File + +var common = require('../common-tap.js') + +var PKG_DIR = path.resolve(__dirname, 'search') +var CACHE_DIR = path.resolve(PKG_DIR, 'cache') +var cacheBase = cacheFile(CACHE_DIR)(common.registry + '/-/all') +var cachePath = path.join(cacheBase, '.cache.json') + +var server + +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.pass('all set up') + t.done() + }) +}) + +var searches = [ + { + term: 'cool', + description: 'non-regex search', + location: 103 + }, + { + term: '/cool/', + description: 'regex search', + location: 103 + }, + { + term: 'cool', + description: 'searches name field', + location: 103 + }, + { + term: 'ool', + description: 'excludes matches for --searchexclude', + location: 205, + inject: { + other: { name: 'other', description: 'this is a simple tool' } + }, + extraOpts: ['--searchexclude', 'cool'] + }, + { + term: 'neat lib', + description: 'searches description field', + location: 141, + inject: { + cool: { + name: 'cool', version: '5.0.0', description: 'this is a neat lib' + } + } + }, + { + term: 'foo', + description: 'skips description field with --no-description', + location: 80, + inject: { + cool: { + name: 'cool', version: '5.0.0', description: 'foo bar!' + } + }, + extraOpts: ['--no-description'] + }, + { + term: 'zkat', + description: 'searches maintainers by name', + location: 155, + inject: { + cool: { + name: 'cool', + version: '5.0.0', + maintainers: [{ + name: 'zkat' + }] + } + } + }, + { + term: '=zkat', + description: 'searches maintainers unambiguously by =name', + location: 154, + inject: { + bar: { name: 'bar', description: 'zkat thing', version: '1.0.0' }, + cool: { + name: 'cool', + version: '5.0.0', + maintainers: [{ + name: 'zkat' + }] + } + } + }, + { + term: 'github.com', + description: 'searches projects by url', + location: 205, + inject: { + bar: { + name: 'bar', + url: 'gitlab.com/bar', + // For historical reasons, `url` is only present if `versions` is there + versions: ['1.0.0'], + version: '1.0.0' + }, + cool: { + name: 'cool', + version: '5.0.0', + versions: ['1.0.0'], + url: 'github.com/cool/cool' + } + } + }, + { + term: 'monad', + description: 'searches projects by keywords', + location: 197, + inject: { + cool: { + name: 'cool', + version: '5.0.0', + keywords: ['monads'] + } + } + } +] + +// These test classic hand-matched searches +searches.forEach(function (search) { + test(search.description, function (t) { + setup() + server.get('/-/v1/search?text=' + encodeURIComponent(search.term) + '&size=20').once().reply(404, {}) + var now = Date.now() + var cacheContents = { + '_updated': now, + bar: { name: 'bar', version: '1.0.0' }, + cool: { name: 'cool', version: '5.0.0' }, + foo: { name: 'foo', version: '2.0.0' }, + other: { name: 'other', version: '1.0.0' } + } + for (var k in search.inject) { + cacheContents[k] = search.inject[k] + } + var fixture = new Tacks(File(cacheContents)) + fixture.create(cachePath) + common.npm([ + 'search', search.term, + '--registry', common.registry, + '--cache', CACHE_DIR, + '--loglevel', 'error', + '--color', 'always' + ].concat(search.extraOpts || []), + {}, + function (err, code, stdout, stderr) { + t.equal(stderr, '', 'no error output') + t.notEqual(stdout, '', 'got output') + t.equal(code, 0, 'search finished successfully') + t.ifErr(err, 'search finished successfully') + // \033 == \u001B + var markStart = '\u001B\\[[0-9][0-9]m' + var markEnd = '\u001B\\[0m' + + var re = new RegExp(markStart + '.*?' + markEnd) + + var cnt = stdout.search(re) + t.equal( + cnt, + search.location, + search.description + ' search for ' + search.term + ) + t.end() + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + server.close() + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(cacheBase) +} + +function cleanup () { + server.done() + process.chdir(osenv.tmpdir()) + rimraf.sync(PKG_DIR) +} diff --git a/deps/npm/test/tap/search.esearch.js b/deps/npm/test/tap/search.esearch.js new file mode 100644 index 0000000000..d892aec957 --- /dev/null +++ b/deps/npm/test/tap/search.esearch.js @@ -0,0 +1,192 @@ +var common = require('../common-tap.js') +var finished = require('mississippi').finished +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var npm = require('../../') +var osenv = require('osenv') +var path = require('path') +var rimraf = require('rimraf') +var test = require('tap').test + +var SEARCH = '/-/v1/search' +var PKG_DIR = path.resolve(__dirname, 'create-entry-update-stream') +var CACHE_DIR = path.resolve(PKG_DIR, 'cache') + +var esearch = require('../../lib/search/esearch') + +var server + +function setup () { + cleanup() + mkdirp.sync(CACHE_DIR) + process.chdir(CACHE_DIR) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(PKG_DIR) +} + +test('setup', function (t) { + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + npm.load({ cache: CACHE_DIR, registry: common.registry }, function (err) { + t.ifError(err, 'npm loaded successfully') + server = s + t.pass('all set up') + t.done() + }) + }) +}) + +test('basic test', function (t) { + setup() + server.get(SEARCH + '?text=oo&size=1').once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'foo', version: '2.0.0' } } + ] + }) + var results = [] + var s = esearch({ + include: ['oo'], + limit: 1 + }) + t.ok(s, 'got a stream') + s.on('data', function (d) { + results.push(d) + }) + finished(s, function (err) { + if (err) { throw err } + t.ok(true, 'stream finished without error') + t.deepEquals(results, [{ + name: 'cool', + version: '1.0.0', + description: null, + maintainers: null, + keywords: null, + date: null + }, { + name: 'foo', + version: '2.0.0', + description: null, + maintainers: null, + keywords: null, + date: null + }]) + server.done() + t.done() + }) +}) + +test('only returns certain fields for each package', function (t) { + setup() + var date = new Date() + server.get(SEARCH + '?text=oo&size=1').once().reply(200, { + objects: [{ + package: { + name: 'cool', + version: '1.0.0', + description: 'desc', + maintainers: [ + {username: 'x', email: 'a@b.c'}, + {username: 'y', email: 'c@b.a'} + ], + keywords: ['a', 'b', 'c'], + date: date.toISOString(), + extra: 'lol' + } + }] + }) + var results = [] + var s = esearch({ + include: ['oo'], + limit: 1 + }) + t.ok(s, 'got a stream') + s.on('data', function (d) { + results.push(d) + }) + finished(s, function (err) { + if (err) { throw err } + t.ok(true, 'stream finished without error') + t.deepEquals(results, [{ + name: 'cool', + version: '1.0.0', + description: 'desc', + maintainers: [ + {username: 'x', email: 'a@b.c'}, + {username: 'y', email: 'c@b.a'} + ], + keywords: ['a', 'b', 'c'], + date: date + }]) + server.done() + t.done() + }) +}) + +test('accepts a limit option', function (t) { + setup() + server.get(SEARCH + '?text=oo&size=3').once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'cool', version: '1.0.0' } } + ] + }) + var results = 0 + var s = esearch({ + include: ['oo'], + limit: 3 + }) + s.on('data', function () { results++ }) + finished(s, function (err) { + if (err) { throw err } + t.ok(true, 'request sent with correct size') + t.equal(results, 2, 'behaves fine with fewer results than size') + server.done() + t.done() + }) +}) + +test('passes foo:bar syntax params directly', function (t) { + setup() + server.get(SEARCH + '?text=foo%3Abar&size=1').once().reply(200, { + objects: [] + }) + var s = esearch({ + include: ['foo:bar'], + limit: 1 + }) + s.on('data', function () {}) + finished(s, function (err) { + if (err) { throw err } + t.ok(true, 'request sent with correct params') + server.done() + t.done() + }) +}) + +test('space-separates and URI-encodes multiple search params', function (t) { + setup() + server.get(SEARCH + '?text=foo%20bar%3Abaz%20quux%3F%3D&size=1').once().reply(200, { + objects: [] + }) + var s = esearch({ + include: ['foo', 'bar:baz', 'quux?='], + limit: 1 + }) + s.on('data', function () {}) + finished(s, function (err) { + if (err) { throw err } + t.ok(true, 'request sent with correct params') + server.done() + t.done() + }) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.done() +}) diff --git a/deps/npm/test/tap/search.js b/deps/npm/test/tap/search.js index dcc46df78e..78436e1e29 100644 --- a/deps/npm/test/tap/search.js +++ b/deps/npm/test/tap/search.js @@ -1,5 +1,6 @@ var path = require('path') var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') var osenv = require('osenv') var rimraf = require('rimraf') var cacheFile = require('npm-cache-filename') @@ -14,28 +15,26 @@ var CACHE_DIR = path.resolve(PKG_DIR, 'cache') var cacheBase = cacheFile(CACHE_DIR)(common.registry + '/-/all') var cachePath = path.join(cacheBase, '.cache.json') +var server + test('setup', function (t) { - t.pass('all set up') - t.done() + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.pass('all set up') + t.done() + }) }) test('notifies when there are no results', function (t) { setup() - var now = Date.now() - var cacheContents = { - '_updated': now, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '1.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - } - var fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) + server.get('/-/v1/search?text=none&size=20').once().reply(200, { + objects: [] + }) common.npm([ - 'search', 'nomatcheswhatsoeverfromthis', + 'search', 'none', '--registry', common.registry, - '--loglevel', 'error', - '--cache', CACHE_DIR + '--loglevel', 'error' ], {}, function (err, code, stdout, stderr) { if (err) throw err t.equal(stderr, '', 'no error output') @@ -47,6 +46,8 @@ test('notifies when there are no results', function (t) { test('spits out a useful error when no cache nor network', function (t) { setup() + server.get('/-/v1/search?text=foo&size=20').once().reply(404, {}) + server.get('/-/all').many().reply(404, {}) var cacheContents = {} var fixture = new Tacks(File(cacheContents)) fixture.create(cachePath) @@ -54,6 +55,7 @@ test('spits out a useful error when no cache nor network', function (t) { 'search', 'foo', '--registry', common.registry, '--loglevel', 'silly', + '--json', '--fetch-retry-mintimeout', 0, '--fetch-retry-maxtimeout', 0, '--cache', CACHE_DIR @@ -68,16 +70,12 @@ test('spits out a useful error when no cache nor network', function (t) { test('can switch to JSON mode', function (t) { setup() - var now = Date.now() - var cacheContents = { - '_updated': now, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '1.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - } - var fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) + server.get('/-/v1/search?text=oo&size=20').once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'foo', version: '2.0.0' } } + ] + }) common.npm([ 'search', 'oo', '--json', @@ -86,30 +84,23 @@ test('can switch to JSON mode', function (t) { '--cache', CACHE_DIR ], {}, function (err, code, stdout, stderr) { if (err) throw err - t.deepEquals(JSON.parse(stdout), [ - { name: 'cool', version: '1.0.0' }, - { name: 'foo', version: '2.0.0' } - ], 'results returned as valid json') t.equal(stderr, '', 'no error output') t.equal(code, 0, 'search gives 0 error code even if no matches') + t.deepEquals(JSON.parse(stdout), [ + { name: 'cool', version: '1.0.0', date: null }, + { name: 'foo', version: '2.0.0', date: null } + ], 'results returned as valid json') t.done() }) }) test('JSON mode does not notify on empty', function (t) { setup() - var now = Date.now() - var cacheContents = { - '_updated': now, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '1.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - } - var fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) + server.get('/-/v1/search?text=oo&size=20').once().reply(200, { + objects: [] + }) common.npm([ - 'search', 'nomatcheswhatsoeverfromthis', + 'search', 'oo', '--json', '--registry', common.registry, '--loglevel', 'error', @@ -125,16 +116,12 @@ test('JSON mode does not notify on empty', function (t) { test('can switch to tab separated mode', function (t) { setup() - var now = Date.now() - var cacheContents = { - '_updated': now, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '1.0.0' }, - foo: { name: 'foo', description: 'this\thas\ttabs', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - } - var fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) + server.get('/-/v1/search?text=oo&size=20').once().reply(200, { + objects: [ + { package: { name: 'cool', version: '1.0.0' } }, + { package: { name: 'foo', description: 'this\thas\ttabs', version: '2.0.0' } } + ] + }) common.npm([ 'search', 'oo', '--parseable', @@ -152,18 +139,11 @@ test('can switch to tab separated mode', function (t) { test('tab mode does not notify on empty', function (t) { setup() - var now = Date.now() - var cacheContents = { - '_updated': now, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '1.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - } - var fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) + server.get('/-/v1/search?text=oo&size=20').once().reply(200, { + objects: [] + }) common.npm([ - 'search', 'nomatcheswhatsoeverfromthis', + 'search', 'oo', '--parseable', '--registry', common.registry, '--loglevel', 'error', @@ -192,163 +172,9 @@ test('no arguments provided should error', function (t) { }) }) -var searches = [ - { - term: 'cool', - description: 'non-regex search', - location: 103 - }, - { - term: '/cool/', - description: 'regex search', - location: 103 - }, - { - term: 'cool', - description: 'searches name field', - location: 103 - }, - { - term: 'ool', - description: 'excludes matches for --searchexclude', - location: 205, - inject: { - other: { name: 'other', description: 'this is a simple tool' } - }, - extraOpts: ['--searchexclude', 'cool'] - }, - { - term: 'neat lib', - description: 'searches description field', - location: 141, - inject: { - cool: { - name: 'cool', version: '5.0.0', description: 'this is a neat lib' - } - } - }, - { - term: 'foo', - description: 'skips description field with --no-description', - location: 80, - inject: { - cool: { - name: 'cool', version: '5.0.0', description: 'foo bar!' - } - }, - extraOpts: ['--no-description'] - }, - { - term: 'zkat', - description: 'searches maintainers by name', - location: 155, - inject: { - cool: { - name: 'cool', - version: '5.0.0', - maintainers: [{ - name: 'zkat' - }] - } - } - }, - { - term: '=zkat', - description: 'searches maintainers unambiguously by =name', - location: 154, - inject: { - bar: { name: 'bar', description: 'zkat thing', version: '1.0.0' }, - cool: { - name: 'cool', - version: '5.0.0', - maintainers: [{ - name: 'zkat' - }] - } - } - }, - { - term: 'github.com', - description: 'searches projects by url', - location: 205, - inject: { - bar: { - name: 'bar', - url: 'gitlab.com/bar', - // For historical reasons, `url` is only present if `versions` is there - versions: ['1.0.0'], - version: '1.0.0' - }, - cool: { - name: 'cool', - version: '5.0.0', - versions: ['1.0.0'], - url: 'github.com/cool/cool' - } - } - }, - { - term: 'monad', - description: 'searches projects by keywords', - location: 197, - inject: { - cool: { - name: 'cool', - version: '5.0.0', - keywords: ['monads'] - } - } - } -] - -searches.forEach(function (search) { - test(search.description, function (t) { - setup() - var now = Date.now() - var cacheContents = { - '_updated': now, - bar: { name: 'bar', version: '1.0.0' }, - cool: { name: 'cool', version: '5.0.0' }, - foo: { name: 'foo', version: '2.0.0' }, - other: { name: 'other', version: '1.0.0' } - } - for (var k in search.inject) { - cacheContents[k] = search.inject[k] - } - var fixture = new Tacks(File(cacheContents)) - fixture.create(cachePath) - common.npm([ - 'search', search.term, - '--registry', common.registry, - '--cache', CACHE_DIR, - '--loglevel', 'error', - '--color', 'always' - ].concat(search.extraOpts || []), - {}, - function (err, code, stdout, stderr) { - t.equal(stderr, '', 'no error output') - t.notEqual(stdout, '', 'got output') - t.equal(code, 0, 'search finished successfully') - t.ifErr(err, 'search finished successfully') - // \033 == \u001B - var markStart = '\u001B\\[[0-9][0-9]m' - var markEnd = '\u001B\\[0m' - - var re = new RegExp(markStart + '.*?' + markEnd) - - var cnt = stdout.search(re) - t.equal( - cnt, - search.location, - search.description + ' search for ' + search.term - ) - t.end() - }) - }) -}) - test('cleanup', function (t) { cleanup() + server.close() t.end() }) @@ -358,6 +184,7 @@ function setup () { } function cleanup () { + server.done() process.chdir(osenv.tmpdir()) rimraf.sync(PKG_DIR) } From 8a639bb6965658f526950ca787c8d28bca93e608 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Wed, 22 Mar 2017 16:11:58 -0700 Subject: [PATCH 051/198] doc: update collaborator email address Per email conversation with Shigeki Ohtsu, updating email address in docs. The current listed email address does not work anymore. PR-URL: https://github.com/nodejs/node/pull/11996 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Shigeki Ohtsu --- .mailmap | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.mailmap b/.mailmap index 36324c6aa2..722995b6b0 100644 --- a/.mailmap +++ b/.mailmap @@ -143,7 +143,7 @@ San-Tai Hsu Scott Blomquist Sergey Kryzhanovsky Shannen Saez -Shigeki Ohtsu +Shigeki Ohtsu Siddharth Mahendraker Simon Willison Stanislav Opichal diff --git a/README.md b/README.md index e2d66b90be..fdbbb16f82 100644 --- a/README.md +++ b/README.md @@ -185,7 +185,7 @@ more information about the governance of the Node.js project, see * [rvagg](https://github.com/rvagg) - **Rod Vagg** <rod@vagg.org> * [shigeki](https://github.com/shigeki) - -**Shigeki Ohtsu** <ohtsu@iij.ad.jp> (he/him) +**Shigeki Ohtsu** <ohtsu@ohtsu.org> (he/him) * [targos](https://github.com/targos) - **Michaël Zasso** <targos@protonmail.com> (he/him) * [thefourtheye](https://github.com/thefourtheye) - From 2dff3a22feefe173c2c44574fd3cf312f79ee3b2 Mon Sep 17 00:00:00 2001 From: Vse Mozhet Byt Date: Tue, 21 Mar 2017 02:58:54 +0200 Subject: [PATCH 052/198] test: do not use `more` command on Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/11953 Fixes: https://github.com/nodejs/node/issues/11469 Reviewed-By: João Reis Reviewed-By: Gibson Fahnestock Reviewed-By: Michael Dawson Reviewed-By: Rich Trott --- test/README.md | 12 ---------- test/common.js | 22 ------------------- .../test-child-process-spawn-shell.js | 2 +- .../test-child-process-spawnsync-shell.js | 2 +- test/parallel/test-child-process-stdin.js | 8 ++----- .../test-child-process-stdio-inherit.js | 4 ++-- test/parallel/test-child-process-stdio.js | 3 ++- 7 files changed, 8 insertions(+), 45 deletions(-) diff --git a/test/README.md b/test/README.md index 653f78cc6d..ae54942062 100644 --- a/test/README.md +++ b/test/README.md @@ -376,24 +376,12 @@ Path to the 'root' directory. either `/` or `c:\\` (windows) Logs '1..0 # Skipped: ' + `msg` -### spawnCat(options) -* `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) -* return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) - -Platform normalizes the `cat` command. - ### spawnPwd(options) * `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) * return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) Platform normalizes the `pwd` command. -### spawnSyncCat(options) -* `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) -* return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) - -Synchronous version of `spawnCat`. - ### spawnSyncPwd(options) * `options` [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) * return [<Object>](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) diff --git a/test/common.js b/test/common.js index 8f19efd900..eedc537d1d 100644 --- a/test/common.js +++ b/test/common.js @@ -261,28 +261,6 @@ exports.ddCommand = function(filename, kilobytes) { }; -exports.spawnCat = function(options) { - const spawn = require('child_process').spawn; - - if (exports.isWindows) { - return spawn('more', [], options); - } else { - return spawn('cat', [], options); - } -}; - - -exports.spawnSyncCat = function(options) { - const spawnSync = require('child_process').spawnSync; - - if (exports.isWindows) { - return spawnSync('more', [], options); - } else { - return spawnSync('cat', [], options); - } -}; - - exports.spawnPwd = function(options) { const spawn = require('child_process').spawn; diff --git a/test/parallel/test-child-process-spawn-shell.js b/test/parallel/test-child-process-spawn-shell.js index 444d1eb063..e9dd0e07ef 100644 --- a/test/parallel/test-child-process-spawn-shell.js +++ b/test/parallel/test-child-process-spawn-shell.js @@ -34,7 +34,7 @@ echo.on('close', common.mustCall((code, signal) => { })); // Verify that shell features can be used -const cmd = common.isWindows ? 'echo bar | more' : 'echo bar | cat'; +const cmd = 'echo bar | cat'; const command = cp.spawn(cmd, { encoding: 'utf8', shell: true diff --git a/test/parallel/test-child-process-spawnsync-shell.js b/test/parallel/test-child-process-spawnsync-shell.js index 1d92767a8b..9e03ee126f 100644 --- a/test/parallel/test-child-process-spawnsync-shell.js +++ b/test/parallel/test-child-process-spawnsync-shell.js @@ -23,7 +23,7 @@ assert.strictEqual(echo.args[echo.args.length - 1].replace(/"/g, ''), assert.strictEqual(echo.stdout.toString().trim(), 'foo'); // Verify that shell features can be used -const cmd = common.isWindows ? 'echo bar | more' : 'echo bar | cat'; +const cmd = 'echo bar | cat'; const command = cp.spawnSync(cmd, {shell: true}); assert.strictEqual(command.stdout.toString().trim(), 'bar'); diff --git a/test/parallel/test-child-process-stdin.js b/test/parallel/test-child-process-stdin.js index 4f5352438d..8a0a2bcfae 100644 --- a/test/parallel/test-child-process-stdin.js +++ b/test/parallel/test-child-process-stdin.js @@ -25,7 +25,7 @@ const assert = require('assert'); const spawn = require('child_process').spawn; -const cat = spawn(common.isWindows ? 'more' : 'cat'); +const cat = spawn('cat'); cat.stdin.write('hello'); cat.stdin.write(' '); cat.stdin.write('world'); @@ -54,9 +54,5 @@ cat.on('exit', common.mustCall(function(status) { })); cat.on('close', common.mustCall(function() { - if (common.isWindows) { - assert.strictEqual('hello world\r\n', response); - } else { - assert.strictEqual('hello world', response); - } + assert.strictEqual('hello world', response); })); diff --git a/test/parallel/test-child-process-stdio-inherit.js b/test/parallel/test-child-process-stdio-inherit.js index 4318ba3ee1..b77391d87d 100644 --- a/test/parallel/test-child-process-stdio-inherit.js +++ b/test/parallel/test-child-process-stdio-inherit.js @@ -20,7 +20,7 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. 'use strict'; -const common = require('../common'); +require('../common'); const assert = require('assert'); const spawn = require('child_process').spawn; @@ -52,5 +52,5 @@ function grandparent() { function parent() { // should not immediately exit. - common.spawnCat({ stdio: 'inherit' }); + spawn('cat', [], { stdio: 'inherit' }); } diff --git a/test/parallel/test-child-process-stdio.js b/test/parallel/test-child-process-stdio.js index b7193b2f59..00c002e89d 100644 --- a/test/parallel/test-child-process-stdio.js +++ b/test/parallel/test-child-process-stdio.js @@ -22,6 +22,7 @@ 'use strict'; const common = require('../common'); const assert = require('assert'); +const spawnSync = require('child_process').spawnSync; let options = {stdio: ['pipe']}; let child = common.spawnPwd(options); @@ -36,7 +37,7 @@ assert.strictEqual(child.stdout, null); assert.strictEqual(child.stderr, null); options = {stdio: 'ignore'}; -child = common.spawnSyncCat(options); +child = spawnSync('cat', [], options); assert.deepStrictEqual(options, {stdio: 'ignore'}); assert.throws(() => { From ee19e2923acc806fc37cabceb03460fb88c95def Mon Sep 17 00:00:00 2001 From: Joyee Cheung Date: Mon, 20 Mar 2017 14:18:37 +0800 Subject: [PATCH 053/198] url: show input in parse error message PR-URL: https://github.com/nodejs/node/pull/11934 Reviewed-By: James M Snell Reviewed-By: Colin Ihrig Reviewed-By: Timothy Gu Reviewed-By: Anna Henningsen Reviewed-By: Daijiro Wachi --- lib/internal/url.js | 24 ++++------- src/node_url.cc | 52 ++++++++++++++---------- src/node_url.h | 10 +++++ test/parallel/test-whatwg-url-parsing.js | 31 ++++++++++---- 4 files changed, 71 insertions(+), 46 deletions(-) diff --git a/lib/internal/url.js b/lib/internal/url.js index 040771c228..7a6ff227ed 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -99,8 +99,6 @@ class TupleOrigin { function onParseComplete(flags, protocol, username, password, host, port, path, query, fragment) { - if (flags & binding.URL_FLAGS_FAILED) - throw new TypeError('Invalid URL'); var ctx = this[context]; ctx.flags = flags; ctx.scheme = protocol; @@ -118,19 +116,23 @@ function onParseComplete(flags, protocol, username, password, initSearchParams(this[searchParams], query); } +function onParseError(flags, input) { + const error = new TypeError('Invalid URL: ' + input); + error.input = input; + throw error; +} + // Reused by URL constructor and URL#href setter. function parse(url, input, base) { const base_context = base ? base[context] : undefined; url[context] = new StorageObject(); binding.parse(input.trim(), -1, base_context, undefined, - onParseComplete.bind(url)); + onParseComplete.bind(url), onParseError); } function onParseProtocolComplete(flags, protocol, username, password, host, port, path, query, fragment) { - if (flags & binding.URL_FLAGS_FAILED) - return; const newIsSpecial = (flags & binding.URL_FLAGS_SPECIAL) !== 0; const s = this[special]; const ctx = this[context]; @@ -159,8 +161,6 @@ function onParseProtocolComplete(flags, protocol, username, password, function onParseHostComplete(flags, protocol, username, password, host, port, path, query, fragment) { - if (flags & binding.URL_FLAGS_FAILED) - return; const ctx = this[context]; if (host) { ctx.host = host; @@ -174,8 +174,6 @@ function onParseHostComplete(flags, protocol, username, password, function onParseHostnameComplete(flags, protocol, username, password, host, port, path, query, fragment) { - if (flags & binding.URL_FLAGS_FAILED) - return; const ctx = this[context]; if (host) { ctx.host = host; @@ -187,15 +185,11 @@ function onParseHostnameComplete(flags, protocol, username, password, function onParsePortComplete(flags, protocol, username, password, host, port, path, query, fragment) { - if (flags & binding.URL_FLAGS_FAILED) - return; this[context].port = port; } function onParsePathComplete(flags, protocol, username, password, host, port, path, query, fragment) { - if (flags & binding.URL_FLAGS_FAILED) - return; const ctx = this[context]; if (path) { ctx.path = path; @@ -207,16 +201,12 @@ function onParsePathComplete(flags, protocol, username, password, function onParseSearchComplete(flags, protocol, username, password, host, port, path, query, fragment) { - if (flags & binding.URL_FLAGS_FAILED) - return; const ctx = this[context]; ctx.query = query; } function onParseHashComplete(flags, protocol, username, password, host, port, path, query, fragment) { - if (flags & binding.URL_FLAGS_FAILED) - return; const ctx = this[context]; if (fragment) { ctx.fragment = fragment; diff --git a/src/node_url.cc b/src/node_url.cc index ba3ceec6ac..6cd78c2c6c 100644 --- a/src/node_url.cc +++ b/src/node_url.cc @@ -1233,7 +1233,8 @@ namespace url { enum url_parse_state state_override, Local base_obj, Local context_obj, - Local cb) { + Local cb, + Local error_cb) { Isolate* isolate = env->isolate(); Local context = env->context(); HandleScope handle_scope(isolate); @@ -1254,20 +1255,19 @@ namespace url { // Define the return value placeholders const Local undef = Undefined(isolate); - Local argv[9] = { - undef, - undef, - undef, - undef, - undef, - undef, - undef, - undef, - undef, - }; - - argv[ARG_FLAGS] = Integer::NewFromUnsigned(isolate, url.flags); if (!(url.flags & URL_FLAGS_FAILED)) { + Local argv[9] = { + undef, + undef, + undef, + undef, + undef, + undef, + undef, + undef, + undef, + }; + argv[ARG_FLAGS] = Integer::NewFromUnsigned(isolate, url.flags); if (url.flags & URL_FLAGS_HAS_SCHEME) argv[ARG_PROTOCOL] = OneByteString(isolate, url.scheme.c_str()); if (url.flags & URL_FLAGS_HAS_USERNAME) @@ -1284,22 +1284,31 @@ namespace url { argv[ARG_PORT] = Integer::New(isolate, url.port); if (url.flags & URL_FLAGS_HAS_PATH) argv[ARG_PATH] = Copy(env, url.path); + (void)cb->Call(context, recv, arraysize(argv), argv); + } else if (error_cb->IsFunction()) { + Local argv[2] = { undef, undef }; + argv[ERR_ARG_FLAGS] = Integer::NewFromUnsigned(isolate, url.flags); + argv[ERR_ARG_INPUT] = + String::NewFromUtf8(env->isolate(), + input, + v8::NewStringType::kNormal).ToLocalChecked(); + (void)error_cb.As()->Call(context, recv, arraysize(argv), argv); } - - (void)cb->Call(context, recv, 9, argv); } static void Parse(const FunctionCallbackInfo& args) { Environment* env = Environment::GetCurrent(args); CHECK_GE(args.Length(), 5); - CHECK(args[0]->IsString()); - CHECK(args[2]->IsUndefined() || + CHECK(args[0]->IsString()); // input + CHECK(args[2]->IsUndefined() || // base context args[2]->IsNull() || args[2]->IsObject()); - CHECK(args[3]->IsUndefined() || + CHECK(args[3]->IsUndefined() || // context args[3]->IsNull() || args[3]->IsObject()); - CHECK(args[4]->IsFunction()); + CHECK(args[4]->IsFunction()); // complete callback + CHECK(args[5]->IsUndefined() || args[5]->IsFunction()); // error callback + Utf8Value input(env->isolate(), args[0]); enum url_parse_state state_override = kUnknownState; if (args[1]->IsNumber()) { @@ -1312,7 +1321,8 @@ namespace url { state_override, args[2], args[3], - args[4].As()); + args[4].As(), + args[5]); } static void EncodeAuthSet(const FunctionCallbackInfo& args) { diff --git a/src/node_url.h b/src/node_url.h index 49f6de866d..b9d91782be 100644 --- a/src/node_url.h +++ b/src/node_url.h @@ -463,6 +463,10 @@ static inline void PercentDecode(const char* input, XX(ARG_QUERY) \ XX(ARG_FRAGMENT) +#define ERR_ARGS(XX) \ + XX(ERR_ARG_FLAGS) \ + XX(ERR_ARG_INPUT) \ + static const char kEOL = -1; enum url_parse_state { @@ -484,6 +488,12 @@ enum url_cb_args { #undef XX }; +enum url_error_cb_args { +#define XX(name) name, + ERR_ARGS(XX) +#undef XX +} url_error_cb_args; + static inline bool IsSpecial(std::string scheme) { #define XX(name, _) if (scheme == name) return true; SPECIALS(XX); diff --git a/test/parallel/test-whatwg-url-parsing.js b/test/parallel/test-whatwg-url-parsing.js index e4f8306ead..4d04c3194e 100644 --- a/test/parallel/test-whatwg-url-parsing.js +++ b/test/parallel/test-whatwg-url-parsing.js @@ -13,15 +13,30 @@ if (!common.hasIntl) { // Tests below are not from WPT. const tests = require(path.join(common.fixturesDir, 'url-tests')); +const failureTests = tests.filter((test) => test.failure).concat([ + { input: '' }, + { input: 'test' }, + { input: undefined }, + { input: 0 }, + { input: true }, + { input: false }, + { input: null }, + { input: new Date() }, + { input: new RegExp() }, + { input: () => {} } +]); -for (const test of tests) { - if (typeof test === 'string') - continue; - - if (test.failure) { - assert.throws(() => new URL(test.input, test.base), - /^TypeError: Invalid URL$/); - } +for (const test of failureTests) { + assert.throws( + () => new URL(test.input, test.base), + (error) => { + // The input could be processed, so we don't do strict matching here + const match = (error + '').match(/^TypeError: Invalid URL: (.*)$/); + if (!match) { + return false; + } + return error.input === match[1]; + }); } const additional_tests = require( From 348cc80a3cbf0f4271ed30418c6ed661bdeede7b Mon Sep 17 00:00:00 2001 From: ghaiklor Date: Sun, 27 Mar 2016 16:09:08 +0300 Subject: [PATCH 054/198] tls: make rejectUnauthorized default to true rejectUnauthorized used to be false when the property was undefined or null, quietly allowing client connections for which certificates have been requested (requestCert is true) even when the client certificate was not authorized (signed by a trusted CA). Change this so rejectUnauthorized is always true unless it is explicitly set to false. PR-URL: https://github.com/nodejs/node/pull/5923 Reviewed-By: Sam Roberts Reviewed-By: James M Snell Reviewed-By: Ben Noordhuis Reviewed-By: Colin Ihrig --- doc/api/tls.md | 16 +++++++++------- lib/_tls_wrap.js | 15 +++------------ test/parallel/test-https-foafssl.js | 3 ++- test/parallel/test-tls-session-cache.js | 3 ++- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/doc/api/tls.md b/doc/api/tls.md index 94281dd3f0..468a1b4eb8 100644 --- a/doc/api/tls.md +++ b/doc/api/tls.md @@ -712,7 +712,10 @@ added: v0.11.8 --> * `options` {Object} - * `rejectUnauthorized` {boolean} + * `rejectUnauthorized` {boolean} If not `false`, the server certificate is verified + against the list of supplied CAs. An `'error'` event is emitted if + verification fails; `err.code` contains the OpenSSL error code. Defaults to + `true`. * `requestCert` * `callback` {Function} A function that will be called when the renegotiation request has been completed. @@ -769,7 +772,7 @@ changes: connection/disconnection/destruction of `socket` is the user's responsibility, calling `tls.connect()` will not cause `net.connect()` to be called. - * `rejectUnauthorized` {boolean} If `true`, the server certificate is verified + * `rejectUnauthorized` {boolean} If not `false`, the server certificate is verified against the list of supplied CAs. An `'error'` event is emitted if verification fails; `err.code` contains the OpenSSL error code. Defaults to `true`. @@ -1012,9 +1015,9 @@ changes: * `requestCert` {boolean} If `true` the server will request a certificate from clients that connect and attempt to verify that certificate. Defaults to `false`. - * `rejectUnauthorized` {boolean} If `true` the server will reject any + * `rejectUnauthorized` {boolean} If not `false` the server will reject any connection which is not authorized with the list of supplied CAs. This - option only has an effect if `requestCert` is `true`. Defaults to `false`. + option only has an effect if `requestCert` is `true`. Defaults to `true`. * `NPNProtocols` {string[]|Buffer} An array of strings or a `Buffer` naming possible NPN protocols. (Protocols should be ordered by their priority.) * `ALPNProtocols` {string[]|Buffer} An array of strings or a `Buffer` naming @@ -1190,9 +1193,8 @@ changes: opened as a server. * `requestCert` {boolean} `true` to specify whether a server should request a certificate from a connecting client. Only applies when `isServer` is `true`. -* `rejectUnauthorized` {boolean} `true` to specify whether a server should - automatically reject clients with invalid certificates. Only applies when - `isServer` is `true`. +* `rejectUnauthorized` {boolean} If not `false` a server automatically reject clients + with invalid certificates. Only applies when `isServer` is `true`. * `options` * `secureContext`: An optional TLS context object from [`tls.createSecureContext()`][] diff --git a/lib/_tls_wrap.js b/lib/_tls_wrap.js index e1767c5e67..288f82e05b 100644 --- a/lib/_tls_wrap.js +++ b/lib/_tls_wrap.js @@ -920,17 +920,8 @@ Server.prototype.setTicketKeys = function setTicketKeys(keys) { Server.prototype.setOptions = function(options) { - if (typeof options.requestCert === 'boolean') { - this.requestCert = options.requestCert; - } else { - this.requestCert = false; - } - - if (typeof options.rejectUnauthorized === 'boolean') { - this.rejectUnauthorized = options.rejectUnauthorized; - } else { - this.rejectUnauthorized = false; - } + this.requestCert = options.requestCert === true; + this.rejectUnauthorized = options.rejectUnauthorized !== false; if (options.pfx) this.pfx = options.pfx; if (options.key) this.key = options.key; @@ -1062,7 +1053,7 @@ exports.connect = function(...args /* [port,] [host,] [options,] [cb] */) { secureContext: context, isServer: false, requestCert: true, - rejectUnauthorized: options.rejectUnauthorized, + rejectUnauthorized: options.rejectUnauthorized !== false, session: options.session, NPNProtocols: NPN.NPNProtocols, ALPNProtocols: ALPN.ALPNProtocols, diff --git a/test/parallel/test-https-foafssl.js b/test/parallel/test-https-foafssl.js index 8b711b81fe..661b196152 100644 --- a/test/parallel/test-https-foafssl.js +++ b/test/parallel/test-https-foafssl.js @@ -42,7 +42,8 @@ const https = require('https'); const options = { key: fs.readFileSync(common.fixturesDir + '/agent.key'), cert: fs.readFileSync(common.fixturesDir + '/agent.crt'), - requestCert: true + requestCert: true, + rejectUnauthorized: false }; const modulus = 'A6F44A9C25791431214F5C87AF9E040177A8BB89AC803F7E09BBC3A5519F' + diff --git a/test/parallel/test-tls-session-cache.js b/test/parallel/test-tls-session-cache.js index f555da842b..887c36d4c5 100644 --- a/test/parallel/test-tls-session-cache.js +++ b/test/parallel/test-tls-session-cache.js @@ -56,7 +56,8 @@ function doTest(testOptions, callback) { key: key, cert: cert, ca: [cert], - requestCert: true + requestCert: true, + rejectUnauthorized: false }; let requestCount = 0; let resumeCount = 0; From cb6c0c14eb58fb0660bc429cce37ef7e519ad06d Mon Sep 17 00:00:00 2001 From: Richard Lau Date: Fri, 24 Mar 2017 08:27:38 -0400 Subject: [PATCH 055/198] doc: add richardlau to collaborators PR-URL: https://github.com/nodejs/node/pull/12020 Reviewed-By: Ben Noordhuis Reviewed-By: Daniel Bevenius Reviewed-By: Evan Lucas Reviewed-By: Gibson Fahnestock Reviewed-By: Yuta Hiroto --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fdbbb16f82..2144742ea7 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,8 @@ more information about the governance of the Node.js project, see **Prince John Wesley** <princejohnwesley@gmail.com> * [qard](https://github.com/qard) - **Stephen Belanger** <admin@stephenbelanger.com> (he/him) +* [richardlau](https://github.com/richardlau) - +**Richard Lau** <riclau@uk.ibm.com> * [rlidwka](https://github.com/rlidwka) - **Alex Kocharin** <alex@kocharin.ru> * [rmg](https://github.com/rmg) - From a8a042a6d336af816461fc26fe0527a68b68f3aa Mon Sep 17 00:00:00 2001 From: Morgan Brenner Date: Wed, 22 Mar 2017 15:23:00 -0400 Subject: [PATCH 056/198] build: add lint option to vcbuild.bat help PR-URL: https://github.com/nodejs/node/pull/11992 Fixes: https://github.com/nodejs/node/issues/11971 Reviewed-By: Gibson Fahnestock Reviewed-By: Vse Mozhet Byt Reviewed-By: James M Snell Reviewed-By: Richard Lau Reviewed-By: Colin Ihrig --- vcbuild.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vcbuild.bat b/vcbuild.bat index e4c5276bf2..9cbac9088f 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -417,7 +417,7 @@ echo Failed to create vc project files. goto exit :help -echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [sign] [x86/x64] [vc2015] [download-all] [enable-vtune] +echo vcbuild.bat [debug/release] [msi] [test-all/test-uv/test-inspector/test-internet/test-pummel/test-simple/test-message] [clean] [noprojgen] [small-icu/full-icu/without-intl] [nobuild] [sign] [x86/x64] [vc2015] [download-all] [enable-vtune] [lint/lint-ci] echo Examples: echo vcbuild.bat : builds release build echo vcbuild.bat debug : builds debug build From 6a09a69ec9d36b705e9bde2ac1a193566a702d96 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Tue, 18 Oct 2016 16:41:26 +0200 Subject: [PATCH 057/198] build: enable cctest to use generated objects This commit tries to make it simpler to add unit tests (cctest) for code that needs to test node core funtionality but that might not be appropriate as an addon or a JavaScript test. An example of this could be adding functionality targeted for situations when Node itself is embedded. Currently it was not as easy, or efficient, as one would have hoped to add such tests. The object output directories vary for different operating systems which we need to link to so that we don't have an additional compilation step. PR-URL: https://github.com/nodejs/node/pull/11956 Ref: https://github.com/nodejs/node/pull/9163 Reviewed-By: James M Snell --- common.gypi | 6 +- node.gyp | 431 +++++--------------------- node.gypi | 332 ++++++++++++++++++++ test/cctest/node_test_fixture.cc | 2 + test/cctest/node_test_fixture.h | 85 +++++ test/cctest/{util.cc => test_util.cc} | 4 - tools/gyp/pylib/gyp/generator/make.py | 2 +- 7 files changed, 505 insertions(+), 357 deletions(-) create mode 100644 node.gypi create mode 100644 test/cctest/node_test_fixture.cc create mode 100644 test/cctest/node_test_fixture.h rename test/cctest/{util.cc => test_util.cc} (99%) diff --git a/common.gypi b/common.gypi index 147cc70fa5..224498b431 100644 --- a/common.gypi +++ b/common.gypi @@ -38,6 +38,8 @@ ['OS == "win"', { 'os_posix': 0, 'v8_postmortem_support%': 'false', + 'OBJ_DIR': '<(PRODUCT_DIR)/obj', + 'V8_BASE': '<(PRODUCT_DIR)/lib/v8_libbase.lib', }, { 'os_posix': 1, 'v8_postmortem_support%': 'true', @@ -51,8 +53,8 @@ 'OBJ_DIR': '<(PRODUCT_DIR)/obj', 'V8_BASE': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a', }, { - 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target', - 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a', + 'OBJ_DIR%': '<(PRODUCT_DIR)/obj.target', + 'V8_BASE%': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a', }], ], }], diff --git a/node.gyp b/node.gyp index 637a193428..2652ecc63b 100644 --- a/node.gyp +++ b/node.gyp @@ -145,6 +145,10 @@ 'node_js2c#host', ], + 'includes': [ + 'node.gypi' + ], + 'include_dirs': [ 'src', 'tools/msvs/genfiles', @@ -259,338 +263,6 @@ # Warn when using deprecated V8 APIs. 'V8_DEPRECATION_WARNINGS=1', ], - - - 'conditions': [ - [ 'node_shared=="false"', { - 'msvs_settings': { - 'VCManifestTool': { - 'EmbedManifest': 'true', - 'AdditionalManifestFiles': 'src/res/node.exe.extra.manifest' - } - }, - }, { - 'defines': [ - 'NODE_SHARED_MODE', - ], - 'conditions': [ - [ 'node_module_version!="" and OS!="win"', { - 'product_extension': '<(shlib_suffix)', - }] - ], - }], - [ 'node_enable_d8=="true"', { - 'dependencies': [ 'deps/v8/src/d8.gyp:d8' ], - }], - [ 'node_use_bundled_v8=="true"', { - 'dependencies': [ - 'deps/v8/src/v8.gyp:v8', - 'deps/v8/src/v8.gyp:v8_libplatform' - ], - }], - [ 'node_use_v8_platform=="true"', { - 'defines': [ - 'NODE_USE_V8_PLATFORM=1', - ], - }, { - 'defines': [ - 'NODE_USE_V8_PLATFORM=0', - ], - }], - [ 'node_tag!=""', { - 'defines': [ 'NODE_TAG="<(node_tag)"' ], - }], - [ 'node_v8_options!=""', { - 'defines': [ 'NODE_V8_OPTIONS="<(node_v8_options)"'], - }], - # No node_main.cc for anything except executable - [ 'node_target_type!="executable"', { - 'sources!': [ - 'src/node_main.cc', - ], - }], - [ 'node_release_urlbase!=""', { - 'defines': [ - 'NODE_RELEASE_URLBASE="<(node_release_urlbase)"', - ] - }], - [ 'v8_enable_i18n_support==1', { - 'defines': [ 'NODE_HAVE_I18N_SUPPORT=1' ], - 'dependencies': [ - '<(icu_gyp_path):icui18n', - '<(icu_gyp_path):icuuc', - ], - 'conditions': [ - [ 'icu_small=="true"', { - 'defines': [ 'NODE_HAVE_SMALL_ICU=1' ], - }]], - }], - [ 'node_use_bundled_v8=="true" and \ - node_enable_v8_vtunejit=="true" and (target_arch=="x64" or \ - target_arch=="ia32" or target_arch=="x32")', { - 'defines': [ 'NODE_ENABLE_VTUNE_PROFILING' ], - 'dependencies': [ - 'deps/v8/src/third_party/vtune/v8vtune.gyp:v8_vtune' - ], - }], - [ 'v8_enable_inspector==1', { - 'defines': [ - 'HAVE_INSPECTOR=1', - ], - 'sources': [ - 'src/inspector_agent.cc', - 'src/inspector_socket.cc', - 'src/inspector_socket_server.cc', - 'src/inspector_agent.h', - 'src/inspector_socket.h', - 'src/inspector_socket_server.h', - ], - 'dependencies': [ - 'v8_inspector_compress_protocol_json#host', - ], - 'include_dirs': [ - '<(SHARED_INTERMEDIATE_DIR)/include', # for inspector - '<(SHARED_INTERMEDIATE_DIR)', - ], - }, { - 'defines': [ 'HAVE_INSPECTOR=0' ] - }], - [ 'node_use_openssl=="true"', { - 'defines': [ 'HAVE_OPENSSL=1' ], - 'sources': [ - 'src/node_crypto.cc', - 'src/node_crypto_bio.cc', - 'src/node_crypto_clienthello.cc', - 'src/node_crypto.h', - 'src/node_crypto_bio.h', - 'src/node_crypto_clienthello.h', - 'src/tls_wrap.cc', - 'src/tls_wrap.h' - ], - 'conditions': [ - ['openssl_fips != ""', { - 'defines': [ 'NODE_FIPS_MODE' ], - }], - [ 'node_shared_openssl=="false"', { - 'dependencies': [ - './deps/openssl/openssl.gyp:openssl', - - # For tests - './deps/openssl/openssl.gyp:openssl-cli', - ], - # Do not let unused OpenSSL symbols to slip away - 'conditions': [ - # -force_load or --whole-archive are not applicable for - # the static library - [ 'node_target_type!="static_library"', { - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-Wl,-force_load,<(PRODUCT_DIR)/<(OPENSSL_PRODUCT)', - ], - }, - 'conditions': [ - ['OS in "linux freebsd" and node_shared=="false"', { - 'ldflags': [ - '-Wl,--whole-archive,' - '<(OBJ_DIR)/deps/openssl/' - '<(OPENSSL_PRODUCT)', - '-Wl,--no-whole-archive', - ], - }], - # openssl.def is based on zlib.def, zlib symbols - # are always exported. - ['use_openssl_def==1', { - 'sources': ['<(SHARED_INTERMEDIATE_DIR)/openssl.def'], - }], - ['OS=="win" and use_openssl_def==0', { - 'sources': ['deps/zlib/win32/zlib.def'], - }], - ], - }], - ], - }]] - }, { - 'defines': [ 'HAVE_OPENSSL=0' ] - }], - [ 'node_use_dtrace=="true"', { - 'defines': [ 'HAVE_DTRACE=1' ], - 'dependencies': [ - 'node_dtrace_header', - 'specialize_node_d', - ], - 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ], - - # - # DTrace is supported on linux, solaris, mac, and bsd. There are - # three object files associated with DTrace support, but they're - # not all used all the time: - # - # node_dtrace.o all configurations - # node_dtrace_ustack.o not supported on mac and linux - # node_dtrace_provider.o All except OS X. "dtrace -G" is not - # used on OS X. - # - # Note that node_dtrace_provider.cc and node_dtrace_ustack.cc do not - # actually exist. They're listed here to trick GYP into linking the - # corresponding object files into the final "node" executable. These - # object files are generated by "dtrace -G" using custom actions - # below, and the GYP-generated Makefiles will properly build them when - # needed. - # - 'sources': [ 'src/node_dtrace.cc' ], - 'conditions': [ - [ 'OS=="linux"', { - 'sources': [ - '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o' - ], - }], - [ 'OS!="mac" and OS!="linux"', { - 'sources': [ - 'src/node_dtrace_ustack.cc', - 'src/node_dtrace_provider.cc', - ] - } - ] ] - } ], - [ 'node_use_lttng=="true"', { - 'defines': [ 'HAVE_LTTNG=1' ], - 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ], - 'libraries': [ '-llttng-ust' ], - 'sources': [ - 'src/node_lttng.cc' - ], - } ], - [ 'node_use_etw=="true"', { - 'defines': [ 'HAVE_ETW=1' ], - 'dependencies': [ 'node_etw' ], - 'sources': [ - 'src/node_win32_etw_provider.h', - 'src/node_win32_etw_provider-inl.h', - 'src/node_win32_etw_provider.cc', - 'src/node_dtrace.cc', - 'tools/msvs/genfiles/node_etw_provider.h', - 'tools/msvs/genfiles/node_etw_provider.rc', - ] - } ], - [ 'node_use_perfctr=="true"', { - 'defines': [ 'HAVE_PERFCTR=1' ], - 'dependencies': [ 'node_perfctr' ], - 'sources': [ - 'src/node_win32_perfctr_provider.h', - 'src/node_win32_perfctr_provider.cc', - 'src/node_counters.cc', - 'src/node_counters.h', - 'tools/msvs/genfiles/node_perfctr_provider.rc', - ] - } ], - [ 'node_no_browser_globals=="true"', { - 'defines': [ 'NODE_NO_BROWSER_GLOBALS' ], - } ], - [ 'node_use_bundled_v8=="true" and v8_postmortem_support=="true"', { - 'dependencies': [ 'deps/v8/src/v8.gyp:postmortem-metadata' ], - 'conditions': [ - # -force_load is not applicable for the static library - [ 'node_target_type!="static_library"', { - 'xcode_settings': { - 'OTHER_LDFLAGS': [ - '-Wl,-force_load,<(V8_BASE)', - ], - }, - }], - ], - }], - [ 'node_shared_zlib=="false"', { - 'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ], - }], - - [ 'node_shared_http_parser=="false"', { - 'dependencies': [ 'deps/http_parser/http_parser.gyp:http_parser' ], - }], - - [ 'node_shared_cares=="false"', { - 'dependencies': [ 'deps/cares/cares.gyp:cares' ], - }], - - [ 'node_shared_libuv=="false"', { - 'dependencies': [ 'deps/uv/uv.gyp:libuv' ], - }], - - [ 'OS=="win"', { - 'sources': [ - 'src/backtrace_win32.cc', - 'src/res/node.rc', - ], - 'defines!': [ - 'NODE_PLATFORM="win"', - ], - 'defines': [ - 'FD_SETSIZE=1024', - # we need to use node's preferred "win32" rather than gyp's preferred "win" - 'NODE_PLATFORM="win32"', - '_UNICODE=1', - ], - 'libraries': [ '-lpsapi.lib' ] - }, { # POSIX - 'defines': [ '__POSIX__' ], - 'sources': [ 'src/backtrace_posix.cc' ], - }], - [ 'OS=="mac"', { - # linking Corefoundation is needed since certain OSX debugging tools - # like Instruments require it for some features - 'libraries': [ '-framework CoreFoundation' ], - 'defines!': [ - 'NODE_PLATFORM="mac"', - ], - 'defines': [ - # we need to use node's preferred "darwin" rather than gyp's preferred "mac" - 'NODE_PLATFORM="darwin"', - ], - }], - [ 'OS=="freebsd"', { - 'libraries': [ - '-lutil', - '-lkvm', - ], - }], - [ 'OS=="aix"', { - 'defines': [ - '_LINUX_SOURCE_COMPAT', - ], - }], - [ 'OS=="solaris"', { - 'libraries': [ - '-lkstat', - '-lumem', - ], - 'defines!': [ - 'NODE_PLATFORM="solaris"', - ], - 'defines': [ - # we need to use node's preferred "sunos" - # rather than gyp's preferred "solaris" - 'NODE_PLATFORM="sunos"', - ], - }], - [ '(OS=="freebsd" or OS=="linux") and node_shared=="false" and coverage=="false"', { - 'ldflags': [ '-Wl,-z,noexecstack', - '-Wl,--whole-archive <(V8_BASE)', - '-Wl,--no-whole-archive' ] - }], - [ '(OS=="freebsd" or OS=="linux") and node_shared=="false" and coverage=="true"', { - 'ldflags': [ '-Wl,-z,noexecstack', - '-Wl,--whole-archive <(V8_BASE)', - '-Wl,--no-whole-archive', - '--coverage', - '-g', - '-O0' ], - 'cflags': [ '--coverage', - '-g', - '-O0' ] - }], - [ 'OS=="sunos"', { - 'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ], - }], - ], }, { 'target_name': 'mkssldef', @@ -888,12 +560,70 @@ { 'target_name': 'cctest', 'type': 'executable', - 'dependencies': [ 'deps/gtest/gtest.gyp:gtest' ], + + 'dependencies': [ + '<(node_core_target_name)', + 'deps/gtest/gtest.gyp:gtest', + 'node_js2c#host', + 'node_dtrace_header', + 'node_dtrace_ustack', + 'node_dtrace_provider', + ], + + 'variables': { + 'OBJ_PATH': '<(OBJ_DIR)/node/src', + 'OBJ_GEN_PATH': '<(OBJ_DIR)/node/gen', + 'OBJ_TRACING_PATH': '<(OBJ_DIR)/node/src/tracing', + 'OBJ_SUFFIX': 'o', + 'conditions': [ + ['OS=="win"', { + 'OBJ_PATH': '<(OBJ_DIR)/node', + 'OBJ_GEN_PATH': '<(OBJ_DIR)/node', + 'OBJ_TRACING_PATH': '<(OBJ_DIR)/node', + 'OBJ_SUFFIX': 'obj', + }], + ['OS=="aix"', { + 'OBJ_PATH': '<(OBJ_DIR)/node_base/src', + 'OBJ_GEN_PATH': '<(OBJ_DIR)/node_base/gen', + 'OBJ_TRACING_PATH': '<(OBJ_DIR)/node_base/src/tracing', + }], + ], + }, + + 'includes': [ + 'node.gypi' + ], + 'include_dirs': [ 'src', + 'tools/msvs/genfiles', 'deps/v8/include', - '<(SHARED_INTERMEDIATE_DIR)' + 'deps/cares/include', + 'deps/uv/include', + '<(SHARED_INTERMEDIATE_DIR)', # for node_natives.h + ], + + 'libraries': [ + '<(OBJ_GEN_PATH)/node_javascript.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/node_debug_options.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/async-wrap.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/env.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/node.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/node_buffer.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/node_i18n.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/debug-agent.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/util.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/string_bytes.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/string_search.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/stream_base.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/node_constants.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/node_revert.<(OBJ_SUFFIX)', + '<(OBJ_TRACING_PATH)/agent.<(OBJ_SUFFIX)', + '<(OBJ_TRACING_PATH)/node_trace_buffer.<(OBJ_SUFFIX)', + '<(OBJ_TRACING_PATH)/node_trace_writer.<(OBJ_SUFFIX)', + '<(OBJ_TRACING_PATH)/trace_event.<(OBJ_SUFFIX)', ], + 'defines': [ # gtest's ASSERT macros conflict with our own. 'GTEST_DONT_DEFINE_ASSERT_EQ=1', @@ -904,24 +634,18 @@ 'GTEST_DONT_DEFINE_ASSERT_NE=1', 'NODE_WANT_INTERNALS=1', ], + 'sources': [ - 'test/cctest/util.cc', + 'test/cctest/test_util.cc', + ], + + 'sources!': [ + 'src/node_main.cc' ], 'conditions': [ ['v8_enable_inspector==1', { - 'defines': [ - 'HAVE_INSPECTOR=1', - ], - 'dependencies': [ - 'v8_inspector_compress_protocol_json#host' - ], - 'include_dirs': [ - '<(SHARED_INTERMEDIATE_DIR)' - ], 'sources': [ - 'src/inspector_socket.cc', - 'src/inspector_socket_server.cc', 'test/cctest/test_inspector_socket.cc', 'test/cctest/test_inspector_socket_server.cc' ], @@ -953,12 +677,19 @@ 'deps/v8/src/v8.gyp:v8_libplatform', ], }], - [ 'node_use_bundled_v8=="true"', { - 'dependencies': [ - 'deps/v8/src/v8.gyp:v8', - 'deps/v8/src/v8.gyp:v8_libplatform' + [ 'node_use_dtrace=="true" and OS!="mac" and OS!="linux"', { + 'copies': [{ + 'destination': '<(OBJ_DIR)/cctest/src', + 'files': [ + '<(OBJ_PATH)/node_dtrace_ustack.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/node_dtrace_provider.<(OBJ_SUFFIX)', + '<(OBJ_PATH)/node_dtrace.<(OBJ_SUFFIX)', + ]}, ], }], + ['OS=="solaris"', { + 'ldflags': [ '-I<(SHARED_INTERMEDIATE_DIR)' ] + }], ] } ], # end targets diff --git a/node.gypi b/node.gypi new file mode 100644 index 0000000000..d78d24da8b --- /dev/null +++ b/node.gypi @@ -0,0 +1,332 @@ +{ + 'conditions': [ + [ 'node_shared=="false"', { + 'msvs_settings': { + 'VCManifestTool': { + 'EmbedManifest': 'true', + 'AdditionalManifestFiles': 'src/res/node.exe.extra.manifest' + } + }, + }, { + 'defines': [ + 'NODE_SHARED_MODE', + ], + 'conditions': [ + [ 'node_module_version!="" and OS!="win"', { + 'product_extension': '<(shlib_suffix)', + }] + ], + }], + [ 'node_enable_d8=="true"', { + 'dependencies': [ 'deps/v8/src/d8.gyp:d8' ], + }], + [ 'node_use_bundled_v8=="true"', { + 'dependencies': [ + 'deps/v8/src/v8.gyp:v8', + 'deps/v8/src/v8.gyp:v8_libplatform' + ], + }], + [ 'node_use_v8_platform=="true"', { + 'defines': [ + 'NODE_USE_V8_PLATFORM=1', + ], + }, { + 'defines': [ + 'NODE_USE_V8_PLATFORM=0', + ], + }], + [ 'node_tag!=""', { + 'defines': [ 'NODE_TAG="<(node_tag)"' ], + }], + [ 'node_v8_options!=""', { + 'defines': [ 'NODE_V8_OPTIONS="<(node_v8_options)"'], + }], + # No node_main.cc for anything except executable + [ 'node_target_type!="executable"', { + 'sources!': [ + 'src/node_main.cc', + ], + }], + [ 'node_release_urlbase!=""', { + 'defines': [ + 'NODE_RELEASE_URLBASE="<(node_release_urlbase)"', + ] + }], + [ 'v8_enable_i18n_support==1', { + 'defines': [ 'NODE_HAVE_I18N_SUPPORT=1' ], + 'dependencies': [ + '<(icu_gyp_path):icui18n', + '<(icu_gyp_path):icuuc', + ], + 'conditions': [ + [ 'icu_small=="true"', { + 'defines': [ 'NODE_HAVE_SMALL_ICU=1' ], + }]], + }], + [ 'node_use_bundled_v8=="true" and \ + node_enable_v8_vtunejit=="true" and (target_arch=="x64" or \ + target_arch=="ia32" or target_arch=="x32")', { + 'defines': [ 'NODE_ENABLE_VTUNE_PROFILING' ], + 'dependencies': [ + 'deps/v8/src/third_party/vtune/v8vtune.gyp:v8_vtune' + ], + }], + [ 'v8_enable_inspector==1', { + 'defines': [ + 'HAVE_INSPECTOR=1', + ], + 'sources': [ + 'src/inspector_agent.cc', + 'src/inspector_socket.cc', + 'src/inspector_socket_server.cc', + 'src/inspector_agent.h', + 'src/inspector_socket.h', + 'src/inspector_socket_server.h', + ], + 'dependencies': [ + 'v8_inspector_compress_protocol_json#host', + ], + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)/include', # for inspector + '<(SHARED_INTERMEDIATE_DIR)', + ], + }, { + 'defines': [ 'HAVE_INSPECTOR=0' ] + }], + [ 'node_use_openssl=="true"', { + 'defines': [ 'HAVE_OPENSSL=1' ], + 'sources': [ + 'src/node_crypto.cc', + 'src/node_crypto_bio.cc', + 'src/node_crypto_clienthello.cc', + 'src/node_crypto.h', + 'src/node_crypto_bio.h', + 'src/node_crypto_clienthello.h', + 'src/tls_wrap.cc', + 'src/tls_wrap.h' + ], + 'conditions': [ + ['openssl_fips != ""', { + 'defines': [ 'NODE_FIPS_MODE' ], + }], + [ 'node_shared_openssl=="false"', { + 'dependencies': [ + './deps/openssl/openssl.gyp:openssl', + + # For tests + './deps/openssl/openssl.gyp:openssl-cli', + ], + # Do not let unused OpenSSL symbols to slip away + 'conditions': [ + # -force_load or --whole-archive are not applicable for + # the static library + [ 'node_target_type!="static_library"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-force_load,<(PRODUCT_DIR)/<(OPENSSL_PRODUCT)', + ], + }, + 'conditions': [ + ['OS in "linux freebsd" and node_shared=="false"', { + 'ldflags': [ + '-Wl,--whole-archive,' + '<(OBJ_DIR)/deps/openssl/' + '<(OPENSSL_PRODUCT)', + '-Wl,--no-whole-archive', + ], + }], + # openssl.def is based on zlib.def, zlib symbols + # are always exported. + ['use_openssl_def==1', { + 'sources': ['<(SHARED_INTERMEDIATE_DIR)/openssl.def'], + }], + ['OS=="win" and use_openssl_def==0', { + 'sources': ['deps/zlib/win32/zlib.def'], + }], + ], + }], + ], + }]] + }, { + 'defines': [ 'HAVE_OPENSSL=0' ] + }], + [ 'node_use_dtrace=="true"', { + 'defines': [ 'HAVE_DTRACE=1' ], + 'dependencies': [ + 'node_dtrace_header', + 'specialize_node_d', + ], + 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ], + + # + # DTrace is supported on linux, solaris, mac, and bsd. There are + # three object files associated with DTrace support, but they're + # not all used all the time: + # + # node_dtrace.o all configurations + # node_dtrace_ustack.o not supported on mac and linux + # node_dtrace_provider.o All except OS X. "dtrace -G" is not + # used on OS X. + # + # Note that node_dtrace_provider.cc and node_dtrace_ustack.cc do not + # actually exist. They're listed here to trick GYP into linking the + # corresponding object files into the final "node" executable. These + # object files are generated by "dtrace -G" using custom actions + # below, and the GYP-generated Makefiles will properly build them when + # needed. + # + 'sources': [ 'src/node_dtrace.cc' ], + 'conditions': [ + [ 'OS=="linux"', { + 'sources': [ + '<(SHARED_INTERMEDIATE_DIR)/node_dtrace_provider.o' + ], + }], + [ 'OS!="mac" and OS!="linux"', { + 'sources': [ + 'src/node_dtrace_ustack.cc', + 'src/node_dtrace_provider.cc', + ] + } + ] ] + } ], + [ 'node_use_lttng=="true"', { + 'defines': [ 'HAVE_LTTNG=1' ], + 'include_dirs': [ '<(SHARED_INTERMEDIATE_DIR)' ], + 'libraries': [ '-llttng-ust' ], + 'sources': [ + 'src/node_lttng.cc' + ], + } ], + [ 'node_use_etw=="true"', { + 'defines': [ 'HAVE_ETW=1' ], + 'dependencies': [ 'node_etw' ], + 'sources': [ + 'src/node_win32_etw_provider.h', + 'src/node_win32_etw_provider-inl.h', + 'src/node_win32_etw_provider.cc', + 'src/node_dtrace.cc', + 'tools/msvs/genfiles/node_etw_provider.h', + 'tools/msvs/genfiles/node_etw_provider.rc', + ] + } ], + [ 'node_use_perfctr=="true"', { + 'defines': [ 'HAVE_PERFCTR=1' ], + 'dependencies': [ 'node_perfctr' ], + 'sources': [ + 'src/node_win32_perfctr_provider.h', + 'src/node_win32_perfctr_provider.cc', + 'src/node_counters.cc', + 'src/node_counters.h', + 'tools/msvs/genfiles/node_perfctr_provider.rc', + ] + } ], + [ 'node_no_browser_globals=="true"', { + 'defines': [ 'NODE_NO_BROWSER_GLOBALS' ], + } ], + [ 'node_use_bundled_v8=="true" and v8_postmortem_support=="true"', { + 'dependencies': [ 'deps/v8/src/v8.gyp:postmortem-metadata' ], + 'conditions': [ + # -force_load is not applicable for the static library + [ 'node_target_type!="static_library"', { + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-force_load,<(V8_BASE)', + ], + }, + }], + ], + }], + [ 'node_shared_zlib=="false"', { + 'dependencies': [ 'deps/zlib/zlib.gyp:zlib' ], + }], + + [ 'node_shared_http_parser=="false"', { + 'dependencies': [ 'deps/http_parser/http_parser.gyp:http_parser' ], + }], + + [ 'node_shared_cares=="false"', { + 'dependencies': [ 'deps/cares/cares.gyp:cares' ], + }], + + [ 'node_shared_libuv=="false"', { + 'dependencies': [ 'deps/uv/uv.gyp:libuv' ], + }], + + [ 'OS=="win"', { + 'sources': [ + 'src/backtrace_win32.cc', + 'src/res/node.rc', + ], + 'defines!': [ + 'NODE_PLATFORM="win"', + ], + 'defines': [ + 'FD_SETSIZE=1024', + # we need to use node's preferred "win32" rather than gyp's preferred "win" + 'NODE_PLATFORM="win32"', + '_UNICODE=1', + ], + 'libraries': [ '-lpsapi.lib' ] + }, { # POSIX + 'defines': [ '__POSIX__' ], + 'sources': [ 'src/backtrace_posix.cc' ], + }], + [ 'OS=="mac"', { + # linking Corefoundation is needed since certain OSX debugging tools + # like Instruments require it for some features + 'libraries': [ '-framework CoreFoundation' ], + 'defines!': [ + 'NODE_PLATFORM="mac"', + ], + 'defines': [ + # we need to use node's preferred "darwin" rather than gyp's preferred "mac" + 'NODE_PLATFORM="darwin"', + ], + }], + [ 'OS=="freebsd"', { + 'libraries': [ + '-lutil', + '-lkvm', + ], + }], + [ 'OS=="aix"', { + 'defines': [ + '_LINUX_SOURCE_COMPAT', + ], + }], + [ 'OS=="solaris"', { + 'libraries': [ + '-lkstat', + '-lumem', + ], + 'defines!': [ + 'NODE_PLATFORM="solaris"', + ], + 'defines': [ + # we need to use node's preferred "sunos" + # rather than gyp's preferred "solaris" + 'NODE_PLATFORM="sunos"', + ], + }], + [ '(OS=="freebsd" or OS=="linux") and node_shared=="false" and coverage=="false"', { + 'ldflags': [ '-Wl,-z,noexecstack', + '-Wl,--whole-archive <(V8_BASE)', + '-Wl,--no-whole-archive' ] + }], + [ '(OS=="freebsd" or OS=="linux") and node_shared=="false" and coverage=="true"', { + 'ldflags': [ '-Wl,-z,noexecstack', + '-Wl,--whole-archive <(V8_BASE)', + '-Wl,--no-whole-archive', + '--coverage', + '-g', + '-O0' ], + 'cflags': [ '--coverage', + '-g', + '-O0' ] + }], + [ 'OS=="sunos"', { + 'ldflags': [ '-Wl,-M,/usr/lib/ld/map.noexstk' ], + }], + ], +} diff --git a/test/cctest/node_test_fixture.cc b/test/cctest/node_test_fixture.cc new file mode 100644 index 0000000000..9fc8b96445 --- /dev/null +++ b/test/cctest/node_test_fixture.cc @@ -0,0 +1,2 @@ +#include +#include "node_test_fixture.h" diff --git a/test/cctest/node_test_fixture.h b/test/cctest/node_test_fixture.h new file mode 100644 index 0000000000..de79b18685 --- /dev/null +++ b/test/cctest/node_test_fixture.h @@ -0,0 +1,85 @@ +#ifndef TEST_CCTEST_NODE_TEST_FIXTURE_H_ +#define TEST_CCTEST_NODE_TEST_FIXTURE_H_ + +#include +#include "gtest/gtest.h" +#include "node.h" +#include "env.h" +#include "v8.h" +#include "libplatform/libplatform.h" + +using node::Environment; +using node::IsolateData; +using node::CreateIsolateData; +using node::CreateEnvironment; +using node::AtExit; +using node::RunAtExit; + +class ArrayBufferAllocator : public v8::ArrayBuffer::Allocator { + public: + virtual void* Allocate(size_t length) { + return AllocateUninitialized(length); + } + + virtual void* AllocateUninitialized(size_t length) { + return calloc(length, sizeof(int)); + } + + virtual void Free(void* data, size_t) { + free(data); + } +}; + +struct Argv { + public: + Argv(const char* prog, const char* arg1, const char* arg2) { + int prog_len = strlen(prog) + 1; + int arg1_len = strlen(arg1) + 1; + int arg2_len = strlen(arg2) + 1; + argv_ = static_cast(malloc(3 * sizeof(char*))); + argv_[0] = static_cast(malloc(prog_len + arg1_len + arg2_len)); + snprintf(argv_[0], prog_len, "%s", prog); + snprintf(argv_[0] + prog_len, arg1_len, "%s", arg1); + snprintf(argv_[0] + prog_len + arg1_len, arg2_len, "%s", arg2); + argv_[1] = argv_[0] + prog_len + 1; + argv_[2] = argv_[0] + prog_len + arg1_len + 1; + } + + ~Argv() { + free(argv_[0]); + free(argv_); + } + + char** operator *() const { + return argv_; + } + + private: + char** argv_; +}; + +class NodeTestFixture : public ::testing::Test { + protected: + v8::Isolate::CreateParams params_; + ArrayBufferAllocator allocator_; + v8::Isolate* isolate_; + + virtual void SetUp() { + platform_ = v8::platform::CreateDefaultPlatform(); + v8::V8::InitializePlatform(platform_); + v8::V8::Initialize(); + params_.array_buffer_allocator = &allocator_; + isolate_ = v8::Isolate::New(params_); + } + + virtual void TearDown() { + v8::V8::ShutdownPlatform(); + delete platform_; + platform_ = nullptr; + } + + private: + v8::Platform* platform_; +}; + +#endif // TEST_CCTEST_NODE_TEST_FIXTURE_H_ diff --git a/test/cctest/util.cc b/test/cctest/test_util.cc similarity index 99% rename from test/cctest/util.cc rename to test/cctest/test_util.cc index a6ece3c6f4..db19d92cbd 100644 --- a/test/cctest/util.cc +++ b/test/cctest/test_util.cc @@ -90,10 +90,6 @@ TEST(UtilTest, ToLower) { EXPECT_EQ('a', ToLower('A')); } -namespace node { - void LowMemoryNotification() {} -} - #define TEST_AND_FREE(expression) \ do { \ auto pointer = expression; \ diff --git a/tools/gyp/pylib/gyp/generator/make.py b/tools/gyp/pylib/gyp/generator/make.py index 39373b9844..d9adddaa9b 100644 --- a/tools/gyp/pylib/gyp/generator/make.py +++ b/tools/gyp/pylib/gyp/generator/make.py @@ -147,7 +147,7 @@ def CalculateGeneratorInputInfo(params): # special "figure out circular dependencies" flags around the entire # input list during linking. quiet_cmd_link = LINK($(TOOLSET)) $@ -cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) -Wl,--end-group $(LIBS) +cmd_link = $(LINK.$(TOOLSET)) $(GYP_LDFLAGS) $(LDFLAGS.$(TOOLSET)) -o $@ -Wl,--start-group $(LD_INPUTS) $(LIBS) -Wl,--end-group # We support two kinds of shared objects (.so): # 1) shared_library, which is just bundling together many dependent libraries From 64af398c263105653dd0ba255a078c305b28e1e9 Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Fri, 24 Mar 2017 15:45:46 +0100 Subject: [PATCH 058/198] doc: c++ unit test guide lines PR-URL: https://github.com/nodejs/node/pull/11956 Ref: https://github.com/nodejs/node/pull/9163 Reviewed-By: James M Snell --- doc/guides/writing-tests.md | 62 +++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/doc/guides/writing-tests.md b/doc/guides/writing-tests.md index 4f226bfdb2..d0a6e1a199 100644 --- a/doc/guides/writing-tests.md +++ b/doc/guides/writing-tests.md @@ -279,3 +279,65 @@ If you want to improve tests that have been imported this way, please send a PR to the upstream project first. When your proposed change is merged in the upstream project, send another PR here to update Node.js accordingly. Be sure to update the hash in the URL following `WPT Refs:`. + +## C++ Unit test +C++ code can be tested using [Google Test][]. Most features in Node.js can be +tested using the methods described previously in this document. But there are +cases where these might not be enough, for example writing code for Node.js +that will only be called when Node.js is embedded. + +### Adding a new test +The unit test should be placed in `test/cctest` and be named with the prefix +`test` followed by the name of unit being tested. For example, the code below +would be placed in `test/cctest/test_env.cc`: + +```c++ +#include "gtest/gtest.h" +#include "node_test_fixture.h" +#include "env.h" +#include "node.h" +#include "v8.h" + +static bool called_cb = false; +static void at_exit_callback(void* arg); + +class EnvTest : public NodeTestFixture { }; + +TEST_F(EnvTest, RunAtExit) { + v8::HandleScope handle_scope(isolate_); + v8::Local context = v8::Context::New(isolate_); + node::IsolateData* isolateData = node::CreateIsolateData(isolate_, uv_default_loop()); + Argv argv{"node", "-e", ";"}; + auto env = Environment:CreateEnvironment(isolateData, context, 1, *argv, 2, *argv); + node::AtExit(at_exit_callback); + node::RunAtExit(env); + EXPECT_TRUE(called_cb); +} + +static void at_exit_callback(void* arg) { + called_cb = true; +} +``` + +Next add the test to the `sources` in the `cctest` target in node.gyp: +``` +'sources': [ + 'test/cctest/test_env.cc', + ... +], +``` +The test can be executed by running the `cctest` target: +``` +$ make cctest +``` + +### Node test fixture +There is a [test fixture] named `node_test_fixture.h` which can be included by +unit tests. The fixture takes care of setting up the Node.js environment +and tearing it down after the tests have finished. + +It also contains a helper to create arguments to be passed into Node.js. It +will depend on what is being tested if this is required or not. + +[Google Test]: https://github.com/google/googletest +[Test fixture]: https://github.com/google/googletest/blob/master/googletest/docs/Primer.md#test-fixtures-using-the-same-data-configuration-for-multiple-tests From 4929d12e999aaab08b0ed90e8a6080e139ca62d1 Mon Sep 17 00:00:00 2001 From: DavidCai Date: Wed, 22 Mar 2017 22:08:02 +0800 Subject: [PATCH 059/198] test: add internal/socket_list tests PR-URL: https://github.com/nodejs/node/pull/11989 Reviewed-By: James M Snell --- .../test-internal-socket-list-receive.js | 67 ++++++++++ .../test-internal-socket-list-send.js | 114 ++++++++++++++++++ 2 files changed, 181 insertions(+) create mode 100644 test/parallel/test-internal-socket-list-receive.js create mode 100644 test/parallel/test-internal-socket-list-send.js diff --git a/test/parallel/test-internal-socket-list-receive.js b/test/parallel/test-internal-socket-list-receive.js new file mode 100644 index 0000000000..5315adbfd4 --- /dev/null +++ b/test/parallel/test-internal-socket-list-receive.js @@ -0,0 +1,67 @@ +// Flags: --expose-internals +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const EventEmitter = require('events'); +const SocketListReceive = require('internal/socket_list').SocketListReceive; + +const key = 'test-key'; + +// Verify that the message won't be sent when child is not connected. +{ + const child = Object.assign(new EventEmitter(), { + connected: false, + send: common.mustNotCall() + }); + + const list = new SocketListReceive(child, key); + list.child.emit('internalMessage', { key, cmd: 'NODE_SOCKET_NOTIFY_CLOSE' }); +} + +// Verify that a "NODE_SOCKET_ALL_CLOSED" message will be sent. +{ + const child = Object.assign(new EventEmitter(), { + connected: true, + send: common.mustCall((msg) => { + assert.strictEqual(msg.cmd, 'NODE_SOCKET_ALL_CLOSED'); + assert.strictEqual(msg.key, key); + }) + }); + + const list = new SocketListReceive(child, key); + list.child.emit('internalMessage', { key, cmd: 'NODE_SOCKET_NOTIFY_CLOSE' }); +} + +// Verify that a "NODE_SOCKET_COUNT" message will be sent. +{ + const child = Object.assign(new EventEmitter(), { + connected: true, + send: common.mustCall((msg) => { + assert.strictEqual(msg.cmd, 'NODE_SOCKET_COUNT'); + assert.strictEqual(msg.key, key); + assert.strictEqual(msg.count, 0); + }) + }); + + const list = new SocketListReceive(child, key); + list.child.emit('internalMessage', { key, cmd: 'NODE_SOCKET_GET_COUNT' }); +} + +// Verify that the connections count is added and an "empty" event +// will be emitted when all sockets in obj were closed. +{ + const child = new EventEmitter(); + const obj = { socket: new EventEmitter() }; + + const list = new SocketListReceive(child, key); + assert.strictEqual(list.connections, 0); + + list.add(obj); + assert.strictEqual(list.connections, 1); + + list.on('empty', common.mustCall((self) => assert.strictEqual(self, list))); + + obj.socket.emit('close'); + assert.strictEqual(list.connections, 0); +} diff --git a/test/parallel/test-internal-socket-list-send.js b/test/parallel/test-internal-socket-list-send.js new file mode 100644 index 0000000000..a5020a431c --- /dev/null +++ b/test/parallel/test-internal-socket-list-send.js @@ -0,0 +1,114 @@ +// Flags: --expose-internals +'use strict'; + +const common = require('../common'); +const assert = require('assert'); +const EventEmitter = require('events'); +const SocketListSend = require('internal/socket_list').SocketListSend; + +const key = 'test-key'; + +// Verify that an error will be received in callback when child is not +// connected. +{ + const child = Object.assign(new EventEmitter(), { connected: false }); + assert.strictEqual(child.listenerCount('internalMessage'), 0); + + const list = new SocketListSend(child, 'test'); + + list._request('msg', 'cmd', common.mustCall((err) => { + assert.strictEqual(err.message, 'child closed before reply'); + assert.strictEqual(child.listenerCount('internalMessage'), 0); + })); +} + +// Verify that the given message will be received in callback. +{ + const child = Object.assign(new EventEmitter(), { + connected: true, + send: function(msg) { + process.nextTick(() => + this.emit('internalMessage', { key, cmd: 'cmd' }) + ); + } + }); + + const list = new SocketListSend(child, key); + + list._request('msg', 'cmd', common.mustCall((err, msg) => { + assert.strictEqual(err, null); + assert.strictEqual(msg.cmd, 'cmd'); + assert.strictEqual(msg.key, key); + assert.strictEqual(child.listenerCount('internalMessage'), 0); + assert.strictEqual(child.listenerCount('disconnect'), 0); + })); +} + +// Verify that an error will be received in callback when child was +// disconnected. +{ + const child = Object.assign(new EventEmitter(), { + connected: true, + send: function(msg) { process.nextTick(() => this.emit('disconnect')); } + }); + + const list = new SocketListSend(child, key); + + list._request('msg', 'cmd', common.mustCall((err) => { + assert.strictEqual(err.message, 'child closed before reply'); + assert.strictEqual(child.listenerCount('internalMessage'), 0); + })); +} + +// Verify that a "NODE_SOCKET_ALL_CLOSED" message will be received +// in callback. +{ + const child = Object.assign(new EventEmitter(), { + connected: true, + send: function(msg) { + assert.strictEqual(msg.cmd, 'NODE_SOCKET_NOTIFY_CLOSE'); + assert.strictEqual(msg.key, key); + process.nextTick(() => + this.emit('internalMessage', { key, cmd: 'NODE_SOCKET_ALL_CLOSED' }) + ); + } + }); + + const list = new SocketListSend(child, key); + + list.close(common.mustCall((err, msg) => { + assert.strictEqual(err, null); + assert.strictEqual(msg.cmd, 'NODE_SOCKET_ALL_CLOSED'); + assert.strictEqual(msg.key, key); + assert.strictEqual(child.listenerCount('internalMessage'), 0); + assert.strictEqual(child.listenerCount('disconnect'), 0); + })); +} + +// Verify that the count of connections will be received in callback. +{ + const count = 1; + const child = Object.assign(new EventEmitter(), { + connected: true, + send: function(msg) { + assert.strictEqual(msg.cmd, 'NODE_SOCKET_GET_COUNT'); + assert.strictEqual(msg.key, key); + process.nextTick(() => + this.emit('internalMessage', { + key, + count, + cmd: 'NODE_SOCKET_COUNT' + }) + ); + } + }); + + const list = new SocketListSend(child, key); + + list.getConnections(common.mustCall((err, msg) => { + assert.strictEqual(err, null); + assert.strictEqual(msg, count); + assert.strictEqual(child.listenerCount('internalMessage'), 0); + assert.strictEqual(child.listenerCount('disconnect'), 0); + })); +} From e40ac30e05be0f086e7a0dba18435af3f6386a0f Mon Sep 17 00:00:00 2001 From: Anna Henningsen Date: Wed, 22 Mar 2017 07:33:31 +0100 Subject: [PATCH 060/198] doc: document extent of crypto Uint8Array support PR-URL: https://github.com/nodejs/node/pull/11982 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- doc/api/crypto.md | 116 ++++++++++++++++++++++++---------------------- 1 file changed, 60 insertions(+), 56 deletions(-) diff --git a/doc/api/crypto.md b/doc/api/crypto.md index 9557273a9b..077c244c43 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -62,7 +62,7 @@ const cert2 = crypto.Certificate(); -- `spkac` {string | Buffer} +- `spkac` {string | Buffer | Uint8Array} - Returns {Buffer} The challenge component of the `spkac` data structure, which includes a public key and a challenge. @@ -78,7 +78,7 @@ console.log(challenge.toString('utf8')); -- `spkac` {string | Buffer} +- `spkac` {string | Buffer | Uint8Array} - Returns {Buffer} The public key component of the `spkac` data structure, which includes a public key and a challenge. @@ -94,7 +94,7 @@ console.log(publicKey); -- `spkac` {Buffer} +- `spkac` {Buffer | Uint8Array} - Returns {boolean} `true` if the given `spkac` data structure is valid, `false` otherwise. @@ -234,15 +234,15 @@ changes: pr-url: https://github.com/nodejs/node/pull/5522 description: The default `input_encoding` changed from `binary` to `utf8`. --> -- `data` {string | Buffer} +- `data` {string | Buffer | Uint8Array} - `input_encoding` {string} - `output_encoding` {string} Updates the cipher with `data`. If the `input_encoding` argument is given, its value must be one of `'utf8'`, `'ascii'`, or `'latin1'` and the `data` argument is a string using the specified encoding. If the `input_encoding` -argument is not given, `data` must be a [`Buffer`][]. If `data` is a -[`Buffer`][] then `input_encoding` is ignored. +argument is not given, `data` must be a [`Buffer`][] or `Uint8Array`. +If `data` is a [`Buffer`][] or `Uint8Array`, then `input_encoding` is ignored. The `output_encoding` specifies the output format of the enciphered data, and can be `'latin1'`, `'base64'` or `'hex'`. If the `output_encoding` @@ -340,7 +340,7 @@ changes: pr-url: https://github.com/nodejs/node/pull/9398 description: This method now returns a reference to `decipher`. --> -- `buffer` {Buffer} +- `buffer` {Buffer | Uint8Array} - Returns the {Cipher} for method chaining. When using an authenticated encryption mode (only `GCM` is currently @@ -357,7 +357,7 @@ changes: pr-url: https://github.com/nodejs/node/pull/9398 description: This method now returns a reference to `decipher`. --> -- `buffer` {Buffer} +- `buffer` {Buffer | Uint8Array} - Returns the {Cipher} for method chaining. When using an authenticated encryption mode (only `GCM` is currently @@ -394,7 +394,7 @@ changes: pr-url: https://github.com/nodejs/node/pull/5522 description: The default `input_encoding` changed from `binary` to `utf8`. --> -- `data` {string | Buffer} +- `data` {string | Buffer | Uint8Array} - `input_encoding` {string} - `output_encoding` {string} @@ -448,7 +448,7 @@ assert.strictEqual(aliceSecret.toString('hex'), bobSecret.toString('hex')); -- `other_public_key` {string | Buffer} +- `other_public_key` {string | Buffer | Uint8Array} - `input_encoding` {string} - `output_encoding` {string} @@ -457,7 +457,7 @@ party's public key and returns the computed shared secret. The supplied key is interpreted using the specified `input_encoding`, and secret is encoded using specified `output_encoding`. Encodings can be `'latin1'`, `'hex'`, or `'base64'`. If the `input_encoding` is not -provided, `other_public_key` is expected to be a [`Buffer`][]. +provided, `other_public_key` is expected to be a [`Buffer`][] or `Uint8Array`. If `output_encoding` is given a string is returned; otherwise, a [`Buffer`][] is returned. @@ -518,25 +518,25 @@ string is returned; otherwise a [`Buffer`][] is returned. -- `private_key` {string | Buffer} +- `private_key` {string | Buffer | Uint8Array} - `encoding` {string} Sets the Diffie-Hellman private key. If the `encoding` argument is provided and is either `'latin1'`, `'hex'`, or `'base64'`, `private_key` is expected to be a string. If no `encoding` is provided, `private_key` is expected -to be a [`Buffer`][]. +to be a [`Buffer`][] or `Uint8Array`. ### diffieHellman.setPublicKey(public_key[, encoding]) -- `public_key` {string | Buffer} +- `public_key` {string | Buffer | Uint8Array} - `encoding` {string} Sets the Diffie-Hellman public key. If the `encoding` argument is provided and is either `'latin1'`, `'hex'` or `'base64'`, `public_key` is expected to be a string. If no `encoding` is provided, `public_key` is expected -to be a [`Buffer`][]. +to be a [`Buffer`][] or `Uint8Array`. ### diffieHellman.verifyError -- `other_public_key` {string | Buffer} +- `other_public_key` {string | Buffer | Uint8Array} - `input_encoding` {string} - `output_encoding` {string} @@ -602,7 +602,7 @@ party's public key and returns the computed shared secret. The supplied key is interpreted using specified `input_encoding`, and the returned secret is encoded using the specified `output_encoding`. Encodings can be `'latin1'`, `'hex'`, or `'base64'`. If the `input_encoding` is not -provided, `other_public_key` is expected to be a [`Buffer`][]. +provided, `other_public_key` is expected to be a [`Buffer`][] or `Uint8Array`. If `output_encoding` is given a string will be returned; otherwise a [`Buffer`][] is returned. @@ -658,13 +658,14 @@ returned. -- `private_key` {string | Buffer} +- `private_key` {string | Buffer | Uint8Array} - `encoding` {string} Sets the EC Diffie-Hellman private key. The `encoding` can be `'latin1'`, `'hex'` or `'base64'`. If `encoding` is provided, `private_key` is expected -to be a string; otherwise `private_key` is expected to be a [`Buffer`][]. If -`private_key` is not valid for the curve specified when the `ECDH` object was +to be a string; otherwise `private_key` is expected to be a [`Buffer`][] +or `Uint8Array`. +If `private_key` is not valid for the curve specified when the `ECDH` object was created, an error is thrown. Upon setting the private key, the associated public point (key) is also generated and set in the ECDH object. @@ -676,12 +677,12 @@ deprecated: v5.2.0 > Stability: 0 - Deprecated -- `public_key` {string | Buffer} +- `public_key` {string | Buffer | Uint8Array} - `encoding` {string} Sets the EC Diffie-Hellman public key. Key encoding can be `'latin1'`, `'hex'` or `'base64'`. If `encoding` is provided `public_key` is expected to -be a string; otherwise a [`Buffer`][] is expected. +be a string; otherwise a [`Buffer`][] or `Uint8Array` is expected. Note that there is not normally a reason to call this method because `ECDH` only requires a private key and the other party's public key to compute the @@ -794,14 +795,14 @@ changes: pr-url: https://github.com/nodejs/node/pull/5522 description: The default `input_encoding` changed from `binary` to `utf8`. --> -- `data` {string | Buffer} +- `data` {string | Buffer | Uint8Array} - `input_encoding` {string} Updates the hash content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'latin1'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then -`input_encoding` is ignored. +encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] or `Uint8Array` +then `input_encoding` is ignored. This can be called many times with new data as it is streamed. @@ -883,14 +884,14 @@ changes: pr-url: https://github.com/nodejs/node/pull/5522 description: The default `input_encoding` changed from `binary` to `utf8`. --> -- `data` {string | Buffer} +- `data` {string | Buffer | Uint8Array} - `input_encoding` {string} Updates the `Hmac` content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'latin1'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then -`input_encoding` is ignored. +encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] or `Uint8Array` +then `input_encoding` is ignored. This can be called many times with new data as it is streamed. @@ -994,14 +995,14 @@ changes: pr-url: https://github.com/nodejs/node/pull/5522 description: The default `input_encoding` changed from `binary` to `utf8`. --> -- `data` {string | Buffer} +- `data` {string | Buffer | Uint8Array} - `input_encoding` {string} Updates the `Sign` content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'latin1'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then -`input_encoding` is ignored. +encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] or `Uint8Array` +then `input_encoding` is ignored. This can be called many times with new data as it is streamed. @@ -1058,14 +1059,14 @@ changes: pr-url: https://github.com/nodejs/node/pull/5522 description: The default `input_encoding` changed from `binary` to `utf8`. --> -- `data` {string | Buffer} +- `data` {string | Buffer | Uint8Array} - `input_encoding` {string} Updates the `Verify` content with the given `data`, the encoding of which is given in `input_encoding` and can be `'utf8'`, `'ascii'` or `'latin1'`. If `encoding` is not provided, and the `data` is a string, an -encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] then -`input_encoding` is ignored. +encoding of `'utf8'` is enforced. If `data` is a [`Buffer`][] or `Uint8Array` +then `input_encoding` is ignored. This can be called many times with new data as it is streamed. @@ -1074,7 +1075,7 @@ This can be called many times with new data as it is streamed. added: v0.1.92 --> - `object` {string} -- `signature` {string | Buffer} +- `signature` {string | Buffer | Uint8Array} - `signature_format` {string} Verifies the provided data using the given `object` and `signature`. @@ -1083,7 +1084,8 @@ an RSA public key, a DSA public key, or an X.509 certificate. The `signature` argument is the previously calculated signature for the data, in the `signature_format` which can be `'latin1'`, `'hex'` or `'base64'`. If a `signature_format` is specified, the `signature` is expected to be a -string; otherwise `signature` is expected to be a [`Buffer`][]. +string; otherwise `signature` is expected to be a [`Buffer`][] or +`Uint8Array`. Returns `true` or `false` depending on the validity of the signature for the data and public key. @@ -1131,7 +1133,7 @@ currently in use. Setting to true requires a FIPS build of Node.js. added: v0.1.94 --> - `algorithm` {string} -- `password` {string | Buffer} +- `password` {string | Buffer | Uint8Array} Creates and returns a `Cipher` object that uses the given `algorithm` and `password`. @@ -1141,7 +1143,8 @@ recent OpenSSL releases, `openssl list-cipher-algorithms` will display the available cipher algorithms. The `password` is used to derive the cipher key and initialization vector (IV). -The value must be either a `'latin1'` encoded string or a [`Buffer`][]. +The value must be either a `'latin1'` encoded string, a [`Buffer`][] or a +`Uint8Array`. The implementation of `crypto.createCipher()` derives keys using the OpenSSL function [`EVP_BytesToKey`][] with the digest algorithm set to MD5, one @@ -1157,8 +1160,8 @@ to create the `Cipher` object. ### crypto.createCipheriv(algorithm, key, iv) - `algorithm` {string} -- `key` {string | Buffer} -- `iv` {string | Buffer} +- `key` {string | Buffer | Uint8Array} +- `iv` {string | Buffer | Uint8Array} Creates and returns a `Cipher` object, with the given `algorithm`, `key` and initialization vector (`iv`). @@ -1168,8 +1171,8 @@ recent OpenSSL releases, `openssl list-cipher-algorithms` will display the available cipher algorithms. The `key` is the raw key used by the `algorithm` and `iv` is an -[initialization vector][]. Both arguments must be `'utf8'` encoded strings or -[buffers][`Buffer`]. +[initialization vector][]. Both arguments must be `'utf8'` encoded strings, +[Buffers][`Buffer`] or `Uint8Array`s. ### crypto.createCredentials(details) - `algorithm` {string} -- `password` {string | Buffer} +- `password` {string | Buffer | Uint8Array} Creates and returns a `Decipher` object that uses the given `algorithm` and `password` (key). @@ -1216,8 +1219,8 @@ to create the `Decipher` object. added: v0.1.94 --> - `algorithm` {string} -- `key` {string | Buffer} -- `iv` {string | Buffer} +- `key` {string | Buffer | Uint8Array} +- `iv` {string | Buffer | Uint8Array} Creates and returns a `Decipher` object that uses the given `algorithm`, `key` and initialization vector (`iv`). @@ -1241,7 +1244,7 @@ changes: --> - `prime` {string | Buffer} - `prime_encoding` {string} -- `generator` {number | string | Buffer} Defaults to `2`. +- `generator` {number | string | Buffer | Uint8Array} Defaults to `2`. - `generator_encoding` {string} Creates a `DiffieHellman` key exchange object using the supplied `prime` and an @@ -1257,14 +1260,14 @@ If `prime_encoding` is specified, `prime` is expected to be a string; otherwise a [`Buffer`][] is expected. If `generator_encoding` is specified, `generator` is expected to be a string; -otherwise either a number or [`Buffer`][] is expected. +otherwise either a number or [`Buffer`][] or `Uint8Array` is expected. ### crypto.createDiffieHellman(prime_length[, generator]) - `prime_length` {number} -- `generator` {number | string | Buffer} Defaults to `2`. +- `generator` {number | string | Buffer | Uint8Array} Defaults to `2`. Creates a `DiffieHellman` key exchange object and generates a prime of `prime_length` bits using an optional specific numeric `generator`. @@ -1321,7 +1324,7 @@ input.on('readable', () => { added: v0.1.94 --> - `algorithm` {string} -- `key` {string | Buffer} +- `key` {string | Buffer | Uint8Array} Creates and returns an `Hmac` object that uses the given `algorithm` and `key`. @@ -1560,7 +1563,7 @@ added: v0.11.14 - `padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`. -- `buffer` {Buffer} +- `buffer` {Buffer | Uint8Array} Decrypts `buffer` with `private_key`. @@ -1577,7 +1580,7 @@ added: v1.1.0 - `padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING` or `RSA_PKCS1_PADDING`. -- `buffer` {Buffer} +- `buffer` {Buffer | Uint8Array} Encrypts `buffer` with `private_key`. @@ -1594,7 +1597,7 @@ added: v1.1.0 - `padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`. -- `buffer` {Buffer} +- `buffer` {Buffer | Uint8Array} Decrypts `buffer` with `public_key`. @@ -1614,7 +1617,7 @@ added: v0.11.14 - `padding` {crypto.constants} An optional padding value defined in `crypto.constants`, which may be: `crypto.constants.RSA_NO_PADDING`, `RSA_PKCS1_PADDING`, or `crypto.constants.RSA_PKCS1_OAEP_PADDING`. -- `buffer` {Buffer} +- `buffer` {Buffer | Uint8Array} Encrypts `buffer` with `public_key`. @@ -1699,15 +1702,16 @@ is a bit field taking one of or a mix of the following flags (defined in -- `a` {Buffer} -- `b` {Buffer} +- `a` {Buffer | Uint8Array} +- `b` {Buffer | Uint8Array} Returns true if `a` is equal to `b`, without leaking timing information that would allow an attacker to guess one of the values. This is suitable for comparing HMAC digests or secret values like authentication cookies or [capability urls](https://www.w3.org/TR/capability-urls/). -`a` and `b` must both be `Buffer`s, and they must have the same length. +`a` and `b` must both be `Buffer`s or `Uint8Array`s, and they must have the +same length. **Note**: Use of `crypto.timingSafeEqual` does not guarantee that the *surrounding* code is timing-safe. Care should be taken to ensure that the From abb0bdd53fa6d831de43119fb1d5560afc495677 Mon Sep 17 00:00:00 2001 From: Yuta Hiroto Date: Thu, 23 Mar 2017 10:57:26 +0900 Subject: [PATCH 061/198] test: add test for url PR-URL: https://github.com/nodejs/node/pull/11999 Reviewed-By: James M Snell Reviewed-By: Joyee Cheung Reviewed-By: Prince John Wesley --- test/parallel/test-url-relative.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/parallel/test-url-relative.js b/test/parallel/test-url-relative.js index cf379e591d..f40981de62 100644 --- a/test/parallel/test-url-relative.js +++ b/test/parallel/test-url-relative.js @@ -4,6 +4,9 @@ const assert = require('assert'); const inspect = require('util').inspect; const url = require('url'); +// when source is false +assert.strictEqual(url.resolveObject('', 'foo'), 'foo'); + /* [from, path, expected] */ From 0d000ca51f4c274a4786f28019032eca9b74146f Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 21 Mar 2017 17:07:23 -0700 Subject: [PATCH 062/198] test: add minimal test for net benchmarks Currently, benchmark code is not exercised at all in CI. This adds a minimal test for net benchmarks. If this is deemed acceptable, similar minimal tests for other benchmarks can be written. Additionally, as issues and edge cases are uncovered, checks for them can be added. PR-URL: https://github.com/nodejs/node/pull/11979 Reviewed-By: James M Snell Reviewed-By: Joyee Cheung --- test/sequential/test-benchmark-net.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/sequential/test-benchmark-net.js diff --git a/test/sequential/test-benchmark-net.js b/test/sequential/test-benchmark-net.js new file mode 100644 index 0000000000..4bb91451e9 --- /dev/null +++ b/test/sequential/test-benchmark-net.js @@ -0,0 +1,22 @@ +'use strict'; + +require('../common'); + +// Minimal test for net benchmarks. This makes sure the benchmarks aren't +// horribly broken but nothing more than that. + +// Because the net benchmarks use hardcoded ports, this should be in sequential +// rather than parallel to make sure it does not conflict with tests that choose +// random available ports. + +const assert = require('assert'); +const fork = require('child_process').fork; +const path = require('path'); + +const runjs = path.join(__dirname, '..', '..', 'benchmark', 'run.js'); + +const child = fork(runjs, ['--set', 'dur=0', 'net']); +child.on('exit', (code, signal) => { + assert.strictEqual(code, 0); + assert.strictEqual(signal, null); +}); From 89d9c3f4a7a552caccf98ea52e4800472bff68ef Mon Sep 17 00:00:00 2001 From: Nick Peleh Date: Tue, 21 Mar 2017 19:50:05 +0200 Subject: [PATCH 063/198] test: improve test-vm-cached-data.js * verify error message by adding 2nd argument to throws in test-assert PR-URL: https://github.com/nodejs/node/pull/11974 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Daijiro Wachi Reviewed-By: Luigi Pinca --- test/parallel/test-vm-cached-data.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-vm-cached-data.js b/test/parallel/test-vm-cached-data.js index 3f74f398b8..a09a41fe98 100644 --- a/test/parallel/test-vm-cached-data.js +++ b/test/parallel/test-vm-cached-data.js @@ -89,4 +89,4 @@ assert.throws(() => { new vm.Script('function abc() {}', { cachedData: 'ohai' }); -}); +}, /^TypeError: options.cachedData must be a Buffer instance$/); From 30f1e8ea041c97370534b9d26eef8f25da18a75c Mon Sep 17 00:00:00 2001 From: Luca Maraschi Date: Tue, 21 Mar 2017 15:47:25 +0100 Subject: [PATCH 064/198] test: invalid chars in http client path This test adds coverage for all the characters which are considered invalid in a http path. PR-URL: https://github.com/nodejs/node/pull/11964 Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- test/parallel/test-http-invalid-path-chars.js | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/parallel/test-http-invalid-path-chars.js diff --git a/test/parallel/test-http-invalid-path-chars.js b/test/parallel/test-http-invalid-path-chars.js new file mode 100644 index 0000000000..462e0bc12a --- /dev/null +++ b/test/parallel/test-http-invalid-path-chars.js @@ -0,0 +1,20 @@ +'use strict'; +const common = require('../common'); +const assert = require('assert'); +const http = require('http'); + +const expectedError = /^TypeError: Request path contains unescaped characters$/; +const theExperimentallyDeterminedNumber = 39; + +function fail(path) { + assert.throws(() => { + http.request({ path }, common.fail); + }, expectedError); +} + +for (let i = 0; i <= theExperimentallyDeterminedNumber; i++) { + const prefix = 'a'.repeat(i); + for (let i = 0; i <= 32; i++) { + fail(prefix + String.fromCodePoint(i)); + } +} From 9ff7ed23cd822dc810ddd99d63d4e2ca68635474 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 21 Mar 2017 11:30:59 +0100 Subject: [PATCH 065/198] lib: fix event race condition with -e Commit c5b07d4 ("lib: fix beforeExit not working with -e") runs the to-be-evaluated code at a later time than before because it switches from `process.nextTick()` to `setImmediate()`. It affects `-e 'process.on("message", ...)'` because there is now a larger time gap between startup and attaching the event listener, increasing the chances of missing early messages. I'm reasonably sure `process.nextTick()` was also susceptible to that, only less pronounced. Avoid the problem altogether by evaluating the code synchronously. Harmonizes the logic with `Module.runMain()` from lib/module.js which also calls `process._tickCallback()` afterwards. PR-URL: https://github.com/nodejs/node/pull/11958 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Jeremiah Senkpiel Reviewed-By: Michael Dawson Reviewed-By: Daijiro Wachi --- lib/internal/bootstrap_node.js | 10 ++----- test/message/eval_messages.out | 53 ++++++++++++++++++--------------- test/message/stdin_messages.out | 37 +++++++++++++---------- test/parallel/test-cli-eval.js | 19 ++++++++++++ 4 files changed, 72 insertions(+), 47 deletions(-) diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index f29f7a647a..51b7f928cb 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -400,13 +400,9 @@ 'return require("vm").runInThisContext(' + `${JSON.stringify(body)}, { filename: ` + `${JSON.stringify(name)}, displayErrors: true });\n`; - // Defer evaluation for a tick. This is a workaround for deferred - // events not firing when evaluating scripts from the command line, - // see https://github.com/nodejs/node/issues/1600. - setImmediate(function() { - const result = module._compile(script, `${name}-wrapper`); - if (process._print_eval) console.log(result); - }); + const result = module._compile(script, `${name}-wrapper`); + if (process._print_eval) console.log(result); + process._tickCallback(); } // Load preload modules diff --git a/test/message/eval_messages.out b/test/message/eval_messages.out index ba0c35431c..340e760dc6 100644 --- a/test/message/eval_messages.out +++ b/test/message/eval_messages.out @@ -3,14 +3,15 @@ with(this){__filename} ^^^^ SyntaxError: Strict mode code may not include a with statement - at createScript (vm.js:*) - at Object.runInThisContext (vm.js:*) + at createScript (vm.js:*:*) + at Object.runInThisContext (vm.js:*:*) at Object. ([eval]-wrapper:*:*) at Module._compile (module.js:*:*) - at Immediate. (bootstrap_node.js:*:*) - at runCallback (timers.js:*:*) - at tryOnImmediate (timers.js:*:*) - at processImmediate [as _immediateCallback] (timers.js:*:*) + at evalScript (bootstrap_node.js:*:*) + at run (bootstrap_node.js:*:*) + at run (bootstrap_node.js:*:*) + at startup (bootstrap_node.js:*:*) + at bootstrap_node.js:*:* 42 42 [eval]:1 @@ -19,28 +20,31 @@ throw new Error("hello") Error: hello at [eval]:1:7 - at ContextifyScript.Script.runInThisContext (vm.js:*) - at Object.runInThisContext (vm.js:*) + at ContextifyScript.Script.runInThisContext (vm.js:*:*) + at Object.runInThisContext (vm.js:*:*) at Object. ([eval]-wrapper:*:*) at Module._compile (module.js:*:*) - at Immediate. (bootstrap_node.js:*:*) - at runCallback (timers.js:*:*) - at tryOnImmediate (timers.js:*:*) - at processImmediate [as _immediateCallback] (timers.js:*:*) + at evalScript (bootstrap_node.js:*:*) + at run (bootstrap_node.js:*:*) + at run (bootstrap_node.js:*:*) + at startup (bootstrap_node.js:*:*) + at bootstrap_node.js:*:* + [eval]:1 throw new Error("hello") ^ Error: hello at [eval]:1:7 - at ContextifyScript.Script.runInThisContext (vm.js:*) - at Object.runInThisContext (vm.js:*) + at ContextifyScript.Script.runInThisContext (vm.js:*:*) + at Object.runInThisContext (vm.js:*:*) at Object. ([eval]-wrapper:*:*) at Module._compile (module.js:*:*) - at Immediate. (bootstrap_node.js:*:*) - at runCallback (timers.js:*:*) - at tryOnImmediate (timers.js:*:*) - at processImmediate [as _immediateCallback] (timers.js:*:*) + at evalScript (bootstrap_node.js:*:*) + at run (bootstrap_node.js:*:*) + at run (bootstrap_node.js:*:*) + at startup (bootstrap_node.js:*:*) + at bootstrap_node.js:*:* 100 [eval]:1 var x = 100; y = x; @@ -48,14 +52,15 @@ var x = 100; y = x; ReferenceError: y is not defined at [eval]:1:16 - at ContextifyScript.Script.runInThisContext (vm.js:*) - at Object.runInThisContext (vm.js:*) + at ContextifyScript.Script.runInThisContext (vm.js:*:*) + at Object.runInThisContext (vm.js:*:*) at Object. ([eval]-wrapper:*:*) at Module._compile (module.js:*:*) - at Immediate. (bootstrap_node.js:*:*) - at runCallback (timers.js:*:*) - at tryOnImmediate (timers.js:*:*) - at processImmediate [as _immediateCallback] (timers.js:*:*) + at evalScript (bootstrap_node.js:*:*) + at run (bootstrap_node.js:*:*) + at run (bootstrap_node.js:*:*) + at startup (bootstrap_node.js:*:*) + at bootstrap_node.js:*:* [eval]:1 var ______________________________________________; throw 10 diff --git a/test/message/stdin_messages.out b/test/message/stdin_messages.out index b4c51d7ad5..ad1688f15d 100644 --- a/test/message/stdin_messages.out +++ b/test/message/stdin_messages.out @@ -7,10 +7,12 @@ SyntaxError: Strict mode code may not include a with statement at Object.runInThisContext (vm.js:*) at Object. ([stdin]-wrapper:*:*) at Module._compile (module.js:*:*) - at Immediate. (bootstrap_node.js:*:*) - at runCallback (timers.js:*:*) - at tryOnImmediate (timers.js:*:*) - at processImmediate [as _immediateCallback] (timers.js:*:*) + at evalScript (bootstrap_node.js:*:*) + at Socket. (bootstrap_node.js:*:*) + at emitNone (events.js:*:*) + at Socket.emit (events.js:*:*) + at endReadableNT (_stream_readable.js:*:*) + at _combinedTickCallback (internal/process/next_tick.js:*:*) 42 42 [stdin]:1 @@ -23,10 +25,11 @@ Error: hello at Object.runInThisContext (vm.js:*) at Object. ([stdin]-wrapper:*:*) at Module._compile (module.js:*:*) - at Immediate. (bootstrap_node.js:*:*) - at runCallback (timers.js:*:*) - at tryOnImmediate (timers.js:*:*) - at processImmediate [as _immediateCallback] (timers.js:*:*) + at evalScript (bootstrap_node.js:*:*) + at Socket. (bootstrap_node.js:*:*) + at emitNone (events.js:*:*) + at Socket.emit (events.js:*:*) + at endReadableNT (_stream_readable.js:*:*) [stdin]:1 throw new Error("hello") ^ @@ -37,10 +40,11 @@ Error: hello at Object.runInThisContext (vm.js:*) at Object. ([stdin]-wrapper:*:*) at Module._compile (module.js:*:*) - at Immediate. (bootstrap_node.js:*:*) - at runCallback (timers.js:*:*) - at tryOnImmediate (timers.js:*:*) - at processImmediate [as _immediateCallback] (timers.js:*:*) + at evalScript (bootstrap_node.js:*:*) + at Socket. (bootstrap_node.js:*:*) + at emitNone (events.js:*:*) + at Socket.emit (events.js:*:*) + at endReadableNT (_stream_readable.js:*:*) 100 [stdin]:1 var x = 100; y = x; @@ -52,10 +56,11 @@ ReferenceError: y is not defined at Object.runInThisContext (vm.js:*) at Object. ([stdin]-wrapper:*:*) at Module._compile (module.js:*:*) - at Immediate. (bootstrap_node.js:*:*) - at runCallback (timers.js:*:*) - at tryOnImmediate (timers.js:*:*) - at processImmediate [as _immediateCallback] (timers.js:*:*) + at evalScript (bootstrap_node.js:*:*) + at Socket. (bootstrap_node.js:*:*) + at emitNone (events.js:*:*) + at Socket.emit (events.js:*:*) + at endReadableNT (_stream_readable.js:*:*) [stdin]:1 var ______________________________________________; throw 10 diff --git a/test/parallel/test-cli-eval.js b/test/parallel/test-cli-eval.js index 6d21b5d50b..34681bd235 100644 --- a/test/parallel/test-cli-eval.js +++ b/test/parallel/test-cli-eval.js @@ -171,6 +171,25 @@ child.exec(`${nodejs} --use-strict -p process.execArgv`, assert.strictEqual(proc.stdout, 'start\nbeforeExit\nexit\n'); } +// Regression test for https://github.com/nodejs/node/issues/11948. +{ + const script = ` + process.on('message', (message) => { + if (message === 'ping') process.send('pong'); + if (message === 'exit') process.disconnect(); + }); + `; + const proc = child.fork('-e', [script]); + proc.on('exit', common.mustCall((exitCode, signalCode) => { + assert.strictEqual(exitCode, 0); + assert.strictEqual(signalCode, null); + })); + proc.on('message', (message) => { + if (message === 'pong') proc.send('exit'); + }); + proc.send('ping'); +} + [ '-arg1', '-arg1 arg2 --arg3', '--', From a45c2db4b67a95f40f66852dd35e45ae9677df05 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 21 Mar 2017 21:48:21 -0700 Subject: [PATCH 066/198] test: refactor test-cluster-disconnect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace `process.once('exit', ...)` with `common.mustCall()`. Remove unneeded variable in loop declaration. PR-URL: https://github.com/nodejs/node/pull/11981 Reviewed-By: James M Snell Reviewed-By: Michaël Zasso Reviewed-By: Colin Ihrig Reviewed-By: Santiago Gimeno Reviewed-By: Luigi Pinca --- test/parallel/test-cluster-disconnect.js | 35 ++++++------------------ 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/test/parallel/test-cluster-disconnect.js b/test/parallel/test-cluster-disconnect.js index a4772d1ad6..0f43b4ef59 100644 --- a/test/parallel/test-cluster-disconnect.js +++ b/test/parallel/test-cluster-disconnect.js @@ -42,7 +42,7 @@ if (cluster.isWorker) { const socket = net.connect(port, '127.0.0.1', () => { // buffer result let result = ''; - socket.on('data', common.mustCall((chunk) => { result += chunk; })); + socket.on('data', (chunk) => { result += chunk; }); // check result socket.on('end', common.mustCall(() => { @@ -55,7 +55,7 @@ if (cluster.isWorker) { const testCluster = function(cb) { let done = 0; - for (let i = 0, l = servers; i < l; i++) { + for (let i = 0; i < servers; i++) { testConnection(common.PORT + i, (success) => { assert.ok(success); done += 1; @@ -81,40 +81,21 @@ if (cluster.isWorker) { } }; - - const results = { - start: 0, - test: 0, - disconnect: 0 - }; - const test = function(again) { //1. start cluster - startCluster(() => { - results.start += 1; - + startCluster(common.mustCall(() => { //2. test cluster - testCluster(() => { - results.test += 1; - + testCluster(common.mustCall(() => { //3. disconnect cluster - cluster.disconnect(() => { - results.disconnect += 1; - + cluster.disconnect(common.mustCall(() => { // run test again to confirm cleanup if (again) { test(); } - }); - }); - }); + })); + })); + })); }; test(true); - - process.once('exit', () => { - assert.strictEqual(results.start, 2); - assert.strictEqual(results.test, 2); - assert.strictEqual(results.disconnect, 2); - }); } From d9b0e4c729fedfe5369ada4229fd170bd6dc7e2f Mon Sep 17 00:00:00 2001 From: Sorin Baltateanu Date: Thu, 21 Jul 2016 14:08:28 +0300 Subject: [PATCH 067/198] benchmark: repair the fs/readfile benchmark PR-URL: https://github.com/nodejs/node/pull/7818 Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- benchmark/fs/readfile.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/benchmark/fs/readfile.js b/benchmark/fs/readfile.js index f58550fae8..9fc8316743 100644 --- a/benchmark/fs/readfile.js +++ b/benchmark/fs/readfile.js @@ -22,8 +22,10 @@ function main(conf) { data = null; var reads = 0; + var bench_ended = false; bench.start(); setTimeout(function() { + bench_ended = true; bench.end(reads); try { fs.unlinkSync(filename); } catch (e) {} process.exit(0); @@ -41,7 +43,8 @@ function main(conf) { throw new Error('wrong number of bytes returned'); reads++; - read(); + if (!bench_ended) + read(); } var cur = +conf.concurrent; From a6e69f8c08958a0909a60b53d048b21d181e90e5 Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 19 Mar 2017 16:05:55 -0700 Subject: [PATCH 068/198] benchmark: add more options to map-bench PR-URL: https://github.com/nodejs/node/pull/11930 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- benchmark/es/map-bench.js | 42 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) diff --git a/benchmark/es/map-bench.js b/benchmark/es/map-bench.js index 047fc05abd..4663d71bdd 100644 --- a/benchmark/es/map-bench.js +++ b/benchmark/es/map-bench.js @@ -4,7 +4,10 @@ const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { - method: ['object', 'nullProtoObject', 'fakeMap', 'map'], + method: [ + 'object', 'nullProtoObject', 'nullProtoLiteralObject', 'storageObject', + 'fakeMap', 'map' + ], millions: [1] }); @@ -36,6 +39,37 @@ function runNullProtoObject(n) { bench.end(n / 1e6); } +function runNullProtoLiteralObject(n) { + const m = { __proto__: null }; + var i = 0; + bench.start(); + for (; i < n; i++) { + m['i' + i] = i; + m['s' + i] = String(i); + assert.strictEqual(String(m['i' + i]), m['s' + i]); + m['i' + i] = undefined; + m['s' + i] = undefined; + } + bench.end(n / 1e6); +} + +function StorageObject() {} +StorageObject.prototype = Object.create(null); + +function runStorageObject(n) { + const m = new StorageObject(); + var i = 0; + bench.start(); + for (; i < n; i++) { + m['i' + i] = i; + m['s' + i] = String(i); + assert.strictEqual(String(m['i' + i]), m['s' + i]); + m['i' + i] = undefined; + m['s' + i] = undefined; + } + bench.end(n / 1e6); +} + function fakeMap() { const m = {}; return { @@ -84,6 +118,12 @@ function main(conf) { case 'nullProtoObject': runNullProtoObject(n); break; + case 'nullProtoLiteralObject': + runNullProtoLiteralObject(n); + break; + case 'storageObject': + runStorageObject(n); + break; case 'fakeMap': runFakeMap(n); break; From 14a91957f8bce2d614ec361f982aa56378f1c24e Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Wed, 22 Mar 2017 11:39:13 -0700 Subject: [PATCH 069/198] url: use a class for WHATWG url[context] The object is used as a structure, not as a map, which `StorageObject` was designed for. PR-URL: https://github.com/nodejs/node/pull/11930 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- lib/internal/url.js | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/lib/internal/url.js b/lib/internal/url.js index 7a6ff227ed..64156803d8 100644 --- a/lib/internal/url.js +++ b/lib/internal/url.js @@ -3,8 +3,7 @@ const util = require('util'); const { hexTable, - isHexTable, - StorageObject + isHexTable } = require('internal/querystring'); const binding = process.binding('url'); const context = Symbol('context'); @@ -97,6 +96,26 @@ class TupleOrigin { } } +// This class provides the internal state of a URL object. An instance of this +// class is stored in every URL object and is accessed internally by setters +// and getters. It roughly corresponds to the concept of a URL record in the +// URL Standard, with a few differences. It is also the object transported to +// the C++ binding. +// Refs: https://url.spec.whatwg.org/#concept-url +class URLContext { + constructor() { + this.flags = 0; + this.scheme = undefined; + this.username = undefined; + this.password = undefined; + this.host = undefined; + this.port = undefined; + this.path = []; + this.query = undefined; + this.fragment = undefined; + } +} + function onParseComplete(flags, protocol, username, password, host, port, path, query, fragment) { var ctx = this[context]; @@ -125,7 +144,7 @@ function onParseError(flags, input) { // Reused by URL constructor and URL#href setter. function parse(url, input, base) { const base_context = base ? base[context] : undefined; - url[context] = new StorageObject(); + url[context] = new URLContext(); binding.parse(input.trim(), -1, base_context, undefined, onParseComplete.bind(url), onParseError); From cfc8422a68c92808a4a2aee374623bebc768522a Mon Sep 17 00:00:00 2001 From: Timothy Gu Date: Sun, 19 Mar 2017 16:11:10 -0700 Subject: [PATCH 070/198] lib: use Object.create(null) directly After V8 5.6, using Object.create(null) directly is now faster than using a constructor for map-like objects. PR-URL: https://github.com/nodejs/node/pull/11930 Refs: https://github.com/emberjs/ember.js/issues/15001 Refs: https://crrev.com/532c16eca071df3ec8eed394dcebb932ef584ee6 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: James M Snell --- lib/_http_outgoing.js | 5 ++--- lib/events.js | 20 +++++++------------- lib/fs.js | 11 +++++------ lib/internal/querystring.js | 8 +------- lib/querystring.js | 3 +-- lib/url.js | 6 +++--- 6 files changed, 19 insertions(+), 34 deletions(-) diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js index cdca2d4e89..a8e04d543a 100644 --- a/lib/_http_outgoing.js +++ b/lib/_http_outgoing.js @@ -31,7 +31,6 @@ const common = require('_http_common'); const checkIsHttpToken = common._checkIsHttpToken; const checkInvalidHeaderChar = common._checkInvalidHeaderChar; const outHeadersKey = require('internal/http').outHeadersKey; -const StorageObject = require('internal/querystring').StorageObject; const CRLF = common.CRLF; const debug = common.debug; @@ -143,7 +142,7 @@ Object.defineProperty(OutgoingMessage.prototype, '_headerNames', { get: function() { const headers = this[outHeadersKey]; if (headers) { - const out = new StorageObject(); + const out = Object.create(null); const keys = Object.keys(headers); for (var i = 0; i < keys.length; ++i) { const key = keys[i]; @@ -552,7 +551,7 @@ OutgoingMessage.prototype.getHeaderNames = function getHeaderNames() { // Returns a shallow copy of the current outgoing headers. OutgoingMessage.prototype.getHeaders = function getHeaders() { const headers = this[outHeadersKey]; - const ret = new StorageObject(); + const ret = Object.create(null); if (headers) { const keys = Object.keys(headers); for (var i = 0; i < keys.length; ++i) { diff --git a/lib/events.js b/lib/events.js index a186d71257..dfd0ed57d4 100644 --- a/lib/events.js +++ b/lib/events.js @@ -23,12 +23,6 @@ var domain; -// This constructor is used to store event handlers. Instantiating this is -// faster than explicitly calling `Object.create(null)` to get a "clean" empty -// object (tested with v8 v4.9). -function EventHandlers() {} -EventHandlers.prototype = Object.create(null); - function EventEmitter() { EventEmitter.init.call(this); } @@ -75,7 +69,7 @@ EventEmitter.init = function() { } if (!this._events || this._events === Object.getPrototypeOf(this)._events) { - this._events = new EventHandlers(); + this._events = Object.create(null); this._eventsCount = 0; } @@ -245,7 +239,7 @@ function _addListener(target, type, listener, prepend) { events = target._events; if (!events) { - events = target._events = new EventHandlers(); + events = target._events = Object.create(null); target._eventsCount = 0; } else { // To avoid recursion in the case that type === "newListener"! Before @@ -360,7 +354,7 @@ EventEmitter.prototype.removeListener = if (list === listener || list.listener === listener) { if (--this._eventsCount === 0) - this._events = new EventHandlers(); + this._events = Object.create(null); else { delete events[type]; if (events.removeListener) @@ -383,7 +377,7 @@ EventEmitter.prototype.removeListener = if (list.length === 1) { list[0] = undefined; if (--this._eventsCount === 0) { - this._events = new EventHandlers(); + this._events = Object.create(null); return this; } else { delete events[type]; @@ -412,11 +406,11 @@ EventEmitter.prototype.removeAllListeners = // not listening for removeListener, no need to emit if (!events.removeListener) { if (arguments.length === 0) { - this._events = new EventHandlers(); + this._events = Object.create(null); this._eventsCount = 0; } else if (events[type]) { if (--this._eventsCount === 0) - this._events = new EventHandlers(); + this._events = Object.create(null); else delete events[type]; } @@ -432,7 +426,7 @@ EventEmitter.prototype.removeAllListeners = this.removeAllListeners(key); } this.removeAllListeners('removeListener'); - this._events = new EventHandlers(); + this._events = Object.create(null); this._eventsCount = 0; return this; } diff --git a/lib/fs.js b/lib/fs.js index 3d65b2efa0..2c2cfae5a5 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -43,7 +43,6 @@ const internalUtil = require('internal/util'); const assertEncoding = internalFS.assertEncoding; const stringToFlags = internalFS.stringToFlags; const getPathFromURL = internalURL.getPathFromURL; -const { StorageObject } = require('internal/querystring'); Object.defineProperty(exports, 'constants', { configurable: false, @@ -1560,7 +1559,7 @@ if (isWindows) { nextPart = function nextPart(p, i) { return p.indexOf('/', i); }; } -const emptyObj = new StorageObject(); +const emptyObj = Object.create(null); fs.realpathSync = function realpathSync(p, options) { if (!options) options = emptyObj; @@ -1580,8 +1579,8 @@ fs.realpathSync = function realpathSync(p, options) { return maybeCachedResult; } - const seenLinks = new StorageObject(); - const knownHard = new StorageObject(); + const seenLinks = Object.create(null); + const knownHard = Object.create(null); const original = p; // current character position in p @@ -1700,8 +1699,8 @@ fs.realpath = function realpath(p, options, callback) { return; p = pathModule.resolve(p); - const seenLinks = new StorageObject(); - const knownHard = new StorageObject(); + const seenLinks = Object.create(null); + const knownHard = Object.create(null); // current character position in p var pos; diff --git a/lib/internal/querystring.js b/lib/internal/querystring.js index c5dc0f63c7..d168441809 100644 --- a/lib/internal/querystring.js +++ b/lib/internal/querystring.js @@ -23,13 +23,7 @@ const isHexTable = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // ... 256 ]; -// Instantiating this is faster than explicitly calling `Object.create(null)` -// to get a "clean" empty object (tested with v8 v4.9). -function StorageObject() {} -StorageObject.prototype = Object.create(null); - module.exports = { hexTable, - isHexTable, - StorageObject + isHexTable }; diff --git a/lib/querystring.js b/lib/querystring.js index 1533c8d87b..1976c8e125 100644 --- a/lib/querystring.js +++ b/lib/querystring.js @@ -25,7 +25,6 @@ const { Buffer } = require('buffer'); const { - StorageObject, hexTable, isHexTable } = require('internal/querystring'); @@ -281,7 +280,7 @@ const defEqCodes = [61]; // = // Parse a key/val string. function parse(qs, sep, eq, options) { - const obj = new StorageObject(); + const obj = Object.create(null); if (typeof qs !== 'string' || qs.length === 0) { return obj; diff --git a/lib/url.js b/lib/url.js index 395a583cb7..4b2ef9b68e 100644 --- a/lib/url.js +++ b/lib/url.js @@ -23,7 +23,7 @@ const { toASCII } = process.binding('config').hasIntl ? process.binding('icu') : require('punycode'); -const { StorageObject, hexTable } = require('internal/querystring'); +const { hexTable } = require('internal/querystring'); const internalUrl = require('internal/url'); exports.parse = urlParse; exports.resolve = urlResolve; @@ -197,7 +197,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { } } else if (parseQueryString) { this.search = ''; - this.query = new StorageObject(); + this.query = Object.create(null); } return this; } @@ -390,7 +390,7 @@ Url.prototype.parse = function(url, parseQueryString, slashesDenoteHost) { } else if (parseQueryString) { // no query string, but parseQueryString still requested this.search = ''; - this.query = new StorageObject(); + this.query = Object.create(null); } var firstIdx = (questionIdx !== -1 && From 2141d374527337f7e1c74c9efad217b017d945cf Mon Sep 17 00:00:00 2001 From: Chris Burkhart Date: Wed, 21 Dec 2016 09:32:21 -0800 Subject: [PATCH 071/198] events: update and clarify error message MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update error message that's thrown when no error listeners are attached to an emitter. PR-URL: https://github.com/nodejs/node/pull/10387 Reviewed-By: Sam Roberts Reviewed-By: Colin Ihrig Reviewed-By: Luigi Pinca Reviewed-By: Italo A. Casas Reviewed-By: James M Snell Reviewed-By: Michaël Zasso --- lib/events.js | 4 ++-- test/parallel/test-event-emitter-errors.js | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/events.js b/lib/events.js index dfd0ed57d4..eabf5c2cc7 100644 --- a/lib/events.js +++ b/lib/events.js @@ -171,7 +171,7 @@ EventEmitter.prototype.emit = function emit(type) { er = arguments[1]; if (domain) { if (!er) - er = new Error('Uncaught, unspecified "error" event'); + er = new Error('Unhandled "error" event'); if (typeof er === 'object' && er !== null) { er.domainEmitter = this; er.domain = domain; @@ -182,7 +182,7 @@ EventEmitter.prototype.emit = function emit(type) { throw er; // Unhandled 'error' event } else { // At least give some kind of context to the user - var err = new Error('Uncaught, unspecified "error" event. (' + er + ')'); + const err = new Error('Unhandled "error" event. (' + er + ')'); err.context = er; throw err; } diff --git a/test/parallel/test-event-emitter-errors.js b/test/parallel/test-event-emitter-errors.js index 2b4a93ae98..be4f4007f0 100644 --- a/test/parallel/test-event-emitter-errors.js +++ b/test/parallel/test-event-emitter-errors.js @@ -5,6 +5,10 @@ const assert = require('assert'); const EE = new EventEmitter(); -assert.throws(function() { +assert.throws(() => { EE.emit('error', 'Accepts a string'); -}, /Accepts a string/); +}, /^Error: Unhandled "error" event\. \(Accepts a string\)$/); + +assert.throws(() => { + EE.emit('error', {message: 'Error!'}); +}, /^Error: Unhandled "error" event\. \(\[object Object\]\)$/); From e0bc5a7361b1d29c3ed034155fd779ce6f44fb13 Mon Sep 17 00:00:00 2001 From: Bryan English Date: Wed, 26 Oct 2016 15:21:36 -0700 Subject: [PATCH 072/198] process: maintain constructor descriptor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use the original property descriptor instead of just taking the value, which would, by default, be non-writable and non-configurable. PR-URL: https://github.com/nodejs/node/pull/9306 Reviewed-By: Anna Henningsen Reviewed-By: Colin Ihrig Reviewed-By: Michaël Zasso --- lib/internal/bootstrap_node.js | 5 ++--- test/parallel/test-process-prototype.js | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 test/parallel/test-process-prototype.js diff --git a/lib/internal/bootstrap_node.js b/lib/internal/bootstrap_node.js index 51b7f928cb..ab3665f03d 100644 --- a/lib/internal/bootstrap_node.js +++ b/lib/internal/bootstrap_node.js @@ -13,10 +13,9 @@ const EventEmitter = NativeModule.require('events'); process._eventsCount = 0; + const origProcProto = Object.getPrototypeOf(process); Object.setPrototypeOf(process, Object.create(EventEmitter.prototype, { - constructor: { - value: process.constructor - } + constructor: Object.getOwnPropertyDescriptor(origProcProto, 'constructor') })); EventEmitter.call(process); diff --git a/test/parallel/test-process-prototype.js b/test/parallel/test-process-prototype.js new file mode 100644 index 0000000000..0a0de8123d --- /dev/null +++ b/test/parallel/test-process-prototype.js @@ -0,0 +1,15 @@ +'use strict'; +require('../common'); +const assert = require('assert'); +const EventEmitter = require('events'); + +const proto = Object.getPrototypeOf(process); + +assert(proto instanceof EventEmitter); + +const desc = Object.getOwnPropertyDescriptor(proto, 'constructor'); + +assert.strictEqual(desc.value, process.constructor); +assert.strictEqual(desc.writable, true); +assert.strictEqual(desc.enumerable, false); +assert.strictEqual(desc.configurable, true); From c459d8ea5d402c702948c860d9497b2230ff7e8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 21 Mar 2017 10:16:54 +0100 Subject: [PATCH 073/198] deps: update V8 to 5.7.492.69 PR-URL: https://github.com/nodejs/node/pull/11752 Reviewed-By: Ben Noordhuis Reviewed-By: Franziska Hinkelmann --- deps/v8/.clang-format | 1 + deps/v8/.gn | 31 +- deps/v8/AUTHORS | 2 + deps/v8/BUILD.gn | 197 +- deps/v8/ChangeLog | 2490 ++++++++++++ deps/v8/DEPS | 22 +- deps/v8/OWNERS | 7 + deps/v8/PRESUBMIT.py | 15 +- deps/v8/build_overrides/build.gni | 6 + deps/v8/build_overrides/v8.gni | 15 +- deps/v8/gni/isolate.gni | 5 +- deps/v8/gni/v8.gni | 26 +- deps/v8/gypfiles/all.gyp | 6 +- deps/v8/gypfiles/get_landmines.py | 1 + deps/v8/gypfiles/toolchain.gypi | 2 + .../v8/gypfiles/win/msvs_dependencies.isolate | 97 + deps/v8/include/libplatform/libplatform.h | 11 + deps/v8/include/v8-debug.h | 80 +- deps/v8/include/v8-inspector.h | 6 +- deps/v8/include/v8-version-string.h | 33 + deps/v8/include/v8-version.h | 6 +- deps/v8/include/v8.h | 465 ++- deps/v8/infra/config/cq.cfg | 1 - deps/v8/infra/mb/mb_config.pyl | 15 +- deps/v8/src/DEPS | 2 + deps/v8/src/accessors.cc | 101 +- deps/v8/src/accessors.h | 1 - deps/v8/src/allocation.cc | 17 - deps/v8/src/allocation.h | 19 +- deps/v8/src/api-arguments-inl.h | 20 + deps/v8/src/api-arguments.cc | 15 + deps/v8/src/api-arguments.h | 2 + deps/v8/src/api-experimental.cc | 3 +- deps/v8/src/api-natives.cc | 67 +- deps/v8/src/api.cc | 727 ++-- deps/v8/src/api.h | 3 +- deps/v8/src/arguments.h | 3 +- deps/v8/src/arm/assembler-arm-inl.h | 2 +- deps/v8/src/arm/assembler-arm.cc | 786 +++- deps/v8/src/arm/assembler-arm.h | 131 +- deps/v8/src/arm/code-stubs-arm.cc | 486 +-- deps/v8/src/arm/code-stubs-arm.h | 19 - deps/v8/src/arm/codegen-arm.cc | 358 +- deps/v8/src/arm/constants-arm.h | 25 +- deps/v8/src/arm/disasm-arm.cc | 379 +- deps/v8/src/arm/interface-descriptors-arm.cc | 8 +- deps/v8/src/arm/macro-assembler-arm.cc | 430 +- deps/v8/src/arm/macro-assembler-arm.h | 104 +- deps/v8/src/arm/simulator-arm.cc | 1201 +++++- deps/v8/src/arm/simulator-arm.h | 11 +- deps/v8/src/arm64/assembler-arm64.cc | 15 +- deps/v8/src/arm64/assembler-arm64.h | 3 - deps/v8/src/arm64/code-stubs-arm64.cc | 452 +-- deps/v8/src/arm64/code-stubs-arm64.h | 8 - deps/v8/src/arm64/codegen-arm64.cc | 290 +- .../src/arm64/interface-descriptors-arm64.cc | 12 +- deps/v8/src/arm64/macro-assembler-arm64.cc | 316 +- deps/v8/src/arm64/macro-assembler-arm64.h | 94 +- deps/v8/src/asmjs/OWNERS | 1 + deps/v8/src/asmjs/asm-js.cc | 129 +- deps/v8/src/asmjs/asm-js.h | 4 +- deps/v8/src/asmjs/asm-typer.cc | 407 +- deps/v8/src/asmjs/asm-typer.h | 80 +- deps/v8/src/asmjs/asm-types.cc | 1 + deps/v8/src/asmjs/asm-wasm-builder.cc | 465 ++- deps/v8/src/asmjs/asm-wasm-builder.h | 14 +- deps/v8/src/assembler-inl.h | 32 + deps/v8/src/assembler.cc | 74 +- deps/v8/src/assembler.h | 47 +- deps/v8/src/assert-scope.cc | 10 +- deps/v8/src/assert-scope.h | 23 +- deps/v8/src/ast/ast-expression-rewriter.cc | 6 +- .../ast/ast-function-literal-id-reindexer.cc | 29 + .../ast/ast-function-literal-id-reindexer.h | 36 + deps/v8/src/ast/ast-literal-reindexer.cc | 4 + deps/v8/src/ast/ast-numbering.cc | 119 +- deps/v8/src/ast/ast-numbering.h | 15 +- deps/v8/src/ast/ast-traversal-visitor.h | 8 +- deps/v8/src/ast/ast-types.cc | 7 +- deps/v8/src/ast/ast-value-factory.cc | 45 +- deps/v8/src/ast/ast-value-factory.h | 129 +- deps/v8/src/ast/ast.cc | 226 +- deps/v8/src/ast/ast.h | 353 +- deps/v8/src/ast/compile-time-value.cc | 4 +- deps/v8/src/ast/compile-time-value.h | 4 +- deps/v8/src/ast/modules.cc | 2 + deps/v8/src/ast/prettyprinter.cc | 53 +- deps/v8/src/ast/prettyprinter.h | 4 +- deps/v8/src/ast/scopes.cc | 511 ++- deps/v8/src/ast/scopes.h | 118 +- deps/v8/src/ast/variables.cc | 1 + deps/v8/src/bailout-reason.h | 9 +- deps/v8/src/base.isolate | 3 + deps/v8/src/base/cpu.cc | 10 +- deps/v8/src/base/cpu.h | 1 + deps/v8/src/base/hashmap.h | 17 +- deps/v8/src/base/iterator.h | 2 - deps/v8/src/base/logging.cc | 15 +- deps/v8/src/base/logging.h | 105 +- deps/v8/src/base/macros.h | 19 - deps/v8/src/base/platform/platform-linux.cc | 110 +- deps/v8/src/base/platform/platform-posix.cc | 23 + deps/v8/src/base/platform/platform-win32.cc | 7 + deps/v8/src/base/platform/platform.h | 8 + deps/v8/src/bit-vector.cc | 1 + deps/v8/src/bit-vector.h | 2 +- deps/v8/src/bootstrapper.cc | 981 +++-- deps/v8/src/bootstrapper.h | 1 + deps/v8/src/builtins/arm/builtins-arm.cc | 156 +- deps/v8/src/builtins/arm64/builtins-arm64.cc | 164 +- deps/v8/src/builtins/builtins-api.cc | 1 + deps/v8/src/builtins/builtins-array.cc | 1806 +++++---- deps/v8/src/builtins/builtins-boolean.cc | 29 +- deps/v8/src/builtins/builtins-constructor.cc | 772 ++++ deps/v8/src/builtins/builtins-constructor.h | 68 + deps/v8/src/builtins/builtins-conversion.cc | 321 +- deps/v8/src/builtins/builtins-date.cc | 308 +- deps/v8/src/builtins/builtins-function.cc | 208 +- deps/v8/src/builtins/builtins-generator.cc | 36 +- deps/v8/src/builtins/builtins-global.cc | 107 +- deps/v8/src/builtins/builtins-handler.cc | 239 +- deps/v8/src/builtins/builtins-ic.cc | 78 + deps/v8/src/builtins/builtins-internal.cc | 268 +- deps/v8/src/builtins/builtins-iterator.cc | 68 - deps/v8/src/builtins/builtins-math.cc | 515 ++- deps/v8/src/builtins/builtins-number.cc | 1663 ++++---- deps/v8/src/builtins/builtins-object.cc | 698 ++-- deps/v8/src/builtins/builtins-promise.cc | 1574 +++++++- deps/v8/src/builtins/builtins-promise.h | 120 + deps/v8/src/builtins/builtins-reflect.cc | 34 +- deps/v8/src/builtins/builtins-regexp.cc | 3214 ++++++++------- .../builtins/builtins-sharedarraybuffer.cc | 155 +- deps/v8/src/builtins/builtins-string.cc | 1451 +++---- deps/v8/src/builtins/builtins-symbol.cc | 76 +- deps/v8/src/builtins/builtins-typedarray.cc | 152 +- deps/v8/src/builtins/builtins-utils.h | 35 +- deps/v8/src/builtins/builtins.cc | 17 +- deps/v8/src/builtins/builtins.h | 1396 ++++--- deps/v8/src/builtins/ia32/builtins-ia32.cc | 160 +- deps/v8/src/builtins/mips/builtins-mips.cc | 171 +- .../v8/src/builtins/mips64/builtins-mips64.cc | 469 +-- deps/v8/src/builtins/ppc/builtins-ppc.cc | 174 +- deps/v8/src/builtins/s390/builtins-s390.cc | 168 +- deps/v8/src/builtins/x64/builtins-x64.cc | 175 +- deps/v8/src/builtins/x87/OWNERS | 1 + deps/v8/src/builtins/x87/builtins-x87.cc | 168 +- deps/v8/src/cancelable-task.cc | 27 +- deps/v8/src/cancelable-task.h | 16 +- deps/v8/src/code-events.h | 2 +- deps/v8/src/code-factory.cc | 144 +- deps/v8/src/code-factory.h | 25 +- deps/v8/src/code-stub-assembler.cc | 3321 ++++++---------- deps/v8/src/code-stub-assembler.h | 1469 ++++--- deps/v8/src/code-stubs-hydrogen.cc | 460 +-- deps/v8/src/code-stubs.cc | 1828 ++------- deps/v8/src/code-stubs.h | 687 +--- deps/v8/src/codegen.cc | 92 + deps/v8/src/codegen.h | 37 - deps/v8/src/compilation-info.cc | 13 +- deps/v8/src/compilation-info.h | 12 +- deps/v8/src/compilation-statistics.cc | 10 +- deps/v8/src/compilation-statistics.h | 1 + .../compiler-dispatcher-job.cc | 213 +- .../compiler-dispatcher-job.h | 28 +- .../compiler-dispatcher-tracer.cc | 34 +- .../compiler-dispatcher-tracer.h | 11 +- .../compiler-dispatcher.cc | 631 +++ .../compiler-dispatcher/compiler-dispatcher.h | 175 + deps/v8/src/compiler.cc | 415 +- deps/v8/src/compiler.h | 26 +- deps/v8/src/compiler/OWNERS | 1 + deps/v8/src/compiler/access-builder.cc | 549 +-- deps/v8/src/compiler/access-builder.h | 24 +- deps/v8/src/compiler/access-info.cc | 48 +- deps/v8/src/compiler/access-info.h | 3 +- .../v8/src/compiler/arm/code-generator-arm.cc | 276 +- .../src/compiler/arm/instruction-codes-arm.h | 23 +- .../compiler/arm/instruction-scheduler-arm.cc | 21 + .../compiler/arm/instruction-selector-arm.cc | 180 +- .../compiler/arm64/code-generator-arm64.cc | 66 +- .../arm64/instruction-selector-arm64.cc | 44 +- deps/v8/src/compiler/ast-graph-builder.cc | 1361 +------ deps/v8/src/compiler/ast-graph-builder.h | 61 +- .../compiler/ast-loop-assignment-analyzer.cc | 2 + deps/v8/src/compiler/branch-elimination.cc | 21 +- deps/v8/src/compiler/bytecode-analysis.cc | 622 +++ deps/v8/src/compiler/bytecode-analysis.h | 126 + .../src/compiler/bytecode-branch-analysis.cc | 43 - .../src/compiler/bytecode-branch-analysis.h | 65 - .../v8/src/compiler/bytecode-graph-builder.cc | 541 +-- deps/v8/src/compiler/bytecode-graph-builder.h | 57 +- deps/v8/src/compiler/bytecode-liveness-map.cc | 42 + deps/v8/src/compiler/bytecode-liveness-map.h | 119 + .../v8/src/compiler/bytecode-loop-analysis.cc | 100 - deps/v8/src/compiler/bytecode-loop-analysis.h | 67 - deps/v8/src/compiler/code-assembler.cc | 1051 ++--- deps/v8/src/compiler/code-assembler.h | 369 +- deps/v8/src/compiler/code-generator.cc | 162 +- deps/v8/src/compiler/code-generator.h | 24 +- .../src/compiler/common-operator-reducer.cc | 69 +- deps/v8/src/compiler/common-operator.cc | 301 +- deps/v8/src/compiler/common-operator.h | 136 +- deps/v8/src/compiler/control-builders.cc | 61 +- deps/v8/src/compiler/control-builders.h | 53 - deps/v8/src/compiler/dead-code-elimination.cc | 31 +- .../src/compiler/effect-control-linearizer.cc | 3526 ++++++----------- .../src/compiler/effect-control-linearizer.h | 244 +- .../src/compiler/escape-analysis-reducer.cc | 42 +- .../v8/src/compiler/escape-analysis-reducer.h | 1 + deps/v8/src/compiler/escape-analysis.cc | 74 +- deps/v8/src/compiler/escape-analysis.h | 2 +- deps/v8/src/compiler/frame-elider.cc | 35 +- deps/v8/src/compiler/frame-states.cc | 1 + deps/v8/src/compiler/frame.h | 32 +- deps/v8/src/compiler/graph-assembler.cc | 287 ++ deps/v8/src/compiler/graph-assembler.h | 449 +++ deps/v8/src/compiler/graph-reducer.cc | 43 +- deps/v8/src/compiler/graph-visualizer.cc | 6 +- .../src/compiler/ia32/code-generator-ia32.cc | 196 +- .../ia32/instruction-selector-ia32.cc | 94 +- deps/v8/src/compiler/instruction-codes.h | 9 +- .../src/compiler/instruction-selector-impl.h | 23 +- deps/v8/src/compiler/instruction-selector.cc | 261 +- deps/v8/src/compiler/instruction-selector.h | 20 +- deps/v8/src/compiler/instruction.cc | 16 +- deps/v8/src/compiler/instruction.h | 146 +- deps/v8/src/compiler/int64-lowering.cc | 10 +- deps/v8/src/compiler/js-builtin-reducer.cc | 310 +- deps/v8/src/compiler/js-builtin-reducer.h | 3 +- deps/v8/src/compiler/js-call-reducer.cc | 200 +- deps/v8/src/compiler/js-call-reducer.h | 13 +- .../src/compiler/js-context-specialization.cc | 116 +- .../src/compiler/js-context-specialization.h | 6 +- deps/v8/src/compiler/js-create-lowering.cc | 227 +- .../src/compiler/js-frame-specialization.cc | 3 + deps/v8/src/compiler/js-generic-lowering.cc | 207 +- .../js-global-object-specialization.cc | 61 +- deps/v8/src/compiler/js-graph.cc | 26 +- deps/v8/src/compiler/js-graph.h | 6 +- deps/v8/src/compiler/js-inlining-heuristic.cc | 4 +- deps/v8/src/compiler/js-inlining.cc | 87 +- deps/v8/src/compiler/js-intrinsic-lowering.cc | 31 +- deps/v8/src/compiler/js-intrinsic-lowering.h | 3 +- .../js-native-context-specialization.cc | 452 ++- .../js-native-context-specialization.h | 7 +- deps/v8/src/compiler/js-operator.cc | 196 +- deps/v8/src/compiler/js-operator.h | 90 +- deps/v8/src/compiler/js-typed-lowering.cc | 178 +- deps/v8/src/compiler/js-typed-lowering.h | 3 +- deps/v8/src/compiler/linkage.cc | 3 - deps/v8/src/compiler/load-elimination.cc | 270 +- deps/v8/src/compiler/load-elimination.h | 55 + .../v8/src/compiler/machine-graph-verifier.cc | 194 +- deps/v8/src/compiler/machine-graph-verifier.h | 3 +- .../src/compiler/machine-operator-reducer.cc | 80 +- .../src/compiler/machine-operator-reducer.h | 5 +- deps/v8/src/compiler/machine-operator.cc | 166 +- deps/v8/src/compiler/machine-operator.h | 14 +- deps/v8/src/compiler/memory-optimizer.cc | 185 +- deps/v8/src/compiler/memory-optimizer.h | 3 + .../src/compiler/mips/code-generator-mips.cc | 223 +- .../compiler/mips/instruction-codes-mips.h | 4 - .../mips/instruction-selector-mips.cc | 123 +- .../compiler/mips64/code-generator-mips64.cc | 383 +- .../mips64/instruction-codes-mips64.h | 4 - .../mips64/instruction-selector-mips64.cc | 202 +- deps/v8/src/compiler/node-marker.h | 13 +- deps/v8/src/compiler/node-properties.cc | 14 +- deps/v8/src/compiler/node-properties.h | 5 + deps/v8/src/compiler/node.cc | 6 - deps/v8/src/compiler/node.h | 167 +- deps/v8/src/compiler/opcodes.h | 67 +- deps/v8/src/compiler/operation-typer.cc | 84 +- deps/v8/src/compiler/operator-properties.cc | 3 + deps/v8/src/compiler/osr.cc | 23 +- deps/v8/src/compiler/pipeline.cc | 329 +- deps/v8/src/compiler/pipeline.h | 21 +- .../v8/src/compiler/ppc/code-generator-ppc.cc | 210 +- .../src/compiler/ppc/instruction-codes-ppc.h | 5 +- .../compiler/ppc/instruction-scheduler-ppc.cc | 3 +- .../compiler/ppc/instruction-selector-ppc.cc | 40 +- deps/v8/src/compiler/raw-machine-assembler.cc | 318 +- deps/v8/src/compiler/raw-machine-assembler.h | 64 +- .../v8/src/compiler/redundancy-elimination.cc | 58 +- deps/v8/src/compiler/redundancy-elimination.h | 3 + .../compiler/register-allocator-verifier.cc | 32 +- deps/v8/src/compiler/register-allocator.cc | 41 +- deps/v8/src/compiler/representation-change.cc | 65 +- deps/v8/src/compiler/representation-change.h | 1 + .../src/compiler/s390/code-generator-s390.cc | 176 +- .../compiler/s390/instruction-codes-s390.h | 1 - .../s390/instruction-scheduler-s390.cc | 1 - .../s390/instruction-selector-s390.cc | 139 +- deps/v8/src/compiler/schedule.cc | 2 +- deps/v8/src/compiler/simd-scalar-lowering.cc | 254 +- deps/v8/src/compiler/simd-scalar-lowering.h | 7 + deps/v8/src/compiler/simplified-lowering.cc | 185 +- .../compiler/simplified-operator-reducer.cc | 9 + deps/v8/src/compiler/simplified-operator.cc | 116 +- deps/v8/src/compiler/simplified-operator.h | 76 +- deps/v8/src/compiler/state-values-utils.cc | 323 +- deps/v8/src/compiler/state-values-utils.h | 49 +- deps/v8/src/compiler/type-cache.h | 16 +- deps/v8/src/compiler/type-hint-analyzer.cc | 128 - deps/v8/src/compiler/type-hint-analyzer.h | 57 - deps/v8/src/compiler/typed-optimization.cc | 37 +- deps/v8/src/compiler/typed-optimization.h | 1 + deps/v8/src/compiler/typer.cc | 105 +- deps/v8/src/compiler/types.cc | 27 +- deps/v8/src/compiler/types.h | 29 +- .../src/compiler/value-numbering-reducer.cc | 19 +- deps/v8/src/compiler/verifier.cc | 59 +- deps/v8/src/compiler/wasm-compiler.cc | 858 ++-- deps/v8/src/compiler/wasm-compiler.h | 81 +- deps/v8/src/compiler/wasm-linkage.cc | 28 +- .../v8/src/compiler/x64/code-generator-x64.cc | 311 +- .../src/compiler/x64/instruction-codes-x64.h | 8 +- .../compiler/x64/instruction-scheduler-x64.cc | 4 +- .../compiler/x64/instruction-selector-x64.cc | 266 +- .../v8/src/compiler/x87/code-generator-x87.cc | 8 +- .../compiler/x87/instruction-selector-x87.cc | 14 + deps/v8/src/contexts-inl.h | 7 + deps/v8/src/contexts.cc | 200 +- deps/v8/src/contexts.h | 203 +- deps/v8/src/conversions-inl.h | 54 +- deps/v8/src/conversions.cc | 144 +- deps/v8/src/conversions.h | 8 + deps/v8/src/counters-inl.h | 51 + deps/v8/src/counters.cc | 50 +- deps/v8/src/counters.h | 186 +- .../src/crankshaft/arm/lithium-codegen-arm.cc | 30 +- .../crankshaft/arm64/lithium-codegen-arm64.cc | 16 +- .../v8/src/crankshaft/hydrogen-instructions.h | 8 +- deps/v8/src/crankshaft/hydrogen-types.cc | 1 + deps/v8/src/crankshaft/hydrogen.cc | 204 +- deps/v8/src/crankshaft/hydrogen.h | 48 +- .../crankshaft/ia32/lithium-codegen-ia32.cc | 33 +- .../crankshaft/mips/lithium-codegen-mips.cc | 40 +- .../mips64/lithium-codegen-mips64.cc | 33 +- .../src/crankshaft/ppc/lithium-codegen-ppc.cc | 55 +- .../crankshaft/s390/lithium-codegen-s390.cc | 226 +- deps/v8/src/crankshaft/s390/lithium-s390.cc | 31 +- deps/v8/src/crankshaft/s390/lithium-s390.h | 16 - deps/v8/src/crankshaft/typing.cc | 1 + .../src/crankshaft/x64/lithium-codegen-x64.cc | 20 +- deps/v8/src/crankshaft/x87/OWNERS | 1 + .../src/crankshaft/x87/lithium-codegen-x87.cc | 33 +- deps/v8/src/d8.cc | 305 +- deps/v8/src/d8.h | 8 +- deps/v8/src/debug/arm/debug-arm.cc | 2 +- deps/v8/src/debug/arm64/debug-arm64.cc | 2 +- deps/v8/src/debug/debug-evaluate.cc | 316 +- deps/v8/src/debug/debug-evaluate.h | 11 +- deps/v8/src/debug/debug-frames.cc | 49 +- deps/v8/src/debug/debug-frames.h | 6 +- deps/v8/src/debug/debug-interface.h | 343 +- deps/v8/src/debug/debug-scopes.cc | 64 +- deps/v8/src/debug/debug-scopes.h | 8 +- deps/v8/src/debug/debug.cc | 571 +-- deps/v8/src/debug/debug.h | 145 +- deps/v8/src/debug/debug.js | 106 +- deps/v8/src/debug/ia32/debug-ia32.cc | 2 +- deps/v8/src/debug/interface-types.h | 75 + deps/v8/src/debug/liveedit.cc | 46 +- deps/v8/src/debug/liveedit.h | 10 +- deps/v8/src/debug/liveedit.js | 119 +- deps/v8/src/debug/mips/debug-mips.cc | 2 +- deps/v8/src/debug/mips64/debug-mips64.cc | 2 +- deps/v8/src/debug/mirrors.js | 36 +- deps/v8/src/debug/ppc/debug-ppc.cc | 2 +- deps/v8/src/debug/s390/debug-s390.cc | 2 +- deps/v8/src/debug/x64/debug-x64.cc | 2 +- deps/v8/src/debug/x87/OWNERS | 1 + deps/v8/src/debug/x87/debug-x87.cc | 2 +- deps/v8/src/deoptimizer.cc | 542 ++- deps/v8/src/deoptimizer.h | 10 +- deps/v8/src/elements-kind.cc | 1 + deps/v8/src/elements.cc | 200 +- deps/v8/src/elements.h | 3 + deps/v8/src/execution.cc | 70 +- deps/v8/src/execution.h | 33 +- .../externalize-string-extension.cc | 1 + deps/v8/src/external-reference-table.cc | 18 +- deps/v8/src/factory.cc | 247 +- deps/v8/src/factory.h | 53 +- deps/v8/src/fast-accessor-assembler.cc | 141 +- deps/v8/src/fast-accessor-assembler.h | 14 +- deps/v8/src/field-type.cc | 1 + deps/v8/src/flag-definitions.h | 119 +- deps/v8/src/frames-inl.h | 14 +- deps/v8/src/frames.cc | 471 ++- deps/v8/src/frames.h | 279 +- .../src/full-codegen/arm/full-codegen-arm.cc | 951 +---- .../full-codegen/arm64/full-codegen-arm64.cc | 954 +---- deps/v8/src/full-codegen/full-codegen.cc | 552 +-- deps/v8/src/full-codegen/full-codegen.h | 134 +- .../full-codegen/ia32/full-codegen-ia32.cc | 912 +---- .../full-codegen/mips/full-codegen-mips.cc | 937 +---- .../mips64/full-codegen-mips64.cc | 935 +---- .../src/full-codegen/ppc/full-codegen-ppc.cc | 944 +---- .../full-codegen/s390/full-codegen-s390.cc | 989 +---- .../src/full-codegen/x64/full-codegen-x64.cc | 918 +---- deps/v8/src/full-codegen/x87/OWNERS | 1 + .../src/full-codegen/x87/full-codegen-x87.cc | 912 +---- deps/v8/src/futex-emulation.cc | 1 + deps/v8/src/global-handles.cc | 31 +- deps/v8/src/global-handles.h | 11 +- deps/v8/src/globals.h | 75 +- deps/v8/src/handles.h | 9 +- deps/v8/src/heap-symbols.h | 39 +- deps/v8/src/heap/array-buffer-tracker.cc | 4 +- deps/v8/src/heap/embedder-tracing.cc | 72 + deps/v8/src/heap/embedder-tracing.h | 67 + deps/v8/src/heap/gc-idle-time-handler.cc | 1 + deps/v8/src/heap/gc-idle-time-handler.h | 2 + deps/v8/src/heap/gc-tracer.cc | 14 +- deps/v8/src/heap/gc-tracer.h | 6 + deps/v8/src/heap/heap-inl.h | 15 +- deps/v8/src/heap/heap.cc | 397 +- deps/v8/src/heap/heap.h | 129 +- deps/v8/src/heap/incremental-marking.cc | 126 +- deps/v8/src/heap/incremental-marking.h | 8 +- deps/v8/src/heap/mark-compact-inl.h | 9 +- deps/v8/src/heap/mark-compact.cc | 341 +- deps/v8/src/heap/mark-compact.h | 62 +- deps/v8/src/heap/memory-reducer.cc | 40 +- deps/v8/src/heap/memory-reducer.h | 15 +- deps/v8/src/heap/object-stats.cc | 13 +- deps/v8/src/heap/objects-visiting-inl.h | 38 +- deps/v8/src/heap/objects-visiting.cc | 2 +- deps/v8/src/heap/objects-visiting.h | 15 +- deps/v8/src/heap/remembered-set.h | 15 +- deps/v8/src/heap/scavenger.cc | 2 +- deps/v8/src/heap/slot-set.h | 12 + deps/v8/src/heap/spaces-inl.h | 67 +- deps/v8/src/heap/spaces.cc | 88 +- deps/v8/src/heap/spaces.h | 72 +- deps/v8/src/heap/store-buffer.cc | 34 +- deps/v8/src/heap/store-buffer.h | 93 +- deps/v8/src/i18n.cc | 84 +- deps/v8/src/i18n.h | 38 +- deps/v8/src/ia32/assembler-ia32.cc | 9 +- deps/v8/src/ia32/assembler-ia32.h | 3 - deps/v8/src/ia32/code-stubs-ia32.cc | 568 +-- deps/v8/src/ia32/code-stubs-ia32.h | 18 - deps/v8/src/ia32/codegen-ia32.cc | 331 +- deps/v8/src/ia32/deoptimizer-ia32.cc | 3 +- .../v8/src/ia32/interface-descriptors-ia32.cc | 9 +- deps/v8/src/ia32/macro-assembler-ia32.cc | 292 +- deps/v8/src/ia32/macro-assembler-ia32.h | 81 +- deps/v8/src/ic/accessor-assembler-impl.h | 203 + deps/v8/src/ic/accessor-assembler.cc | 1933 +++++++++ deps/v8/src/ic/accessor-assembler.h | 45 + deps/v8/src/ic/arm/handler-compiler-arm.cc | 79 - deps/v8/src/ic/arm/ic-arm.cc | 485 --- deps/v8/src/ic/arm/ic-compiler-arm.cc | 33 - deps/v8/src/ic/arm/stub-cache-arm.cc | 157 - .../v8/src/ic/arm64/handler-compiler-arm64.cc | 78 - deps/v8/src/ic/arm64/ic-arm64.cc | 450 --- deps/v8/src/ic/arm64/ic-compiler-arm64.cc | 33 - deps/v8/src/ic/arm64/stub-cache-arm64.cc | 156 - deps/v8/src/ic/handler-compiler.cc | 320 +- deps/v8/src/ic/handler-compiler.h | 43 - deps/v8/src/ic/handler-configuration-inl.h | 3 +- deps/v8/src/ic/ia32/handler-compiler-ia32.cc | 82 - deps/v8/src/ic/ia32/ic-compiler-ia32.cc | 45 - deps/v8/src/ic/ia32/ic-ia32.cc | 478 --- deps/v8/src/ic/ia32/stub-cache-ia32.cc | 185 - deps/v8/src/ic/ic-compiler.cc | 45 +- deps/v8/src/ic/ic-compiler.h | 15 +- deps/v8/src/ic/ic-inl.h | 4 +- deps/v8/src/ic/ic-state.cc | 17 + deps/v8/src/ic/ic-state.h | 8 + deps/v8/src/ic/ic-stats.cc | 144 + deps/v8/src/ic/ic-stats.h | 77 + deps/v8/src/ic/ic.cc | 523 ++- deps/v8/src/ic/ic.h | 23 +- deps/v8/src/ic/keyed-store-generic.cc | 355 +- deps/v8/src/ic/keyed-store-generic.h | 9 +- deps/v8/src/ic/mips/handler-compiler-mips.cc | 79 - deps/v8/src/ic/mips/ic-compiler-mips.cc | 33 - deps/v8/src/ic/mips/ic-mips.cc | 483 --- deps/v8/src/ic/mips/stub-cache-mips.cc | 157 - .../src/ic/mips64/handler-compiler-mips64.cc | 79 - deps/v8/src/ic/mips64/ic-compiler-mips64.cc | 33 - deps/v8/src/ic/mips64/ic-mips64.cc | 484 --- deps/v8/src/ic/mips64/stub-cache-mips64.cc | 161 - deps/v8/src/ic/ppc/handler-compiler-ppc.cc | 80 - deps/v8/src/ic/ppc/ic-compiler-ppc.cc | 31 - deps/v8/src/ic/ppc/ic-ppc.cc | 482 --- deps/v8/src/ic/ppc/stub-cache-ppc.cc | 176 - deps/v8/src/ic/s390/handler-compiler-s390.cc | 72 - deps/v8/src/ic/s390/ic-compiler-s390.cc | 29 - deps/v8/src/ic/s390/ic-s390.cc | 477 +-- deps/v8/src/ic/s390/stub-cache-s390.cc | 173 - deps/v8/src/ic/stub-cache.h | 7 - deps/v8/src/ic/x64/handler-compiler-x64.cc | 82 - deps/v8/src/ic/x64/ic-compiler-x64.cc | 39 - deps/v8/src/ic/x64/ic-x64.cc | 476 --- deps/v8/src/ic/x64/stub-cache-x64.cc | 153 - deps/v8/src/ic/x87/OWNERS | 1 + deps/v8/src/ic/x87/handler-compiler-x87.cc | 82 - deps/v8/src/ic/x87/ic-compiler-x87.cc | 45 - deps/v8/src/ic/x87/ic-x87.cc | 478 --- deps/v8/src/ic/x87/stub-cache-x87.cc | 185 - deps/v8/src/inspector/BUILD.gn | 5 +- deps/v8/src/inspector/DEPS | 1 + deps/v8/src/inspector/debugger-script.js | 74 +- .../src/inspector/debugger_script_externs.js | 51 +- .../src/inspector/injected-script-native.cc | 6 +- .../v8/src/inspector/injected-script-native.h | 3 +- .../src/inspector/injected-script-source.js | 21 +- deps/v8/src/inspector/injected-script.cc | 28 +- deps/v8/src/inspector/injected-script.h | 6 +- deps/v8/src/inspector/inspected-context.cc | 12 +- deps/v8/src/inspector/inspected-context.h | 2 + deps/v8/src/inspector/inspector.gyp | 28 - deps/v8/src/inspector/inspector.gypi | 5 +- .../inspector/inspector_protocol_config.json | 29 +- .../src/inspector/java-script-call-frame.cc | 16 +- .../v8/src/inspector/java-script-call-frame.h | 7 +- deps/v8/src/inspector/js_protocol.json | 12 +- deps/v8/src/inspector/protocol-platform.h | 21 - deps/v8/src/inspector/remote-object-id.cc | 3 +- deps/v8/src/inspector/script-breakpoint.h | 21 +- deps/v8/src/inspector/search-util.cc | 3 +- deps/v8/src/inspector/string-16.cc | 27 +- deps/v8/src/inspector/string-16.h | 2 +- deps/v8/src/inspector/string-util.cc | 16 +- deps/v8/src/inspector/string-util.h | 8 +- deps/v8/src/inspector/test-interface.cc | 18 + deps/v8/src/inspector/test-interface.h | 18 + deps/v8/src/inspector/v8-console-message.cc | 43 +- deps/v8/src/inspector/v8-console-message.h | 8 +- deps/v8/src/inspector/v8-console.cc | 23 + .../src/inspector/v8-debugger-agent-impl.cc | 202 +- .../v8/src/inspector/v8-debugger-agent-impl.h | 3 +- deps/v8/src/inspector/v8-debugger-script.cc | 230 +- deps/v8/src/inspector/v8-debugger-script.h | 60 +- deps/v8/src/inspector/v8-debugger.cc | 428 +- deps/v8/src/inspector/v8-debugger.h | 49 +- deps/v8/src/inspector/v8-function-call.cc | 3 +- .../inspector/v8-heap-profiler-agent-impl.cc | 10 +- deps/v8/src/inspector/v8-inspector-impl.cc | 137 +- deps/v8/src/inspector/v8-inspector-impl.h | 22 +- .../inspector/v8-inspector-session-impl.cc | 69 +- .../src/inspector/v8-inspector-session-impl.h | 6 +- .../src/inspector/v8-internal-value-type.cc | 1 - .../src/inspector/v8-profiler-agent-impl.cc | 4 - .../v8/src/inspector/v8-profiler-agent-impl.h | 2 - .../v8/src/inspector/v8-runtime-agent-impl.cc | 32 +- deps/v8/src/inspector/v8-stack-trace-impl.cc | 38 +- deps/v8/src/inspector/wasm-translation.cc | 309 ++ deps/v8/src/inspector/wasm-translation.h | 75 + deps/v8/src/interface-descriptors.cc | 110 +- deps/v8/src/interface-descriptors.h | 74 +- deps/v8/src/interpreter/OWNERS | 1 + .../interpreter/bytecode-array-accessor.cc | 205 + .../src/interpreter/bytecode-array-accessor.h | 76 + .../src/interpreter/bytecode-array-builder.cc | 116 +- .../src/interpreter/bytecode-array-builder.h | 51 +- .../interpreter/bytecode-array-iterator.cc | 175 +- .../src/interpreter/bytecode-array-iterator.h | 49 +- .../bytecode-array-random-iterator.cc | 37 + .../bytecode-array-random-iterator.h | 78 + .../src/interpreter/bytecode-array-writer.cc | 11 +- deps/v8/src/interpreter/bytecode-flags.cc | 8 +- deps/v8/src/interpreter/bytecode-generator.cc | 459 ++- deps/v8/src/interpreter/bytecode-generator.h | 13 +- deps/v8/src/interpreter/bytecode-label.cc | 1 + deps/v8/src/interpreter/bytecode-label.h | 4 +- deps/v8/src/interpreter/bytecode-operands.h | 55 +- .../bytecode-peephole-optimizer.cc | 73 +- .../src/interpreter/bytecode-peephole-table.h | 21 +- deps/v8/src/interpreter/bytecode-pipeline.h | 138 +- .../bytecode-register-optimizer.cc | 34 +- .../interpreter/bytecode-register-optimizer.h | 27 +- deps/v8/src/interpreter/bytecodes.h | 221 +- .../src/interpreter/constant-array-builder.cc | 34 +- .../src/interpreter/constant-array-builder.h | 5 +- .../src/interpreter/control-flow-builders.cc | 7 +- .../src/interpreter/control-flow-builders.h | 19 +- .../src/interpreter/handler-table-builder.h | 2 +- .../src/interpreter/interpreter-assembler.cc | 217 +- .../src/interpreter/interpreter-assembler.h | 50 +- .../src/interpreter/interpreter-intrinsics.cc | 33 +- .../src/interpreter/interpreter-intrinsics.h | 37 +- deps/v8/src/interpreter/interpreter.cc | 1052 +++-- deps/v8/src/interpreter/interpreter.h | 9 + deps/v8/src/interpreter/mkpeephole.cc | 22 + deps/v8/src/isolate-inl.h | 5 + deps/v8/src/isolate.cc | 563 ++- deps/v8/src/isolate.h | 93 +- deps/v8/src/js/array.js | 23 +- deps/v8/src/js/arraybuffer.js | 8 - deps/v8/src/js/async-await.js | 61 +- deps/v8/src/js/collection.js | 16 - deps/v8/src/js/i18n.js | 385 +- deps/v8/src/js/macros.py | 1 - deps/v8/src/js/prologue.js | 26 +- deps/v8/src/js/promise.js | 524 +-- deps/v8/src/js/string.js | 2 +- deps/v8/src/js/symbol.js | 68 - deps/v8/src/js/typedarray.js | 8 +- deps/v8/src/json-parser.cc | 5 +- deps/v8/src/json-stringifier.cc | 3 +- deps/v8/src/keys.cc | 7 +- deps/v8/src/layout-descriptor-inl.h | 2 +- deps/v8/src/layout-descriptor.cc | 3 +- deps/v8/src/layout-descriptor.h | 1 + deps/v8/src/libplatform/default-platform.cc | 48 +- deps/v8/src/libplatform/default-platform.h | 6 +- .../src/libplatform/tracing/trace-config.cc | 9 +- deps/v8/src/list-inl.h | 3 +- deps/v8/src/list.h | 6 +- deps/v8/src/log-utils.h | 4 +- deps/v8/src/log.cc | 55 +- deps/v8/src/lookup.cc | 41 +- deps/v8/src/lookup.h | 2 +- deps/v8/src/machine-type.h | 30 +- deps/v8/src/macro-assembler.h | 21 +- deps/v8/src/map-updater.cc | 615 +++ deps/v8/src/map-updater.h | 173 + deps/v8/src/messages.cc | 359 +- deps/v8/src/messages.h | 79 +- deps/v8/src/mips/assembler-mips.cc | 44 +- deps/v8/src/mips/assembler-mips.h | 33 +- deps/v8/src/mips/code-stubs-mips.cc | 491 +-- deps/v8/src/mips/code-stubs-mips.h | 19 - deps/v8/src/mips/codegen-mips.cc | 373 +- .../v8/src/mips/interface-descriptors-mips.cc | 8 +- deps/v8/src/mips/macro-assembler-mips.cc | 675 ++-- deps/v8/src/mips/macro-assembler-mips.h | 146 +- deps/v8/src/mips/simulator-mips.cc | 8 +- deps/v8/src/mips64/assembler-mips64.cc | 134 +- deps/v8/src/mips64/assembler-mips64.h | 19 +- deps/v8/src/mips64/code-stubs-mips64.cc | 491 +-- deps/v8/src/mips64/code-stubs-mips64.h | 19 - deps/v8/src/mips64/codegen-mips64.cc | 370 +- .../mips64/interface-descriptors-mips64.cc | 8 +- deps/v8/src/mips64/macro-assembler-mips64.cc | 666 +--- deps/v8/src/mips64/macro-assembler-mips64.h | 148 +- deps/v8/src/mips64/simulator-mips64.cc | 8 +- deps/v8/src/objects-body-descriptors-inl.h | 7 +- deps/v8/src/objects-debug.cc | 111 +- deps/v8/src/objects-inl.h | 1784 ++++----- deps/v8/src/objects-printer.cc | 300 +- deps/v8/src/objects.cc | 2428 +++++------- deps/v8/src/objects.h | 1282 +++--- deps/v8/src/objects/module-info.h | 129 + deps/v8/src/objects/object-macros-undef.h | 9 + deps/v8/src/objects/object-macros.h | 32 + .../scopeinfo.cc => objects/scope-info.cc} | 54 +- deps/v8/src/objects/scope-info.h | 345 ++ deps/v8/src/parsing/OWNERS | 1 + deps/v8/src/parsing/duplicate-finder.cc | 69 +- deps/v8/src/parsing/duplicate-finder.h | 28 +- deps/v8/src/parsing/func-name-inferrer.cc | 7 +- .../parsing/parameter-initializer-rewriter.cc | 3 +- deps/v8/src/parsing/parse-info.cc | 18 +- deps/v8/src/parsing/parse-info.h | 24 +- deps/v8/src/parsing/parser-base.h | 304 +- deps/v8/src/parsing/parser.cc | 875 ++-- deps/v8/src/parsing/parser.h | 122 +- deps/v8/src/parsing/parsing.cc | 62 + deps/v8/src/parsing/parsing.h | 34 + deps/v8/src/parsing/pattern-rewriter.cc | 15 +- deps/v8/src/parsing/preparse-data-format.h | 2 +- deps/v8/src/parsing/preparse-data.cc | 5 +- deps/v8/src/parsing/preparse-data.h | 12 +- deps/v8/src/parsing/preparser.cc | 89 +- deps/v8/src/parsing/preparser.h | 298 +- deps/v8/src/parsing/rewriter.cc | 36 +- .../src/parsing/scanner-character-streams.cc | 73 +- .../src/parsing/scanner-character-streams.h | 4 +- deps/v8/src/parsing/scanner.cc | 105 +- deps/v8/src/parsing/scanner.h | 90 +- deps/v8/src/perf-jit.cc | 98 +- deps/v8/src/ppc/assembler-ppc.cc | 56 +- deps/v8/src/ppc/assembler-ppc.h | 20 +- deps/v8/src/ppc/code-stubs-ppc.cc | 492 +-- deps/v8/src/ppc/code-stubs-ppc.h | 13 - deps/v8/src/ppc/codegen-ppc.cc | 324 +- deps/v8/src/ppc/constants-ppc.h | 53 +- deps/v8/src/ppc/disasm-ppc.cc | 45 + deps/v8/src/ppc/interface-descriptors-ppc.cc | 8 +- deps/v8/src/ppc/macro-assembler-ppc.cc | 260 +- deps/v8/src/ppc/macro-assembler-ppc.h | 76 +- deps/v8/src/ppc/simulator-ppc.cc | 128 +- deps/v8/src/ppc/simulator-ppc.h | 1 + .../profiler/heap-snapshot-generator-inl.h | 14 +- .../src/profiler/heap-snapshot-generator.cc | 33 +- .../v8/src/profiler/heap-snapshot-generator.h | 17 +- deps/v8/src/profiler/profile-generator.cc | 26 +- deps/v8/src/profiler/profiler-listener.cc | 7 +- deps/v8/src/promise-utils.cc | 75 - deps/v8/src/promise-utils.h | 32 - deps/v8/src/property-descriptor.cc | 23 +- deps/v8/src/property-details.h | 62 +- deps/v8/src/property.cc | 77 +- deps/v8/src/property.h | 75 +- deps/v8/src/prototype.h | 4 +- deps/v8/src/regexp/interpreter-irregexp.cc | 1 + deps/v8/src/regexp/jsregexp.cc | 31 +- .../regexp/regexp-macro-assembler-irregexp.cc | 3 +- .../regexp/regexp-macro-assembler-tracer.cc | 1 + deps/v8/src/regexp/regexp-parser.cc | 56 +- deps/v8/src/regexp/regexp-utils.cc | 9 +- deps/v8/src/regexp/x87/OWNERS | 1 + deps/v8/src/runtime-profiler.cc | 6 +- deps/v8/src/runtime/runtime-array.cc | 99 +- deps/v8/src/runtime/runtime-atomics.cc | 16 +- deps/v8/src/runtime/runtime-classes.cc | 182 +- deps/v8/src/runtime/runtime-collections.cc | 54 +- deps/v8/src/runtime/runtime-compiler.cc | 35 +- deps/v8/src/runtime/runtime-debug.cc | 414 +- deps/v8/src/runtime/runtime-error.cc | 2 +- deps/v8/src/runtime/runtime-function.cc | 38 +- deps/v8/src/runtime/runtime-futex.cc | 6 +- deps/v8/src/runtime/runtime-generator.cc | 83 +- deps/v8/src/runtime/runtime-i18n.cc | 453 +-- deps/v8/src/runtime/runtime-internal.cc | 166 +- deps/v8/src/runtime/runtime-interpreter.cc | 20 +- deps/v8/src/runtime/runtime-literals.cc | 38 +- deps/v8/src/runtime/runtime-liveedit.cc | 40 +- deps/v8/src/runtime/runtime-maths.cc | 2 +- deps/v8/src/runtime/runtime-module.cc | 6 +- deps/v8/src/runtime/runtime-numbers.cc | 22 +- deps/v8/src/runtime/runtime-object.cc | 172 +- deps/v8/src/runtime/runtime-promise.cc | 270 +- deps/v8/src/runtime/runtime-proxy.cc | 12 +- deps/v8/src/runtime/runtime-regexp.cc | 263 +- deps/v8/src/runtime/runtime-scopes.cc | 95 +- deps/v8/src/runtime/runtime-simd.cc | 64 +- deps/v8/src/runtime/runtime-strings.cc | 170 +- deps/v8/src/runtime/runtime-symbol.cc | 15 +- deps/v8/src/runtime/runtime-test.cc | 218 +- deps/v8/src/runtime/runtime-typedarray.cc | 22 +- deps/v8/src/runtime/runtime-utils.h | 11 +- deps/v8/src/runtime/runtime-wasm.cc | 142 +- deps/v8/src/runtime/runtime.cc | 1 + deps/v8/src/runtime/runtime.h | 146 +- deps/v8/src/s390/assembler-s390.cc | 603 +-- deps/v8/src/s390/assembler-s390.h | 354 +- deps/v8/src/s390/code-stubs-s390.cc | 495 +-- deps/v8/src/s390/code-stubs-s390.h | 13 - deps/v8/src/s390/codegen-s390.cc | 326 +- deps/v8/src/s390/constants-s390.h | 2403 +++++++---- deps/v8/src/s390/disasm-s390.cc | 36 + .../v8/src/s390/interface-descriptors-s390.cc | 8 +- deps/v8/src/s390/macro-assembler-s390.cc | 471 +-- deps/v8/src/s390/macro-assembler-s390.h | 101 +- deps/v8/src/s390/simulator-s390.cc | 244 +- deps/v8/src/s390/simulator-s390.h | 9 + deps/v8/src/snapshot/code-serializer.cc | 27 +- deps/v8/src/snapshot/deserializer.cc | 22 +- deps/v8/src/snapshot/deserializer.h | 9 +- deps/v8/src/snapshot/partial-serializer.cc | 12 +- deps/v8/src/snapshot/partial-serializer.h | 2 +- deps/v8/src/snapshot/serializer-common.cc | 12 +- deps/v8/src/snapshot/serializer-common.h | 2 + deps/v8/src/snapshot/snapshot-common.cc | 8 +- deps/v8/src/snapshot/snapshot-source-sink.cc | 2 +- deps/v8/src/snapshot/snapshot.h | 3 +- deps/v8/src/snapshot/startup-serializer.cc | 13 +- deps/v8/src/snapshot/startup-serializer.h | 1 + deps/v8/src/source-position.cc | 33 +- deps/v8/src/source-position.h | 9 +- deps/v8/src/string-case.cc | 130 + deps/v8/src/string-case.h | 17 + deps/v8/src/string-stream.cc | 56 +- deps/v8/src/string-stream.h | 116 +- deps/v8/src/tracing/traced-value.cc | 40 +- deps/v8/src/tracing/traced-value.h | 9 +- .../src/tracing/tracing-category-observer.cc | 7 + deps/v8/src/transitions.cc | 6 +- deps/v8/src/trap-handler/trap-handler.h | 26 + deps/v8/src/type-feedback-vector-inl.h | 23 +- deps/v8/src/type-feedback-vector.cc | 205 +- deps/v8/src/type-feedback-vector.h | 107 +- deps/v8/src/type-hints.cc | 51 + deps/v8/src/type-hints.h | 4 + deps/v8/src/type-info.cc | 4 + deps/v8/src/utils.h | 51 +- deps/v8/src/v8.cc | 2 +- deps/v8/src/v8.gyp | 79 +- deps/v8/src/value-serializer.cc | 70 +- deps/v8/src/value-serializer.h | 3 +- deps/v8/src/vector.h | 5 +- deps/v8/src/version.cc | 22 +- deps/v8/src/wasm/OWNERS | 1 + deps/v8/src/wasm/decoder.h | 43 +- ...st-decoder.cc => function-body-decoder.cc} | 936 ++--- ...{ast-decoder.h => function-body-decoder.h} | 166 +- deps/v8/src/wasm/module-decoder.cc | 389 +- deps/v8/src/wasm/module-decoder.h | 24 +- deps/v8/src/wasm/wasm-debug.cc | 341 +- deps/v8/src/wasm/wasm-external-refs.cc | 13 + deps/v8/src/wasm/wasm-external-refs.h | 6 + deps/v8/src/wasm/wasm-interpreter.cc | 199 +- deps/v8/src/wasm/wasm-interpreter.h | 36 +- deps/v8/src/wasm/wasm-js.cc | 719 +++- deps/v8/src/wasm/wasm-js.h | 11 +- deps/v8/src/wasm/wasm-limits.h | 45 + deps/v8/src/wasm/wasm-macro-gen.h | 62 +- deps/v8/src/wasm/wasm-module-builder.cc | 118 +- deps/v8/src/wasm/wasm-module-builder.h | 30 +- deps/v8/src/wasm/wasm-module.cc | 1913 +++++---- deps/v8/src/wasm/wasm-module.h | 234 +- deps/v8/src/wasm/wasm-objects.cc | 678 +++- deps/v8/src/wasm/wasm-objects.h | 321 +- deps/v8/src/wasm/wasm-opcodes.cc | 5 +- deps/v8/src/wasm/wasm-opcodes.h | 219 +- deps/v8/src/wasm/wasm-result.cc | 11 + deps/v8/src/wasm/wasm-result.h | 3 + deps/v8/src/wasm/wasm-text.cc | 312 ++ deps/v8/src/wasm/wasm-text.h | 38 + deps/v8/src/x64/assembler-x64-inl.h | 2 +- deps/v8/src/x64/assembler-x64.cc | 187 +- deps/v8/src/x64/assembler-x64.h | 3 - deps/v8/src/x64/code-stubs-x64.cc | 428 +- deps/v8/src/x64/code-stubs-x64.h | 17 - deps/v8/src/x64/codegen-x64.cc | 331 +- deps/v8/src/x64/interface-descriptors-x64.cc | 9 +- deps/v8/src/x64/macro-assembler-x64.cc | 282 +- deps/v8/src/x64/macro-assembler-x64.h | 85 +- deps/v8/src/x87/OWNERS | 1 + deps/v8/src/x87/assembler-x87.cc | 9 +- deps/v8/src/x87/assembler-x87.h | 3 - deps/v8/src/x87/code-stubs-x87.cc | 565 +-- deps/v8/src/x87/code-stubs-x87.h | 18 - deps/v8/src/x87/codegen-x87.cc | 296 +- deps/v8/src/x87/deoptimizer-x87.cc | 3 +- deps/v8/src/x87/interface-descriptors-x87.cc | 9 +- deps/v8/src/x87/macro-assembler-x87.cc | 290 +- deps/v8/src/x87/macro-assembler-x87.h | 80 +- deps/v8/src/zone/zone-chunk-list.h | 1 + deps/v8/src/zone/zone-containers.h | 7 + deps/v8/src/zone/zone-handle-set.h | 165 + deps/v8/src/zone/zone.cc | 1 + deps/v8/test/BUILD.gn | 6 +- deps/v8/test/cctest/BUILD.gn | 24 +- deps/v8/test/cctest/asmjs/OWNERS | 1 + deps/v8/test/cctest/asmjs/test-asm-typer.cc | 76 +- deps/v8/test/cctest/cctest.gyp | 39 +- deps/v8/test/cctest/cctest.h | 15 +- deps/v8/test/cctest/cctest.status | 100 +- .../cctest/compiler/code-assembler-tester.h | 57 +- .../test/cctest/compiler/function-tester.cc | 12 +- .../v8/test/cctest/compiler/function-tester.h | 3 +- .../cctest/compiler/test-code-assembler.cc | 312 +- .../test-js-context-specialization.cc | 472 ++- .../cctest/compiler/test-js-typed-lowering.cc | 9 +- .../compiler/test-loop-assignment-analysis.cc | 28 +- .../compiler/test-machine-operator-reducer.cc | 16 +- .../compiler/test-representation-change.cc | 2 +- .../test-run-bytecode-graph-builder.cc | 34 +- .../test/cctest/compiler/test-run-inlining.cc | 471 --- .../cctest/compiler/test-run-intrinsics.cc | 15 - .../test/cctest/compiler/test-run-jscalls.cc | 1 + .../test/cctest/compiler/test-run-machops.cc | 24 + .../cctest/compiler/test-run-native-calls.cc | 52 +- .../cctest/compiler/test-run-variables.cc | 1 + .../cctest/compiler/test-run-wasm-machops.cc | 44 +- deps/v8/test/cctest/heap/heap-tester.h | 1 + deps/v8/test/cctest/heap/heap-utils.cc | 1 + deps/v8/test/cctest/heap/test-alloc.cc | 6 +- .../cctest/heap/test-array-buffer-tracker.cc | 5 + deps/v8/test/cctest/heap/test-heap.cc | 211 +- .../cctest/heap/test-incremental-marking.cc | 28 +- deps/v8/test/cctest/heap/test-mark-compact.cc | 34 + .../test/cctest/heap/test-page-promotion.cc | 1 + .../bytecode-expectations-printer.cc | 25 +- .../ArrayLiterals.golden | 16 +- .../ArrayLiteralsWide.golden | 2 +- .../AssignmentsInBinaryExpression.golden | 42 +- .../bytecode_expectations/BasicLoops.golden | 166 +- .../BreakableBlocks.golden | 15 +- .../bytecode_expectations/CallGlobal.golden | 10 +- .../CallLookupSlot.golden | 12 +- .../bytecode_expectations/CallNew.golden | 15 +- .../bytecode_expectations/CallRuntime.golden | 4 +- .../ClassAndSuperClass.golden | 28 +- .../ClassDeclarations.golden | 177 +- .../CompoundExpressions.golden | 6 +- .../ConstVariableContextSlot.golden | 16 +- .../ContextParameters.golden | 16 +- .../ContextVariables.golden | 25 +- .../CountOperators.golden | 14 +- .../CreateRestParameter.golden | 2 +- .../DeclareGlobals.golden | 7 +- .../bytecode_expectations/Delete.golden | 4 +- .../bytecode_expectations/ForIn.golden | 8 +- .../bytecode_expectations/ForOf.golden | 199 +- .../FunctionLiterals.golden | 12 +- .../GenerateTestUndetectable.golden | 239 ++ .../bytecode_expectations/Generators.golden | 565 +-- .../GlobalCompoundExpressions.golden | 8 +- .../GlobalCountOperators.golden | 16 +- .../bytecode_expectations/GlobalDelete.golden | 12 +- .../LetVariableContextSlot.golden | 16 +- .../bytecode_expectations/LoadGlobal.golden | 20 +- .../bytecode_expectations/Modules.golden | 703 ++-- .../ObjectLiterals.golden | 98 +- .../OuterContextVariables.golden | 2 +- .../PrimitiveExpressions.golden | 40 +- .../bytecode_expectations/PropertyCall.golden | 2 +- .../RemoveRedundantLdar.golden | 6 +- .../SuperCallAndSpread.golden | 155 + .../bytecode_expectations/Switch.golden | 2 +- .../TopLevelObjectLiterals.golden | 6 +- .../bytecode_expectations/TryCatch.golden | 21 +- .../bytecode_expectations/TryFinally.golden | 45 +- .../bytecode_expectations/Typeof.golden | 5 +- .../UnaryOperators.golden | 21 +- .../cctest/interpreter/interpreter-tester.cc | 4 +- .../interpreter/test-bytecode-generator.cc | 95 +- .../test-interpreter-intrinsics.cc | 21 - .../cctest/interpreter/test-interpreter.cc | 25 +- .../interpreter/test-source-positions.cc | 4 +- .../test/cctest/libplatform/test-tracing.cc | 8 + .../cctest/parsing/test-parse-decision.cc | 107 + .../cctest/parsing/test-scanner-streams.cc | 31 +- deps/v8/test/cctest/parsing/test-scanner.cc | 37 +- deps/v8/test/cctest/test-access-checks.cc | 99 + .../v8/test/cctest/test-accessor-assembler.cc | 263 ++ deps/v8/test/cctest/test-api-accessors.cc | 31 + .../cctest/test-api-fast-accessor-builder.cc | 1 + deps/v8/test/cctest/test-api-interceptors.cc | 128 +- deps/v8/test/cctest/test-api.cc | 984 +++-- deps/v8/test/cctest/test-assembler-arm.cc | 700 +++- deps/v8/test/cctest/test-assembler-mips.cc | 6 +- deps/v8/test/cctest/test-assembler-mips64.cc | 6 +- deps/v8/test/cctest/test-assembler-s390.cc | 89 +- deps/v8/test/cctest/test-assembler-x64.cc | 183 + deps/v8/test/cctest/test-ast.cc | 48 +- .../test/cctest/test-code-stub-assembler.cc | 1534 ++++--- deps/v8/test/cctest/test-compiler.cc | 2 +- deps/v8/test/cctest/test-conversions.cc | 58 + deps/v8/test/cctest/test-cpu-profiler.cc | 12 +- deps/v8/test/cctest/test-debug.cc | 1933 +-------- deps/v8/test/cctest/test-disasm-arm.cc | 187 + deps/v8/test/cctest/test-extra.js | 3 +- deps/v8/test/cctest/test-feedback-vector.cc | 14 + .../test/cctest/test-field-type-tracking.cc | 186 +- deps/v8/test/cctest/test-flags.cc | 2 +- deps/v8/test/cctest/test-global-handles.cc | 1 + deps/v8/test/cctest/test-global-object.cc | 28 + deps/v8/test/cctest/test-heap-profiler.cc | 96 +- .../cctest/test-inobject-slack-tracking.cc | 5 +- deps/v8/test/cctest/test-javascript-arm64.cc | 1 + .../v8/test/cctest/test-js-arm64-variables.cc | 1 + deps/v8/test/cctest/test-liveedit.cc | 1 + deps/v8/test/cctest/test-lockers.cc | 4 +- deps/v8/test/cctest/test-log.cc | 1 + .../test/cctest/test-macro-assembler-arm.cc | 356 ++ .../test/cctest/test-macro-assembler-mips.cc | 609 ++- .../cctest/test-macro-assembler-mips64.cc | 791 +++- deps/v8/test/cctest/test-object.cc | 1 + deps/v8/test/cctest/test-parsing.cc | 1111 ++++-- deps/v8/test/cctest/test-profile-generator.cc | 1 + deps/v8/test/cctest/test-regexp.cc | 3 +- deps/v8/test/cctest/test-serialize.cc | 370 +- deps/v8/test/cctest/test-strings.cc | 36 + .../v8/test/cctest/test-thread-termination.cc | 5 +- deps/v8/test/cctest/test-transitions.cc | 19 - deps/v8/test/cctest/test-typedarrays.cc | 1 + deps/v8/test/cctest/test-unboxed-doubles.cc | 28 +- deps/v8/test/cctest/test-usecounters.cc | 43 + deps/v8/test/cctest/test-weakmaps.cc | 1 + deps/v8/test/cctest/wasm/OWNERS | 1 + deps/v8/test/cctest/wasm/test-run-wasm-64.cc | 473 ++- .../test/cctest/wasm/test-run-wasm-asmjs.cc | 177 +- .../cctest/wasm/test-run-wasm-interpreter.cc | 102 +- deps/v8/test/cctest/wasm/test-run-wasm-js.cc | 98 +- .../test/cctest/wasm/test-run-wasm-module.cc | 168 +- .../cctest/wasm/test-run-wasm-relocation.cc | 28 +- .../wasm/test-run-wasm-simd-lowering.cc | 262 +- .../v8/test/cctest/wasm/test-run-wasm-simd.cc | 400 +- deps/v8/test/cctest/wasm/test-run-wasm.cc | 1431 ++++--- .../test/cctest/wasm/test-wasm-breakpoints.cc | 70 + deps/v8/test/cctest/wasm/test-wasm-stack.cc | 62 +- .../cctest/wasm/test-wasm-trap-position.cc | 54 +- deps/v8/test/cctest/wasm/wasm-run-utils.h | 675 ++-- deps/v8/test/common/wasm/test-signatures.h | 48 +- .../v8/test/common/wasm/wasm-module-runner.cc | 51 +- deps/v8/test/common/wasm/wasm-module-runner.h | 15 +- .../bugs/harmony/debug-blockscopes.js | 69 +- .../debug}/compiler/debug-catch-prediction.js | 1 - .../debug/compiler/osr-typing-debug-change.js | 6 +- .../debug/debug-backtrace.js} | 71 +- .../debug}/debug-break-native.js | 2 - .../debug}/debug-breakpoints.js | 105 - .../debug/debug-clearbreakpoint.js} | 45 +- .../debug}/debug-compile-event.js | 26 +- .../debug}/debug-conditional-breakpoints.js | 23 +- .../debug-enable-disable-breakpoints.js | 47 +- .../debug}/debug-eval-scope.js | 2 +- .../debug}/debug-evaluate-bool-constructor.js | 28 +- .../debug-evaluate-locals-optimized-double.js | 3 +- .../debug}/debug-evaluate-locals.js | 12 +- .../debug-evaluate-no-side-effect-builtins.js | 79 + .../debug/debug-evaluate-no-side-effect.js | 83 + .../debug}/debug-evaluate-shadowed-context.js | 2 +- .../debugger/debug/debug-evaluate-with.js | 2 + .../debug/debug-evaluate.js} | 79 +- .../debugger/debug/debug-function-scopes.js | 191 + .../debug}/debug-liveedit-1.js | 2 - .../debug}/debug-liveedit-2.js | 3 +- .../debug}/debug-liveedit-3.js | 2 - .../debug}/debug-liveedit-4.js | 3 +- .../debug}/debug-liveedit-check-stack.js | 2 - .../debug}/debug-liveedit-compile-error.js | 2 - .../debug}/debug-liveedit-diff.js | 2 - .../debug}/debug-liveedit-double-call.js | 2 - .../debug}/debug-liveedit-exceptions.js | 1 - .../debug}/debug-liveedit-literals.js | 2 - .../debug}/debug-liveedit-newsource.js | 2 - .../debug-liveedit-patch-positions-replace.js | 2 - .../debug}/debug-liveedit-restart-frame.js | 4 +- .../debug}/debug-liveedit-stack-padding.js | 2 - .../debug}/debug-liveedit-stepin.js | 1 - .../debug}/debug-liveedit-utils.js | 2 - .../debug}/debug-multiple-breakpoints.js | 35 +- .../debug}/debug-multiple-var-decl.js | 1 - .../debug}/debug-negative-break-points.js | 29 +- .../debug}/debug-receiver.js | 6 +- .../debug}/debug-return-value.js | 46 - .../debug-scopes-suspended-generators.js | 184 +- .../debug}/debug-scopes.js | 181 +- .../debug}/debug-script.js | 15 +- .../debug}/debug-scripts-throw.js | 6 +- .../debug}/debug-set-variable-value.js | 54 - .../debug}/debug-setbreakpoint.js | 102 +- .../debug}/debug-sourceinfo.js | 12 +- deps/v8/test/debugger/debug/debug-step.js | 38 +- .../debug}/debug-stepframe-clearing.js | 1 - .../debug}/debug-stepframe.js | 1 - .../debug}/es6/debug-blockscopes.js | 70 +- .../debug-evaluate-arrow-function-receiver.js | 3 +- .../debug}/es6/debug-evaluate-blockscopes.js | 2 - .../debug-evaluate-receiver-before-super.js | 3 +- .../debug}/es6/debug-exception-generators.js | 1 - .../debug}/es6/debug-function-scopes.js | 88 +- .../debug}/es6/debug-liveedit-new-target-1.js | 1 - .../debug}/es6/debug-liveedit-new-target-2.js | 1 - .../debug}/es6/debug-liveedit-new-target-3.js | 1 - .../es6/debug-promises/async-task-event.js | 62 - .../debug-promises/promise-all-uncaught.js | 3 - .../debug-promises/promise-race-uncaught.js | 3 - .../es6/debug-promises/reject-caught-all.js | 2 - ...reject-caught-by-default-reject-handler.js | 3 - .../debug-promises/reject-in-constructor.js | 2 - .../es6/debug-promises/reject-uncaught-all.js | 3 - .../debug-promises/reject-uncaught-late.js | 3 - .../reject-uncaught-uncaught.js | 3 - .../reject-with-invalid-reject.js | 1 - .../reject-with-throw-in-reject.js | 1 - .../reject-with-undefined-reject.js | 1 - .../es6/debug-promises/throw-caught-all.js | 2 - .../throw-caught-by-default-reject-handler.js | 3 - .../throw-finally-caught-all.js | 2 - .../debug-promises/throw-in-constructor.js | 2 - .../es6/debug-promises/throw-uncaught-all.js | 3 - .../debug-promises/throw-uncaught-uncaught.js | 4 - .../throw-with-throw-in-reject.js | 2 - .../try-reject-in-constructor.js | 2 - .../try-throw-reject-in-constructor.js | 2 - .../debug-scope-default-param-with-eval.js | 1 - .../es6/debug-stepin-default-parameters.js | 1 - .../debug/es6/debug-stepin-generators.js | 6 +- .../debug}/es6/debug-stepin-microtasks.js | 7 +- .../debug}/es6/debug-stepin-proxies.js | 1 - .../es6/debug-stepin-string-template.js | 1 - .../debug}/es6/debug-stepnext-for.js | 2 +- .../debug/es6/debug-stepnext-generators.js | 48 + .../debug}/es6/default-parameters-debug.js | 4 +- .../debug}/es6/generators-debug-liveedit.js | 1 - .../debug}/es6/generators-debug-scopes.js | 83 +- .../debug}/es6/regress/regress-468661.js | 1 - .../{harmony => es8}/async-debug-basic.js | 2 - .../async-debug-caught-exception-cases.js | 7 +- .../async-debug-caught-exception-cases0.js} | 5 +- .../async-debug-caught-exception-cases1.js | 3 +- .../async-debug-caught-exception-cases2.js | 3 +- .../async-debug-caught-exception-cases3.js | 3 +- .../async-debug-caught-exception.js | 2 - .../async-debug-step-abort-at-break.js | 2 - .../async-debug-step-continue-at-break.js | 2 - .../async-debug-step-in-and-out.js | 2 - .../async-debug-step-in-out-out.js | 2 - .../{harmony => es8}/async-debug-step-in.js | 2 - .../async-debug-step-nested.js | 2 - .../async-debug-step-next-constant.js | 2 - .../{harmony => es8}/async-debug-step-next.js | 2 - .../{harmony => es8}/async-debug-step-out.js | 2 - .../es8}/async-function-debug-evaluate.js | 2 - .../debug/es8}/async-function-debug-scopes.js | 78 +- .../debug-async-break-on-stack.js | 2 - .../{harmony => es8}/debug-async-break.js | 2 - .../debug/es8}/debug-async-liveedit.js | 3 - .../debug}/function-source.js | 2 - .../debug-async-function-async-task-event.js | 97 - .../debug/harmony}/modules-debug-scopes1.js | 160 +- .../debug/harmony}/modules-debug-scopes2.js | 70 +- .../ignition/debug-step-prefix-bytecodes.js | 3 +- .../debug}/ignition/elided-instruction.js | 1 - .../debug}/ignition/optimized-debug-frame.js | 1 - .../debug}/regress-5207.js | 3 +- .../debug}/regress/regress-102153.js | 1 - .../debug}/regress/regress-1081309.js | 58 +- .../debug}/regress/regress-109195.js | 2 +- .../debug}/regress/regress-119609.js | 7 +- .../debugger/debug/regress/regress-131994.js | 2 + .../debug}/regress/regress-1639.js | 18 +- .../debug}/regress/regress-1853.js | 40 +- .../debug}/regress/regress-2296.js | 1 - .../debug}/regress/regress-3960.js | 1 - .../debug}/regress/regress-419663.js | 11 +- .../debug}/regress/regress-4309-2.js | 1 - .../debugger/debug/regress/regress-5071.js | 2 + .../debug}/regress/regress-5164.js | 1 - .../debugger/debug/regress/regress-617882.js | 2 +- .../debugger/debug/regress/regress-94873.js | 76 - .../debug}/regress/regress-crbug-119800.js | 1 - .../debug}/regress/regress-crbug-171715.js | 1 - .../debug}/regress/regress-crbug-222893.js | 4 +- .../debug}/regress/regress-crbug-424142.js | 1 - .../debug}/regress/regress-crbug-432493.js | 1 - .../debug}/regress/regress-crbug-465298.js | 5 +- .../debug}/regress/regress-crbug-481896.js | 3 +- .../debug}/regress/regress-crbug-487289.js | 1 - .../debug}/regress/regress-crbug-491943.js | 1 - .../debug}/regress/regress-crbug-517592.js | 2 +- .../debug/regress/regress-crbug-568477-1.js | 5 +- .../debug}/regress/regress-crbug-568477-2.js | 8 +- .../debug/regress/regress-crbug-568477-3.js | 5 +- .../debug/regress/regress-crbug-568477-4.js | 8 +- .../debug}/regress/regress-crbug-605581.js | 1 - .../debug}/regress/regress-crbug-621361.js | 7 +- .../regress-debug-deopt-while-recompile.js | 1 - .../regress-frame-details-null-receiver.js | 1 - .../regress-prepare-break-while-recompile.js | 1 - .../debug}/wasm/frame-inspection.js | 25 +- deps/v8/test/debugger/debugger.status | 82 +- .../regress/regress-1639-2.js | 33 +- .../regress/regress-2318.js | 2 +- deps/v8/test/debugger/regress/regress-5610.js | 2 +- deps/v8/test/debugger/test-api.js | 583 ++- deps/v8/test/debugger/testcfg.py | 3 + deps/v8/test/fuzzer/fuzzer.gyp | 8 + deps/v8/test/fuzzer/parser.cc | 6 +- deps/v8/test/fuzzer/regexp.cc | 30 +- deps/v8/test/fuzzer/wasm-call.cc | 23 +- deps/v8/test/fuzzer/wasm-code.cc | 51 +- deps/v8/test/inspector/BUILD.gn | 3 +- deps/v8/test/inspector/DEPS | 1 + ...asm-js-breakpoint-before-exec-expected.txt | 30 +- .../debugger/asm-js-breakpoint-before-exec.js | 6 +- .../async-instrumentation-expected.txt | 43 + .../debugger/async-instrumentation.js | 68 + .../async-promise-late-then-expected.txt | 16 + .../debugger/async-promise-late-then.js | 48 + .../debugger/async-set-timeout-expected.txt | 11 + .../inspector/debugger/async-set-timeout.js | 48 + .../debugger/async-stack-await-expected.txt | 42 + .../inspector/debugger/async-stack-await.js | 46 + .../async-stack-for-promise-expected.txt | 155 + .../debugger/async-stack-for-promise.js | 265 ++ .../debugger/async-stacks-limit-expected.txt | 137 + .../inspector/debugger/async-stacks-limit.js | 156 + .../debugger/eval-scopes-expected.txt | 19 + .../v8/test/inspector/debugger/eval-scopes.js | 43 + ...t-preview-internal-properties-expected.txt | 9 +- ...t-parsed-for-runtime-evaluate-expected.txt | 101 + .../script-parsed-for-runtime-evaluate.js | 49 + .../set-script-source-exception-expected.txt | 23 + .../debugger/set-script-source-exception.js | 23 + .../step-into-nested-arrow-expected.txt | 17 + .../debugger/step-into-nested-arrow.js | 23 + .../suspended-generator-scopes-expected.txt | 63 + .../debugger/suspended-generator-scopes.js | 78 + .../debugger/wasm-scripts-expected.txt | 18 + .../test/inspector/debugger/wasm-scripts.js | 71 + .../debugger/wasm-source-expected.txt | 9 + .../v8/test/inspector/debugger/wasm-source.js | 79 + .../debugger/wasm-stack-expected.txt | 6 +- deps/v8/test/inspector/debugger/wasm-stack.js | 14 +- deps/v8/test/inspector/inspector-impl.cc | 13 +- deps/v8/test/inspector/inspector-test.cc | 59 +- deps/v8/test/inspector/inspector.status | 10 + deps/v8/test/inspector/protocol-test.js | 22 +- .../runtime/await-promise-expected.txt | 12 + .../runtime/call-function-on-async.js | 2 +- .../runtime/console-assert-expected.txt | 147 + .../test/inspector/runtime/console-assert.js | 24 + .../console-messages-limits-expected.txt | 7 + .../runtime/console-messages-limits.js | 44 + .../runtime/evaluate-empty-stack-expected.txt | 10 + .../inspector/runtime/evaluate-empty-stack.js | 13 + ...valuate-with-generate-preview-expected.txt | 102 + .../runtime/evaluate-with-generate-preview.js | 76 + .../length-or-size-description-expected.txt | 17 + .../runtime/length-or-size-description.js | 23 + .../runtime/set-or-map-entries-expected.txt | 8 +- deps/v8/test/inspector/task-runner.cc | 35 +- deps/v8/test/inspector/task-runner.h | 23 +- deps/v8/test/intl/assert.js | 6 +- deps/v8/test/intl/bad-target.js | 39 + .../intl/date-format/unmodified-options.js | 17 + deps/v8/test/intl/general/case-mapping.js | 58 +- deps/v8/test/intl/general/constructor.js | 44 + deps/v8/test/intl/intl.status | 4 + deps/v8/test/intl/not-constructors.js | 34 + deps/v8/test/intl/toStringTag.js | 29 + .../AsyncAwait/baseline-babel-es2017.js | 169 + .../AsyncAwait/baseline-naive-promises.js | 52 + .../v8/test/js-perf-test/AsyncAwait/native.js | 43 + deps/v8/test/js-perf-test/AsyncAwait/run.js | 28 + .../v8/test/js-perf-test/Closures/closures.js | 43 + deps/v8/test/js-perf-test/Closures/run.js | 26 + deps/v8/test/js-perf-test/JSTests.json | 39 + deps/v8/test/js-perf-test/RegExp.json | 61 + .../test/js-perf-test/RegExp/RegExpTests.json | 61 + deps/v8/test/js-perf-test/RegExp/base.js | 43 + deps/v8/test/js-perf-test/RegExp/base_ctor.js | 55 + deps/v8/test/js-perf-test/RegExp/base_exec.js | 57 + .../v8/test/js-perf-test/RegExp/base_flags.js | 21 + .../v8/test/js-perf-test/RegExp/base_match.js | 32 + .../test/js-perf-test/RegExp/base_replace.js | 54 + .../test/js-perf-test/RegExp/base_search.js | 33 + .../v8/test/js-perf-test/RegExp/base_split.js | 56 + deps/v8/test/js-perf-test/RegExp/base_test.js | 26 + deps/v8/test/js-perf-test/RegExp/ctor.js | 8 + deps/v8/test/js-perf-test/RegExp/exec.js | 8 + deps/v8/test/js-perf-test/RegExp/flags.js | 8 + deps/v8/test/js-perf-test/RegExp/match.js | 8 + deps/v8/test/js-perf-test/RegExp/replace.js | 8 + deps/v8/test/js-perf-test/RegExp/run.js | 41 + deps/v8/test/js-perf-test/RegExp/search.js | 8 + deps/v8/test/js-perf-test/RegExp/slow_exec.js | 8 + .../v8/test/js-perf-test/RegExp/slow_flags.js | 8 + .../v8/test/js-perf-test/RegExp/slow_match.js | 8 + .../test/js-perf-test/RegExp/slow_replace.js | 8 + .../test/js-perf-test/RegExp/slow_search.js | 8 + .../v8/test/js-perf-test/RegExp/slow_split.js | 8 + deps/v8/test/js-perf-test/RegExp/slow_test.js | 8 + deps/v8/test/js-perf-test/RegExp/split.js | 8 + deps/v8/test/js-perf-test/RegExp/test.js | 8 + deps/v8/test/js-perf-test/SixSpeed.json | 28 + .../array_destructuring.js | 38 + .../SixSpeed/array_destructuring/run.js | 25 + .../object_literals/object_literals.js | 41 + .../SixSpeed/object_literals/run.js | 25 + .../v8/test/message/call-non-constructable.js | 8 + .../test/message/call-non-constructable.out | 9 + .../message/call-primitive-constructor.js | 6 + .../message/call-primitive-constructor.out | 9 + .../test/message/call-primitive-function.js | 6 + .../test/message/call-primitive-function.out | 9 + .../test/message/call-undeclared-function.js | 5 + .../test/message/call-undeclared-function.out | 9 + deps/v8/test/message/for-loop-invalid-lhs.js | 4 - deps/v8/test/message/for-loop-invalid-lhs.out | 2 +- deps/v8/test/message/message.status | 6 - .../message/regress/regress-crbug-661579.js | 12 + .../message/regress/regress-crbug-661579.out | 11 + .../message/regress/regress-crbug-669017.js | 5 + .../message/regress/regress-crbug-669017.out | 8 + deps/v8/test/message/strict-octal-string.out | 4 +- .../message/strict-octal-use-strict-after.out | 4 +- .../strict-octal-use-strict-before.out | 4 +- deps/v8/test/message/tonumber-symbol.js | 9 + deps/v8/test/message/tonumber-symbol.out | 6 + deps/v8/test/message/wasm-trap.js | 15 + deps/v8/test/message/wasm-trap.out | 5 + deps/v8/test/mjsunit/array-length.js | 27 + .../v8/test/mjsunit/array-push-hole-double.js | 23 + deps/v8/test/mjsunit/array-push11.js | 19 +- deps/v8/test/mjsunit/array-push13.js | 22 + deps/v8/test/mjsunit/array-push14.js | 18 + deps/v8/test/mjsunit/asm/asm-validation.js | 144 +- deps/v8/test/mjsunit/asm/regress-641885.js | 13 + deps/v8/test/mjsunit/asm/regress-669899.js | 27 + deps/v8/test/mjsunit/asm/regress-672045.js | 13 + deps/v8/test/mjsunit/asm/regress-676573.js | 17 + deps/v8/test/mjsunit/big-array-literal.js | 5 + .../test/mjsunit/compiler/capture-context.js | 16 + .../mjsunit/compiler/escape-analysis-11.js | 19 + .../mjsunit/compiler/escape-analysis-12.js | 17 + .../compiler/escape-analysis-deopt-6.js | 16 + ...-analysis-framestate-use-at-branchpoint.js | 19 + .../escape-analysis-replacement.js} | 26 +- .../mjsunit/compiler/inline-context-deopt.js | 18 + .../compiler/inline-omit-arguments-deopt.js | 19 + .../compiler/inline-omit-arguments-object.js | 14 + .../mjsunit/compiler/inline-omit-arguments.js | 12 + .../inline-surplus-arguments-deopt.js | 20 + .../inline-surplus-arguments-object.js | 17 + .../compiler/inline-surplus-arguments.js | 12 + .../test/mjsunit/compiler/instanceof-opt1.js | 18 + .../test/mjsunit/compiler/instanceof-opt2.js | 16 + .../test/mjsunit/compiler/instanceof-opt3.js | 17 + .../test/mjsunit/compiler/regress-664117.js | 16 + .../test/mjsunit/compiler/regress-668760.js | 28 + .../test/mjsunit/compiler/regress-669517.js | 17 + .../test/mjsunit/compiler/regress-671574.js | 21 + .../test/mjsunit/compiler/regress-674469.js | 14 + .../mjsunit/compiler/regress-uint8-deopt.js | 17 - .../test/mjsunit/compiler/regress-v8-5756.js | 31 + .../constant-fold-control-instructions.js | 3 - deps/v8/test/mjsunit/cross-realm-filtering.js | 10 + deps/v8/test/mjsunit/debug-backtrace-text.js | 150 - deps/v8/test/mjsunit/debug-backtrace.js | 271 -- .../v8/test/mjsunit/debug-changebreakpoint.js | 102 - deps/v8/test/mjsunit/debug-clearbreakpoint.js | 100 - .../mjsunit/debug-clearbreakpointgroup.js | 127 - .../debug-compile-event-newfunction.js | 68 - deps/v8/test/mjsunit/debug-constructed-by.js | 60 - deps/v8/test/mjsunit/debug-continue.js | 115 - deps/v8/test/mjsunit/debug-evaluate-nested.js | 49 - .../test/mjsunit/debug-evaluate-recursive.js | 167 - .../mjsunit/debug-evaluate-with-context.js | 145 - deps/v8/test/mjsunit/debug-evaluate.js | 156 - deps/v8/test/mjsunit/debug-function-scopes.js | 156 - deps/v8/test/mjsunit/debug-handle.js | 252 -- deps/v8/test/mjsunit/debug-is-active.js | 28 - deps/v8/test/mjsunit/debug-listbreakpoints.js | 210 - .../mjsunit/debug-liveedit-breakpoints.js | 115 - deps/v8/test/mjsunit/debug-referenced-by.js | 112 - deps/v8/test/mjsunit/debug-references.js | 120 - .../debug-script-breakpoints-closure.js | 67 - .../debug-script-breakpoints-nested.js | 82 - .../test/mjsunit/debug-script-breakpoints.js | 125 - deps/v8/test/mjsunit/debug-scripts-request.js | 112 - .../test/mjsunit/debug-set-script-source.js | 64 - .../test/mjsunit/debug-setexceptionbreak.js | 119 - deps/v8/test/mjsunit/debugPrint.js | 29 + ...agerly-parsed-lazily-compiled-functions.js | 2 - deps/v8/test/mjsunit/element-accessor.js | 12 +- .../mjsunit/es6/array-iterator-detached.js | 47 + .../es6/arrow-rest-params-lazy-parsing.js | 2 - .../es6/block-scoping-top-level-sloppy.js | 2 - .../mjsunit/es6/block-scoping-top-level.js | 1 - .../test/mjsunit/es6/classes-lazy-parsing.js | 2 - deps/v8/test/mjsunit/es6/completion.js | 22 +- .../es6/computed-property-names-classes.js | 6 +- .../es6/destructuring-assignment-lazy.js | 2 - deps/v8/test/mjsunit/es6/destructuring.js | 9 +- deps/v8/test/mjsunit/es6/function-name.js | 49 + .../mjsunit/es6/generator-destructuring.js | 9 +- deps/v8/test/mjsunit/es6/generators-mirror.js | 112 - .../v8/test/mjsunit/es6/mirror-collections.js | 165 - deps/v8/test/mjsunit/es6/mirror-iterators.js | 103 - deps/v8/test/mjsunit/es6/mirror-promises.js | 90 - deps/v8/test/mjsunit/es6/mirror-symbols.js | 38 - .../es6/promise-lookup-getter-setter.js | 76 + deps/v8/test/mjsunit/es6/regexp-sticky.js | 7 + .../test/mjsunit/es6/regress/regress-4400.js | 2 - .../mjsunit/es6/regress/regress-594084.js | 1 - deps/v8/test/mjsunit/es6/string-startswith.js | 1 + .../test/mjsunit/es6/typedarray-neutered.js | 781 ++++ deps/v8/test/mjsunit/es6/typedarray.js | 25 + .../async-arrow-lexical-arguments.js | 2 +- .../async-arrow-lexical-new.target.js | 2 +- .../async-arrow-lexical-super.js | 2 +- .../async-arrow-lexical-this.js | 2 +- .../{harmony => es8}/async-await-basic.js | 32 +- .../async-await-no-constructor.js | 4 +- .../async-await-resolve-new.js | 2 - .../{harmony => es8}/async-await-species.js | 2 +- .../{harmony => es8}/async-destructuring.js | 11 +- .../async-function-stacktrace.js | 2 - .../regress/regress-618603.js | 2 - .../regress/regress-624300.js | 2 - .../sloppy-no-duplicate-async.js | 2 - deps/v8/test/mjsunit/fast-prototype.js | 3 +- .../fixed-context-shapes-when-recompiling.js | 264 +- deps/v8/test/mjsunit/for-in.js | 26 + .../mjsunit/harmony/harmony-string-pad-end.js | 2 - .../harmony/harmony-string-pad-start.js | 2 - .../harmony/mirror-async-function-promise.js | 93 - .../mjsunit/harmony/mirror-async-function.js | 76 - .../mjsunit/harmony/object-spread-basic.js | 111 + .../mjsunit/harmony/regexp-property-blocks.js | 36 - .../harmony/regexp-property-enumerated.js | 19 +- .../harmony/regexp-property-exact-match.js | 2 +- .../regexp-property-general-category.js | 4 + .../harmony/regexp-property-invalid.js | 38 + .../regexp-property-script-extensions.js | 2821 +++++++++++++ deps/v8/test/mjsunit/ignition/regress-5768.js | 16 + deps/v8/test/mjsunit/lazy-inner-functions.js | 19 +- deps/v8/test/mjsunit/mirror-array.js | 138 - deps/v8/test/mjsunit/mirror-boolean.js | 59 - deps/v8/test/mjsunit/mirror-date.js | 77 - deps/v8/test/mjsunit/mirror-error.js | 94 - deps/v8/test/mjsunit/mirror-function.js | 91 - deps/v8/test/mjsunit/mirror-null.js | 50 - deps/v8/test/mjsunit/mirror-number.js | 77 - deps/v8/test/mjsunit/mirror-object.js | 291 -- deps/v8/test/mjsunit/mirror-regexp.js | 101 - deps/v8/test/mjsunit/mirror-script.js | 88 - deps/v8/test/mjsunit/mirror-string.js | 89 - deps/v8/test/mjsunit/mirror-undefined.js | 50 - .../mjsunit/mirror-unresolved-function.js | 81 - deps/v8/test/mjsunit/mjsunit.js | 2 +- deps/v8/test/mjsunit/mjsunit.status | 141 +- deps/v8/test/mjsunit/modules-namespace1.js | 44 +- deps/v8/test/mjsunit/modules-namespace2.js | 4 +- deps/v8/test/mjsunit/modules-preparse.js | 1 - deps/v8/test/mjsunit/noopt.js | 17 + ...9300.js => number-tostring-big-integer.js} | 28 +- deps/v8/test/mjsunit/number-tostring.js | 7 + deps/v8/test/mjsunit/object-literal.js | 41 + .../mjsunit/preparse-toplevel-strict-eval.js | 2 - deps/v8/test/mjsunit/regress/regress-2263.js | 24 + .../mjsunit/{ => regress}/regress-3456.js | 2 - .../v8/test/mjsunit/regress/regress-353551.js | 2 +- .../{regress-4399.js => regress-4399-01.js} | 0 .../regress-4399-02.js} | 0 deps/v8/test/mjsunit/regress/regress-4870.js | 10 + deps/v8/test/mjsunit/regress/regress-4962.js | 11 + .../v8/test/mjsunit/regress/regress-5295-2.js | 20 + deps/v8/test/mjsunit/regress/regress-5295.js | 18 + deps/v8/test/mjsunit/regress/regress-5405.js | 2 +- .../regress/regress-5664.js} | 6 +- deps/v8/test/mjsunit/regress/regress-5669.js | 21 + deps/v8/test/mjsunit/regress/regress-5736.js | 34 + deps/v8/test/mjsunit/regress/regress-5749.js | 23 + .../v8/test/mjsunit/regress/regress-575364.js | 2 +- deps/v8/test/mjsunit/regress/regress-5767.js | 5 + deps/v8/test/mjsunit/regress/regress-5772.js | 42 + deps/v8/test/mjsunit/regress/regress-5780.js | 16 + deps/v8/test/mjsunit/regress/regress-5783.js | 8 + deps/v8/test/mjsunit/regress/regress-5836.js | 7 + .../v8/test/mjsunit/regress/regress-585775.js | 2 +- .../mjsunit/{ => regress}/regress-587004.js | 0 deps/v8/test/mjsunit/regress/regress-5943.js | 14 + .../v8/test/mjsunit/regress/regress-599825.js | 2 +- .../mjsunit/{ => regress}/regress-604044.js | 2 - .../v8/test/mjsunit/regress/regress-613928.js | 2 +- .../v8/test/mjsunit/regress/regress-617525.js | 2 +- .../v8/test/mjsunit/regress/regress-617529.js | 2 +- .../v8/test/mjsunit/regress/regress-618608.js | 4 +- .../v8/test/mjsunit/regress/regress-648719.js | 5 + .../v8/test/mjsunit/regress/regress-667603.js | 9 + .../v8/test/mjsunit/regress/regress-669024.js | 21 + .../v8/test/mjsunit/regress/regress-670671.js | 23 + .../v8/test/mjsunit/regress/regress-670808.js | 22 + .../regress/regress-670981-array-push.js | 8 + .../v8/test/mjsunit/regress/regress-672041.js | 23 + .../v8/test/mjsunit/regress/regress-673241.js | 13 + .../v8/test/mjsunit/regress/regress-673242.js | 31 + .../v8/test/mjsunit/regress/regress-673297.js | 13 + .../v8/test/mjsunit/regress/regress-674232.js | 16 + .../v8/test/mjsunit/regress/regress-677055.js | 11 + .../v8/test/mjsunit/regress/regress-677685.js | 32 + .../v8/test/mjsunit/regress/regress-678917.js | 24 + .../v8/test/mjsunit/regress/regress-679727.js | 6 + .../test/mjsunit/regress/regress-681171-1.js | 13 + .../test/mjsunit/regress/regress-681171-2.js | 12 + .../test/mjsunit/regress/regress-681171-3.js | 11 + .../v8/test/mjsunit/regress/regress-681383.js | 19 + .../v8/test/mjsunit/regress/regress-693500.js | 5 + .../mjsunit/regress/regress-builtinbust-7.js | 2 +- .../mjsunit/regress/regress-crbug-513507.js | 2 +- .../{ => regress}/regress-crbug-528379.js | 0 .../mjsunit/regress/regress-crbug-580934.js | 2 - .../{ => regress}/regress-crbug-619476.js | 0 .../mjsunit/regress/regress-crbug-627828.js | 35 +- .../mjsunit/regress/regress-crbug-629996.js | 9 - .../mjsunit/regress/regress-crbug-648740.js | 2 - .../mjsunit/regress/regress-crbug-659915a.js | 2 +- .../mjsunit/regress/regress-crbug-659915b.js | 2 +- .../mjsunit/regress/regress-crbug-662854.js | 10 + .../mjsunit/regress/regress-crbug-662907.js | 53 + .../mjsunit/regress/regress-crbug-663340.js | 32 + .../mjsunit/regress/regress-crbug-663410.js | 8 + .../mjsunit/regress/regress-crbug-663750.js | 10 +- .../mjsunit/regress/regress-crbug-665587.js | 16 + .../mjsunit/regress/regress-crbug-665793.js | 12 + .../mjsunit/regress/regress-crbug-666308.js | 9 + .../mjsunit/regress/regress-crbug-666742.js | 15 + .../mjsunit/regress/regress-crbug-668101.js | 21 + .../mjsunit/regress/regress-crbug-668414.js | 58 + .../mjsunit/regress/regress-crbug-668795.js | 21 + .../mjsunit/regress/regress-crbug-669411.js | 11 + .../mjsunit/regress/regress-crbug-669451.js | 15 + .../mjsunit/regress/regress-crbug-669540.js | 15 + .../mjsunit/regress/regress-crbug-669850.js | 11 + .../mjsunit/regress/regress-crbug-671576.js | 13 + .../mjsunit/regress/regress-crbug-672792.js | 18 + .../mjsunit/regress/regress-crbug-677757.js | 7 + .../mjsunit/regress/regress-crbug-679378.js | 19 + .../regress/regress-crbug-679841.js} | 4 +- .../mjsunit/regress/regress-crbug-683667.js | 14 + .../mjsunit/regress/regress-crbug-686102.js | 15 + .../mjsunit/regress/regress-crbug-686427.js | 15 + .../mjsunit/regress/regress-crbug-691323.js | 35 + ...egress-keyed-store-non-strict-arguments.js | 0 .../test/mjsunit/{ => regress}/regress-ntl.js | 0 .../regress/regress-private-enumerable.js | 23 + .../regress-sync-optimized-lists.js | 0 .../test/mjsunit/regress/regress-v8-5697.js | 26 + .../regress/regress-wasm-crbug-599413.js | 2 +- .../regress/regress-wasm-crbug-618602.js | 2 +- .../mjsunit/regress/wasm/regression-5531.js | 4 +- .../mjsunit/regress/wasm/regression-5800.js | 56 + .../mjsunit/regress/wasm/regression-5884.js | 20 + .../mjsunit/regress/wasm/regression-643595.js | 11 + .../mjsunit/regress/wasm/regression-663994.js | 14 + .../mjsunit/regress/wasm/regression-666741.js | 9 + .../mjsunit/regress/wasm/regression-667745.js | 389 ++ .../mjsunit/regress/wasm/regression-670683.js | 17 + .../mjsunit/regress/wasm/regression-674447.js | 10 + .../mjsunit/regress/wasm/regression-680938.js | 8 + .../mjsunit/regress/wasm/regression-684858.js | 34 + deps/v8/test/mjsunit/stack-traces.js | 3 - deps/v8/test/mjsunit/store-dictionary.js | 26 + deps/v8/test/mjsunit/string-indexof-1.js | 68 + deps/v8/test/mjsunit/string-split.js | 8 + deps/v8/test/mjsunit/wasm/OWNERS | 1 + deps/v8/test/mjsunit/wasm/adapter-frame.js | 42 +- deps/v8/test/mjsunit/wasm/add-getters.js | 75 + .../wasm/asm-wasm-exception-in-tonumber.js | 107 + deps/v8/test/mjsunit/wasm/asm-wasm-f32.js | 14 +- deps/v8/test/mjsunit/wasm/asm-wasm-names.js | 15 + deps/v8/test/mjsunit/wasm/asm-wasm-stack.js | 94 +- deps/v8/test/mjsunit/wasm/asm-wasm-stdlib.js | 8 +- deps/v8/test/mjsunit/wasm/asm-wasm.js | 86 +- .../v8/test/mjsunit/wasm/asm-with-wasm-off.js | 20 + .../wasm/compiled-module-management.js | 10 +- .../wasm/compiled-module-serialization.js | 19 +- deps/v8/test/mjsunit/wasm/data-segments.js | 8 +- deps/v8/test/mjsunit/wasm/divrem-trap.js | 22 +- deps/v8/test/mjsunit/wasm/errors.js | 81 +- deps/v8/test/mjsunit/wasm/exceptions.js | 42 +- deps/v8/test/mjsunit/wasm/export-table.js | 78 +- deps/v8/test/mjsunit/wasm/ffi-error.js | 20 +- deps/v8/test/mjsunit/wasm/ffi.js | 136 +- .../mjsunit/wasm/float-constant-folding.js | 220 + deps/v8/test/mjsunit/wasm/function-names.js | 2 +- .../test/mjsunit/wasm/function-prototype.js | 6 +- deps/v8/test/mjsunit/wasm/gc-buffer.js | 4 +- deps/v8/test/mjsunit/wasm/gc-frame.js | 10 +- deps/v8/test/mjsunit/wasm/gc-stress.js | 4 +- deps/v8/test/mjsunit/wasm/globals.js | 60 +- deps/v8/test/mjsunit/wasm/grow-memory.js | 6 + deps/v8/test/mjsunit/wasm/import-memory.js | 208 +- deps/v8/test/mjsunit/wasm/import-table.js | 72 +- deps/v8/test/mjsunit/wasm/incrementer.wasm | Bin 45 -> 46 bytes deps/v8/test/mjsunit/wasm/indirect-calls.js | 12 +- deps/v8/test/mjsunit/wasm/indirect-tables.js | 198 +- .../mjsunit/wasm/instance-memory-gc-stress.js | 124 + .../mjsunit/wasm/instantiate-module-basic.js | 88 +- .../mjsunit/wasm/instantiate-run-basic.js | 4 +- deps/v8/test/mjsunit/wasm/js-api.js | 709 ++++ .../wasm/memory-instance-validation.js | 103 + deps/v8/test/mjsunit/wasm/memory-size.js | 1 + deps/v8/test/mjsunit/wasm/memory.js | 10 + deps/v8/test/mjsunit/wasm/module-memory.js | 21 +- deps/v8/test/mjsunit/wasm/names.js | 51 + deps/v8/test/mjsunit/wasm/params.js | 20 +- deps/v8/test/mjsunit/wasm/receiver.js | 4 +- deps/v8/test/mjsunit/wasm/stack.js | 30 +- deps/v8/test/mjsunit/wasm/stackwalk.js | 4 +- deps/v8/test/mjsunit/wasm/start-function.js | 14 +- deps/v8/test/mjsunit/wasm/table.js | 71 +- .../wasm/test-import-export-wrapper.js | 20 +- .../wasm/test-wasm-compilation-control.js | 118 + .../mjsunit/wasm/test-wasm-module-builder.js | 22 +- .../wasm/trap-location-with-trap-if.js | 81 + deps/v8/test/mjsunit/wasm/trap-location.js | 8 +- .../test/mjsunit/wasm/unicode-validation.js | 2 +- .../mjsunit/wasm/unreachable-validation.js | 130 + deps/v8/test/mjsunit/wasm/wasm-constants.js | 55 +- deps/v8/test/mjsunit/wasm/wasm-default.js | 19 + .../test/mjsunit/wasm/wasm-module-builder.js | 48 +- deps/v8/test/mozilla/mozilla.status | 4 + deps/v8/test/test262/archive.py | 1 + deps/v8/test/test262/harness-adapt.js | 18 +- deps/v8/test/test262/list.py | 3 +- .../test/intl402/DateTimeFormat/12.1.1_1.js | 42 + .../test/intl402/NumberFormat/11.1.1_1.js | 42 + deps/v8/test/test262/prune-local-tests.sh | 15 + deps/v8/test/test262/test262.status | 248 +- deps/v8/test/test262/testcfg.py | 52 +- deps/v8/test/test262/upstream-local-tests.sh | 22 + deps/v8/test/unittests/BUILD.gn | 18 +- .../unittests/api/access-check-unittest.cc | 79 + .../test/unittests/base/logging-unittest.cc | 56 +- .../unittests/cancelable-tasks-unittest.cc | 45 + .../compiler-dispatcher-helper.cc | 28 + .../compiler-dispatcher-helper.h | 23 + .../compiler-dispatcher-job-unittest.cc | 104 +- .../compiler-dispatcher-tracer-unittest.cc | 12 +- .../compiler-dispatcher-unittest.cc | 806 ++++ .../compiler/bytecode-analysis-unittest.cc | 418 ++ .../common-operator-reducer-unittest.cc | 27 + .../compiler/escape-analysis-unittest.cc | 26 +- .../test/unittests/compiler/graph-unittest.cc | 6 +- .../test/unittests/compiler/graph-unittest.h | 1 + .../compiler/instruction-selector-unittest.cc | 90 +- .../compiler/instruction-sequence-unittest.cc | 20 +- .../compiler/int64-lowering-unittest.cc | 25 +- .../compiler/js-create-lowering-unittest.cc | 29 +- .../js-intrinsic-lowering-unittest.cc | 31 - .../compiler/js-typed-lowering-unittest.cc | 78 +- .../compiler/liveness-analyzer-unittest.cc | 6 +- .../compiler/load-elimination-unittest.cc | 96 +- .../machine-operator-reducer-unittest.cc | 45 +- .../instruction-selector-mips-unittest.cc | 164 +- .../instruction-selector-mips64-unittest.cc | 203 +- .../unittests/compiler/node-test-utils.cc | 55 +- .../test/unittests/compiler/node-test-utils.h | 8 +- .../test/unittests/compiler/regalloc/OWNERS | 5 + .../{ => regalloc}/live-range-unittest.cc | 30 - .../{ => regalloc}/move-optimizer-unittest.cc | 8 - .../register-allocator-unittest.cc | 34 +- .../simplified-operator-reducer-unittest.cc | 16 + .../compiler/state-values-utils-unittest.cc | 90 +- .../test/unittests/compiler/typer-unittest.cc | 4 +- deps/v8/test/unittests/counters-unittest.cc | 310 ++ .../heap/embedder-tracing-unittest.cc | 163 + .../heap/gc-idle-time-handler-unittest.cc | 13 + deps/v8/test/unittests/heap/heap-unittest.cc | 1 + .../unittests/heap/memory-reducer-unittest.cc | 67 +- .../test/unittests/heap/unmapper-unittest.cc | 88 + .../bytecode-array-builder-unittest.cc | 69 +- .../bytecode-array-iterator-unittest.cc | 7 +- ...bytecode-array-random-iterator-unittest.cc | 1011 +++++ .../bytecode-array-writer-unittest.cc | 1 + .../interpreter/bytecode-operands-unittest.cc | 47 + .../bytecode-peephole-optimizer-unittest.cc | 24 +- .../interpreter/bytecode-pipeline-unittest.cc | 37 +- .../bytecode-register-allocator-unittest.cc | 1 + .../bytecode-register-optimizer-unittest.cc | 19 +- .../interpreter/bytecodes-unittest.cc | 120 + .../constant-array-builder-unittest.cc | 1 + .../interpreter-assembler-unittest.cc | 189 +- .../interpreter-assembler-unittest.h | 16 +- .../libplatform/default-platform-unittest.cc | 34 + deps/v8/test/unittests/object-unittest.cc | 57 + deps/v8/test/unittests/run-all-unittests.cc | 3 + deps/v8/test/unittests/unittests.gyp | 18 +- deps/v8/test/unittests/unittests.status | 9 + .../unittests/value-serializer-unittest.cc | 107 +- deps/v8/test/unittests/wasm/OWNERS | 1 + .../wasm/control-transfer-unittest.cc | 146 +- ...t.cc => function-body-decoder-unittest.cc} | 1238 +++--- .../wasm/loop-assignment-analysis-unittest.cc | 12 +- .../unittests/wasm/module-decoder-unittest.cc | 166 +- .../unittests/wasm/wasm-macro-gen-unittest.cc | 7 +- .../wasm/wasm-module-builder-unittest.cc | 4 +- .../zone/zone-chunk-list-unittest.cc | 1 - .../webkit/class-syntax-call-expected.txt | 2 +- deps/v8/test/webkit/class-syntax-call.js | 2 +- .../webkit/class-syntax-extends-expected.txt | 2 +- deps/v8/test/webkit/class-syntax-extends.js | 2 +- .../webkit/class-syntax-super-expected.txt | 4 +- deps/v8/test/webkit/class-syntax-super.js | 4 +- .../fast/js/basic-strict-mode-expected.txt | 8 +- .../webkit/fast/js/deep-recursion-test.js | 2 +- .../webkit/fast/js/kde/parse-expected.txt | 4 - deps/v8/test/webkit/fast/js/kde/parse.js | 4 - .../fast/js/number-toString-expected.txt | 58 +- ...ic-escapes-in-string-literals-expected.txt | 28 +- .../fast/js/parser-syntax-check-expected.txt | 10 - .../webkit/fast/js/parser-syntax-check.js | 6 - .../fast/js/toString-number-expected.txt | 42 +- deps/v8/test/webkit/webkit.status | 19 +- .../inspector_protocol/CodeGenerator.py | 370 +- .../third_party/inspector_protocol/README.v8 | 2 +- .../inspector_protocol/inspector_protocol.gni | 9 + .../inspector_protocol/lib/Array_h.template | 20 +- .../lib/Collections_h.template | 2 +- .../lib/DispatcherBase_cpp.template | 169 +- .../lib/DispatcherBase_h.template | 54 +- .../lib/ErrorSupport_cpp.template | 2 +- .../inspector_protocol/lib/Forward_h.template | 1 - .../lib/FrontendChannel_h.template | 10 +- .../inspector_protocol/lib/Maybe_h.template | 2 +- .../lib/Object_cpp.template | 13 +- .../inspector_protocol/lib/Object_h.template | 4 +- .../lib/Parser_cpp.template | 4 +- .../inspector_protocol/lib/Parser_h.template | 4 +- .../lib/Protocol_cpp.template | 2 +- .../lib/ValueConversions_h.template | 46 +- .../lib/Values_cpp.template | 16 +- .../inspector_protocol/lib/Values_h.template | 28 +- .../templates/Exported_h.template | 6 +- .../templates/Imported_h.template | 20 +- .../templates/TypeBuilder_cpp.template | 171 +- .../templates/TypeBuilder_h.template | 105 +- deps/v8/tools/callstats.html | 114 +- deps/v8/tools/callstats.py | 55 +- deps/v8/tools/foozzie/BUILD.gn | 18 + .../tools/foozzie/testdata/failure_output.txt | 50 + deps/v8/tools/foozzie/testdata/fuzz-123.js | 5 + deps/v8/tools/foozzie/testdata/test_d8_1.py | 14 + deps/v8/tools/foozzie/testdata/test_d8_2.py | 14 + deps/v8/tools/foozzie/testdata/test_d8_3.py | 14 + deps/v8/tools/foozzie/v8_commands.py | 64 + deps/v8/tools/foozzie/v8_foozzie.py | 299 ++ deps/v8/tools/foozzie/v8_foozzie_test.py | 111 + deps/v8/tools/foozzie/v8_mock.js | 76 + deps/v8/tools/foozzie/v8_suppressions.js | 18 + deps/v8/tools/foozzie/v8_suppressions.py | 330 ++ deps/v8/tools/fuzz-harness.sh | 2 +- deps/v8/tools/gdbinit | 18 + deps/v8/tools/gen-postmortem-metadata.py | 15 +- deps/v8/tools/ignition/linux_perf_report.py | 17 +- deps/v8/tools/jsfunfuzz/fuzz-harness.sh | 2 +- deps/v8/tools/mb/mb.py | 9 +- deps/v8/tools/parser-shell.cc | 11 +- deps/v8/tools/presubmit.py | 102 +- deps/v8/tools/release/create_release.py | 50 +- deps/v8/tools/release/test_scripts.py | 15 +- deps/v8/tools/run-deopt-fuzzer.py | 3 +- deps/v8/tools/run-tests.py | 3 +- deps/v8/tools/run_perf.py | 2 +- deps/v8/tools/testrunner/local/statusfile.py | 18 +- deps/v8/tools/testrunner/local/variants.py | 6 +- deps/v8/tools/turbolizer/node.js | 2 +- deps/v8/tools/v8heapconst.py | 501 +-- deps/v8/tools/whitespace.txt | 3 +- 1726 files changed, 100857 insertions(+), 86452 deletions(-) create mode 100644 deps/v8/gypfiles/win/msvs_dependencies.isolate create mode 100644 deps/v8/include/v8-version-string.h create mode 100644 deps/v8/src/assembler-inl.h create mode 100644 deps/v8/src/ast/ast-function-literal-id-reindexer.cc create mode 100644 deps/v8/src/ast/ast-function-literal-id-reindexer.h create mode 100644 deps/v8/src/builtins/builtins-constructor.cc create mode 100644 deps/v8/src/builtins/builtins-constructor.h create mode 100644 deps/v8/src/builtins/builtins-ic.cc delete mode 100644 deps/v8/src/builtins/builtins-iterator.cc create mode 100644 deps/v8/src/builtins/builtins-promise.h create mode 100644 deps/v8/src/compiler-dispatcher/compiler-dispatcher.cc create mode 100644 deps/v8/src/compiler-dispatcher/compiler-dispatcher.h create mode 100644 deps/v8/src/compiler/bytecode-analysis.cc create mode 100644 deps/v8/src/compiler/bytecode-analysis.h delete mode 100644 deps/v8/src/compiler/bytecode-branch-analysis.cc delete mode 100644 deps/v8/src/compiler/bytecode-branch-analysis.h create mode 100644 deps/v8/src/compiler/bytecode-liveness-map.cc create mode 100644 deps/v8/src/compiler/bytecode-liveness-map.h delete mode 100644 deps/v8/src/compiler/bytecode-loop-analysis.cc delete mode 100644 deps/v8/src/compiler/bytecode-loop-analysis.h create mode 100644 deps/v8/src/compiler/graph-assembler.cc create mode 100644 deps/v8/src/compiler/graph-assembler.h delete mode 100644 deps/v8/src/compiler/type-hint-analyzer.cc delete mode 100644 deps/v8/src/compiler/type-hint-analyzer.h create mode 100644 deps/v8/src/debug/interface-types.h create mode 100644 deps/v8/src/heap/embedder-tracing.cc create mode 100644 deps/v8/src/heap/embedder-tracing.h create mode 100644 deps/v8/src/ic/accessor-assembler-impl.h create mode 100644 deps/v8/src/ic/accessor-assembler.cc create mode 100644 deps/v8/src/ic/accessor-assembler.h delete mode 100644 deps/v8/src/ic/arm/ic-compiler-arm.cc delete mode 100644 deps/v8/src/ic/arm/stub-cache-arm.cc delete mode 100644 deps/v8/src/ic/arm64/ic-compiler-arm64.cc delete mode 100644 deps/v8/src/ic/arm64/stub-cache-arm64.cc delete mode 100644 deps/v8/src/ic/ia32/ic-compiler-ia32.cc delete mode 100644 deps/v8/src/ic/ia32/stub-cache-ia32.cc create mode 100644 deps/v8/src/ic/ic-stats.cc create mode 100644 deps/v8/src/ic/ic-stats.h delete mode 100644 deps/v8/src/ic/mips/ic-compiler-mips.cc delete mode 100644 deps/v8/src/ic/mips/stub-cache-mips.cc delete mode 100644 deps/v8/src/ic/mips64/ic-compiler-mips64.cc delete mode 100644 deps/v8/src/ic/mips64/stub-cache-mips64.cc delete mode 100644 deps/v8/src/ic/ppc/ic-compiler-ppc.cc delete mode 100644 deps/v8/src/ic/ppc/stub-cache-ppc.cc delete mode 100644 deps/v8/src/ic/s390/ic-compiler-s390.cc delete mode 100644 deps/v8/src/ic/s390/stub-cache-s390.cc delete mode 100644 deps/v8/src/ic/x64/ic-compiler-x64.cc delete mode 100644 deps/v8/src/ic/x64/stub-cache-x64.cc delete mode 100644 deps/v8/src/ic/x87/ic-compiler-x87.cc delete mode 100644 deps/v8/src/ic/x87/stub-cache-x87.cc delete mode 100644 deps/v8/src/inspector/protocol-platform.h create mode 100644 deps/v8/src/inspector/test-interface.cc create mode 100644 deps/v8/src/inspector/test-interface.h create mode 100644 deps/v8/src/inspector/wasm-translation.cc create mode 100644 deps/v8/src/inspector/wasm-translation.h create mode 100644 deps/v8/src/interpreter/bytecode-array-accessor.cc create mode 100644 deps/v8/src/interpreter/bytecode-array-accessor.h create mode 100644 deps/v8/src/interpreter/bytecode-array-random-iterator.cc create mode 100644 deps/v8/src/interpreter/bytecode-array-random-iterator.h delete mode 100644 deps/v8/src/js/symbol.js create mode 100644 deps/v8/src/map-updater.cc create mode 100644 deps/v8/src/map-updater.h create mode 100644 deps/v8/src/objects/module-info.h create mode 100644 deps/v8/src/objects/object-macros-undef.h create mode 100644 deps/v8/src/objects/object-macros.h rename deps/v8/src/{ast/scopeinfo.cc => objects/scope-info.cc} (98%) create mode 100644 deps/v8/src/objects/scope-info.h create mode 100644 deps/v8/src/parsing/parsing.cc create mode 100644 deps/v8/src/parsing/parsing.h delete mode 100644 deps/v8/src/promise-utils.cc delete mode 100644 deps/v8/src/promise-utils.h create mode 100644 deps/v8/src/string-case.cc create mode 100644 deps/v8/src/string-case.h create mode 100644 deps/v8/src/trap-handler/trap-handler.h rename deps/v8/src/wasm/{ast-decoder.cc => function-body-decoder.cc} (72%) rename deps/v8/src/wasm/{ast-decoder.h => function-body-decoder.h} (74%) create mode 100644 deps/v8/src/wasm/wasm-limits.h create mode 100644 deps/v8/src/wasm/wasm-text.cc create mode 100644 deps/v8/src/wasm/wasm-text.h create mode 100644 deps/v8/src/zone/zone-handle-set.h delete mode 100644 deps/v8/test/cctest/compiler/test-run-inlining.cc create mode 100644 deps/v8/test/cctest/interpreter/bytecode_expectations/GenerateTestUndetectable.golden create mode 100644 deps/v8/test/cctest/interpreter/bytecode_expectations/SuperCallAndSpread.golden create mode 100644 deps/v8/test/cctest/parsing/test-parse-decision.cc create mode 100644 deps/v8/test/cctest/test-accessor-assembler.cc create mode 100644 deps/v8/test/cctest/wasm/test-wasm-breakpoints.cc rename deps/v8/test/{mjsunit => debugger}/bugs/harmony/debug-blockscopes.js (64%) rename deps/v8/test/{mjsunit => debugger/debug}/compiler/debug-catch-prediction.js (98%) rename deps/v8/test/{mjsunit/debug-mirror-cache.js => debugger/debug/debug-backtrace.js} (59%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-break-native.js (93%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-breakpoints.js (56%) rename deps/v8/test/{mjsunit/bugs/bug-2337.js => debugger/debug/debug-clearbreakpoint.js} (68%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-compile-event.js (80%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-conditional-breakpoints.js (86%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-enable-disable-breakpoints.js (71%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-eval-scope.js (99%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-evaluate-bool-constructor.js (76%) rename deps/v8/test/debugger/{ => debug}/debug-evaluate-locals-optimized-double.js (98%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-evaluate-locals.js (93%) create mode 100644 deps/v8/test/debugger/debug/debug-evaluate-no-side-effect-builtins.js create mode 100644 deps/v8/test/debugger/debug/debug-evaluate-no-side-effect.js rename deps/v8/test/{mjsunit => debugger/debug}/debug-evaluate-shadowed-context.js (96%) rename deps/v8/test/{mjsunit/debug-suspend.js => debugger/debug/debug-evaluate.js} (60%) create mode 100644 deps/v8/test/debugger/debug/debug-function-scopes.js rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-1.js (95%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-2.js (95%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-3.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-4.js (95%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-check-stack.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-compile-error.js (95%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-diff.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-double-call.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-exceptions.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-literals.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-newsource.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-patch-positions-replace.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-restart-frame.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-stack-padding.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-stepin.js (98%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-liveedit-utils.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-multiple-breakpoints.js (80%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-multiple-var-decl.js (98%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-negative-break-points.js (77%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-receiver.js (94%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-return-value.js (77%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-scopes-suspended-generators.js (64%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-scopes.js (86%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-script.js (91%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-scripts-throw.js (61%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-set-variable-value.js (79%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-setbreakpoint.js (53%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-sourceinfo.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-stepframe-clearing.js (98%) rename deps/v8/test/{mjsunit => debugger/debug}/debug-stepframe.js (98%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-blockscopes.js (81%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-evaluate-arrow-function-receiver.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-evaluate-blockscopes.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-evaluate-receiver-before-super.js (88%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-exception-generators.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-function-scopes.js (59%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-liveedit-new-target-1.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-liveedit-new-target-2.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-liveedit-new-target-3.js (96%) delete mode 100644 deps/v8/test/debugger/debug/es6/debug-promises/async-task-event.js rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/promise-all-uncaught.js (91%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/promise-race-uncaught.js (91%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/reject-caught-all.js (93%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/reject-caught-by-default-reject-handler.js (92%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/reject-in-constructor.js (91%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/reject-uncaught-all.js (90%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/reject-uncaught-late.js (91%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/reject-uncaught-uncaught.js (90%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/reject-with-invalid-reject.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/reject-with-throw-in-reject.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/reject-with-undefined-reject.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/throw-caught-all.js (93%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/throw-caught-by-default-reject-handler.js (92%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/throw-finally-caught-all.js (93%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/throw-in-constructor.js (92%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/throw-uncaught-all.js (91%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/throw-uncaught-uncaught.js (88%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/throw-with-throw-in-reject.js (95%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/try-reject-in-constructor.js (92%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-promises/try-throw-reject-in-constructor.js (93%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-scope-default-param-with-eval.js (98%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-stepin-default-parameters.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-stepin-microtasks.js (92%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-stepin-proxies.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-stepin-string-template.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/debug-stepnext-for.js (98%) create mode 100644 deps/v8/test/debugger/debug/es6/debug-stepnext-generators.js rename deps/v8/test/{mjsunit => debugger/debug}/es6/default-parameters-debug.js (94%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/generators-debug-liveedit.js (98%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/generators-debug-scopes.js (74%) rename deps/v8/test/{mjsunit => debugger/debug}/es6/regress/regress-468661.js (98%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-basic.js (96%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-caught-exception-cases.js (96%) rename deps/v8/test/{mjsunit/wasm/no-wasm-by-default.js => debugger/debug/es8/async-debug-caught-exception-cases0.js} (63%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-caught-exception-cases1.js (62%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-caught-exception-cases2.js (62%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-caught-exception-cases3.js (62%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-caught-exception.js (99%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-step-abort-at-break.js (97%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-step-continue-at-break.js (97%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-step-in-and-out.js (97%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-step-in-out-out.js (97%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-step-in.js (97%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-step-nested.js (97%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-step-next-constant.js (96%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-step-next.js (97%) rename deps/v8/test/debugger/debug/{harmony => es8}/async-debug-step-out.js (96%) rename deps/v8/test/{mjsunit/harmony => debugger/debug/es8}/async-function-debug-evaluate.js (98%) rename deps/v8/test/{mjsunit/harmony => debugger/debug/es8}/async-function-debug-scopes.js (87%) rename deps/v8/test/debugger/debug/{harmony => es8}/debug-async-break-on-stack.js (98%) rename deps/v8/test/debugger/debug/{harmony => es8}/debug-async-break.js (98%) rename deps/v8/test/{mjsunit/harmony => debugger/debug/es8}/debug-async-liveedit.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/function-source.js (95%) delete mode 100644 deps/v8/test/debugger/debug/harmony/debug-async-function-async-task-event.js rename deps/v8/test/{mjsunit => debugger/debug/harmony}/modules-debug-scopes1.js (83%) rename deps/v8/test/{mjsunit => debugger/debug/harmony}/modules-debug-scopes2.js (65%) rename deps/v8/test/{mjsunit => debugger/debug}/ignition/debug-step-prefix-bytecodes.js (99%) rename deps/v8/test/{mjsunit => debugger/debug}/ignition/elided-instruction.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/ignition/optimized-debug-frame.js (93%) rename deps/v8/test/{mjsunit/regress => debugger/debug}/regress-5207.js (95%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-102153.js (98%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-1081309.js (64%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-109195.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-119609.js (92%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-1639.js (82%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-1853.js (82%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-2296.js (98%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-3960.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-419663.js (71%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-4309-2.js (91%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-5164.js (96%) delete mode 100644 deps/v8/test/debugger/debug/regress/regress-94873.js rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-119800.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-171715.js (99%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-222893.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-424142.js (96%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-432493.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-465298.js (87%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-481896.js (93%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-487289.js (93%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-491943.js (94%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-517592.js (93%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-568477-2.js (69%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-605581.js (95%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-crbug-621361.js (82%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-debug-deopt-while-recompile.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-frame-details-null-receiver.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/regress/regress-prepare-break-while-recompile.js (97%) rename deps/v8/test/{mjsunit => debugger/debug}/wasm/frame-inspection.js (63%) rename deps/v8/test/{mjsunit => debugger}/regress/regress-1639-2.js (76%) rename deps/v8/test/{mjsunit => debugger}/regress/regress-2318.js (98%) create mode 100644 deps/v8/test/inspector/debugger/async-instrumentation-expected.txt create mode 100644 deps/v8/test/inspector/debugger/async-instrumentation.js create mode 100644 deps/v8/test/inspector/debugger/async-promise-late-then-expected.txt create mode 100644 deps/v8/test/inspector/debugger/async-promise-late-then.js create mode 100644 deps/v8/test/inspector/debugger/async-set-timeout-expected.txt create mode 100644 deps/v8/test/inspector/debugger/async-set-timeout.js create mode 100644 deps/v8/test/inspector/debugger/async-stack-await-expected.txt create mode 100644 deps/v8/test/inspector/debugger/async-stack-await.js create mode 100644 deps/v8/test/inspector/debugger/async-stack-for-promise-expected.txt create mode 100644 deps/v8/test/inspector/debugger/async-stack-for-promise.js create mode 100644 deps/v8/test/inspector/debugger/async-stacks-limit-expected.txt create mode 100644 deps/v8/test/inspector/debugger/async-stacks-limit.js create mode 100644 deps/v8/test/inspector/debugger/eval-scopes-expected.txt create mode 100644 deps/v8/test/inspector/debugger/eval-scopes.js create mode 100644 deps/v8/test/inspector/debugger/script-parsed-for-runtime-evaluate-expected.txt create mode 100644 deps/v8/test/inspector/debugger/script-parsed-for-runtime-evaluate.js create mode 100644 deps/v8/test/inspector/debugger/set-script-source-exception-expected.txt create mode 100644 deps/v8/test/inspector/debugger/set-script-source-exception.js create mode 100644 deps/v8/test/inspector/debugger/step-into-nested-arrow-expected.txt create mode 100644 deps/v8/test/inspector/debugger/step-into-nested-arrow.js create mode 100644 deps/v8/test/inspector/debugger/suspended-generator-scopes-expected.txt create mode 100644 deps/v8/test/inspector/debugger/suspended-generator-scopes.js create mode 100644 deps/v8/test/inspector/debugger/wasm-scripts-expected.txt create mode 100644 deps/v8/test/inspector/debugger/wasm-scripts.js create mode 100644 deps/v8/test/inspector/debugger/wasm-source-expected.txt create mode 100644 deps/v8/test/inspector/debugger/wasm-source.js create mode 100644 deps/v8/test/inspector/runtime/console-assert-expected.txt create mode 100644 deps/v8/test/inspector/runtime/console-assert.js create mode 100644 deps/v8/test/inspector/runtime/console-messages-limits-expected.txt create mode 100644 deps/v8/test/inspector/runtime/console-messages-limits.js create mode 100644 deps/v8/test/inspector/runtime/evaluate-empty-stack-expected.txt create mode 100644 deps/v8/test/inspector/runtime/evaluate-empty-stack.js create mode 100644 deps/v8/test/inspector/runtime/evaluate-with-generate-preview-expected.txt create mode 100644 deps/v8/test/inspector/runtime/evaluate-with-generate-preview.js create mode 100644 deps/v8/test/inspector/runtime/length-or-size-description-expected.txt create mode 100644 deps/v8/test/inspector/runtime/length-or-size-description.js create mode 100644 deps/v8/test/intl/bad-target.js create mode 100644 deps/v8/test/intl/date-format/unmodified-options.js create mode 100644 deps/v8/test/intl/general/constructor.js create mode 100644 deps/v8/test/intl/not-constructors.js create mode 100644 deps/v8/test/intl/toStringTag.js create mode 100644 deps/v8/test/js-perf-test/AsyncAwait/baseline-babel-es2017.js create mode 100644 deps/v8/test/js-perf-test/AsyncAwait/baseline-naive-promises.js create mode 100644 deps/v8/test/js-perf-test/AsyncAwait/native.js create mode 100644 deps/v8/test/js-perf-test/AsyncAwait/run.js create mode 100644 deps/v8/test/js-perf-test/Closures/closures.js create mode 100644 deps/v8/test/js-perf-test/Closures/run.js create mode 100644 deps/v8/test/js-perf-test/RegExp.json create mode 100644 deps/v8/test/js-perf-test/RegExp/RegExpTests.json create mode 100644 deps/v8/test/js-perf-test/RegExp/base.js create mode 100644 deps/v8/test/js-perf-test/RegExp/base_ctor.js create mode 100644 deps/v8/test/js-perf-test/RegExp/base_exec.js create mode 100644 deps/v8/test/js-perf-test/RegExp/base_flags.js create mode 100644 deps/v8/test/js-perf-test/RegExp/base_match.js create mode 100644 deps/v8/test/js-perf-test/RegExp/base_replace.js create mode 100644 deps/v8/test/js-perf-test/RegExp/base_search.js create mode 100644 deps/v8/test/js-perf-test/RegExp/base_split.js create mode 100644 deps/v8/test/js-perf-test/RegExp/base_test.js create mode 100644 deps/v8/test/js-perf-test/RegExp/ctor.js create mode 100644 deps/v8/test/js-perf-test/RegExp/exec.js create mode 100644 deps/v8/test/js-perf-test/RegExp/flags.js create mode 100644 deps/v8/test/js-perf-test/RegExp/match.js create mode 100644 deps/v8/test/js-perf-test/RegExp/replace.js create mode 100644 deps/v8/test/js-perf-test/RegExp/run.js create mode 100644 deps/v8/test/js-perf-test/RegExp/search.js create mode 100644 deps/v8/test/js-perf-test/RegExp/slow_exec.js create mode 100644 deps/v8/test/js-perf-test/RegExp/slow_flags.js create mode 100644 deps/v8/test/js-perf-test/RegExp/slow_match.js create mode 100644 deps/v8/test/js-perf-test/RegExp/slow_replace.js create mode 100644 deps/v8/test/js-perf-test/RegExp/slow_search.js create mode 100644 deps/v8/test/js-perf-test/RegExp/slow_split.js create mode 100644 deps/v8/test/js-perf-test/RegExp/slow_test.js create mode 100644 deps/v8/test/js-perf-test/RegExp/split.js create mode 100644 deps/v8/test/js-perf-test/RegExp/test.js create mode 100644 deps/v8/test/js-perf-test/SixSpeed/array_destructuring/array_destructuring.js create mode 100644 deps/v8/test/js-perf-test/SixSpeed/array_destructuring/run.js create mode 100644 deps/v8/test/js-perf-test/SixSpeed/object_literals/object_literals.js create mode 100644 deps/v8/test/js-perf-test/SixSpeed/object_literals/run.js create mode 100644 deps/v8/test/message/call-non-constructable.js create mode 100644 deps/v8/test/message/call-non-constructable.out create mode 100644 deps/v8/test/message/call-primitive-constructor.js create mode 100644 deps/v8/test/message/call-primitive-constructor.out create mode 100644 deps/v8/test/message/call-primitive-function.js create mode 100644 deps/v8/test/message/call-primitive-function.out create mode 100644 deps/v8/test/message/call-undeclared-function.js create mode 100644 deps/v8/test/message/call-undeclared-function.out create mode 100644 deps/v8/test/message/regress/regress-crbug-661579.js create mode 100644 deps/v8/test/message/regress/regress-crbug-661579.out create mode 100644 deps/v8/test/message/regress/regress-crbug-669017.js create mode 100644 deps/v8/test/message/regress/regress-crbug-669017.out create mode 100644 deps/v8/test/message/tonumber-symbol.js create mode 100644 deps/v8/test/message/tonumber-symbol.out create mode 100644 deps/v8/test/message/wasm-trap.js create mode 100644 deps/v8/test/message/wasm-trap.out create mode 100644 deps/v8/test/mjsunit/array-push-hole-double.js create mode 100644 deps/v8/test/mjsunit/array-push13.js create mode 100644 deps/v8/test/mjsunit/array-push14.js create mode 100644 deps/v8/test/mjsunit/asm/regress-641885.js create mode 100644 deps/v8/test/mjsunit/asm/regress-669899.js create mode 100644 deps/v8/test/mjsunit/asm/regress-672045.js create mode 100644 deps/v8/test/mjsunit/asm/regress-676573.js create mode 100644 deps/v8/test/mjsunit/compiler/capture-context.js create mode 100644 deps/v8/test/mjsunit/compiler/escape-analysis-11.js create mode 100644 deps/v8/test/mjsunit/compiler/escape-analysis-12.js create mode 100644 deps/v8/test/mjsunit/compiler/escape-analysis-deopt-6.js create mode 100644 deps/v8/test/mjsunit/compiler/escape-analysis-framestate-use-at-branchpoint.js rename deps/v8/test/mjsunit/{debug-toggle-mirror-cache.js => compiler/escape-analysis-replacement.js} (75%) create mode 100644 deps/v8/test/mjsunit/compiler/inline-context-deopt.js create mode 100644 deps/v8/test/mjsunit/compiler/inline-omit-arguments-deopt.js create mode 100644 deps/v8/test/mjsunit/compiler/inline-omit-arguments-object.js create mode 100644 deps/v8/test/mjsunit/compiler/inline-omit-arguments.js create mode 100644 deps/v8/test/mjsunit/compiler/inline-surplus-arguments-deopt.js create mode 100644 deps/v8/test/mjsunit/compiler/inline-surplus-arguments-object.js create mode 100644 deps/v8/test/mjsunit/compiler/inline-surplus-arguments.js create mode 100644 deps/v8/test/mjsunit/compiler/instanceof-opt1.js create mode 100644 deps/v8/test/mjsunit/compiler/instanceof-opt2.js create mode 100644 deps/v8/test/mjsunit/compiler/instanceof-opt3.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-664117.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-668760.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-669517.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-671574.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-674469.js delete mode 100644 deps/v8/test/mjsunit/compiler/regress-uint8-deopt.js create mode 100644 deps/v8/test/mjsunit/compiler/regress-v8-5756.js delete mode 100644 deps/v8/test/mjsunit/debug-backtrace-text.js delete mode 100644 deps/v8/test/mjsunit/debug-backtrace.js delete mode 100644 deps/v8/test/mjsunit/debug-changebreakpoint.js delete mode 100644 deps/v8/test/mjsunit/debug-clearbreakpoint.js delete mode 100644 deps/v8/test/mjsunit/debug-clearbreakpointgroup.js delete mode 100644 deps/v8/test/mjsunit/debug-compile-event-newfunction.js delete mode 100644 deps/v8/test/mjsunit/debug-constructed-by.js delete mode 100644 deps/v8/test/mjsunit/debug-continue.js delete mode 100644 deps/v8/test/mjsunit/debug-evaluate-nested.js delete mode 100644 deps/v8/test/mjsunit/debug-evaluate-recursive.js delete mode 100644 deps/v8/test/mjsunit/debug-evaluate-with-context.js delete mode 100644 deps/v8/test/mjsunit/debug-evaluate.js delete mode 100644 deps/v8/test/mjsunit/debug-function-scopes.js delete mode 100644 deps/v8/test/mjsunit/debug-handle.js delete mode 100644 deps/v8/test/mjsunit/debug-is-active.js delete mode 100644 deps/v8/test/mjsunit/debug-listbreakpoints.js delete mode 100644 deps/v8/test/mjsunit/debug-liveedit-breakpoints.js delete mode 100644 deps/v8/test/mjsunit/debug-referenced-by.js delete mode 100644 deps/v8/test/mjsunit/debug-references.js delete mode 100644 deps/v8/test/mjsunit/debug-script-breakpoints-closure.js delete mode 100644 deps/v8/test/mjsunit/debug-script-breakpoints-nested.js delete mode 100644 deps/v8/test/mjsunit/debug-script-breakpoints.js delete mode 100644 deps/v8/test/mjsunit/debug-scripts-request.js delete mode 100644 deps/v8/test/mjsunit/debug-set-script-source.js delete mode 100644 deps/v8/test/mjsunit/debug-setexceptionbreak.js create mode 100644 deps/v8/test/mjsunit/debugPrint.js create mode 100644 deps/v8/test/mjsunit/es6/array-iterator-detached.js delete mode 100644 deps/v8/test/mjsunit/es6/generators-mirror.js delete mode 100644 deps/v8/test/mjsunit/es6/mirror-collections.js delete mode 100644 deps/v8/test/mjsunit/es6/mirror-iterators.js delete mode 100644 deps/v8/test/mjsunit/es6/mirror-promises.js delete mode 100644 deps/v8/test/mjsunit/es6/mirror-symbols.js create mode 100644 deps/v8/test/mjsunit/es6/promise-lookup-getter-setter.js create mode 100644 deps/v8/test/mjsunit/es6/typedarray-neutered.js rename deps/v8/test/mjsunit/{harmony => es8}/async-arrow-lexical-arguments.js (95%) rename deps/v8/test/mjsunit/{harmony => es8}/async-arrow-lexical-new.target.js (95%) rename deps/v8/test/mjsunit/{harmony => es8}/async-arrow-lexical-super.js (96%) rename deps/v8/test/mjsunit/{harmony => es8}/async-arrow-lexical-this.js (95%) rename deps/v8/test/mjsunit/{harmony => es8}/async-await-basic.js (92%) rename deps/v8/test/mjsunit/{harmony => es8}/async-await-no-constructor.js (85%) rename deps/v8/test/mjsunit/{harmony => es8}/async-await-resolve-new.js (88%) rename deps/v8/test/mjsunit/{harmony => es8}/async-await-species.js (98%) rename deps/v8/test/mjsunit/{harmony => es8}/async-destructuring.js (97%) rename deps/v8/test/mjsunit/{harmony => es8}/async-function-stacktrace.js (99%) rename deps/v8/test/mjsunit/{harmony => es8}/regress/regress-618603.js (91%) rename deps/v8/test/mjsunit/{harmony => es8}/regress/regress-624300.js (88%) rename deps/v8/test/mjsunit/{harmony => es8}/sloppy-no-duplicate-async.js (95%) delete mode 100644 deps/v8/test/mjsunit/harmony/mirror-async-function-promise.js delete mode 100644 deps/v8/test/mjsunit/harmony/mirror-async-function.js create mode 100644 deps/v8/test/mjsunit/harmony/object-spread-basic.js delete mode 100644 deps/v8/test/mjsunit/harmony/regexp-property-blocks.js create mode 100644 deps/v8/test/mjsunit/harmony/regexp-property-invalid.js create mode 100644 deps/v8/test/mjsunit/harmony/regexp-property-script-extensions.js create mode 100644 deps/v8/test/mjsunit/ignition/regress-5768.js delete mode 100644 deps/v8/test/mjsunit/mirror-array.js delete mode 100644 deps/v8/test/mjsunit/mirror-boolean.js delete mode 100644 deps/v8/test/mjsunit/mirror-date.js delete mode 100644 deps/v8/test/mjsunit/mirror-error.js delete mode 100644 deps/v8/test/mjsunit/mirror-function.js delete mode 100644 deps/v8/test/mjsunit/mirror-null.js delete mode 100644 deps/v8/test/mjsunit/mirror-number.js delete mode 100644 deps/v8/test/mjsunit/mirror-object.js delete mode 100644 deps/v8/test/mjsunit/mirror-regexp.js delete mode 100644 deps/v8/test/mjsunit/mirror-script.js delete mode 100644 deps/v8/test/mjsunit/mirror-string.js delete mode 100644 deps/v8/test/mjsunit/mirror-undefined.js delete mode 100644 deps/v8/test/mjsunit/mirror-unresolved-function.js create mode 100644 deps/v8/test/mjsunit/noopt.js rename deps/v8/test/mjsunit/{regress/regress-crbug-259300.js => number-tostring-big-integer.js} (72%) rename deps/v8/test/mjsunit/{ => regress}/regress-3456.js (94%) rename deps/v8/test/mjsunit/regress/{regress-4399.js => regress-4399-01.js} (100%) rename deps/v8/test/mjsunit/{regress-4399.js => regress/regress-4399-02.js} (100%) create mode 100644 deps/v8/test/mjsunit/regress/regress-4870.js create mode 100644 deps/v8/test/mjsunit/regress/regress-4962.js create mode 100644 deps/v8/test/mjsunit/regress/regress-5295-2.js create mode 100644 deps/v8/test/mjsunit/regress/regress-5295.js rename deps/v8/test/{debugger/debug/harmony/async-debug-caught-exception-cases0.js => mjsunit/regress/regress-5664.js} (58%) create mode 100644 deps/v8/test/mjsunit/regress/regress-5669.js create mode 100644 deps/v8/test/mjsunit/regress/regress-5736.js create mode 100644 deps/v8/test/mjsunit/regress/regress-5749.js create mode 100644 deps/v8/test/mjsunit/regress/regress-5767.js create mode 100644 deps/v8/test/mjsunit/regress/regress-5772.js create mode 100644 deps/v8/test/mjsunit/regress/regress-5780.js create mode 100644 deps/v8/test/mjsunit/regress/regress-5783.js create mode 100644 deps/v8/test/mjsunit/regress/regress-5836.js rename deps/v8/test/mjsunit/{ => regress}/regress-587004.js (100%) create mode 100644 deps/v8/test/mjsunit/regress/regress-5943.js rename deps/v8/test/mjsunit/{ => regress}/regress-604044.js (85%) create mode 100644 deps/v8/test/mjsunit/regress/regress-648719.js create mode 100644 deps/v8/test/mjsunit/regress/regress-667603.js create mode 100644 deps/v8/test/mjsunit/regress/regress-669024.js create mode 100644 deps/v8/test/mjsunit/regress/regress-670671.js create mode 100644 deps/v8/test/mjsunit/regress/regress-670808.js create mode 100644 deps/v8/test/mjsunit/regress/regress-670981-array-push.js create mode 100644 deps/v8/test/mjsunit/regress/regress-672041.js create mode 100644 deps/v8/test/mjsunit/regress/regress-673241.js create mode 100644 deps/v8/test/mjsunit/regress/regress-673242.js create mode 100644 deps/v8/test/mjsunit/regress/regress-673297.js create mode 100644 deps/v8/test/mjsunit/regress/regress-674232.js create mode 100644 deps/v8/test/mjsunit/regress/regress-677055.js create mode 100644 deps/v8/test/mjsunit/regress/regress-677685.js create mode 100644 deps/v8/test/mjsunit/regress/regress-678917.js create mode 100644 deps/v8/test/mjsunit/regress/regress-679727.js create mode 100644 deps/v8/test/mjsunit/regress/regress-681171-1.js create mode 100644 deps/v8/test/mjsunit/regress/regress-681171-2.js create mode 100644 deps/v8/test/mjsunit/regress/regress-681171-3.js create mode 100644 deps/v8/test/mjsunit/regress/regress-681383.js create mode 100644 deps/v8/test/mjsunit/regress/regress-693500.js rename deps/v8/test/mjsunit/{ => regress}/regress-crbug-528379.js (100%) rename deps/v8/test/mjsunit/{ => regress}/regress-crbug-619476.js (100%) delete mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-629996.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-662854.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-662907.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-663340.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-663410.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-665587.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-665793.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-666308.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-666742.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-668101.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-668414.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-668795.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-669411.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-669451.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-669540.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-669850.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-671576.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-672792.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-677757.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-679378.js rename deps/v8/test/{debugger/debug/regress/regress-crbug-405491.js => mjsunit/regress/regress-crbug-679841.js} (53%) create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-683667.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-686102.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-686427.js create mode 100644 deps/v8/test/mjsunit/regress/regress-crbug-691323.js rename deps/v8/test/mjsunit/{ => regress}/regress-keyed-store-non-strict-arguments.js (100%) rename deps/v8/test/mjsunit/{ => regress}/regress-ntl.js (100%) rename deps/v8/test/mjsunit/{ => regress}/regress-sync-optimized-lists.js (100%) create mode 100644 deps/v8/test/mjsunit/regress/regress-v8-5697.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regression-5800.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regression-5884.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regression-643595.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regression-663994.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regression-666741.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regression-667745.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regression-670683.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regression-674447.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regression-680938.js create mode 100644 deps/v8/test/mjsunit/regress/wasm/regression-684858.js create mode 100644 deps/v8/test/mjsunit/wasm/add-getters.js create mode 100644 deps/v8/test/mjsunit/wasm/asm-wasm-exception-in-tonumber.js create mode 100644 deps/v8/test/mjsunit/wasm/asm-wasm-names.js create mode 100644 deps/v8/test/mjsunit/wasm/asm-with-wasm-off.js create mode 100644 deps/v8/test/mjsunit/wasm/float-constant-folding.js create mode 100644 deps/v8/test/mjsunit/wasm/instance-memory-gc-stress.js create mode 100644 deps/v8/test/mjsunit/wasm/js-api.js create mode 100644 deps/v8/test/mjsunit/wasm/memory-instance-validation.js create mode 100644 deps/v8/test/mjsunit/wasm/names.js create mode 100644 deps/v8/test/mjsunit/wasm/test-wasm-compilation-control.js create mode 100644 deps/v8/test/mjsunit/wasm/trap-location-with-trap-if.js create mode 100644 deps/v8/test/mjsunit/wasm/unreachable-validation.js create mode 100644 deps/v8/test/mjsunit/wasm/wasm-default.js create mode 100644 deps/v8/test/test262/local-tests/test/intl402/DateTimeFormat/12.1.1_1.js create mode 100644 deps/v8/test/test262/local-tests/test/intl402/NumberFormat/11.1.1_1.js create mode 100755 deps/v8/test/test262/prune-local-tests.sh create mode 100755 deps/v8/test/test262/upstream-local-tests.sh create mode 100644 deps/v8/test/unittests/api/access-check-unittest.cc create mode 100644 deps/v8/test/unittests/compiler-dispatcher/compiler-dispatcher-helper.cc create mode 100644 deps/v8/test/unittests/compiler-dispatcher/compiler-dispatcher-helper.h create mode 100644 deps/v8/test/unittests/compiler-dispatcher/compiler-dispatcher-unittest.cc create mode 100644 deps/v8/test/unittests/compiler/bytecode-analysis-unittest.cc create mode 100644 deps/v8/test/unittests/compiler/regalloc/OWNERS rename deps/v8/test/unittests/compiler/{ => regalloc}/live-range-unittest.cc (99%) rename deps/v8/test/unittests/compiler/{ => regalloc}/move-optimizer-unittest.cc (99%) rename deps/v8/test/unittests/compiler/{ => regalloc}/register-allocator-unittest.cc (99%) create mode 100644 deps/v8/test/unittests/heap/embedder-tracing-unittest.cc create mode 100644 deps/v8/test/unittests/heap/unmapper-unittest.cc create mode 100644 deps/v8/test/unittests/interpreter/bytecode-array-random-iterator-unittest.cc create mode 100644 deps/v8/test/unittests/interpreter/bytecode-operands-unittest.cc create mode 100644 deps/v8/test/unittests/object-unittest.cc rename deps/v8/test/unittests/wasm/{ast-decoder-unittest.cc => function-body-decoder-unittest.cc} (69%) create mode 100644 deps/v8/tools/foozzie/BUILD.gn create mode 100644 deps/v8/tools/foozzie/testdata/failure_output.txt create mode 100644 deps/v8/tools/foozzie/testdata/fuzz-123.js create mode 100644 deps/v8/tools/foozzie/testdata/test_d8_1.py create mode 100644 deps/v8/tools/foozzie/testdata/test_d8_2.py create mode 100644 deps/v8/tools/foozzie/testdata/test_d8_3.py create mode 100644 deps/v8/tools/foozzie/v8_commands.py create mode 100755 deps/v8/tools/foozzie/v8_foozzie.py create mode 100644 deps/v8/tools/foozzie/v8_foozzie_test.py create mode 100644 deps/v8/tools/foozzie/v8_mock.js create mode 100644 deps/v8/tools/foozzie/v8_suppressions.js create mode 100644 deps/v8/tools/foozzie/v8_suppressions.py diff --git a/deps/v8/.clang-format b/deps/v8/.clang-format index ae160a0bcc..55479a2f76 100644 --- a/deps/v8/.clang-format +++ b/deps/v8/.clang-format @@ -1,4 +1,5 @@ # Defines the Google C++ style for automatic reformatting. # http://clang.llvm.org/docs/ClangFormatStyleOptions.html BasedOnStyle: Google +DerivePointerAlignment: false MaxEmptyLinesToKeep: 1 diff --git a/deps/v8/.gn b/deps/v8/.gn index aee1752d4b..c80980ea09 100644 --- a/deps/v8/.gn +++ b/deps/v8/.gn @@ -2,6 +2,8 @@ # tree and to set startup options. For documentation on the values set in this # file, run "gn help dotfile" at the command line. +import("//build/dotfile_settings.gni") + # The location of the build configuration file. buildconfig = "//build/config/BUILDCONFIG.gn" @@ -19,30 +21,5 @@ check_targets = [] # These are the list of GN files that run exec_script. This whitelist exists # to force additional review for new uses of exec_script, which is strongly # discouraged except for gypi_to_gn calls. -exec_script_whitelist = [ - "//build/config/android/BUILD.gn", - "//build/config/android/config.gni", - "//build/config/android/internal_rules.gni", - "//build/config/android/rules.gni", - "//build/config/BUILD.gn", - "//build/config/compiler/BUILD.gn", - "//build/config/gcc/gcc_version.gni", - "//build/config/ios/ios_sdk.gni", - "//build/config/linux/atk/BUILD.gn", - "//build/config/linux/BUILD.gn", - "//build/config/linux/pkg_config.gni", - "//build/config/mac/mac_sdk.gni", - "//build/config/posix/BUILD.gn", - "//build/config/sysroot.gni", - "//build/config/win/BUILD.gn", - "//build/config/win/visual_studio_version.gni", - "//build/gn_helpers.py", - "//build/gypi_to_gn.py", - "//build/toolchain/concurrent_links.gni", - "//build/toolchain/gcc_toolchain.gni", - "//build/toolchain/mac/BUILD.gn", - "//build/toolchain/win/BUILD.gn", - "//build/util/branding.gni", - "//build/util/version.gni", - "//test/test262/BUILD.gn", -] +exec_script_whitelist = + build_dotfile_settings.exec_script_whitelist + [ "//test/test262/BUILD.gn" ] diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 476d0c3632..35edca97e5 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -81,6 +81,7 @@ Julien Brianceau JunHo Seo Kang-Hao (Kenny) Lu Karl Skomski +Kevin Gibbons Luis Reis Luke Zarko Maciej Małecki @@ -104,6 +105,7 @@ Patrick Gansterer Peter Rybin Peter Varga Paul Lind +Qiuyi Zhang Rafal Krypa Refael Ackermann Rene Rebe diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 8587356ddc..c1fa769dc0 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -14,8 +14,6 @@ if (is_android) { import("gni/v8.gni") import("gni/isolate.gni") -import("//build_overrides/v8.gni") - import("snapshot_toolchain.gni") declare_args() { @@ -23,7 +21,10 @@ declare_args() { v8_android_log_stdout = false # Sets -DVERIFY_HEAP. - v8_enable_verify_heap = false + v8_enable_verify_heap = "" + + # Sets -DVERIFY_PREDICTABLE + v8_enable_verify_predictable = false # Enable compiler warnings when using V8_DEPRECATED apis. v8_deprecation_warnings = false @@ -51,7 +52,13 @@ declare_args() { v8_interpreted_regexp = false # Sets -dOBJECT_PRINT. - v8_object_print = "" + v8_enable_object_print = "" + + # Sets -dTRACE_MAPS. + v8_enable_trace_maps = "" + + # Sets -dV8_ENABLE_CHECKS. + v8_enable_v8_checks = "" # With post mortem support enabled, metadata is embedded into libv8 that # describes various parameters of the VM for use by debuggers. See @@ -89,11 +96,20 @@ if (v8_enable_gdbjit == "") { } # Derived defaults. -if (v8_object_print == "") { - v8_object_print = is_debug && !v8_optimized_debug +if (v8_enable_verify_heap == "") { + v8_enable_verify_heap = is_debug +} +if (v8_enable_object_print == "") { + v8_enable_object_print = is_debug } if (v8_enable_disassembler == "") { - v8_enable_disassembler = is_debug && !v8_optimized_debug + v8_enable_disassembler = is_debug +} +if (v8_enable_trace_maps == "") { + v8_enable_trace_maps = is_debug +} +if (v8_enable_v8_checks == "") { + v8_enable_v8_checks = is_debug } # Specifies if the target build is a simulator build. Comparing target cpu @@ -155,7 +171,7 @@ config("external_config") { defines = [ "USING_V8_SHARED" ] } include_dirs = [ "include" ] - if (v8_enable_inspector_override) { + if (v8_enable_inspector) { include_dirs += [ "$target_gen_dir/include" ] } } @@ -179,12 +195,21 @@ config("features") { if (v8_enable_gdbjit) { defines += [ "ENABLE_GDB_JIT_INTERFACE" ] } - if (v8_object_print) { + if (v8_enable_object_print) { defines += [ "OBJECT_PRINT" ] } if (v8_enable_verify_heap) { defines += [ "VERIFY_HEAP" ] } + if (v8_enable_verify_predictable) { + defines += [ "VERIFY_PREDICTABLE" ] + } + if (v8_enable_trace_maps) { + defines += [ "TRACE_MAPS" ] + } + if (v8_enable_v8_checks) { + defines += [ "V8_ENABLE_CHECKS" ] + } if (v8_interpreted_regexp) { defines += [ "V8_INTERPRETED_REGEXP" ] } @@ -348,15 +373,7 @@ config("toolchain") { ldflags += [ "-rdynamic" ] } - # TODO(jochen): Add support for different debug optimization levels. - defines += [ - "ENABLE_DISASSEMBLER", - "V8_ENABLE_CHECKS", - "OBJECT_PRINT", - "VERIFY_HEAP", - "DEBUG", - "TRACE_MAPS", - ] + defines += [ "DEBUG" ] if (v8_enable_slow_dchecks) { defines += [ "ENABLE_SLOW_DCHECKS" ] } @@ -408,7 +425,6 @@ action("js2c") { "src/js/prologue.js", "src/js/runtime.js", "src/js/v8natives.js", - "src/js/symbol.js", "src/js/array.js", "src/js/string.js", "src/js/arraybuffer.js", @@ -422,6 +438,7 @@ action("js2c") { "src/js/spread.js", "src/js/proxy.js", "src/js/async-await.js", + "src/js/harmony-string-padding.js", "src/debug/mirrors.js", "src/debug/debug.js", "src/debug/liveedit.js", @@ -466,7 +483,6 @@ action("js2c_experimental") { "src/messages.h", "src/js/harmony-atomics.js", "src/js/harmony-simd.js", - "src/js/harmony-string-padding.js", ] outputs = [ @@ -742,7 +758,7 @@ action("v8_dump_build_config") { "is_tsan=$is_tsan", "target_cpu=\"$target_cpu\"", "v8_enable_i18n_support=$v8_enable_i18n_support", - "v8_enable_inspector=$v8_enable_inspector_override", + "v8_enable_inspector=$v8_enable_inspector", "v8_target_cpu=\"$v8_target_cpu\"", "v8_use_snapshot=$v8_use_snapshot", ] @@ -848,6 +864,17 @@ if (v8_use_external_startup_data) { } } +# This is split out to be a non-code containing target that the Chromium browser +# DLL can depend upon to get only a version string. +v8_source_set("v8_version") { + configs = [ ":internal_config" ] + + sources = [ + "include/v8-version-string.h", + "include/v8-version.h", + ] +} + v8_source_set("v8_base") { visibility = [ ":*" ] # Only targets in this file can depend on this. @@ -861,7 +888,6 @@ v8_source_set("v8_base") { "include/v8-profiler.h", "include/v8-testing.h", "include/v8-util.h", - "include/v8-version.h", "include/v8.h", "include/v8config.h", "src/accessors.cc", @@ -893,12 +919,15 @@ v8_source_set("v8_base") { "src/asmjs/asm-wasm-builder.h", "src/asmjs/switch-logic.cc", "src/asmjs/switch-logic.h", + "src/assembler-inl.h", "src/assembler.cc", "src/assembler.h", "src/assert-scope.cc", "src/assert-scope.h", "src/ast/ast-expression-rewriter.cc", "src/ast/ast-expression-rewriter.h", + "src/ast/ast-function-literal-id-reindexer.cc", + "src/ast/ast-function-literal-id-reindexer.h", "src/ast/ast-literal-reindexer.cc", "src/ast/ast-literal-reindexer.h", "src/ast/ast-numbering.cc", @@ -919,7 +948,6 @@ v8_source_set("v8_base") { "src/ast/modules.h", "src/ast/prettyprinter.cc", "src/ast/prettyprinter.h", - "src/ast/scopeinfo.cc", "src/ast/scopes.cc", "src/ast/scopes.h", "src/ast/variables.cc", @@ -944,6 +972,8 @@ v8_source_set("v8_base") { "src/builtins/builtins-boolean.cc", "src/builtins/builtins-call.cc", "src/builtins/builtins-callsite.cc", + "src/builtins/builtins-constructor.cc", + "src/builtins/builtins-constructor.h", "src/builtins/builtins-conversion.cc", "src/builtins/builtins-dataview.cc", "src/builtins/builtins-date.cc", @@ -953,14 +983,15 @@ v8_source_set("v8_base") { "src/builtins/builtins-generator.cc", "src/builtins/builtins-global.cc", "src/builtins/builtins-handler.cc", + "src/builtins/builtins-ic.cc", "src/builtins/builtins-internal.cc", "src/builtins/builtins-interpreter.cc", - "src/builtins/builtins-iterator.cc", "src/builtins/builtins-json.cc", "src/builtins/builtins-math.cc", "src/builtins/builtins-number.cc", "src/builtins/builtins-object.cc", "src/builtins/builtins-promise.cc", + "src/builtins/builtins-promise.h", "src/builtins/builtins-proxy.cc", "src/builtins/builtins-reflect.cc", "src/builtins/builtins-regexp.cc", @@ -1002,6 +1033,8 @@ v8_source_set("v8_base") { "src/compiler-dispatcher/compiler-dispatcher-job.h", "src/compiler-dispatcher/compiler-dispatcher-tracer.cc", "src/compiler-dispatcher/compiler-dispatcher-tracer.h", + "src/compiler-dispatcher/compiler-dispatcher.cc", + "src/compiler-dispatcher/compiler-dispatcher.h", "src/compiler-dispatcher/optimizing-compile-dispatcher.cc", "src/compiler-dispatcher/optimizing-compile-dispatcher.h", "src/compiler.cc", @@ -1020,12 +1053,12 @@ v8_source_set("v8_base") { "src/compiler/basic-block-instrumentor.h", "src/compiler/branch-elimination.cc", "src/compiler/branch-elimination.h", - "src/compiler/bytecode-branch-analysis.cc", - "src/compiler/bytecode-branch-analysis.h", + "src/compiler/bytecode-analysis.cc", + "src/compiler/bytecode-analysis.h", "src/compiler/bytecode-graph-builder.cc", "src/compiler/bytecode-graph-builder.h", - "src/compiler/bytecode-loop-analysis.cc", - "src/compiler/bytecode-loop-analysis.h", + "src/compiler/bytecode-liveness-map.cc", + "src/compiler/bytecode-liveness-map.h", "src/compiler/c-linkage.cc", "src/compiler/checkpoint-elimination.cc", "src/compiler/checkpoint-elimination.h", @@ -1065,6 +1098,8 @@ v8_source_set("v8_base") { "src/compiler/frame.h", "src/compiler/gap-resolver.cc", "src/compiler/gap-resolver.h", + "src/compiler/graph-assembler.cc", + "src/compiler/graph-assembler.h", "src/compiler/graph-reducer.cc", "src/compiler/graph-reducer.h", "src/compiler/graph-replay.cc", @@ -1196,8 +1231,6 @@ v8_source_set("v8_base") { "src/compiler/tail-call-optimization.h", "src/compiler/type-cache.cc", "src/compiler/type-cache.h", - "src/compiler/type-hint-analyzer.cc", - "src/compiler/type-hint-analyzer.h", "src/compiler/typed-optimization.cc", "src/compiler/typed-optimization.h", "src/compiler/typer.cc", @@ -1300,6 +1333,7 @@ v8_source_set("v8_base") { "src/debug/debug-scopes.h", "src/debug/debug.cc", "src/debug/debug.h", + "src/debug/interface-types.h", "src/debug/liveedit.cc", "src/debug/liveedit.h", "src/deoptimize-reason.cc", @@ -1373,6 +1407,8 @@ v8_source_set("v8_base") { "src/heap/array-buffer-tracker.h", "src/heap/code-stats.cc", "src/heap/code-stats.h", + "src/heap/embedder-tracing.cc", + "src/heap/embedder-tracing.h", "src/heap/gc-idle-time-handler.cc", "src/heap/gc-idle-time-handler.h", "src/heap/gc-tracer.cc", @@ -1414,6 +1450,9 @@ v8_source_set("v8_base") { "src/ic/access-compiler-data.h", "src/ic/access-compiler.cc", "src/ic/access-compiler.h", + "src/ic/accessor-assembler-impl.h", + "src/ic/accessor-assembler.cc", + "src/ic/accessor-assembler.h", "src/ic/call-optimization.cc", "src/ic/call-optimization.h", "src/ic/handler-compiler.cc", @@ -1425,6 +1464,8 @@ v8_source_set("v8_base") { "src/ic/ic-inl.h", "src/ic/ic-state.cc", "src/ic/ic-state.h", + "src/ic/ic-stats.cc", + "src/ic/ic-stats.h", "src/ic/ic.cc", "src/ic/ic.h", "src/ic/keyed-store-generic.cc", @@ -1437,10 +1478,14 @@ v8_source_set("v8_base") { "src/identity-map.h", "src/interface-descriptors.cc", "src/interface-descriptors.h", + "src/interpreter/bytecode-array-accessor.cc", + "src/interpreter/bytecode-array-accessor.h", "src/interpreter/bytecode-array-builder.cc", "src/interpreter/bytecode-array-builder.h", "src/interpreter/bytecode-array-iterator.cc", "src/interpreter/bytecode-array-iterator.h", + "src/interpreter/bytecode-array-random-iterator.cc", + "src/interpreter/bytecode-array-random-iterator.h", "src/interpreter/bytecode-array-writer.cc", "src/interpreter/bytecode-array-writer.h", "src/interpreter/bytecode-dead-code-optimizer.cc", @@ -1509,6 +1554,8 @@ v8_source_set("v8_base") { "src/machine-type.cc", "src/machine-type.h", "src/macro-assembler.h", + "src/map-updater.cc", + "src/map-updater.h", "src/messages.cc", "src/messages.h", "src/msan.h", @@ -1519,6 +1566,11 @@ v8_source_set("v8_base") { "src/objects-printer.cc", "src/objects.cc", "src/objects.h", + "src/objects/module-info.h", + "src/objects/object-macros-undef.h", + "src/objects/object-macros.h", + "src/objects/scope-info.cc", + "src/objects/scope-info.h", "src/ostreams.cc", "src/ostreams.h", "src/parsing/duplicate-finder.cc", @@ -1533,6 +1585,8 @@ v8_source_set("v8_base") { "src/parsing/parser-base.h", "src/parsing/parser.cc", "src/parsing/parser.h", + "src/parsing/parsing.cc", + "src/parsing/parsing.h", "src/parsing/pattern-rewriter.cc", "src/parsing/preparse-data-format.h", "src/parsing/preparse-data.cc", @@ -1578,8 +1632,6 @@ v8_source_set("v8_base") { "src/profiler/tracing-cpu-profiler.h", "src/profiler/unbound-queue-inl.h", "src/profiler/unbound-queue.h", - "src/promise-utils.cc", - "src/promise-utils.h", "src/property-descriptor.cc", "src/property-descriptor.h", "src/property-details.h", @@ -1679,6 +1731,8 @@ v8_source_set("v8_base") { "src/startup-data-util.h", "src/string-builder.cc", "src/string-builder.h", + "src/string-case.cc", + "src/string-case.h", "src/string-search.h", "src/string-stream.cc", "src/string-stream.h", @@ -1693,6 +1747,7 @@ v8_source_set("v8_base") { "src/transitions-inl.h", "src/transitions.cc", "src/transitions.h", + "src/trap-handler/trap-handler.h", "src/type-feedback-vector-inl.h", "src/type-feedback-vector.cc", "src/type-feedback-vector.h", @@ -1724,9 +1779,9 @@ v8_source_set("v8_base") { "src/version.h", "src/vm-state-inl.h", "src/vm-state.h", - "src/wasm/ast-decoder.cc", - "src/wasm/ast-decoder.h", "src/wasm/decoder.h", + "src/wasm/function-body-decoder.cc", + "src/wasm/function-body-decoder.h", "src/wasm/leb-helper.h", "src/wasm/managed.h", "src/wasm/module-decoder.cc", @@ -1740,6 +1795,7 @@ v8_source_set("v8_base") { "src/wasm/wasm-interpreter.h", "src/wasm/wasm-js.cc", "src/wasm/wasm-js.h", + "src/wasm/wasm-limits.h", "src/wasm/wasm-macro-gen.h", "src/wasm/wasm-module-builder.cc", "src/wasm/wasm-module-builder.h", @@ -1751,12 +1807,15 @@ v8_source_set("v8_base") { "src/wasm/wasm-opcodes.h", "src/wasm/wasm-result.cc", "src/wasm/wasm-result.h", + "src/wasm/wasm-text.cc", + "src/wasm/wasm-text.h", "src/zone/accounting-allocator.cc", "src/zone/accounting-allocator.h", "src/zone/zone-allocator.h", "src/zone/zone-allocator.h", "src/zone/zone-chunk-list.h", "src/zone/zone-containers.h", + "src/zone/zone-handle-set.h", "src/zone/zone-segment.cc", "src/zone/zone-segment.h", "src/zone/zone.cc", @@ -1797,9 +1856,7 @@ v8_source_set("v8_base") { "src/ia32/simulator-ia32.h", "src/ic/ia32/access-compiler-ia32.cc", "src/ic/ia32/handler-compiler-ia32.cc", - "src/ic/ia32/ic-compiler-ia32.cc", "src/ic/ia32/ic-ia32.cc", - "src/ic/ia32/stub-cache-ia32.cc", "src/regexp/ia32/regexp-macro-assembler-ia32.cc", "src/regexp/ia32/regexp-macro-assembler-ia32.h", ] @@ -1822,9 +1879,7 @@ v8_source_set("v8_base") { "src/full-codegen/x64/full-codegen-x64.cc", "src/ic/x64/access-compiler-x64.cc", "src/ic/x64/handler-compiler-x64.cc", - "src/ic/x64/ic-compiler-x64.cc", "src/ic/x64/ic-x64.cc", - "src/ic/x64/stub-cache-x64.cc", "src/regexp/x64/regexp-macro-assembler-x64.cc", "src/regexp/x64/regexp-macro-assembler-x64.h", "src/third_party/valgrind/valgrind.h", @@ -1889,8 +1944,6 @@ v8_source_set("v8_base") { "src/ic/arm/access-compiler-arm.cc", "src/ic/arm/handler-compiler-arm.cc", "src/ic/arm/ic-arm.cc", - "src/ic/arm/ic-compiler-arm.cc", - "src/ic/arm/stub-cache-arm.cc", "src/regexp/arm/regexp-macro-assembler-arm.cc", "src/regexp/arm/regexp-macro-assembler-arm.h", ] @@ -1948,8 +2001,6 @@ v8_source_set("v8_base") { "src/ic/arm64/access-compiler-arm64.cc", "src/ic/arm64/handler-compiler-arm64.cc", "src/ic/arm64/ic-arm64.cc", - "src/ic/arm64/ic-compiler-arm64.cc", - "src/ic/arm64/stub-cache-arm64.cc", "src/regexp/arm64/regexp-macro-assembler-arm64.cc", "src/regexp/arm64/regexp-macro-assembler-arm64.h", ] @@ -1970,9 +2021,7 @@ v8_source_set("v8_base") { "src/full-codegen/mips/full-codegen-mips.cc", "src/ic/mips/access-compiler-mips.cc", "src/ic/mips/handler-compiler-mips.cc", - "src/ic/mips/ic-compiler-mips.cc", "src/ic/mips/ic-mips.cc", - "src/ic/mips/stub-cache-mips.cc", "src/mips/assembler-mips-inl.h", "src/mips/assembler-mips.cc", "src/mips/assembler-mips.h", @@ -2012,9 +2061,7 @@ v8_source_set("v8_base") { "src/full-codegen/mips64/full-codegen-mips64.cc", "src/ic/mips64/access-compiler-mips64.cc", "src/ic/mips64/handler-compiler-mips64.cc", - "src/ic/mips64/ic-compiler-mips64.cc", "src/ic/mips64/ic-mips64.cc", - "src/ic/mips64/stub-cache-mips64.cc", "src/mips64/assembler-mips64-inl.h", "src/mips64/assembler-mips64.cc", "src/mips64/assembler-mips64.h", @@ -2054,9 +2101,7 @@ v8_source_set("v8_base") { "src/full-codegen/ppc/full-codegen-ppc.cc", "src/ic/ppc/access-compiler-ppc.cc", "src/ic/ppc/handler-compiler-ppc.cc", - "src/ic/ppc/ic-compiler-ppc.cc", "src/ic/ppc/ic-ppc.cc", - "src/ic/ppc/stub-cache-ppc.cc", "src/ppc/assembler-ppc-inl.h", "src/ppc/assembler-ppc.cc", "src/ppc/assembler-ppc.h", @@ -2096,9 +2141,7 @@ v8_source_set("v8_base") { "src/full-codegen/s390/full-codegen-s390.cc", "src/ic/s390/access-compiler-s390.cc", "src/ic/s390/handler-compiler-s390.cc", - "src/ic/s390/ic-compiler-s390.cc", "src/ic/s390/ic-s390.cc", - "src/ic/s390/stub-cache-s390.cc", "src/regexp/s390/regexp-macro-assembler-s390.cc", "src/regexp/s390/regexp-macro-assembler-s390.h", "src/s390/assembler-s390-inl.h", @@ -2138,9 +2181,7 @@ v8_source_set("v8_base") { "src/full-codegen/x87/full-codegen-x87.cc", "src/ic/x87/access-compiler-x87.cc", "src/ic/x87/handler-compiler-x87.cc", - "src/ic/x87/ic-compiler-x87.cc", "src/ic/x87/ic-x87.cc", - "src/ic/x87/stub-cache-x87.cc", "src/regexp/x87/regexp-macro-assembler-x87.cc", "src/regexp/x87/regexp-macro-assembler-x87.h", "src/x87/assembler-x87-inl.h", @@ -2169,6 +2210,7 @@ v8_source_set("v8_base") { deps = [ ":v8_libbase", ":v8_libsampler", + ":v8_version", ] sources += [ v8_generated_peephole_source ] @@ -2196,7 +2238,7 @@ v8_source_set("v8_base") { deps += [ ":postmortem-metadata" ] } - if (v8_enable_inspector_override) { + if (v8_enable_inspector) { deps += [ "src/inspector:inspector" ] } } @@ -2399,14 +2441,10 @@ v8_source_set("fuzzer_support") { ":v8_libbase", ":v8_libplatform", ] -} - -v8_source_set("simple_fuzzer") { - sources = [ - "test/fuzzer/fuzzer.cc", - ] - configs = [ ":internal_config_base" ] + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } } ############################################################################### @@ -2477,14 +2515,10 @@ group("gn_all") { deps = [ ":d8", + ":v8_fuzzers", ":v8_hello_world", ":v8_parser_shell", ":v8_sample_process", - ":v8_simple_json_fuzzer", - ":v8_simple_parser_fuzzer", - ":v8_simple_regexp_fuzzer", - ":v8_simple_wasm_asmjs_fuzzer", - ":v8_simple_wasm_fuzzer", "test:gn_all", "tools:gn_all", ] @@ -2498,6 +2532,26 @@ group("gn_all") { } } +group("v8_fuzzers") { + testonly = true + deps = [ + ":v8_simple_json_fuzzer", + ":v8_simple_parser_fuzzer", + ":v8_simple_regexp_fuzzer", + ":v8_simple_wasm_asmjs_fuzzer", + ":v8_simple_wasm_call_fuzzer", + ":v8_simple_wasm_code_fuzzer", + ":v8_simple_wasm_data_section_fuzzer", + ":v8_simple_wasm_function_sigs_section_fuzzer", + ":v8_simple_wasm_fuzzer", + ":v8_simple_wasm_globals_section_fuzzer", + ":v8_simple_wasm_imports_section_fuzzer", + ":v8_simple_wasm_memory_section_fuzzer", + ":v8_simple_wasm_names_section_fuzzer", + ":v8_simple_wasm_types_section_fuzzer", + ] +} + if (is_component_build) { v8_component("v8") { sources = [ @@ -2527,6 +2581,7 @@ if (is_component_build) { ":v8_base", ":v8_maybe_snapshot", ] + public_configs = [ ":external_config" ] } } @@ -2566,8 +2621,12 @@ v8_executable("d8") { deps += [ "//third_party/icu" ] } + if (v8_correctness_fuzzer) { + deps += [ "tools/foozzie:v8_correctness_fuzzer_resources" ] + } + defines = [] - if (v8_enable_inspector_override) { + if (v8_enable_inspector) { defines += [ "V8_INSPECTOR_ENABLED" ] } } @@ -2687,10 +2746,14 @@ template("v8_fuzzer") { v8_executable("v8_simple_" + name) { deps = [ ":" + name, - ":simple_fuzzer", + "//build/config/sanitizers:deps", "//build/win:default_exe_manifest", ] + sources = [ + "test/fuzzer/fuzzer.cc", + ] + configs = [ ":external_config" ] } } diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index 2dc77568d4..1ff3b3bf8c 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,3 +1,2493 @@ +2017-01-17: Version 5.7.492 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.491 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.490 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.489 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.488 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.487 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.486 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.485 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.484 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.483 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.482 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.481 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.480 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.479 + + Performance and stability improvements on all platforms. + + +2017-01-17: Version 5.7.478 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.477 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.476 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.475 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.474 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.473 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.472 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.471 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.470 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.469 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.468 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.467 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.466 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.465 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.464 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.463 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.462 + + Performance and stability improvements on all platforms. + + +2017-01-16: Version 5.7.461 + + Performance and stability improvements on all platforms. + + +2017-01-15: Version 5.7.460 + + Performance and stability improvements on all platforms. + + +2017-01-15: Version 5.7.459 + + Performance and stability improvements on all platforms. + + +2017-01-15: Version 5.7.458 + + Performance and stability improvements on all platforms. + + +2017-01-15: Version 5.7.457 + + Performance and stability improvements on all platforms. + + +2017-01-14: Version 5.7.456 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.455 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.454 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.453 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.452 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.451 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.450 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.449 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.448 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.447 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.446 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.445 + + Performance and stability improvements on all platforms. + + +2017-01-13: Version 5.7.444 + + Performance and stability improvements on all platforms. + + +2017-01-12: Version 5.7.443 + + Performance and stability improvements on all platforms. + + +2017-01-12: Version 5.7.442 + + Performance and stability improvements on all platforms. + + +2017-01-11: Version 5.7.441 + + Performance and stability improvements on all platforms. + + +2017-01-11: Version 5.7.440 + + Performance and stability improvements on all platforms. + + +2017-01-11: Version 5.7.439 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.438 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.437 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.436 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.435 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.434 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.433 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.432 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.431 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.430 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.429 + + Performance and stability improvements on all platforms. + + +2017-01-10: Version 5.7.428 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.427 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.426 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.425 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.424 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.423 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.422 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.421 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.420 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.419 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.418 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.417 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.416 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.415 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.414 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.413 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.412 + + Performance and stability improvements on all platforms. + + +2017-01-09: Version 5.7.411 + + Performance and stability improvements on all platforms. + + +2017-01-08: Version 5.7.410 + + Performance and stability improvements on all platforms. + + +2017-01-06: Version 5.7.409 + + Performance and stability improvements on all platforms. + + +2017-01-06: Version 5.7.408 + + Performance and stability improvements on all platforms. + + +2017-01-06: Version 5.7.407 + + Performance and stability improvements on all platforms. + + +2017-01-06: Version 5.7.406 + + Performance and stability improvements on all platforms. + + +2017-01-06: Version 5.7.405 + + Performance and stability improvements on all platforms. + + +2017-01-06: Version 5.7.404 + + Performance and stability improvements on all platforms. + + +2017-01-06: Version 5.7.403 + + Performance and stability improvements on all platforms. + + +2017-01-05: Version 5.7.402 + + Performance and stability improvements on all platforms. + + +2017-01-05: Version 5.7.401 + + Performance and stability improvements on all platforms. + + +2017-01-05: Version 5.7.400 + + Performance and stability improvements on all platforms. + + +2017-01-05: Version 5.7.399 + + Performance and stability improvements on all platforms. + + +2017-01-05: Version 5.7.398 + + Performance and stability improvements on all platforms. + + +2017-01-04: Version 5.7.397 + + Performance and stability improvements on all platforms. + + +2017-01-04: Version 5.7.396 + + Performance and stability improvements on all platforms. + + +2017-01-04: Version 5.7.395 + + Performance and stability improvements on all platforms. + + +2017-01-04: Version 5.7.394 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.393 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.392 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.391 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.390 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.389 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.388 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.387 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.386 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.385 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.384 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.383 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.382 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.381 + + Performance and stability improvements on all platforms. + + +2017-01-03: Version 5.7.380 + + Performance and stability improvements on all platforms. + + +2017-01-02: Version 5.7.379 + + Performance and stability improvements on all platforms. + + +2017-01-02: Version 5.7.378 + + Performance and stability improvements on all platforms. + + +2017-01-02: Version 5.7.377 + + Performance and stability improvements on all platforms. + + +2017-01-02: Version 5.7.376 + + Performance and stability improvements on all platforms. + + +2017-01-02: Version 5.7.375 + + Performance and stability improvements on all platforms. + + +2017-01-02: Version 5.7.374 + + Performance and stability improvements on all platforms. + + +2017-01-02: Version 5.7.373 + + Performance and stability improvements on all platforms. + + +2017-01-02: Version 5.7.372 + + Performance and stability improvements on all platforms. + + +2017-01-02: Version 5.7.371 + + Performance and stability improvements on all platforms. + + +2016-12-30: Version 5.7.370 + + Performance and stability improvements on all platforms. + + +2016-12-30: Version 5.7.369 + + Performance and stability improvements on all platforms. + + +2016-12-30: Version 5.7.368 + + Performance and stability improvements on all platforms. + + +2016-12-30: Version 5.7.367 + + Performance and stability improvements on all platforms. + + +2016-12-30: Version 5.7.366 + + Performance and stability improvements on all platforms. + + +2016-12-28: Version 5.7.365 + + Performance and stability improvements on all platforms. + + +2016-12-28: Version 5.7.364 + + Performance and stability improvements on all platforms. + + +2016-12-28: Version 5.7.363 + + Performance and stability improvements on all platforms. + + +2016-12-28: Version 5.7.362 + + Performance and stability improvements on all platforms. + + +2016-12-28: Version 5.7.361 + + Performance and stability improvements on all platforms. + + +2016-12-27: Version 5.7.360 + + Performance and stability improvements on all platforms. + + +2016-12-27: Version 5.7.359 + + Performance and stability improvements on all platforms. + + +2016-12-27: Version 5.7.358 + + Performance and stability improvements on all platforms. + + +2016-12-27: Version 5.7.357 + + Performance and stability improvements on all platforms. + + +2016-12-27: Version 5.7.356 + + Performance and stability improvements on all platforms. + + +2016-12-27: Version 5.7.355 + + Performance and stability improvements on all platforms. + + +2016-12-27: Version 5.7.354 + + Performance and stability improvements on all platforms. + + +2016-12-27: Version 5.7.353 + + Performance and stability improvements on all platforms. + + +2016-12-26: Version 5.7.352 + + Performance and stability improvements on all platforms. + + +2016-12-24: Version 5.7.351 + + Performance and stability improvements on all platforms. + + +2016-12-24: Version 5.7.350 + + Performance and stability improvements on all platforms. + + +2016-12-24: Version 5.7.349 + + Performance and stability improvements on all platforms. + + +2016-12-23: Version 5.7.348 + + Performance and stability improvements on all platforms. + + +2016-12-23: Version 5.7.347 + + Performance and stability improvements on all platforms. + + +2016-12-23: Version 5.7.346 + + [intl] Add new semantics + compat fallback to Intl constructor (issues + 4360, 4870). + + Performance and stability improvements on all platforms. + + +2016-12-23: Version 5.7.345 + + Performance and stability improvements on all platforms. + + +2016-12-23: Version 5.7.344 + + Performance and stability improvements on all platforms. + + +2016-12-23: Version 5.7.343 + + Performance and stability improvements on all platforms. + + +2016-12-23: Version 5.7.342 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.341 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.340 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.339 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.338 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.337 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.336 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.335 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.334 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.333 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.332 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.331 + + Performance and stability improvements on all platforms. + + +2016-12-22: Version 5.7.330 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.329 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.328 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.327 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.326 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.325 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.324 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.323 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.322 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.321 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.320 + + Performance and stability improvements on all platforms. + + +2016-12-21: Version 5.7.319 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.318 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.317 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.316 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.315 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.314 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.313 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.312 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.311 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.310 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.309 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.308 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.307 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.306 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.305 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.304 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.303 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.302 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.301 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.300 + + Performance and stability improvements on all platforms. + + +2016-12-20: Version 5.7.299 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.298 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.297 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.296 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.295 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.294 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.293 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.292 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.291 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.290 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.289 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.288 + + Performance and stability improvements on all platforms. + + +2016-12-19: Version 5.7.287 + + Performance and stability improvements on all platforms. + + +2016-12-18: Version 5.7.286 + + Performance and stability improvements on all platforms. + + +2016-12-18: Version 5.7.285 + + Performance and stability improvements on all platforms. + + +2016-12-17: Version 5.7.284 + + Performance and stability improvements on all platforms. + + +2016-12-17: Version 5.7.283 + + Performance and stability improvements on all platforms. + + +2016-12-17: Version 5.7.282 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.281 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.280 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.279 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.278 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.277 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.276 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.275 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.274 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.273 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.272 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.271 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.270 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.269 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.268 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.267 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.266 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.265 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.264 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.263 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.262 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.261 + + Performance and stability improvements on all platforms. + + +2016-12-16: Version 5.7.260 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.259 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.258 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.257 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.256 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.255 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.254 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.253 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.252 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.251 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.250 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.249 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.248 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.247 + + Performance and stability improvements on all platforms. + + +2016-12-15: Version 5.7.246 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.245 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.244 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.243 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.242 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.241 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.240 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.239 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.238 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.237 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.236 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.235 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.234 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.233 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.232 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.231 + + Performance and stability improvements on all platforms. + + +2016-12-14: Version 5.7.230 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.229 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.228 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.227 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.226 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.225 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.224 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.223 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.222 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.221 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.220 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.219 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.218 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.217 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.216 + + Performance and stability improvements on all platforms. + + +2016-12-13: Version 5.7.215 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.214 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.213 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.212 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.211 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.210 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.209 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.208 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.207 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.206 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.205 + + Performance and stability improvements on all platforms. + + +2016-12-12: Version 5.7.204 + + Performance and stability improvements on all platforms. + + +2016-12-11: Version 5.7.203 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.202 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.201 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.200 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.199 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.198 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.197 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.196 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.195 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.194 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.193 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.192 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.191 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.190 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.189 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.188 + + Performance and stability improvements on all platforms. + + +2016-12-09: Version 5.7.187 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.186 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.185 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.184 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.183 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.182 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.181 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.180 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.179 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.178 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.177 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.176 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.175 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.174 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.173 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.172 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.171 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.170 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.169 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.168 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.167 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.166 + + Performance and stability improvements on all platforms. + + +2016-12-08: Version 5.7.165 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.164 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.163 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.162 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.161 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.160 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.159 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.158 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.157 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.156 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.155 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.154 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.153 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.152 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.151 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.150 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.149 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.148 + + Performance and stability improvements on all platforms. + + +2016-12-07: Version 5.7.147 + + Performance and stability improvements on all platforms. + + +2016-12-06: Version 5.7.146 + + Performance and stability improvements on all platforms. + + +2016-12-06: Version 5.7.145 + + Performance and stability improvements on all platforms. + + +2016-12-06: Version 5.7.144 + + Performance and stability improvements on all platforms. + + +2016-12-06: Version 5.7.143 + + Performance and stability improvements on all platforms. + + +2016-12-06: Version 5.7.142 + + Performance and stability improvements on all platforms. + + +2016-12-06: Version 5.7.141 + + Performance and stability improvements on all platforms. + + +2016-12-06: Version 5.7.140 + + Performance and stability improvements on all platforms. + + +2016-12-06: Version 5.7.139 + + Performance and stability improvements on all platforms. + + +2016-12-06: Version 5.7.138 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.137 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.136 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.135 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.134 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.133 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.132 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.131 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.130 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.129 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.128 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.127 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.126 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.125 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.124 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.123 + + Performance and stability improvements on all platforms. + + +2016-12-05: Version 5.7.122 + + Performance and stability improvements on all platforms. + + +2016-12-02: Version 5.7.121 + + Performance and stability improvements on all platforms. + + +2016-12-02: Version 5.7.120 + + Performance and stability improvements on all platforms. + + +2016-12-02: Version 5.7.119 + + Performance and stability improvements on all platforms. + + +2016-12-02: Version 5.7.118 + + Performance and stability improvements on all platforms. + + +2016-12-02: Version 5.7.117 + + Performance and stability improvements on all platforms. + + +2016-12-02: Version 5.7.116 + + Performance and stability improvements on all platforms. + + +2016-12-02: Version 5.7.115 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.114 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.113 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.112 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.111 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.110 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.109 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.108 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.107 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.106 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.105 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.104 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.103 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.102 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.101 + + Performance and stability improvements on all platforms. + + +2016-12-01: Version 5.7.100 + + [build] Use MSVS 2015 by default (Chromium issue 603131). + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.99 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.98 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.97 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.96 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.95 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.94 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.93 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.92 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.91 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.90 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.89 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.88 + + Performance and stability improvements on all platforms. + + +2016-11-30: Version 5.7.87 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.86 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.85 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.84 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.83 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.82 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.81 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.80 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.79 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.78 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.77 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.76 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.75 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.74 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.73 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.72 + + Performance and stability improvements on all platforms. + + +2016-11-29: Version 5.7.71 + + Performance and stability improvements on all platforms. + + +2016-11-28: Version 5.7.70 + + Performance and stability improvements on all platforms. + + +2016-11-28: Version 5.7.69 + + Performance and stability improvements on all platforms. + + +2016-11-28: Version 5.7.68 + + Performance and stability improvements on all platforms. + + +2016-11-28: Version 5.7.67 + + Performance and stability improvements on all platforms. + + +2016-11-28: Version 5.7.66 + + Performance and stability improvements on all platforms. + + +2016-11-28: Version 5.7.65 + + Performance and stability improvements on all platforms. + + +2016-11-28: Version 5.7.64 + + Performance and stability improvements on all platforms. + + +2016-11-25: Version 5.7.63 + + Performance and stability improvements on all platforms. + + +2016-11-25: Version 5.7.62 + + Performance and stability improvements on all platforms. + + +2016-11-25: Version 5.7.61 + + Performance and stability improvements on all platforms. + + +2016-11-25: Version 5.7.60 + + Performance and stability improvements on all platforms. + + +2016-11-25: Version 5.7.59 + + Performance and stability improvements on all platforms. + + +2016-11-25: Version 5.7.58 + + Performance and stability improvements on all platforms. + + +2016-11-24: Version 5.7.57 + + Performance and stability improvements on all platforms. + + +2016-11-24: Version 5.7.56 + + Performance and stability improvements on all platforms. + + +2016-11-24: Version 5.7.55 + + Performance and stability improvements on all platforms. + + +2016-11-24: Version 5.7.54 + + Performance and stability improvements on all platforms. + + +2016-11-24: Version 5.7.53 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.52 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.51 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.50 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.49 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.48 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.47 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.46 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.45 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.44 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.43 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.42 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.41 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.40 + + Performance and stability improvements on all platforms. + + +2016-11-23: Version 5.7.39 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.38 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.37 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.36 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.35 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.34 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.33 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.32 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.31 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.30 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.29 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.28 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.27 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.26 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.25 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.24 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.23 + + Performance and stability improvements on all platforms. + + +2016-11-22: Version 5.7.22 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.21 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.20 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.19 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.18 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.17 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.16 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.15 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.14 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.13 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.12 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.11 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.10 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.9 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.8 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.7 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.6 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.5 + + Performance and stability improvements on all platforms. + + +2016-11-21: Version 5.7.4 + + Performance and stability improvements on all platforms. + + +2016-11-20: Version 5.7.3 + + Performance and stability improvements on all platforms. + + +2016-11-20: Version 5.7.2 + + Performance and stability improvements on all platforms. + + +2016-11-20: Version 5.7.1 + + Performance and stability improvements on all platforms. + + +2016-11-17: Version 5.6.331 + + Performance and stability improvements on all platforms. + + +2016-11-17: Version 5.6.330 + + Performance and stability improvements on all platforms. + + +2016-11-17: Version 5.6.329 + + Performance and stability improvements on all platforms. + + +2016-11-17: Version 5.6.328 + + Performance and stability improvements on all platforms. + + +2016-11-16: Version 5.6.327 + + Performance and stability improvements on all platforms. + + 2016-11-15: Version 5.6.326 Performance and stability improvements on all platforms. diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 161015d661..6f66ac36f7 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -8,15 +8,15 @@ vars = { deps = { "v8/build": - Var("chromium_url") + "/chromium/src/build.git" + "@" + "a3b623a6eff6dc9d58a03251ae22bccf92f67cb2", + Var("chromium_url") + "/chromium/src/build.git" + "@" + "f55127ddc3632dbd6fef285c71ab4cb103e08f0c", "v8/tools/gyp": Var("chromium_url") + "/external/gyp.git" + "@" + "e7079f0e0e14108ab0dba58728ff219637458563", "v8/third_party/icu": - Var("chromium_url") + "/chromium/deps/icu.git" + "@" + "c1a237113f525a1561d4b322d7653e1083f79aaa", + Var("chromium_url") + "/chromium/deps/icu.git" + "@" + "9cd2828740572ba6f694b9365236a8356fd06147", "v8/third_party/instrumented_libraries": - Var("chromium_url") + "/chromium/src/third_party/instrumented_libraries.git" + "@" + "45f5814b1543e41ea0be54c771e3840ea52cca4a", + Var("chromium_url") + "/chromium/src/third_party/instrumented_libraries.git" + "@" + "5b6f777da671be977f56f0e8fc3469a3ccbb4474", "v8/buildtools": - Var("chromium_url") + "/chromium/buildtools.git" + "@" + "39b1db2ab4aa4b2ccaa263c29bdf63e7c1ee28aa", + Var("chromium_url") + "/chromium/buildtools.git" + "@" + "cb12d6e8641f0c9b0fbbfa4bf17c55c6c0d3c38f", "v8/base/trace_event/common": Var("chromium_url") + "/chromium/src/base/trace_event/common.git" + "@" + "06294c8a4a6f744ef284cd63cfe54dbf61eea290", "v8/third_party/jinja2": @@ -24,7 +24,7 @@ deps = { "v8/third_party/markupsafe": Var("chromium_url") + "/chromium/src/third_party/markupsafe.git" + "@" + "484a5661041cac13bfc688a26ec5434b05d18961", "v8/tools/swarming_client": - Var('chromium_url') + '/external/swarming.client.git' + '@' + "380e32662312eb107f06fcba6409b0409f8fef72", + Var('chromium_url') + '/external/swarming.client.git' + '@' + "ebc8dab6f8b8d79ec221c94de39a921145abd404", "v8/testing/gtest": Var("chromium_url") + "/external/github.com/google/googletest.git" + "@" + "6f8a66431cb592dad629028a50b3dd418a408c87", "v8/testing/gmock": @@ -35,19 +35,19 @@ deps = { Var("chromium_url") + "/v8/deps/third_party/mozilla-tests.git" + "@" + "f6c578a10ea707b1a8ab0b88943fe5115ce2b9be", "v8/test/simdjs/data": Var("chromium_url") + "/external/github.com/tc39/ecmascript_simd.git" + "@" + "baf493985cb9ea7cdbd0d68704860a8156de9556", "v8/test/test262/data": - Var("chromium_url") + "/external/github.com/tc39/test262.git" + "@" + "fb61ab44eb1bbc2699d714fc00e33af2a19411ce", + Var("chromium_url") + "/external/github.com/tc39/test262.git" + "@" + "6a0f1189eb00d38ef9760cb65cbc41c066876cde", "v8/test/test262/harness": - Var("chromium_url") + "/external/github.com/test262-utils/test262-harness-py.git" + "@" + "cbd968f54f7a95c6556d53ba852292a4c49d11d8", + Var("chromium_url") + "/external/github.com/test262-utils/test262-harness-py.git" + "@" + "0f2acdd882c84cff43b9d60df7574a1901e2cdcd", "v8/tools/clang": - Var("chromium_url") + "/chromium/src/tools/clang.git" + "@" + "75350a858c51ad69e2aae051a8727534542da29f", + Var("chromium_url") + "/chromium/src/tools/clang.git" + "@" + "f7ce1a5678e5addc015aed5f1e7734bbd2caac7c", } deps_os = { "android": { "v8/third_party/android_tools": - Var("chromium_url") + "/android_tools.git" + "@" + "25d57ead05d3dfef26e9c19b13ed10b0a69829cf", + Var("chromium_url") + "/android_tools.git" + "@" + "b43a6a289a7588b1769814f04dd6c7d7176974cc", "v8/third_party/catapult": - Var('chromium_url') + "/external/github.com/catapult-project/catapult.git" + "@" + "6962f5c0344a79b152bf84460a93e1b2e11ea0f4", + Var('chromium_url') + "/external/github.com/catapult-project/catapult.git" + "@" + "143ba4ddeb05e6165fb8413c5f3f47d342922d24", }, "win": { "v8/third_party/cygwin": @@ -263,7 +263,7 @@ hooks = [ # Update the Windows toolchain if necessary. 'name': 'win_toolchain', 'pattern': '.', - 'action': ['python', 'v8/gypfiles/vs_toolchain.py', 'update'], + 'action': ['python', 'v8/build/vs_toolchain.py', 'update'], }, # Pull binutils for linux, enabled debug fission for faster linking / # debugging when used with clang on Ubuntu Precise. diff --git a/deps/v8/OWNERS b/deps/v8/OWNERS index 028f4ff12c..e375fa65b7 100644 --- a/deps/v8/OWNERS +++ b/deps/v8/OWNERS @@ -5,14 +5,19 @@ binji@chromium.org bmeurer@chromium.org bradnelson@chromium.org cbruni@chromium.org +clemensh@chromium.org danno@chromium.org epertoso@chromium.org +franzih@chromium.org +gsathya@chromium.org hablich@chromium.org hpayer@chromium.org ishell@chromium.org jarin@chromium.org +jgruber@chromium.org jkummerow@chromium.org jochen@chromium.org +leszeks@chromium.org littledan@chromium.org machenbach@chromium.org marja@chromium.org @@ -21,9 +26,11 @@ mstarzinger@chromium.org mtrofin@chromium.org mvstanton@chromium.org mythria@chromium.org +petermarshall@chromium.org neis@chromium.org rmcilroy@chromium.org rossberg@chromium.org +tebbi@chromium.org titzer@chromium.org ulan@chromium.org verwaest@chromium.org diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index ad218330b1..8321f5cedf 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -67,19 +67,22 @@ def _V8PresubmitChecks(input_api, output_api): input_api.PresubmitLocalPath(), 'tools')) from presubmit import CppLintProcessor from presubmit import SourceProcessor - from presubmit import CheckAuthorizedAuthor - from presubmit import CheckStatusFiles + from presubmit import StatusFilesProcessor results = [] - if not CppLintProcessor().Run(input_api.PresubmitLocalPath()): + if not CppLintProcessor().RunOnFiles( + input_api.AffectedFiles(include_deletes=False)): results.append(output_api.PresubmitError("C++ lint check failed")) - if not SourceProcessor().Run(input_api.PresubmitLocalPath()): + if not SourceProcessor().RunOnFiles( + input_api.AffectedFiles(include_deletes=False)): results.append(output_api.PresubmitError( "Copyright header, trailing whitespaces and two empty lines " \ "between declarations check failed")) - if not CheckStatusFiles(input_api.PresubmitLocalPath()): + if not StatusFilesProcessor().RunOnFiles( + input_api.AffectedFiles(include_deletes=False)): results.append(output_api.PresubmitError("Status file check failed")) - results.extend(CheckAuthorizedAuthor(input_api, output_api)) + results.extend(input_api.canned_checks.CheckAuthorizedAuthor( + input_api, output_api)) return results diff --git a/deps/v8/build_overrides/build.gni b/deps/v8/build_overrides/build.gni index 6b8a4ff219..8dcaf3a29d 100644 --- a/deps/v8/build_overrides/build.gni +++ b/deps/v8/build_overrides/build.gni @@ -24,3 +24,9 @@ linux_use_bundled_binutils_override = true asan_suppressions_file = "//build/sanitizers/asan_suppressions.cc" lsan_suppressions_file = "//build/sanitizers/lsan_suppressions.cc" tsan_suppressions_file = "//build/sanitizers/tsan_suppressions.cc" + +# Skip assertions about 4GiB file size limit. +ignore_elf32_limitations = true + +# Use the system install of Xcode for tools like ibtool, libtool, etc. +use_system_xcode = true diff --git a/deps/v8/build_overrides/v8.gni b/deps/v8/build_overrides/v8.gni index df8320d5d1..15a5055861 100644 --- a/deps/v8/build_overrides/v8.gni +++ b/deps/v8/build_overrides/v8.gni @@ -2,14 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. -import("//build/config/features.gni") -import("//build/config/ui.gni") import("//build/config/v8_target_cpu.gni") -import("//gni/v8.gni") - -if (is_android) { - import("//build/config/android/config.gni") -} if (((v8_current_cpu == "x86" || v8_current_cpu == "x64" || v8_current_cpu == "x87") && (is_linux || is_mac)) || @@ -24,9 +17,9 @@ v8_extra_library_files = [ "//test/cctest/test-extra.js" ] v8_experimental_extra_library_files = [ "//test/cctest/test-experimental-extra.js" ] +v8_enable_inspector_override = true + declare_args() { - # Enable inspector. See include/v8-inspector.h. - v8_enable_inspector = true + # Use static libraries instead of source_sets. + v8_static_library = false } - -v8_enable_inspector_override = v8_enable_inspector diff --git a/deps/v8/gni/isolate.gni b/deps/v8/gni/isolate.gni index 1cc3a38770..3906cf60ef 100644 --- a/deps/v8/gni/isolate.gni +++ b/deps/v8/gni/isolate.gni @@ -3,7 +3,6 @@ # found in the LICENSE file. import("//build/config/sanitizers/sanitizers.gni") -import("//build_overrides/v8.gni") import("//third_party/icu/config.gni") import("v8.gni") @@ -97,7 +96,7 @@ template("v8_isolate_run") { } else { icu_use_data_file_flag = "0" } - if (v8_enable_inspector_override) { + if (v8_enable_inspector) { enable_inspector = "1" } else { enable_inspector = "0" @@ -181,7 +180,7 @@ template("v8_isolate_run") { if (is_win) { args += [ "--config-variable", - "msvs_version=2013", + "msvs_version=2015", ] } else { args += [ diff --git a/deps/v8/gni/v8.gni b/deps/v8/gni/v8.gni index 3759572b93..cb2bdf2cf5 100644 --- a/deps/v8/gni/v8.gni +++ b/deps/v8/gni/v8.gni @@ -4,8 +4,12 @@ import("//build/config/sanitizers/sanitizers.gni") import("//build/config/v8_target_cpu.gni") +import("//build_overrides/v8.gni") declare_args() { + # Includes files needed for correctness fuzzing. + v8_correctness_fuzzer = false + # Indicate if valgrind was fetched as a custom deps to make it available on # swarming. v8_has_valgrind = false @@ -30,6 +34,9 @@ declare_args() { # Enable ECMAScript Internationalization API. Enabling this feature will # add a dependency on the ICU library. v8_enable_i18n_support = true + + # Enable inspector. See include/v8-inspector.h. + v8_enable_inspector = v8_enable_inspector_override } if (v8_use_external_startup_data == "") { @@ -83,11 +90,20 @@ if (is_posix && v8_enable_backtrace) { # All templates should be kept in sync. template("v8_source_set") { - source_set(target_name) { - forward_variables_from(invoker, "*", [ "configs" ]) - configs += invoker.configs - configs -= v8_remove_configs - configs += v8_add_configs + if (defined(v8_static_library) && v8_static_library) { + static_library(target_name) { + forward_variables_from(invoker, "*", [ "configs" ]) + configs += invoker.configs + configs -= v8_remove_configs + configs += v8_add_configs + } + } else { + source_set(target_name) { + forward_variables_from(invoker, "*", [ "configs" ]) + configs += invoker.configs + configs -= v8_remove_configs + configs += v8_add_configs + } } } diff --git a/deps/v8/gypfiles/all.gyp b/deps/v8/gypfiles/all.gyp index a3f2eedc77..12e1fdadb7 100644 --- a/deps/v8/gypfiles/all.gyp +++ b/deps/v8/gypfiles/all.gyp @@ -27,10 +27,14 @@ }], ['v8_enable_inspector==1', { 'dependencies': [ - '../test/debugger/debugger.gyp:*', '../test/inspector/inspector.gyp:*', ], }], + ['v8_enable_inspector==1 and test_isolation_mode != "noop"', { + 'dependencies': [ + '../test/debugger/debugger.gyp:*', + ], + }], ['test_isolation_mode != "noop"', { 'dependencies': [ '../test/bot_default.gyp:*', diff --git a/deps/v8/gypfiles/get_landmines.py b/deps/v8/gypfiles/get_landmines.py index e6b6da6c48..6137648e6d 100755 --- a/deps/v8/gypfiles/get_landmines.py +++ b/deps/v8/gypfiles/get_landmines.py @@ -31,6 +31,7 @@ def main(): print 'Clober to fix windows build problems.' print 'Clober again to fix windows build problems.' print 'Clobber to possibly resolve failure on win-32 bot.' + print 'Clobber for http://crbug.com/668958.' return 0 diff --git a/deps/v8/gypfiles/toolchain.gypi b/deps/v8/gypfiles/toolchain.gypi index 5105fff070..95eb1d99cb 100644 --- a/deps/v8/gypfiles/toolchain.gypi +++ b/deps/v8/gypfiles/toolchain.gypi @@ -989,6 +989,8 @@ # present in VS 2003 and earlier. 'msvs_disabled_warnings': [4351], 'msvs_configuration_attributes': { + 'OutputDirectory': '<(DEPTH)\\build\\$(ConfigurationName)', + 'IntermediateDirectory': '$(OutDir)\\obj\\$(ProjectName)', 'CharacterSet': '1', }, }], diff --git a/deps/v8/gypfiles/win/msvs_dependencies.isolate b/deps/v8/gypfiles/win/msvs_dependencies.isolate new file mode 100644 index 0000000000..79ae11a1ae --- /dev/null +++ b/deps/v8/gypfiles/win/msvs_dependencies.isolate @@ -0,0 +1,97 @@ +# Copyright 2016 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# TODO(machenbach): Remove this when crbug.com/669910 is resolved. +{ + 'conditions': [ + # Copy the VS runtime DLLs into the isolate so that they + # don't have to be preinstalled on the target machine. + # + # VS2013 runtimes + ['OS=="win" and msvs_version==2013 and component=="shared_library" and (CONFIGURATION_NAME=="Debug" or CONFIGURATION_NAME=="Debug_x64")', { + 'variables': { + 'files': [ + '<(PRODUCT_DIR)/msvcp120d.dll', + '<(PRODUCT_DIR)/msvcr120d.dll', + ], + }, + }], + ['OS=="win" and msvs_version==2013 and component=="shared_library" and (CONFIGURATION_NAME=="Release" or CONFIGURATION_NAME=="Release_x64")', { + 'variables': { + 'files': [ + '<(PRODUCT_DIR)/msvcp120.dll', + '<(PRODUCT_DIR)/msvcr120.dll', + ], + }, + }], + # VS2015 runtimes + ['OS=="win" and msvs_version==2015 and component=="shared_library" and (CONFIGURATION_NAME=="Debug" or CONFIGURATION_NAME=="Debug_x64")', { + 'variables': { + 'files': [ + '<(PRODUCT_DIR)/msvcp140d.dll', + '<(PRODUCT_DIR)/vccorlib140d.dll', + '<(PRODUCT_DIR)/vcruntime140d.dll', + '<(PRODUCT_DIR)/ucrtbased.dll', + ], + }, + }], + ['OS=="win" and msvs_version==2015 and component=="shared_library" and (CONFIGURATION_NAME=="Release" or CONFIGURATION_NAME=="Release_x64")', { + 'variables': { + 'files': [ + '<(PRODUCT_DIR)/msvcp140.dll', + '<(PRODUCT_DIR)/vccorlib140.dll', + '<(PRODUCT_DIR)/vcruntime140.dll', + '<(PRODUCT_DIR)/ucrtbase.dll', + ], + }, + }], + ['OS=="win" and msvs_version==2015 and component=="shared_library"', { + # Windows 10 Universal C Runtime binaries. + 'variables': { + 'files': [ + '<(PRODUCT_DIR)/api-ms-win-core-console-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-datetime-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-debug-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-errorhandling-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-file-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-file-l1-2-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-file-l2-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-handle-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-heap-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-interlocked-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-libraryloader-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-localization-l1-2-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-memory-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-namedpipe-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-processenvironment-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-processthreads-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-processthreads-l1-1-1.dll', + '<(PRODUCT_DIR)/api-ms-win-core-profile-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-rtlsupport-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-string-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-synch-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-synch-l1-2-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-sysinfo-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-timezone-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-core-util-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-conio-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-convert-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-environment-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-filesystem-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-heap-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-locale-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-math-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-multibyte-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-private-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-process-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-runtime-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-stdio-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-string-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-time-l1-1-0.dll', + '<(PRODUCT_DIR)/api-ms-win-crt-utility-l1-1-0.dll', + ], + }, + }], + ], +} diff --git a/deps/v8/include/libplatform/libplatform.h b/deps/v8/include/libplatform/libplatform.h index 40f3f66892..cab467fd50 100644 --- a/deps/v8/include/libplatform/libplatform.h +++ b/deps/v8/include/libplatform/libplatform.h @@ -34,6 +34,17 @@ V8_PLATFORM_EXPORT v8::Platform* CreateDefaultPlatform( V8_PLATFORM_EXPORT bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate); +/** + * Runs pending idle tasks for at most |idle_time_in_seconds| seconds. + * + * The caller has to make sure that this is called from the right thread. + * This call does not block if no task is pending. The |platform| has to be + * created using |CreateDefaultPlatform|. + */ +V8_PLATFORM_EXPORT void RunIdleTasks(v8::Platform* platform, + v8::Isolate* isolate, + double idle_time_in_seconds); + /** * Attempts to set the tracing controller for the given platform. * diff --git a/deps/v8/include/v8-debug.h b/deps/v8/include/v8-debug.h index 6385a31d85..777b8aaa3e 100644 --- a/deps/v8/include/v8-debug.h +++ b/deps/v8/include/v8-debug.h @@ -16,11 +16,9 @@ namespace v8 { enum DebugEvent { Break = 1, Exception = 2, - NewFunction = 3, - BeforeCompile = 4, - AfterCompile = 5, - CompileError = 6, - AsyncTaskEvent = 7, + AfterCompile = 3, + CompileError = 4, + AsyncTaskEvent = 5, }; class V8_EXPORT Debug { @@ -87,7 +85,6 @@ class V8_EXPORT Debug { virtual ~Message() {} }; - /** * An event details object passed to the debug event listener. */ @@ -145,7 +142,7 @@ class V8_EXPORT Debug { * * \param message the debug message handler message object * - * A MessageHandler2 does not take possession of the message data, + * A MessageHandler does not take possession of the message data, * and must not rely on the data persisting after the handler returns. */ typedef void (*MessageHandler)(const Message& message); @@ -167,33 +164,37 @@ class V8_EXPORT Debug { static void CancelDebugBreak(Isolate* isolate); // Check if a debugger break is scheduled in the given isolate. - static bool CheckDebugBreak(Isolate* isolate); + V8_DEPRECATED("No longer supported", + static bool CheckDebugBreak(Isolate* isolate)); // Message based interface. The message protocol is JSON. - static void SetMessageHandler(Isolate* isolate, MessageHandler handler); - - static void SendCommand(Isolate* isolate, - const uint16_t* command, int length, - ClientData* client_data = NULL); - - /** - * Run a JavaScript function in the debugger. - * \param fun the function to call - * \param data passed as second argument to the function - * With this call the debugger is entered and the function specified is called - * with the execution state as the first argument. This makes it possible to - * get access to information otherwise not available during normal JavaScript - * execution e.g. details on stack frames. Receiver of the function call will - * be the debugger context global object, however this is a subject to change. - * The following example shows a JavaScript function which when passed to - * v8::Debug::Call will return the current line of JavaScript execution. - * - * \code - * function frame_source_line(exec_state) { - * return exec_state.frame(0).sourceLine(); - * } - * \endcode - */ + V8_DEPRECATED("No longer supported", + static void SetMessageHandler(Isolate* isolate, + MessageHandler handler)); + + V8_DEPRECATED("No longer supported", + static void SendCommand(Isolate* isolate, + const uint16_t* command, int length, + ClientData* client_data = NULL)); + + /** + * Run a JavaScript function in the debugger. + * \param fun the function to call + * \param data passed as second argument to the function + * With this call the debugger is entered and the function specified is called + * with the execution state as the first argument. This makes it possible to + * get access to information otherwise not available during normal JavaScript + * execution e.g. details on stack frames. Receiver of the function call will + * be the debugger context global object, however this is a subject to change. + * The following example shows a JavaScript function which when passed to + * v8::Debug::Call will return the current line of JavaScript execution. + * + * \code + * function frame_source_line(exec_state) { + * return exec_state.frame(0).sourceLine(); + * } + * \endcode + */ // TODO(dcarney): data arg should be a MaybeLocal static MaybeLocal Call(Local context, v8::Local fun, @@ -202,8 +203,9 @@ class V8_EXPORT Debug { /** * Returns a mirror object for the given object. */ - static MaybeLocal GetMirror(Local context, - v8::Local obj); + V8_DEPRECATED("No longer supported", + static MaybeLocal GetMirror(Local context, + v8::Local obj)); /** * Makes V8 process all pending debug messages. @@ -236,7 +238,8 @@ class V8_EXPORT Debug { * "Evaluate" debug command behavior currently is not specified in scope * of this method. */ - static void ProcessDebugMessages(Isolate* isolate); + V8_DEPRECATED("No longer supported", + static void ProcessDebugMessages(Isolate* isolate)); /** * Debugger is running in its own context which is entered while debugger @@ -245,13 +248,16 @@ class V8_EXPORT Debug { * to change. The Context exists only when the debugger is active, i.e. at * least one DebugEventListener or MessageHandler is set. */ - static Local GetDebugContext(Isolate* isolate); + V8_DEPRECATED("Use v8-inspector", + static Local GetDebugContext(Isolate* isolate)); /** * While in the debug context, this method returns the top-most non-debug * context, if it exists. */ - static MaybeLocal GetDebuggedContext(Isolate* isolate); + V8_DEPRECATED( + "No longer supported", + static MaybeLocal GetDebuggedContext(Isolate* isolate)); /** * Enable/disable LiveEdit functionality for the given Isolate diff --git a/deps/v8/include/v8-inspector.h b/deps/v8/include/v8-inspector.h index 0855ac101b..d0925adba0 100644 --- a/deps/v8/include/v8-inspector.h +++ b/deps/v8/include/v8-inspector.h @@ -248,9 +248,9 @@ class V8_EXPORT V8Inspector { class V8_EXPORT Channel { public: virtual ~Channel() {} - virtual void sendProtocolResponse(int callId, - const StringView& message) = 0; - virtual void sendProtocolNotification(const StringView& message) = 0; + virtual void sendResponse(int callId, + std::unique_ptr message) = 0; + virtual void sendNotification(std::unique_ptr message) = 0; virtual void flushProtocolNotifications() = 0; }; virtual std::unique_ptr connect( diff --git a/deps/v8/include/v8-version-string.h b/deps/v8/include/v8-version-string.h new file mode 100644 index 0000000000..075282de4c --- /dev/null +++ b/deps/v8/include/v8-version-string.h @@ -0,0 +1,33 @@ +// Copyright 2017 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_VERSION_STRING_H_ +#define V8_VERSION_STRING_H_ + +#include "v8-version.h" // NOLINT(build/include) + +// This is here rather than v8-version.h to keep that file simple and +// machine-processable. + +#if V8_IS_CANDIDATE_VERSION +#define V8_CANDIDATE_STRING " (candidate)" +#else +#define V8_CANDIDATE_STRING "" +#endif + +#define V8_SX(x) #x +#define V8_S(x) V8_SX(x) + +#if V8_PATCH_LEVEL > 0 +#define V8_VERSION_STRING \ + V8_S(V8_MAJOR_VERSION) \ + "." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) "." V8_S( \ + V8_PATCH_LEVEL) V8_CANDIDATE_STRING +#else +#define V8_VERSION_STRING \ + V8_S(V8_MAJOR_VERSION) \ + "." V8_S(V8_MINOR_VERSION) "." V8_S(V8_BUILD_NUMBER) V8_CANDIDATE_STRING +#endif + +#endif // V8_VERSION_STRING_H_ diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 663964616f..2301f219b3 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -9,9 +9,9 @@ // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. #define V8_MAJOR_VERSION 5 -#define V8_MINOR_VERSION 6 -#define V8_BUILD_NUMBER 326 -#define V8_PATCH_LEVEL 57 +#define V8_MINOR_VERSION 7 +#define V8_BUILD_NUMBER 492 +#define V8_PATCH_LEVEL 69 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 5348ba7e48..b513c7f1f3 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -666,7 +666,7 @@ struct CopyablePersistentTraits { /** * A PersistentBase which allows copy and assignment. * - * Copy, assignment and destructor bevavior is controlled by the traits + * Copy, assignment and destructor behavior is controlled by the traits * class M. * * Note: Persistent class hierarchy is subject to future changes. @@ -867,8 +867,8 @@ class V8_EXPORT HandleScope { HandleScope(const HandleScope&) = delete; void operator=(const HandleScope&) = delete; - void* operator new(size_t size) = delete; - void operator delete(void*, size_t) = delete; + void* operator new(size_t size); + void operator delete(void*, size_t); protected: V8_INLINE HandleScope() {} @@ -919,8 +919,8 @@ class V8_EXPORT EscapableHandleScope : public HandleScope { EscapableHandleScope(const EscapableHandleScope&) = delete; void operator=(const EscapableHandleScope&) = delete; - void* operator new(size_t size) = delete; - void operator delete(void*, size_t) = delete; + void* operator new(size_t size); + void operator delete(void*, size_t); private: internal::Object** Escape(internal::Object** escape_value); @@ -934,8 +934,8 @@ class V8_EXPORT SealHandleScope { SealHandleScope(const SealHandleScope&) = delete; void operator=(const SealHandleScope&) = delete; - void* operator new(size_t size) = delete; - void operator delete(void*, size_t) = delete; + void* operator new(size_t size); + void operator delete(void*, size_t); private: internal::Isolate* const isolate_; @@ -961,30 +961,21 @@ class V8_EXPORT Data { */ class ScriptOriginOptions { public: - V8_INLINE ScriptOriginOptions(bool is_embedder_debug_script = false, - bool is_shared_cross_origin = false, - bool is_opaque = false) - : flags_((is_embedder_debug_script ? kIsEmbedderDebugScript : 0) | - (is_shared_cross_origin ? kIsSharedCrossOrigin : 0) | - (is_opaque ? kIsOpaque : 0)) {} + V8_INLINE ScriptOriginOptions(bool is_shared_cross_origin = false, + bool is_opaque = false, bool is_wasm = false) + : flags_((is_shared_cross_origin ? kIsSharedCrossOrigin : 0) | + (is_wasm ? kIsWasm : 0) | (is_opaque ? kIsOpaque : 0)) {} V8_INLINE ScriptOriginOptions(int flags) - : flags_(flags & - (kIsEmbedderDebugScript | kIsSharedCrossOrigin | kIsOpaque)) {} - bool IsEmbedderDebugScript() const { - return (flags_ & kIsEmbedderDebugScript) != 0; - } + : flags_(flags & (kIsSharedCrossOrigin | kIsOpaque | kIsWasm)) {} bool IsSharedCrossOrigin() const { return (flags_ & kIsSharedCrossOrigin) != 0; } bool IsOpaque() const { return (flags_ & kIsOpaque) != 0; } + bool IsWasm() const { return (flags_ & kIsWasm) != 0; } int Flags() const { return flags_; } private: - enum { - kIsEmbedderDebugScript = 1, - kIsSharedCrossOrigin = 1 << 1, - kIsOpaque = 1 << 2 - }; + enum { kIsSharedCrossOrigin = 1, kIsOpaque = 1 << 1, kIsWasm = 1 << 2 }; const int flags_; }; @@ -999,9 +990,10 @@ class ScriptOrigin { Local resource_column_offset = Local(), Local resource_is_shared_cross_origin = Local(), Local script_id = Local(), - Local resource_is_embedder_debug_script = Local(), Local source_map_url = Local(), - Local resource_is_opaque = Local()); + Local resource_is_opaque = Local(), + Local is_wasm = Local()); + V8_INLINE Local ResourceName() const; V8_INLINE Local ResourceLineOffset() const; V8_INLINE Local ResourceColumnOffset() const; @@ -1485,6 +1477,11 @@ class V8_EXPORT Message { */ int GetEndPosition() const; + /** + * Returns the error level of the message. + */ + int ErrorLevel() const; + /** * Returns the index within the line of the first character where * the error occurred. @@ -1712,6 +1709,19 @@ class V8_EXPORT ValueSerializer { */ virtual Maybe WriteHostObject(Isolate* isolate, Local object); + /* + * Called when the ValueSerializer is going to serialize a + * SharedArrayBuffer object. The embedder must return an ID for the + * object, using the same ID if this SharedArrayBuffer has already been + * serialized in this buffer. When deserializing, this ID will be passed to + * ValueDeserializer::TransferSharedArrayBuffer as |transfer_id|. + * + * If the object cannot be serialized, an + * exception should be thrown and Nothing() returned. + */ + virtual Maybe GetSharedArrayBufferId( + Isolate* isolate, Local shared_array_buffer); + /* * Allocates memory for the buffer of at least the size provided. The actual * size (which may be greater or equal) is written to |actual_size|. If no @@ -1766,8 +1776,10 @@ class V8_EXPORT ValueSerializer { /* * Similar to TransferArrayBuffer, but for SharedArrayBuffer. */ - void TransferSharedArrayBuffer(uint32_t transfer_id, - Local shared_array_buffer); + V8_DEPRECATE_SOON("Use Delegate::GetSharedArrayBufferId", + void TransferSharedArrayBuffer( + uint32_t transfer_id, + Local shared_array_buffer)); /* * Write raw data in various common formats to the buffer. @@ -1834,9 +1846,10 @@ class V8_EXPORT ValueDeserializer { /* * Similar to TransferArrayBuffer, but for SharedArrayBuffer. - * transfer_id exists in the same namespace as unshared ArrayBuffer objects. + * The id is not necessarily in the same namespace as unshared ArrayBuffer + * objects. */ - void TransferSharedArrayBuffer(uint32_t transfer_id, + void TransferSharedArrayBuffer(uint32_t id, Local shared_array_buffer); /* @@ -1908,9 +1921,16 @@ class V8_EXPORT Value : public Data { */ V8_INLINE bool IsNull() const; - /** - * Returns true if this value is true. + /** + * Returns true if this value is either the null or the undefined value. + * See ECMA-262 + * 4.3.11. and 4.3.12 */ + V8_INLINE bool IsNullOrUndefined() const; + + /** + * Returns true if this value is true. + */ bool IsTrue() const; /** @@ -1920,7 +1940,6 @@ class V8_EXPORT Value : public Data { /** * Returns true if this value is a symbol or a string. - * This is an experimental feature. */ bool IsName() const; @@ -1932,7 +1951,6 @@ class V8_EXPORT Value : public Data { /** * Returns true if this value is a symbol. - * This is an experimental feature. */ bool IsSymbol() const; @@ -2004,7 +2022,6 @@ class V8_EXPORT Value : public Data { /** * Returns true if this value is a Symbol object. - * This is an experimental feature. */ bool IsSymbolObject() const; @@ -2025,19 +2042,16 @@ class V8_EXPORT Value : public Data { /** * Returns true if this value is a Generator function. - * This is an experimental feature. */ bool IsGeneratorFunction() const; /** * Returns true if this value is a Generator object (iterator). - * This is an experimental feature. */ bool IsGeneratorObject() const; /** * Returns true if this value is a Promise. - * This is an experimental feature. */ bool IsPromise() const; @@ -2073,73 +2087,61 @@ class V8_EXPORT Value : public Data { /** * Returns true if this value is an ArrayBuffer. - * This is an experimental feature. */ bool IsArrayBuffer() const; /** * Returns true if this value is an ArrayBufferView. - * This is an experimental feature. */ bool IsArrayBufferView() const; /** * Returns true if this value is one of TypedArrays. - * This is an experimental feature. */ bool IsTypedArray() const; /** * Returns true if this value is an Uint8Array. - * This is an experimental feature. */ bool IsUint8Array() const; /** * Returns true if this value is an Uint8ClampedArray. - * This is an experimental feature. */ bool IsUint8ClampedArray() const; /** * Returns true if this value is an Int8Array. - * This is an experimental feature. */ bool IsInt8Array() const; /** * Returns true if this value is an Uint16Array. - * This is an experimental feature. */ bool IsUint16Array() const; /** * Returns true if this value is an Int16Array. - * This is an experimental feature. */ bool IsInt16Array() const; /** * Returns true if this value is an Uint32Array. - * This is an experimental feature. */ bool IsUint32Array() const; /** * Returns true if this value is an Int32Array. - * This is an experimental feature. */ bool IsInt32Array() const; /** * Returns true if this value is a Float32Array. - * This is an experimental feature. */ bool IsFloat32Array() const; /** * Returns true if this value is a Float64Array. - * This is an experimental feature. */ bool IsFloat64Array() const; @@ -2151,7 +2153,6 @@ class V8_EXPORT Value : public Data { /** * Returns true if this value is a DataView. - * This is an experimental feature. */ bool IsDataView() const; @@ -2244,11 +2245,12 @@ class V8_EXPORT Value : public Data { template V8_INLINE static Value* Cast(T* value); - Local TypeOf(v8::Isolate*); + Local TypeOf(Isolate*); private: V8_INLINE bool QuickIsUndefined() const; V8_INLINE bool QuickIsNull() const; + V8_INLINE bool QuickIsNullOrUndefined() const; V8_INLINE bool QuickIsString() const; bool FullIsUndefined() const; bool FullIsNull() const; @@ -2291,9 +2293,10 @@ class V8_EXPORT Name : public Primitive { */ int GetIdentityHash(); - V8_INLINE static Name* Cast(v8::Value* obj); + V8_INLINE static Name* Cast(Value* obj); + private: - static void CheckCast(v8::Value* obj); + static void CheckCast(Value* obj); }; @@ -2391,7 +2394,7 @@ class V8_EXPORT String : public Name { /** * A zero length string. */ - V8_INLINE static v8::Local Empty(Isolate* isolate); + V8_INLINE static Local Empty(Isolate* isolate); /** * Returns true if the string is external @@ -2425,7 +2428,7 @@ class V8_EXPORT String : public Name { void operator=(const ExternalStringResourceBase&) = delete; private: - friend class v8::internal::Heap; + friend class internal::Heap; }; /** @@ -2669,8 +2672,6 @@ class V8_EXPORT String : public Name { /** * A JavaScript symbol (ECMA-262 edition 6) - * - * This is an experimental feature. Use at your own risk. */ class V8_EXPORT Symbol : public Name { public: @@ -2695,14 +2696,15 @@ class V8_EXPORT Symbol : public Name { // Well-known symbols static Local GetIterator(Isolate* isolate); static Local GetUnscopables(Isolate* isolate); + static Local GetToPrimitive(Isolate* isolate); static Local GetToStringTag(Isolate* isolate); static Local GetIsConcatSpreadable(Isolate* isolate); - V8_INLINE static Symbol* Cast(v8::Value* obj); + V8_INLINE static Symbol* Cast(Value* obj); private: Symbol(); - static void CheckCast(v8::Value* obj); + static void CheckCast(Value* obj); }; @@ -3695,7 +3697,7 @@ class V8_EXPORT Function : public Object { /** * Tells whether this function is builtin. */ - bool IsBuiltin() const; + V8_DEPRECATED("this should no longer be used.", bool IsBuiltin() const); /** * Returns scriptId. @@ -3720,10 +3722,15 @@ class V8_EXPORT Function : public Object { /** * An instance of the built-in Promise constructor (ES6 draft). - * This API is experimental. Only works with --harmony flag. */ class V8_EXPORT Promise : public Object { public: + /** + * State of the promise. Each value corresponds to one of the possible values + * of the [[PromiseState]] field. + */ + enum PromiseState { kPending, kFulfilled, kRejected }; + class V8_EXPORT Resolver : public Object { public: /** @@ -3780,6 +3787,17 @@ class V8_EXPORT Promise : public Object { */ bool HasHandler(); + /** + * Returns the content of the [[PromiseResult]] field. The Promise must not + * be pending. + */ + Local Result(); + + /** + * Returns the value of the [[PromiseState]] field. + */ + PromiseState State(); + V8_INLINE static Promise* Cast(Value* obj); private: @@ -3926,7 +3944,6 @@ enum class ArrayBufferCreationMode { kInternalized, kExternalized }; /** * An instance of the built-in ArrayBuffer constructor (ES6 draft 15.13.5). - * This API is experimental and may change significantly. */ class V8_EXPORT ArrayBuffer : public Object { public: @@ -3982,8 +3999,6 @@ class V8_EXPORT ArrayBuffer : public Object { * * The Data pointer of ArrayBuffer::Contents is always allocated with * Allocator::Allocate that is set via Isolate::CreateParams. - * - * This API is experimental and may change significantly. */ class V8_EXPORT Contents { // NOLINT public: @@ -4084,8 +4099,6 @@ class V8_EXPORT ArrayBuffer : public Object { /** * A base class for an instance of one of "views" over ArrayBuffer, * including TypedArrays and DataView (ES6 draft 15.13). - * - * This API is experimental and may change significantly. */ class V8_EXPORT ArrayBufferView : public Object { public: @@ -4133,7 +4146,6 @@ class V8_EXPORT ArrayBufferView : public Object { /** * A base class for an instance of TypedArray series of constructors * (ES6 draft 15.13.6). - * This API is experimental and may change significantly. */ class V8_EXPORT TypedArray : public ArrayBufferView { public: @@ -4153,7 +4165,6 @@ class V8_EXPORT TypedArray : public ArrayBufferView { /** * An instance of Uint8Array constructor (ES6 draft 15.13.6). - * This API is experimental and may change significantly. */ class V8_EXPORT Uint8Array : public TypedArray { public: @@ -4171,7 +4182,6 @@ class V8_EXPORT Uint8Array : public TypedArray { /** * An instance of Uint8ClampedArray constructor (ES6 draft 15.13.6). - * This API is experimental and may change significantly. */ class V8_EXPORT Uint8ClampedArray : public TypedArray { public: @@ -4189,7 +4199,6 @@ class V8_EXPORT Uint8ClampedArray : public TypedArray { /** * An instance of Int8Array constructor (ES6 draft 15.13.6). - * This API is experimental and may change significantly. */ class V8_EXPORT Int8Array : public TypedArray { public: @@ -4207,7 +4216,6 @@ class V8_EXPORT Int8Array : public TypedArray { /** * An instance of Uint16Array constructor (ES6 draft 15.13.6). - * This API is experimental and may change significantly. */ class V8_EXPORT Uint16Array : public TypedArray { public: @@ -4225,7 +4233,6 @@ class V8_EXPORT Uint16Array : public TypedArray { /** * An instance of Int16Array constructor (ES6 draft 15.13.6). - * This API is experimental and may change significantly. */ class V8_EXPORT Int16Array : public TypedArray { public: @@ -4243,7 +4250,6 @@ class V8_EXPORT Int16Array : public TypedArray { /** * An instance of Uint32Array constructor (ES6 draft 15.13.6). - * This API is experimental and may change significantly. */ class V8_EXPORT Uint32Array : public TypedArray { public: @@ -4261,7 +4267,6 @@ class V8_EXPORT Uint32Array : public TypedArray { /** * An instance of Int32Array constructor (ES6 draft 15.13.6). - * This API is experimental and may change significantly. */ class V8_EXPORT Int32Array : public TypedArray { public: @@ -4279,7 +4284,6 @@ class V8_EXPORT Int32Array : public TypedArray { /** * An instance of Float32Array constructor (ES6 draft 15.13.6). - * This API is experimental and may change significantly. */ class V8_EXPORT Float32Array : public TypedArray { public: @@ -4297,7 +4301,6 @@ class V8_EXPORT Float32Array : public TypedArray { /** * An instance of Float64Array constructor (ES6 draft 15.13.6). - * This API is experimental and may change significantly. */ class V8_EXPORT Float64Array : public TypedArray { public: @@ -4315,7 +4318,6 @@ class V8_EXPORT Float64Array : public TypedArray { /** * An instance of DataView constructor (ES6 draft 15.13.7). - * This API is experimental and may change significantly. */ class V8_EXPORT DataView : public ArrayBufferView { public: @@ -4446,7 +4448,7 @@ class V8_EXPORT Date : public Object { */ double ValueOf() const; - V8_INLINE static Date* Cast(v8::Value* obj); + V8_INLINE static Date* Cast(Value* obj); /** * Notification that the embedder has changed the time zone, @@ -4463,7 +4465,7 @@ class V8_EXPORT Date : public Object { static void DateTimeConfigurationChangeNotification(Isolate* isolate); private: - static void CheckCast(v8::Value* obj); + static void CheckCast(Value* obj); }; @@ -4476,10 +4478,10 @@ class V8_EXPORT NumberObject : public Object { double ValueOf() const; - V8_INLINE static NumberObject* Cast(v8::Value* obj); + V8_INLINE static NumberObject* Cast(Value* obj); private: - static void CheckCast(v8::Value* obj); + static void CheckCast(Value* obj); }; @@ -4493,10 +4495,10 @@ class V8_EXPORT BooleanObject : public Object { bool ValueOf() const; - V8_INLINE static BooleanObject* Cast(v8::Value* obj); + V8_INLINE static BooleanObject* Cast(Value* obj); private: - static void CheckCast(v8::Value* obj); + static void CheckCast(Value* obj); }; @@ -4509,17 +4511,15 @@ class V8_EXPORT StringObject : public Object { Local ValueOf() const; - V8_INLINE static StringObject* Cast(v8::Value* obj); + V8_INLINE static StringObject* Cast(Value* obj); private: - static void CheckCast(v8::Value* obj); + static void CheckCast(Value* obj); }; /** * A Symbol object (ECMA-262 edition 6). - * - * This is an experimental feature. Use at your own risk. */ class V8_EXPORT SymbolObject : public Object { public: @@ -4527,10 +4527,10 @@ class V8_EXPORT SymbolObject : public Object { Local ValueOf() const; - V8_INLINE static SymbolObject* Cast(v8::Value* obj); + V8_INLINE static SymbolObject* Cast(Value* obj); private: - static void CheckCast(v8::Value* obj); + static void CheckCast(Value* obj); }; @@ -4580,10 +4580,10 @@ class V8_EXPORT RegExp : public Object { */ Flags GetFlags() const; - V8_INLINE static RegExp* Cast(v8::Value* obj); + V8_INLINE static RegExp* Cast(Value* obj); private: - static void CheckCast(v8::Value* obj); + static void CheckCast(Value* obj); }; @@ -5144,7 +5144,11 @@ class V8_EXPORT FunctionTemplate : public Template { /** Get the InstanceTemplate. */ Local InstanceTemplate(); - /** Causes the function template to inherit from a parent function template.*/ + /** + * Causes the function template to inherit from a parent function template. + * This means the the function's prototype.__proto__ is set to the parent + * function's prototype. + **/ void Inherit(Local parent); /** @@ -5153,6 +5157,14 @@ class V8_EXPORT FunctionTemplate : public Template { */ Local PrototypeTemplate(); + /** + * A PrototypeProviderTemplate is another function template whose prototype + * property is used for this template. This is mutually exclusive with setting + * a prototype template indirectly by calling PrototypeTemplate() or using + * Inherit(). + **/ + void SetPrototypeProviderTemplate(Local prototype_provider); + /** * Set the class name of the FunctionTemplate. This is used for * printing objects created with the function created from the @@ -5611,9 +5623,9 @@ class V8_EXPORT Extension { // NOLINT const char** deps = 0, int source_length = -1); virtual ~Extension() { } - virtual v8::Local GetNativeFunctionTemplate( - v8::Isolate* isolate, v8::Local name) { - return v8::Local(); + virtual Local GetNativeFunctionTemplate( + Isolate* isolate, Local name) { + return Local(); } const char* name() const { return name_; } @@ -5718,7 +5730,7 @@ typedef void (*FatalErrorCallback)(const char* location, const char* message); typedef void (*OOMErrorCallback)(const char* location, bool is_heap_oom); -typedef void (*MessageCallback)(Local message, Local error); +typedef void (*MessageCallback)(Local message, Local data); // --- Tracing --- @@ -5787,6 +5799,27 @@ typedef void (*BeforeCallEnteredCallback)(Isolate*); typedef void (*CallCompletedCallback)(Isolate*); typedef void (*DeprecatedCallCompletedCallback)(); +/** + * PromiseHook with type kInit is called when a new promise is + * created. When a new promise is created as part of the chain in the + * case of Promise.then or in the intermediate promises created by + * Promise.{race, all}/AsyncFunctionAwait, we pass the parent promise + * otherwise we pass undefined. + * + * PromiseHook with type kResolve is called at the beginning of + * resolve or reject function defined by CreateResolvingFunctions. + * + * PromiseHook with type kBefore is called at the beginning of the + * PromiseReactionJob. + * + * PromiseHook with type kAfter is called right at the end of the + * PromiseReactionJob. + */ +enum class PromiseHookType { kInit, kResolve, kBefore, kAfter }; + +typedef void (*PromiseHook)(PromiseHookType type, Local promise, + Local parent); + // --- Promise Reject Callback --- enum PromiseRejectEvent { kPromiseRejectWithNoHandler = 0, @@ -5889,6 +5922,21 @@ typedef void (*FailedAccessCheckCallback)(Local target, */ typedef bool (*AllowCodeGenerationFromStringsCallback)(Local context); +// --- WASM compilation callbacks --- + +/** + * Callback to check if a buffer source may be compiled to WASM, given + * the compilation is attempted as a promise or not. + */ + +typedef bool (*AllowWasmCompileCallback)(Isolate* isolate, Local source, + bool as_promise); + +typedef bool (*AllowWasmInstantiateCallback)(Isolate* isolate, + Local module_or_bytes, + MaybeLocal ffi, + bool as_promise); + // --- Garbage Collection Callbacks --- /** @@ -6249,17 +6297,33 @@ class V8_EXPORT EmbedderHeapTracer { }; /** - * Callback to the embedder used in SnapshotCreator to handle internal fields. + * Callback and supporting data used in SnapshotCreator to implement embedder + * logic to serialize internal fields. */ -typedef StartupData (*SerializeInternalFieldsCallback)(Local holder, - int index); +struct SerializeInternalFieldsCallback { + typedef StartupData (*CallbackFunction)(Local holder, int index, + void* data); + SerializeInternalFieldsCallback(CallbackFunction function = nullptr, + void* data_arg = nullptr) + : callback(function), data(data_arg) {} + CallbackFunction callback; + void* data; +}; /** - * Callback to the embedder used to deserialize internal fields. + * Callback and supporting data used to implement embedder logic to deserialize + * internal fields. */ -typedef void (*DeserializeInternalFieldsCallback)(Local holder, - int index, - StartupData payload); +struct DeserializeInternalFieldsCallback { + typedef void (*CallbackFunction)(Local holder, int index, + StartupData payload, void* data); + DeserializeInternalFieldsCallback(CallbackFunction function = nullptr, + void* data_arg = nullptr) + : callback(function), data(data_arg) {} + void (*callback)(Local holder, int index, StartupData payload, + void* data); + void* data; +}; /** * Isolate represents an isolated instance of the V8 engine. V8 isolates have @@ -6283,8 +6347,7 @@ class V8_EXPORT Isolate { create_histogram_callback(nullptr), add_histogram_sample_callback(nullptr), array_buffer_allocator(nullptr), - external_references(nullptr), - deserialize_internal_fields_callback(nullptr) {} + external_references(nullptr) {} /** * The optional entry_hook allows the host application to provide the @@ -6340,12 +6403,6 @@ class V8_EXPORT Isolate { * entire lifetime of the isolate. */ intptr_t* external_references; - - /** - * Specifies an optional callback to deserialize internal fields. It - * should match the SerializeInternalFieldCallback used to serialize. - */ - DeserializeInternalFieldsCallback deserialize_internal_fields_callback; }; @@ -6481,12 +6538,25 @@ class V8_EXPORT Isolate { kLegacyDateParser = 33, kDefineGetterOrSetterWouldThrow = 34, kFunctionConstructorReturnedUndefined = 35, + kAssigmentExpressionLHSIsCallInSloppy = 36, + kAssigmentExpressionLHSIsCallInStrict = 37, + kPromiseConstructorReturnedUndefined = 38, // If you add new values here, you'll also need to update Chromium's: // UseCounter.h, V8PerIsolateData.cpp, histograms.xml kUseCounterFeatureCount // This enum value must be last. }; + enum MessageErrorLevel { + kMessageLog = (1 << 0), + kMessageDebug = (1 << 1), + kMessageInfo = (1 << 2), + kMessageError = (1 << 3), + kMessageWarning = (1 << 4), + kMessageAll = kMessageLog | kMessageDebug | kMessageInfo | kMessageError | + kMessageWarning, + }; + typedef void (*UseCounterCallback)(Isolate* isolate, UseCounterFeature feature); @@ -6725,8 +6795,10 @@ class V8_EXPORT Isolate { * garbage collection types it is sufficient to provide object groups * for partially dependent handles only. */ - template void SetObjectGroupId(const Persistent& object, - UniqueId id); + template + V8_DEPRECATE_SOON("Use EmbedderHeapTracer", + void SetObjectGroupId(const Persistent& object, + UniqueId id)); /** * Allows the host application to declare implicit references from an object @@ -6735,8 +6807,10 @@ class V8_EXPORT Isolate { * are removed. It is intended to be used in the before-garbage-collection * callback function. */ - template void SetReferenceFromGroup(UniqueId id, - const Persistent& child); + template + V8_DEPRECATE_SOON("Use EmbedderHeapTracer", + void SetReferenceFromGroup(UniqueId id, + const Persistent& child)); /** * Allows the host application to declare implicit references from an object @@ -6744,8 +6818,10 @@ class V8_EXPORT Isolate { * too. After each garbage collection, all implicit references are removed. It * is intended to be used in the before-garbage-collection callback function. */ - template - void SetReference(const Persistent& parent, const Persistent& child); + template + V8_DEPRECATE_SOON("Use EmbedderHeapTracer", + void SetReference(const Persistent& parent, + const Persistent& child)); typedef void (*GCCallback)(Isolate* isolate, GCType type, GCCallbackFlags flags); @@ -6887,6 +6963,12 @@ class V8_EXPORT Isolate { void RemoveCallCompletedCallback( DeprecatedCallCompletedCallback callback)); + /** + * Experimental: Set the PromiseHook callback for various promise + * lifecycle events. + */ + void SetPromiseHook(PromiseHook hook); + /** * Set callback to notify about promise reject with no handler, or * revocation of such a previous notification once the handler is added. @@ -7020,6 +7102,23 @@ class V8_EXPORT Isolate { */ void SetRAILMode(RAILMode rail_mode); + /** + * Optional notification to tell V8 the current isolate is used for debugging + * and requires higher heap limit. + */ + void IncreaseHeapLimitForDebugging(); + + /** + * Restores the original heap limit after IncreaseHeapLimitForDebugging(). + */ + void RestoreOriginalHeapLimit(); + + /** + * Returns true if the heap limit was increased for debugging and the + * original heap limit was not restored yet. + */ + bool IsHeapLimitIncreasedForDebugging(); + /** * Allows the host application to provide the address of a function that is * notified each time code is added, moved or removed. @@ -7084,6 +7183,16 @@ class V8_EXPORT Isolate { void SetAllowCodeGenerationFromStringsCallback( AllowCodeGenerationFromStringsCallback callback); + /** + * Set the callback to invoke to check if wasm compilation from + * the specified object is allowed. By default, wasm compilation + * is allowed. + * + * Similar for instantiate. + */ + void SetAllowWasmCompileCallback(AllowWasmCompileCallback callback); + void SetAllowWasmInstantiateCallback(AllowWasmInstantiateCallback callback); + /** * Check if V8 is dead and therefore unusable. This is the case after * fatal errors such as out-of-memory situations. @@ -7091,7 +7200,7 @@ class V8_EXPORT Isolate { bool IsDead(); /** - * Adds a message listener. + * Adds a message listener (errors only). * * The same message listener can be added more than once and in that * case it will be called more than once for each message. @@ -7102,6 +7211,21 @@ class V8_EXPORT Isolate { bool AddMessageListener(MessageCallback that, Local data = Local()); + /** + * Adds a message listener. + * + * The same message listener can be added more than once and in that + * case it will be called more than once for each message. + * + * If data is specified, it will be passed to the callback when it is called. + * Otherwise, the exception object will be passed to the callback instead. + * + * A listener can listen for particular error levels by providing a mask. + */ + bool AddMessageListenerWithErrorLevel(MessageCallback that, + int message_levels, + Local data = Local()); + /** * Remove all message listeners from the specified callback function. */ @@ -7598,10 +7722,23 @@ class V8_EXPORT SnapshotCreator { Isolate* GetIsolate(); /** - * Add a context to be included in the snapshot blob. + * Set the default context to be included in the snapshot blob. + * The snapshot will not contain the global proxy, and we expect one or a + * global object template to create one, to be provided upon deserialization. + */ + void SetDefaultContext(Local context); + + /** + * Add additional context to be included in the snapshot blob. + * The snapshot will include the global proxy. + * + * \param callback optional callback to serialize internal fields. + * * \returns the index of the context in the snapshot blob. */ - size_t AddContext(Local context); + size_t AddContext(Local context, + SerializeInternalFieldsCallback callback = + SerializeInternalFieldsCallback()); /** * Add a template to be included in the snapshot blob. @@ -7614,12 +7751,10 @@ class V8_EXPORT SnapshotCreator { * This must not be called from within a handle scope. * \param function_code_handling whether to include compiled function code * in the snapshot. - * \param callback to serialize embedder-set internal fields. * \returns { nullptr, 0 } on failure, and a startup snapshot on success. The * caller acquires ownership of the data array in the return value. */ - StartupData CreateBlob(FunctionCodeHandling function_code_handling, - SerializeInternalFieldsCallback callback = nullptr); + StartupData CreateBlob(FunctionCodeHandling function_code_handling); // Disallow copying and assigning. SnapshotCreator(const SnapshotCreator&) = delete; @@ -7825,21 +7960,21 @@ class V8_EXPORT TryCatch { * UseAfterReturn is enabled, then the address returned will be the address * of the C++ try catch handler itself. */ - static void* JSStackComparableAddress(v8::TryCatch* handler) { + static void* JSStackComparableAddress(TryCatch* handler) { if (handler == NULL) return NULL; return handler->js_stack_comparable_address_; } TryCatch(const TryCatch&) = delete; void operator=(const TryCatch&) = delete; - void* operator new(size_t size) = delete; - void operator delete(void*, size_t) = delete; + void* operator new(size_t size); + void operator delete(void*, size_t); private: void ResetInternal(); - v8::internal::Isolate* isolate_; - v8::TryCatch* next_; + internal::Isolate* isolate_; + TryCatch* next_; void* exception_; void* message_obj_; void* js_stack_comparable_address_; @@ -7849,7 +7984,7 @@ class V8_EXPORT TryCatch { bool rethrow_ : 1; bool has_terminated_ : 1; - friend class v8::internal::Isolate; + friend class internal::Isolate; }; @@ -7922,10 +8057,30 @@ class V8_EXPORT Context { MaybeLocal global_template = MaybeLocal(), MaybeLocal global_object = MaybeLocal()); + /** + * Create a new context from a (non-default) context snapshot. There + * is no way to provide a global object template since we do not create + * a new global object from template, but we can reuse a global object. + * + * \param isolate See v8::Context::New. + * + * \param context_snapshot_index The index of the context snapshot to + * deserialize from. Use v8::Context::New for the default snapshot. + * + * \param internal_fields_deserializer Optional callback to deserialize + * internal fields. It should match the SerializeInternalFieldCallback used + * to serialize. + * + * \param extensions See v8::Context::New. + * + * \param global_object See v8::Context::New. + */ + static MaybeLocal FromSnapshot( Isolate* isolate, size_t context_snapshot_index, + DeserializeInternalFieldsCallback internal_fields_deserializer = + DeserializeInternalFieldsCallback(), ExtensionConfiguration* extensions = nullptr, - MaybeLocal global_template = MaybeLocal(), MaybeLocal global_object = MaybeLocal()); /** @@ -7976,7 +8131,7 @@ class V8_EXPORT Context { void Exit(); /** Returns an isolate associated with a current context. */ - v8::Isolate* GetIsolate(); + Isolate* GetIsolate(); /** * The field at kDebugIdIndex is reserved for V8 debugger implementation. @@ -8336,8 +8491,8 @@ class Internals { static const int kNodeIsIndependentShift = 3; static const int kNodeIsActiveShift = 4; - static const int kJSObjectType = 0xbc; static const int kJSApiObjectType = 0xbb; + static const int kJSObjectType = 0xbc; static const int kFirstNonstringType = 0x80; static const int kOddballType = 0x83; static const int kForeignType = 0x87; @@ -8856,17 +9011,16 @@ ScriptOrigin::ScriptOrigin(Local resource_name, Local resource_column_offset, Local resource_is_shared_cross_origin, Local script_id, - Local resource_is_embedder_debug_script, Local source_map_url, - Local resource_is_opaque) + Local resource_is_opaque, + Local is_wasm) : resource_name_(resource_name), resource_line_offset_(resource_line_offset), resource_column_offset_(resource_column_offset), - options_(!resource_is_embedder_debug_script.IsEmpty() && - resource_is_embedder_debug_script->IsTrue(), - !resource_is_shared_cross_origin.IsEmpty() && + options_(!resource_is_shared_cross_origin.IsEmpty() && resource_is_shared_cross_origin->IsTrue(), - !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue()), + !resource_is_opaque.IsEmpty() && resource_is_opaque->IsTrue(), + !is_wasm.IsEmpty() && is_wasm->IsTrue()), script_id_(script_id), source_map_url_(source_map_url) {} @@ -8920,9 +9074,8 @@ Local Boolean::New(Isolate* isolate, bool value) { return value ? True(isolate) : False(isolate); } - -void Template::Set(Isolate* isolate, const char* name, v8::Local value) { - Set(v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal) +void Template::Set(Isolate* isolate, const char* name, Local value) { + Set(String::NewFromUtf8(isolate, name, NewStringType::kNormal) .ToLocalChecked(), value); } @@ -9056,6 +9209,23 @@ bool Value::QuickIsNull() const { return (I::GetOddballKind(obj) == I::kNullOddballKind); } +bool Value::IsNullOrUndefined() const { +#ifdef V8_ENABLE_CHECKS + return FullIsNull() || FullIsUndefined(); +#else + return QuickIsNullOrUndefined(); +#endif +} + +bool Value::QuickIsNullOrUndefined() const { + typedef internal::Object O; + typedef internal::Internals I; + O* obj = *reinterpret_cast(this); + if (!I::HasHeapObjectTag(obj)) return false; + if (I::GetInstanceType(obj) != I::kOddballType) return false; + int kind = I::GetOddballKind(obj); + return kind == I::kNullOddballKind || kind == I::kUndefinedOddballKind; +} bool Value::IsString() const { #ifdef V8_ENABLE_CHECKS @@ -9531,7 +9701,7 @@ template void Isolate::SetObjectGroupId(const Persistent& object, UniqueId id) { TYPE_CHECK(Value, T); - SetObjectGroupId(reinterpret_cast(object.val_), id); + SetObjectGroupId(reinterpret_cast(object.val_), id); } @@ -9539,8 +9709,7 @@ template void Isolate::SetReferenceFromGroup(UniqueId id, const Persistent& object) { TYPE_CHECK(Value, T); - SetReferenceFromGroup(id, - reinterpret_cast(object.val_)); + SetReferenceFromGroup(id, reinterpret_cast(object.val_)); } @@ -9549,8 +9718,8 @@ void Isolate::SetReference(const Persistent& parent, const Persistent& child) { TYPE_CHECK(Object, T); TYPE_CHECK(Value, S); - SetReference(reinterpret_cast(parent.val_), - reinterpret_cast(child.val_)); + SetReference(reinterpret_cast(parent.val_), + reinterpret_cast(child.val_)); } @@ -9627,14 +9796,14 @@ void V8::SetFatalErrorHandler(FatalErrorCallback callback) { void V8::RemoveGCPrologueCallback(GCCallback callback) { Isolate* isolate = Isolate::GetCurrent(); isolate->RemoveGCPrologueCallback( - reinterpret_cast(callback)); + reinterpret_cast(callback)); } void V8::RemoveGCEpilogueCallback(GCCallback callback) { Isolate* isolate = Isolate::GetCurrent(); isolate->RemoveGCEpilogueCallback( - reinterpret_cast(callback)); + reinterpret_cast(callback)); } void V8::TerminateExecution(Isolate* isolate) { isolate->TerminateExecution(); } diff --git a/deps/v8/infra/config/cq.cfg b/deps/v8/infra/config/cq.cfg index e93895f382..6e6c725e6d 100644 --- a/deps/v8/infra/config/cq.cfg +++ b/deps/v8/infra/config/cq.cfg @@ -4,7 +4,6 @@ version: 1 cq_name: "v8" cq_status_url: "https://chromium-cq-status.appspot.com" -hide_ref_in_committed_msg: true commit_burst_delay: 60 max_commit_burst: 1 target_ref: "refs/pending/heads/master" diff --git a/deps/v8/infra/mb/mb_config.pyl b/deps/v8/infra/mb/mb_config.pyl index d6a2a2dc4a..2ac80d00f5 100644 --- a/deps/v8/infra/mb/mb_config.pyl +++ b/deps/v8/infra/mb/mb_config.pyl @@ -66,6 +66,7 @@ 'V8 Linux64 TSAN': 'gn_release_x64_tsan', 'V8 Linux - arm64 - sim - MSAN': 'gn_release_simulate_arm64_msan', # Clusterfuzz. + 'V8 Linux64 - release builder': 'gn_release_x64_correctness_fuzzer', 'V8 Linux64 ASAN no inline - release builder': 'gn_release_x64_asan_symbolized_edge_verify_heap', 'V8 Linux64 ASAN - debug builder': 'gn_debug_x64_asan_edge', @@ -116,8 +117,7 @@ 'V8 Linux - s390 - sim': 'gyp_release_simulate_s390', 'V8 Linux - s390x - sim': 'gyp_release_simulate_s390x', # X87. - 'V8 Linux - x87 - nosnap - debug builder': - 'gyp_debug_simulate_x87_no_snap', + 'V8 Linux - x87 - nosnap - debug builder': 'gyp_debug_simulate_x87', }, 'client.v8.branches': { 'V8 Linux - beta branch': 'gn_release_x86', @@ -286,6 +286,8 @@ 'v8_verify_heap'], 'gn_release_x64_clang': [ 'gn', 'release_bot', 'x64', 'clang', 'swarming'], + 'gn_release_x64_correctness_fuzzer' : [ + 'gn', 'release_bot', 'x64', 'v8_correctness_fuzzer'], 'gn_release_x64_internal': [ 'gn', 'release_bot', 'x64', 'swarming', 'v8_snapshot_internal'], 'gn_release_x64_minimal_symbols': [ @@ -359,9 +361,8 @@ 'gn', 'release_trybot', 'x86', 'swarming'], # Gyp debug configs for simulators. - 'gyp_debug_simulate_x87_no_snap': [ - 'gyp', 'debug_bot_static', 'simulate_x87', 'swarming', - 'v8_snapshot_none'], + 'gyp_debug_simulate_x87': [ + 'gyp', 'debug_bot_static', 'simulate_x87', 'swarming'], # Gyp debug configs for x86. 'gyp_debug_x86': [ @@ -626,6 +627,10 @@ 'gyp_defines': 'v8_enable_i18n_support=0 icu_use_data_file_flag=0', }, + 'v8_correctness_fuzzer': { + 'gn_args': 'v8_correctness_fuzzer=true', + }, + 'v8_disable_inspector': { 'gn_args': 'v8_enable_inspector=false', 'gyp_defines': 'v8_enable_inspector=0 ', diff --git a/deps/v8/src/DEPS b/deps/v8/src/DEPS index 9114669a6d..e9026b130d 100644 --- a/deps/v8/src/DEPS +++ b/deps/v8/src/DEPS @@ -10,7 +10,9 @@ include_rules = [ "+src/heap/heap-inl.h", "-src/inspector", "-src/interpreter", + "+src/interpreter/bytecode-array-accessor.h", "+src/interpreter/bytecode-array-iterator.h", + "+src/interpreter/bytecode-array-random-iterator.h", "+src/interpreter/bytecode-decoder.h", "+src/interpreter/bytecode-flags.h", "+src/interpreter/bytecode-register.h", diff --git a/deps/v8/src/accessors.cc b/deps/v8/src/accessors.cc index 9ec24b84c7..1f2ce97240 100644 --- a/deps/v8/src/accessors.cc +++ b/deps/v8/src/accessors.cc @@ -167,16 +167,38 @@ void Accessors::ArrayLengthSetter( i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); HandleScope scope(isolate); + DCHECK(Utils::OpenHandle(*name)->SameValue(isolate->heap()->length_string())); + Handle object = Utils::OpenHandle(*info.Holder()); Handle array = Handle::cast(object); Handle length_obj = Utils::OpenHandle(*val); + bool was_readonly = JSArray::HasReadOnlyLength(array); + uint32_t length = 0; if (!JSArray::AnythingToArrayLength(isolate, length_obj, &length)) { isolate->OptionalRescheduleException(false); return; } + if (!was_readonly && V8_UNLIKELY(JSArray::HasReadOnlyLength(array)) && + length != array->length()->Number()) { + // AnythingToArrayLength() may have called setter re-entrantly and modified + // its property descriptor. Don't perform this check if "length" was + // previously readonly, as this may have been called during + // DefineOwnPropertyIgnoreAttributes(). + if (info.ShouldThrowOnError()) { + Factory* factory = isolate->factory(); + isolate->Throw(*factory->NewTypeError( + MessageTemplate::kStrictReadOnlyProperty, Utils::OpenHandle(*name), + i::Object::TypeOf(isolate, object), object)); + isolate->OptionalRescheduleException(false); + } else { + info.GetReturnValue().Set(false); + } + return; + } + JSArray::SetLength(array, length); uint32_t actual_new_len = 0; @@ -517,34 +539,6 @@ Handle Accessors::ScriptSourceMappingUrlInfo( } -// -// Accessors::ScriptIsEmbedderDebugScript -// - - -void Accessors::ScriptIsEmbedderDebugScriptGetter( - v8::Local name, const v8::PropertyCallbackInfo& info) { - i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); - DisallowHeapAllocation no_allocation; - HandleScope scope(isolate); - Object* object = *Utils::OpenHandle(*info.Holder()); - bool is_embedder_debug_script = Script::cast(JSValue::cast(object)->value()) - ->origin_options() - .IsEmbedderDebugScript(); - Object* res = *isolate->factory()->ToBoolean(is_embedder_debug_script); - info.GetReturnValue().Set(Utils::ToLocal(Handle(res, isolate))); -} - - -Handle Accessors::ScriptIsEmbedderDebugScriptInfo( - Isolate* isolate, PropertyAttributes attributes) { - Handle name(isolate->factory()->InternalizeOneByteString( - STATIC_CHAR_VECTOR("is_debugger_script"))); - return MakeAccessor(isolate, name, &ScriptIsEmbedderDebugScriptGetter, - nullptr, attributes); -} - - // // Accessors::ScriptGetContextData // @@ -829,8 +823,8 @@ static Handle ArgumentsForInlinedFunction( Handle array = factory->NewFixedArray(argument_count); bool should_deoptimize = false; for (int i = 0; i < argument_count; ++i) { - // If we materialize any object, we should deopt because we might alias - // an object that was eliminated by escape analysis. + // If we materialize any object, we should deoptimize the frame because we + // might alias an object that was eliminated by escape analysis. should_deoptimize = should_deoptimize || iter->IsMaterializedObject(); Handle value = iter->GetValue(); array->set(i, *value); @@ -839,7 +833,7 @@ static Handle ArgumentsForInlinedFunction( arguments->set_elements(*array); if (should_deoptimize) { - translated_values.StoreMaterializedValuesAndDeopt(); + translated_values.StoreMaterializedValuesAndDeopt(frame); } // Return the freshly allocated arguments object. @@ -850,10 +844,10 @@ static Handle ArgumentsForInlinedFunction( static int FindFunctionInFrame(JavaScriptFrame* frame, Handle function) { DisallowHeapAllocation no_allocation; - List functions(2); - frame->GetFunctions(&functions); - for (int i = functions.length() - 1; i >= 0; i--) { - if (functions[i] == *function) return i; + List frames(2); + frame->Summarize(&frames); + for (int i = frames.length() - 1; i >= 0; i--) { + if (*frames[i].AsJavaScript().function() == *function) return i; } return -1; } @@ -957,19 +951,16 @@ static inline bool AllowAccessToFunction(Context* current_context, class FrameFunctionIterator { public: FrameFunctionIterator(Isolate* isolate, const DisallowHeapAllocation& promise) - : isolate_(isolate), - frame_iterator_(isolate), - functions_(2), - index_(0) { - GetFunctions(); + : isolate_(isolate), frame_iterator_(isolate), frames_(2), index_(0) { + GetFrames(); } JSFunction* next() { while (true) { - if (functions_.length() == 0) return NULL; - JSFunction* next_function = functions_[index_]; + if (frames_.length() == 0) return NULL; + JSFunction* next_function = *frames_[index_].AsJavaScript().function(); index_--; if (index_ < 0) { - GetFunctions(); + GetFrames(); } // Skip functions from other origins. if (!AllowAccessToFunction(isolate_->context(), next_function)) continue; @@ -990,18 +981,18 @@ class FrameFunctionIterator { } private: - void GetFunctions() { - functions_.Rewind(0); + void GetFrames() { + frames_.Rewind(0); if (frame_iterator_.done()) return; JavaScriptFrame* frame = frame_iterator_.frame(); - frame->GetFunctions(&functions_); - DCHECK(functions_.length() > 0); + frame->Summarize(&frames_); + DCHECK(frames_.length() > 0); frame_iterator_.Advance(); - index_ = functions_.length() - 1; + index_ = frames_.length() - 1; } Isolate* isolate_; JavaScriptFrameIterator frame_iterator_; - List functions_; + List frames_; int index_; }; @@ -1025,10 +1016,11 @@ MaybeHandle FindCaller(Isolate* isolate, if (caller == NULL) return MaybeHandle(); } while (caller->shared()->is_toplevel()); - // If caller is a built-in function and caller's caller is also built-in, + // If caller is not user code and caller's caller is also not user code, // use that instead. JSFunction* potential_caller = caller; - while (potential_caller != NULL && potential_caller->shared()->IsBuiltin()) { + while (potential_caller != NULL && + !potential_caller->shared()->IsUserJavaScript()) { caller = potential_caller; potential_caller = it.next(); } @@ -1210,7 +1202,8 @@ void Accessors::ErrorStackGetter( // If stack is still an accessor (this could have changed in the meantime // since FormatStackTrace can execute arbitrary JS), replace it with a data // property. - Handle receiver = Utils::OpenHandle(*info.This()); + Handle receiver = + Utils::OpenHandle(*v8::Local(info.This())); Handle name = Utils::OpenHandle(*key); if (IsAccessor(receiver, name, holder)) { result = ReplaceAccessorWithDataProperty(isolate, receiver, holder, name, @@ -1236,8 +1229,8 @@ void Accessors::ErrorStackSetter( const v8::PropertyCallbackInfo& info) { i::Isolate* isolate = reinterpret_cast(info.GetIsolate()); HandleScope scope(isolate); - Handle obj = - Handle::cast(Utils::OpenHandle(*info.This())); + Handle obj = Handle::cast( + Utils::OpenHandle(*v8::Local(info.This()))); // Clear internal properties to avoid memory leaks. Handle stack_trace_symbol = isolate->factory()->stack_trace_symbol(); diff --git a/deps/v8/src/accessors.h b/deps/v8/src/accessors.h index f53d30986c..218fb3572f 100644 --- a/deps/v8/src/accessors.h +++ b/deps/v8/src/accessors.h @@ -43,7 +43,6 @@ class AccessorInfo; V(ScriptType) \ V(ScriptSourceUrl) \ V(ScriptSourceMappingUrl) \ - V(ScriptIsEmbedderDebugScript) \ V(StringLength) #define ACCESSOR_SETTER_LIST(V) \ diff --git a/deps/v8/src/allocation.cc b/deps/v8/src/allocation.cc index 195a5443c8..fde01f6447 100644 --- a/deps/v8/src/allocation.cc +++ b/deps/v8/src/allocation.cc @@ -32,23 +32,6 @@ void Malloced::Delete(void* p) { } -#ifdef DEBUG - -static void* invalid = static_cast(NULL); - -void* Embedded::operator new(size_t size) { - UNREACHABLE(); - return invalid; -} - - -void Embedded::operator delete(void* p) { - UNREACHABLE(); -} - -#endif - - char* StrDup(const char* str) { int length = StrLength(str); char* result = NewArray(length + 1); diff --git a/deps/v8/src/allocation.h b/deps/v8/src/allocation.h index e87a3f1b1c..36019d9ab3 100644 --- a/deps/v8/src/allocation.h +++ b/deps/v8/src/allocation.h @@ -26,24 +26,9 @@ class V8_EXPORT_PRIVATE Malloced { static void Delete(void* p); }; - -// A macro is used for defining the base class used for embedded instances. -// The reason is some compilers allocate a minimum of one word for the -// superclass. The macro prevents the use of new & delete in debug mode. -// In release mode we are not willing to pay this overhead. - -#ifdef DEBUG -// Superclass for classes with instances allocated inside stack -// activations or inside other objects. -class Embedded { - public: - void* operator new(size_t size); - void operator delete(void* p); -}; -#define BASE_EMBEDDED : public NON_EXPORTED_BASE(Embedded) -#else +// DEPRECATED +// TODO(leszeks): Delete this during a quiet period #define BASE_EMBEDDED -#endif // Superclass for classes only using static method functions. diff --git a/deps/v8/src/api-arguments-inl.h b/deps/v8/src/api-arguments-inl.h index bf72fc4e6f..91ac253396 100644 --- a/deps/v8/src/api-arguments-inl.h +++ b/deps/v8/src/api-arguments-inl.h @@ -10,6 +10,14 @@ namespace v8 { namespace internal { +#define SIDE_EFFECT_CHECK(ISOLATE, F, RETURN_TYPE) \ + do { \ + if (ISOLATE->needs_side_effect_check() && \ + !PerformSideEffectCheck(ISOLATE, FUNCTION_ADDR(F))) { \ + return Handle(); \ + } \ + } while (false) + #define FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(F) \ F(AccessorNameGetterCallback, "get", v8::Value, Object) \ F(GenericNamedPropertyQueryCallback, "has", v8::Integer, Object) \ @@ -19,6 +27,7 @@ namespace internal { Handle PropertyCallbackArguments::Call(Function f, \ Handle name) { \ Isolate* isolate = this->isolate(); \ + SIDE_EFFECT_CHECK(isolate, f, InternalReturn); \ RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \ VMState state(isolate); \ ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \ @@ -43,6 +52,7 @@ FOR_EACH_CALLBACK_TABLE_MAPPING_1_NAME(WRITE_CALL_1_NAME) Handle PropertyCallbackArguments::Call(Function f, \ uint32_t index) { \ Isolate* isolate = this->isolate(); \ + SIDE_EFFECT_CHECK(isolate, f, InternalReturn); \ RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::Function); \ VMState state(isolate); \ ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); \ @@ -62,6 +72,7 @@ Handle PropertyCallbackArguments::Call( GenericNamedPropertySetterCallback f, Handle name, Handle value) { Isolate* isolate = this->isolate(); + SIDE_EFFECT_CHECK(isolate, f, Object); RuntimeCallTimerScope timer( isolate, &RuntimeCallStats::GenericNamedPropertySetterCallback); VMState state(isolate); @@ -77,6 +88,7 @@ Handle PropertyCallbackArguments::Call( GenericNamedPropertyDefinerCallback f, Handle name, const v8::PropertyDescriptor& desc) { Isolate* isolate = this->isolate(); + SIDE_EFFECT_CHECK(isolate, f, Object); RuntimeCallTimerScope timer( isolate, &RuntimeCallStats::GenericNamedPropertyDefinerCallback); VMState state(isolate); @@ -92,6 +104,7 @@ Handle PropertyCallbackArguments::Call(IndexedPropertySetterCallback f, uint32_t index, Handle value) { Isolate* isolate = this->isolate(); + SIDE_EFFECT_CHECK(isolate, f, Object); RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::IndexedPropertySetterCallback); VMState state(isolate); @@ -107,6 +120,7 @@ Handle PropertyCallbackArguments::Call( IndexedPropertyDefinerCallback f, uint32_t index, const v8::PropertyDescriptor& desc) { Isolate* isolate = this->isolate(); + SIDE_EFFECT_CHECK(isolate, f, Object); RuntimeCallTimerScope timer( isolate, &RuntimeCallStats::IndexedPropertyDefinerCallback); VMState state(isolate); @@ -121,6 +135,10 @@ Handle PropertyCallbackArguments::Call( void PropertyCallbackArguments::Call(AccessorNameSetterCallback f, Handle name, Handle value) { Isolate* isolate = this->isolate(); + if (isolate->needs_side_effect_check() && + !PerformSideEffectCheck(isolate, FUNCTION_ADDR(f))) { + return; + } RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::AccessorNameSetterCallback); VMState state(isolate); @@ -131,5 +149,7 @@ void PropertyCallbackArguments::Call(AccessorNameSetterCallback f, f(v8::Utils::ToLocal(name), v8::Utils::ToLocal(value), info); } +#undef SIDE_EFFECT_CHECK + } // namespace internal } // namespace v8 diff --git a/deps/v8/src/api-arguments.cc b/deps/v8/src/api-arguments.cc index f8d6c8fcc3..c7c54e5de1 100644 --- a/deps/v8/src/api-arguments.cc +++ b/deps/v8/src/api-arguments.cc @@ -4,6 +4,8 @@ #include "src/api-arguments.h" +#include "src/debug/debug.h" +#include "src/objects-inl.h" #include "src/tracing/trace-event.h" #include "src/vm-state-inl.h" @@ -12,6 +14,10 @@ namespace internal { Handle FunctionCallbackArguments::Call(FunctionCallback f) { Isolate* isolate = this->isolate(); + if (isolate->needs_side_effect_check() && + !isolate->debug()->PerformSideEffectCheckForCallback(FUNCTION_ADDR(f))) { + return Handle(); + } RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::FunctionCallback); VMState state(isolate); ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); @@ -23,6 +29,10 @@ Handle FunctionCallbackArguments::Call(FunctionCallback f) { Handle PropertyCallbackArguments::Call( IndexedPropertyEnumeratorCallback f) { Isolate* isolate = this->isolate(); + if (isolate->needs_side_effect_check() && + !isolate->debug()->PerformSideEffectCheckForCallback(FUNCTION_ADDR(f))) { + return Handle(); + } RuntimeCallTimerScope timer(isolate, &RuntimeCallStats::PropertyCallback); VMState state(isolate); ExternalCallbackScope call_scope(isolate, FUNCTION_ADDR(f)); @@ -31,5 +41,10 @@ Handle PropertyCallbackArguments::Call( return GetReturnValue(isolate); } +bool PropertyCallbackArguments::PerformSideEffectCheck(Isolate* isolate, + Address function) { + return isolate->debug()->PerformSideEffectCheckForCallback(function); +} + } // namespace internal } // namespace v8 diff --git a/deps/v8/src/api-arguments.h b/deps/v8/src/api-arguments.h index d6d1b951af..6c9ad7ad6b 100644 --- a/deps/v8/src/api-arguments.h +++ b/deps/v8/src/api-arguments.h @@ -136,6 +136,8 @@ class PropertyCallbackArguments inline JSObject* holder() { return JSObject::cast(this->begin()[T::kHolderIndex]); } + + bool PerformSideEffectCheck(Isolate* isolate, Address function); }; class FunctionCallbackArguments diff --git a/deps/v8/src/api-experimental.cc b/deps/v8/src/api-experimental.cc index 934b27aa5d..a9b5bd043b 100644 --- a/deps/v8/src/api-experimental.cc +++ b/deps/v8/src/api-experimental.cc @@ -8,10 +8,11 @@ #include "src/api-experimental.h" -#include "include/v8.h" #include "include/v8-experimental.h" +#include "include/v8.h" #include "src/api.h" #include "src/fast-accessor-assembler.h" +#include "src/objects-inl.h" namespace { diff --git a/deps/v8/src/api-natives.cc b/deps/v8/src/api-natives.cc index 3fe59e293d..87138bd5cf 100644 --- a/deps/v8/src/api-natives.cc +++ b/deps/v8/src/api-natives.cc @@ -395,6 +395,28 @@ MaybeHandle InstantiateObject(Isolate* isolate, return result; } +namespace { +MaybeHandle GetInstancePrototype(Isolate* isolate, + Object* function_template) { + // Enter a new scope. Recursion could otherwise create a lot of handles. + HandleScope scope(isolate); + Handle parent_instance; + ASSIGN_RETURN_ON_EXCEPTION( + isolate, parent_instance, + InstantiateFunction( + isolate, + handle(FunctionTemplateInfo::cast(function_template), isolate)), + JSFunction); + Handle instance_prototype; + // TODO(cbruni): decide what to do here. + ASSIGN_RETURN_ON_EXCEPTION( + isolate, instance_prototype, + JSObject::GetProperty(parent_instance, + isolate->factory()->prototype_string()), + JSFunction); + return scope.CloseAndEscape(instance_prototype); +} +} // namespace MaybeHandle InstantiateFunction(Isolate* isolate, Handle data, @@ -406,11 +428,18 @@ MaybeHandle InstantiateFunction(Isolate* isolate, return Handle::cast(result); } } - Handle prototype; + Handle prototype; if (!data->remove_prototype()) { Object* prototype_templ = data->prototype_template(); if (prototype_templ->IsUndefined(isolate)) { - prototype = isolate->factory()->NewJSObject(isolate->object_function()); + Object* protoype_provider_templ = data->prototype_provider_template(); + if (protoype_provider_templ->IsUndefined(isolate)) { + prototype = isolate->factory()->NewJSObject(isolate->object_function()); + } else { + ASSIGN_RETURN_ON_EXCEPTION( + isolate, prototype, + GetInstancePrototype(isolate, protoype_provider_templ), JSFunction); + } } else { ASSIGN_RETURN_ON_EXCEPTION( isolate, prototype, @@ -422,22 +451,12 @@ MaybeHandle InstantiateFunction(Isolate* isolate, } Object* parent = data->parent_template(); if (!parent->IsUndefined(isolate)) { - // Enter a new scope. Recursion could otherwise create a lot of handles. - HandleScope scope(isolate); - Handle parent_instance; - ASSIGN_RETURN_ON_EXCEPTION( - isolate, parent_instance, - InstantiateFunction( - isolate, handle(FunctionTemplateInfo::cast(parent), isolate)), - JSFunction); - // TODO(dcarney): decide what to do here. Handle parent_prototype; - ASSIGN_RETURN_ON_EXCEPTION( - isolate, parent_prototype, - JSObject::GetProperty(parent_instance, - isolate->factory()->prototype_string()), - JSFunction); - JSObject::ForceSetPrototype(prototype, parent_prototype); + ASSIGN_RETURN_ON_EXCEPTION(isolate, parent_prototype, + GetInstancePrototype(isolate, parent), + JSFunction); + JSObject::ForceSetPrototype(Handle::cast(prototype), + parent_prototype); } } Handle function = ApiNatives::CreateApiFunction( @@ -531,7 +550,7 @@ MaybeHandle ApiNatives::InstantiateRemoteObject( void ApiNatives::AddDataProperty(Isolate* isolate, Handle info, Handle name, Handle value, PropertyAttributes attributes) { - PropertyDetails details(attributes, DATA, 0, PropertyCellType::kNoCell); + PropertyDetails details(kData, attributes, 0, PropertyCellType::kNoCell); auto details_handle = handle(details.AsSmi(), isolate); Handle data[] = {name, details_handle, value}; AddPropertyToPropertyList(isolate, info, arraysize(data), data); @@ -543,7 +562,7 @@ void ApiNatives::AddDataProperty(Isolate* isolate, Handle info, PropertyAttributes attributes) { auto value = handle(Smi::FromInt(intrinsic), isolate); auto intrinsic_marker = isolate->factory()->true_value(); - PropertyDetails details(attributes, DATA, 0, PropertyCellType::kNoCell); + PropertyDetails details(kData, attributes, 0, PropertyCellType::kNoCell); auto details_handle = handle(details.AsSmi(), isolate); Handle data[] = {name, intrinsic_marker, details_handle, value}; AddPropertyToPropertyList(isolate, info, arraysize(data), data); @@ -556,7 +575,7 @@ void ApiNatives::AddAccessorProperty(Isolate* isolate, Handle getter, Handle setter, PropertyAttributes attributes) { - PropertyDetails details(attributes, ACCESSOR, 0, PropertyCellType::kNoCell); + PropertyDetails details(kAccessor, attributes, 0, PropertyCellType::kNoCell); auto details_handle = handle(details.AsSmi(), isolate); Handle data[] = {name, details_handle, getter, setter}; AddPropertyToPropertyList(isolate, info, arraysize(data), data); @@ -606,7 +625,7 @@ Handle ApiNatives::CreateApiFunction( if (prototype->IsTheHole(isolate)) { prototype = isolate->factory()->NewFunctionPrototype(result); - } else { + } else if (obj->prototype_provider_template()->IsUndefined(isolate)) { JSObject::AddProperty(Handle::cast(prototype), isolate->factory()->constructor_string(), result, DONT_ENUM); @@ -656,6 +675,12 @@ Handle ApiNatives::CreateApiFunction( // Mark as undetectable if needed. if (obj->undetectable()) { + // We only allow callable undetectable receivers here, since this whole + // undetectable business is only to support document.all, which is both + // undetectable and callable. If we ever see the need to have an object + // that is undetectable but not callable, we need to update the types.h + // to allow encoding this. + CHECK(!obj->instance_call_handler()->IsUndefined(isolate)); map->set_is_undetectable(); } diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index da7f2ef414..04ba55c1dd 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -29,6 +29,7 @@ #include "src/bootstrapper.h" #include "src/char-predicates-inl.h" #include "src/code-stubs.h" +#include "src/compiler-dispatcher/compiler-dispatcher.h" #include "src/compiler.h" #include "src/context-measure.h" #include "src/contexts.h" @@ -97,6 +98,15 @@ namespace v8 { ENTER_V8(isolate); \ bool has_pending_exception = false +#define PREPARE_FOR_DEBUG_INTERFACE_EXECUTION_WITH_ISOLATE(isolate, T) \ + if (IsExecutionTerminatingCheck(isolate)) { \ + return MaybeLocal(); \ + } \ + InternalEscapableScope handle_scope(isolate); \ + CallDepthScope call_depth_scope(isolate, v8::Local()); \ + ENTER_V8(isolate); \ + bool has_pending_exception = false + #define PREPARE_FOR_EXECUTION_WITH_CONTEXT(context, class_name, function_name, \ bailout_value, HandleScopeClass, \ do_callback) \ @@ -141,6 +151,23 @@ namespace v8 { PREPARE_FOR_EXECUTION_WITH_CONTEXT(context, class_name, function_name, \ false, i::HandleScope, false) +#ifdef DEBUG +#define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate) \ + i::VMState __state__((isolate)); \ + i::DisallowJavascriptExecutionDebugOnly __no_script__((isolate)); \ + i::DisallowExceptions __no_exceptions__((isolate)) + +#define ENTER_V8_FOR_NEW_CONTEXT(isolate) \ + i::VMState __state__((isolate)); \ + i::DisallowExceptions __no_exceptions__((isolate)) +#else +#define ENTER_V8_NO_SCRIPT_NO_EXCEPTION(isolate) \ + i::VMState __state__((isolate)); + +#define ENTER_V8_FOR_NEW_CONTEXT(isolate) \ + i::VMState __state__((isolate)); +#endif // DEBUG + #define EXCEPTION_BAILOUT_CHECK_SCOPED(isolate, value) \ do { \ if (has_pending_exception) { \ @@ -243,7 +270,7 @@ class CallDepthScope { static ScriptOrigin GetScriptOriginForScript(i::Isolate* isolate, i::Handle script) { - i::Handle scriptName(i::Script::GetNameOrSourceURL(script)); + i::Handle scriptName(script->GetNameOrSourceURL(), isolate); i::Handle source_map_url(script->source_mapping_url(), isolate); v8::Isolate* v8_isolate = reinterpret_cast(script->GetIsolate()); @@ -254,9 +281,9 @@ static ScriptOrigin GetScriptOriginForScript(i::Isolate* isolate, v8::Integer::New(v8_isolate, script->column_offset()), v8::Boolean::New(v8_isolate, options.IsSharedCrossOrigin()), v8::Integer::New(v8_isolate, script->id()), - v8::Boolean::New(v8_isolate, options.IsEmbedderDebugScript()), Utils::ToLocal(source_map_url), - v8::Boolean::New(v8_isolate, options.IsOpaque())); + v8::Boolean::New(v8_isolate, options.IsOpaque()), + v8::Boolean::New(v8_isolate, script->type() == i::Script::TYPE_WASM)); return origin; } @@ -452,6 +479,7 @@ bool RunExtraCode(Isolate* isolate, Local context, struct SnapshotCreatorData { explicit SnapshotCreatorData(Isolate* isolate) : isolate_(isolate), + default_context_(), contexts_(isolate), templates_(isolate), created_(false) {} @@ -462,8 +490,10 @@ struct SnapshotCreatorData { ArrayBufferAllocator allocator_; Isolate* isolate_; + Persistent default_context_; PersistentValueVector contexts_; PersistentValueVector