Commit ac81b4ca authored by Jérémy Lal's avatar Jérémy Lal

Imported Upstream version 4.1.1~dfsg

parent 401419e3
# Node.js ChangeLog
## 2015-09-22, Version 4.1.1 (Stable), @rvagg
### Notable changes
* **buffer**: Fixed a bug introduced in v4.1.0 where allocating a new zero-length buffer can result in the _next_ allocation of a TypedArray in JavaScript not being zero-filled. In certain circumstances this could result in data leakage via reuse of memory space in TypedArrays, breaking the normally safe assumption that TypedArrays should be always zero-filled. (Trevor Norris) [#2931](https://github.com/nodejs/node/pull/2931).
* **http**: Guard against response-splitting of HTTP trailing headers added via [`response.addTrailers()`](https://nodejs.org/api/http.html#http_response_addtrailers_headers) by removing new-line (`[\r\n]`) characters from values. Note that standard header values are already stripped of new-line characters. The expected security impact is low because trailing headers are rarely used. (Ben Noordhuis) [#2945](https://github.com/nodejs/node/pull/2945).
* **npm**: Upgrade to npm 2.14.4 from 2.14.3, see [release notes](https://github.com/npm/npm/releases/tag/v2.14.4) for full details (Kat Marchán) [#2958](https://github.com/nodejs/node/pull/2958)
- Upgrades `graceful-fs` on multiple dependencies to no longer rely on monkey-patching `fs`
- Fix `npm link` for pre-release / RC builds of Node
* **v8**: Update post-mortem metadata to allow post-mortem debugging tools to find and inspect:
- JavaScript objects that use dictionary properties (Julien Gilli) [#2959](https://github.com/nodejs/node/pull/2959)
- ScopeInfo and thus closures (Julien Gilli) [#2974](https://github.com/nodejs/node/pull/2974)
### Known issues
See https://github.com/nodejs/node/labels/confirmed-bug for complete and current list of known issues.
* Some problems with unreferenced timers running during `beforeExit` are still to be resolved. See [#1264](https://github.com/nodejs/node/issues/1264).
* Surrogate pair in REPL can freeze terminal. [#690](https://github.com/nodejs/node/issues/690)
* Calling `dns.setServers()` while a DNS query is in progress can cause the process to crash on a failed assertion. [#894](https://github.com/nodejs/node/issues/894)
* `url.resolve` may transfer the auth portion of the url when resolving between two full hosts, see [#1435](https://github.com/nodejs/node/issues/1435).
### Commits
* [[`d63e02e08d`](https://github.com/nodejs/node/commit/d63e02e08d)] - **buffer**: don't set zero fill for zero-length buffer (Trevor Norris) [#2931](https://github.com/nodejs/node/pull/2931)
* [[`5905b14bff`](https://github.com/nodejs/node/commit/5905b14bff)] - **build**: fix icutrim when building small-icu on BE (Stewart Addison) [#2602](https://github.com/nodejs/node/pull/2602)
* [[`f010cb5d96`](https://github.com/nodejs/node/commit/f010cb5d96)] - **configure**: detect mipsel host (Jérémy Lal) [#2971](https://github.com/nodejs/node/pull/2971)
* [[`b93ad5abbd`](https://github.com/nodejs/node/commit/b93ad5abbd)] - **deps**: backport 357e6b9 from V8's upstream (Julien Gilli) [#2974](https://github.com/nodejs/node/pull/2974)
* [[`8da3da4d41`](https://github.com/nodejs/node/commit/8da3da4d41)] - **deps**: backport ff7d70b from V8's upstream (Julien Gilli) [#2959](https://github.com/nodejs/node/pull/2959)
* [[`2600fb8ae6`](https://github.com/nodejs/node/commit/2600fb8ae6)] - **deps**: upgraded to node-gyp@3.0.3 in npm (Kat Marchán) [#2958](https://github.com/nodejs/node/pull/2958)
* [[`793aad2d7a`](https://github.com/nodejs/node/commit/793aad2d7a)] - **deps**: upgrade to npm 2.14.4 (Kat Marchán) [#2958](https://github.com/nodejs/node/pull/2958)
* [[`43e2b7f836`](https://github.com/nodejs/node/commit/43e2b7f836)] - **doc**: remove usage of events.EventEmitter (Sakthipriyan Vairamani) [#2921](https://github.com/nodejs/node/pull/2921)
* [[`9c59d2f16a`](https://github.com/nodejs/node/commit/9c59d2f16a)] - **doc**: remove extra using v8::HandleScope statement (Christopher J. Brody) [#2983](https://github.com/nodejs/node/pull/2983)
* [[`f7edbab367`](https://github.com/nodejs/node/commit/f7edbab367)] - **doc**: clarify description of assert.ifError() (Rich Trott) [#2941](https://github.com/nodejs/node/pull/2941)
* [[`b2ddf0f9a2`](https://github.com/nodejs/node/commit/b2ddf0f9a2)] - **doc**: refine process.kill() and exit explanations (Rich Trott) [#2918](https://github.com/nodejs/node/pull/2918)
* [[`f68fed2e6f`](https://github.com/nodejs/node/commit/f68fed2e6f)] - **http**: remove redundant code in _deferToConnect (Malcolm Ahoy) [#2769](https://github.com/nodejs/node/pull/2769)
* [[`f542e74c93`](https://github.com/nodejs/node/commit/f542e74c93)] - **http**: guard against response splitting in trailers (Ben Noordhuis) [#2945](https://github.com/nodejs/node/pull/2945)
* [[`bc9f629387`](https://github.com/nodejs/node/commit/bc9f629387)] - **http_parser**: do not dealloc during kOnExecute (Fedor Indutny) [#2956](https://github.com/nodejs/node/pull/2956)
* [[`1860e0cebd`](https://github.com/nodejs/node/commit/1860e0cebd)] - **lib,src**: remove usage of events.EventEmitter (Sakthipriyan Vairamani) [#2921](https://github.com/nodejs/node/pull/2921)
* [[`d4cd5ac407`](https://github.com/nodejs/node/commit/d4cd5ac407)] - **readline**: fix tab completion bug (Matt Harrison) [#2816](https://github.com/nodejs/node/pull/2816)
* [[`9760e04839`](https://github.com/nodejs/node/commit/9760e04839)] - **repl**: don't use tty control codes when $TERM is set to "dumb" (Salman Aljammaz) [#2712](https://github.com/nodejs/node/pull/2712)
* [[`cb971cc97d`](https://github.com/nodejs/node/commit/cb971cc97d)] - **repl**: backslash bug fix (Sakthipriyan Vairamani) [#2968](https://github.com/nodejs/node/pull/2968)
* [[`2034f68668`](https://github.com/nodejs/node/commit/2034f68668)] - **src**: honor --abort_on_uncaught_exception flag (Evan Lucas) [#2776](https://github.com/nodejs/node/pull/2776)
* [[`0b1ca4a9ef`](https://github.com/nodejs/node/commit/0b1ca4a9ef)] - **src**: Add ABORT macro (Evan Lucas) [#2776](https://github.com/nodejs/node/pull/2776)
* [[`4519dd00f9`](https://github.com/nodejs/node/commit/4519dd00f9)] - **test**: test sync version of mkdir & rmdir (Sakthipriyan Vairamani) [#2588](https://github.com/nodejs/node/pull/2588)
* [[`816f609c8b`](https://github.com/nodejs/node/commit/816f609c8b)] - **test**: use tmpDir instead of fixtures in readdir (Sakthipriyan Vairamani) [#2587](https://github.com/nodejs/node/pull/2587)
* [[`2084f52585`](https://github.com/nodejs/node/commit/2084f52585)] - **test**: test more http response splitting scenarios (Ben Noordhuis) [#2945](https://github.com/nodejs/node/pull/2945)
* [[`fa08d1d8a1`](https://github.com/nodejs/node/commit/fa08d1d8a1)] - **test**: add test-spawn-cmd-named-pipe (Alexis Campailla) [#2770](https://github.com/nodejs/node/pull/2770)
* [[`71b5d80682`](https://github.com/nodejs/node/commit/71b5d80682)] - **test**: make cluster tests more time tolerant (Michael Dawson) [#2891](https://github.com/nodejs/node/pull/2891)
* [[`3e09dcfc32`](https://github.com/nodejs/node/commit/3e09dcfc32)] - **test**: update cwd-enoent tests for AIX (Imran Iqbal) [#2909](https://github.com/nodejs/node/pull/2909)
* [[`6ea8ec1c59`](https://github.com/nodejs/node/commit/6ea8ec1c59)] - **tools**: single, cross-platform tick processor (Matt Loring) [#2868](https://github.com/nodejs/node/pull/2868)
## 2015-09-17, Version 4.1.0 (Stable), @Fishrock123
### Notable changes
......
SlowBuffer = require('buffer').SlowBuffer;
var common = require('../common.js');
var SlowBuffer = require('buffer').SlowBuffer;
var bench = common.createBenchmark(main, {
type: ['fast', 'slow'],
len: [10, 1024],
n: [1024]
});
var buf = new Buffer(1024);
var slowBuf = new SlowBuffer(1024);
function main(conf) {
var len = +conf.len;
var n = +conf.n;
var clazz = conf.type === 'fast' ? Buffer : SlowBuffer;
var b = conf.type === 'fast' ? buf : slowBuf;
bench.start();
for (var i = 0; i < n * 1024; i++) {
b = new clazz(len);
b.slice(10, 256);
}
bench.end(n);
}
b
\ No newline at end of file
var SlowBuffer = require('buffer').SlowBuffer;
var common = require('../common.js');
var assert = require('assert');
var bench = common.createBenchmark(main, {
size: [16, 512, 1024, 4096, 16386],
type: ['fast', 'slow'],
method: ['for', 'forOf', 'iterator'],
n: [1e3]
});
var methods = {
'for': benchFor,
'forOf': benchForOf,
'iterator': benchIterator
};
function main(conf) {
var len = +conf.size;
var clazz = conf.type === 'fast' ? Buffer : SlowBuffer;
var buffer = new clazz(len);
buffer.fill(0);
methods[conf.method](buffer, conf.n);
}
function benchFor(buffer, n) {
bench.start();
for (var k = 0; k < n; k++)
for (var i = 0; i < buffer.length; i++)
assert(buffer[i] === 0);
bench.end(n);
}
function benchForOf(buffer, n) {
bench.start();
for (var k = 0; k < n; k++)
for (var b of buffer)
assert(b === 0);
bench.end(n);
}
function benchIterator(buffer, n) {
bench.start();
for (var k = 0; k < n; k++) {
var iter = buffer[Symbol.iterator]();
var cur = iter.next();
while (!cur.done) {
assert(cur.value === 0);
cur = iter.next();
}
}
bench.end(n);
}
var common = require('../common.js');
var bench = common.createBenchmark(main, {
noAssert: [false, true],
buffer: ['fast', 'slow'],
type: ['UInt8', 'UInt16LE', 'UInt16BE',
'UInt32LE', 'UInt32BE',
'Int8', 'Int16LE', 'Int16BE',
'Int32LE', 'Int32BE',
'FloatLE', 'FloatBE',
'DoubleLE', 'DoubleBE'],
millions: [1]
});
function main(conf) {
var noAssert = conf.noAssert === 'true';
var len = +conf.millions * 1e6;
var clazz = conf.buf === 'fast' ? Buffer : require('buffer').SlowBuffer;
var buff = new clazz(8);
var fn = 'read' + conf.type;
buff.writeDoubleLE(0, 0, noAssert);
var testFunction = new Function('buff', [
"for (var i = 0; i !== " + len + "; i++) {",
" buff." + fn + "(0, " + JSON.stringify(noAssert) + ");",
"}"
].join("\n"));
bench.start();
testFunction(buff);
bench.end(len / 1e6);
}
var common = require('../common.js');
var SlowBuffer = require('buffer').SlowBuffer;
var bench = common.createBenchmark(main, {
type: ['fast', 'slow'],
n: [1024]
});
var buf = new Buffer(1024);
var slowBuf = new SlowBuffer(1024);
function main(conf) {
var n = +conf.n;
var b = conf.type === 'fast' ? buf : slowBuf;
bench.start();
for (var i = 0; i < n * 1024; i++) {
b.slice(10, 256);
}
bench.end(n);
}
......@@ -566,6 +566,7 @@ def host_arch_cc():
'__aarch64__' : 'arm64',
'__arm__' : 'arm',
'__i386__' : 'ia32',
'__MIPSEL__' : 'mipsel',
'__mips__' : 'mips',
'__PPC64__' : 'ppc64',
'__PPC__' : 'ppc',
......
......@@ -4086,7 +4086,6 @@ class ScopeInfo : public FixedArray {
FOR_EACH_NUMERIC_FIELD(FIELD_ACCESSORS)
#undef FIELD_ACCESSORS
private:
enum {
#define DECL_INDEX(name) k##name,
FOR_EACH_NUMERIC_FIELD(DECL_INDEX)
......@@ -4095,6 +4094,7 @@ class ScopeInfo : public FixedArray {
kVariablePartIndex
};
private:
// The layout of the variable part of a ScopeInfo is as follows:
// 1. ParameterEntries:
// This part stores the names of the parameters for function scopes. One
......
......@@ -132,6 +132,15 @@ consts_misc = [
'value': 'JavaScriptFrameConstants::kFunctionOffset' },
{ 'name': 'off_fp_args',
'value': 'JavaScriptFrameConstants::kLastParameterOffset' },
{ 'name': 'scopeinfo_idx_nparams',
'value': 'ScopeInfo::kParameterCount' },
{ 'name': 'scopeinfo_idx_nstacklocals',
'value': 'ScopeInfo::kStackLocalCount' },
{ 'name': 'scopeinfo_idx_ncontextlocals',
'value': 'ScopeInfo::kContextLocalCount' },
{ 'name': 'scopeinfo_idx_first_vars',
'value': 'ScopeInfo::kVariablePartIndex' },
];
#
......@@ -146,7 +155,7 @@ extras_accessors = [
'Map, instance_size, int, kInstanceSizeOffset',
'Map, bit_field, char, kBitFieldOffset',
'Map, bit_field2, char, kBitField2Offset',
'Map, bit_field3, SMI, kBitField3Offset',
'Map, bit_field3, int, kBitField3Offset',
'Map, prototype, Object, kPrototypeOffset',
'NameDictionaryShape, prefix_size, int, kPrefixSize',
'NameDictionaryShape, entry_size, int, kEntrySize',
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title> Node.js v4.1.0 Manual &amp; Documentation</title>
<title> Node.js v4.1.1 Manual &amp; Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
......@@ -61,7 +61,7 @@
<div id="column1" data-id="_toc" class="interior">
<header>
<h1>Node.js v4.1.0 Documentation</h1>
<h1>Node.js v4.1.1 Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Addons Node.js v4.1.0 Manual &amp; Documentation</title>
<title>Addons Node.js v4.1.1 Manual &amp; Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
......@@ -61,7 +61,7 @@
<div id="column1" data-id="addons" class="interior">
<header>
<h1>Node.js v4.1.0 Documentation</h1>
<h1>Node.js v4.1.1 Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -148,7 +148,6 @@ the following JavaScript code:
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -264,7 +263,6 @@ namespace demo {
using v8::Exception;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -319,7 +317,6 @@ namespace demo {
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Null;
......@@ -369,7 +366,6 @@ the string passed to <code>createObject()</code>:
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -414,7 +410,6 @@ namespace demo {
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -517,7 +512,6 @@ namespace demo {
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -606,7 +600,6 @@ explicitly instantiating them with the <code>new</code> operator in JavaScript,
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -669,7 +662,6 @@ namespace demo {
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -767,7 +759,6 @@ In the following <code>addon.cc</code> we introduce a function <code>add()</code
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -844,7 +835,6 @@ namespace demo {
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......
This diff is collapsed.
......@@ -44,7 +44,6 @@ First we create a file `hello.cc`:
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -155,7 +154,6 @@ function calls and return a result. This is the main and only needed source
using v8::Exception;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -212,7 +210,6 @@ there. Here's `addon.cc`:
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Null;
......@@ -263,7 +260,6 @@ the string passed to `createObject()`:
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -310,7 +306,6 @@ wraps a C++ function:
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -415,7 +410,6 @@ prototype:
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -505,7 +499,6 @@ Let's register our `createObject` method in `addon.cc`:
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -568,7 +561,6 @@ The implementation is similar to the above in `myobject.cc`:
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -668,7 +660,6 @@ In the following `addon.cc` we introduce a function `add()` that can take on two
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -745,7 +736,6 @@ The implementation of `myobject.cc` is similar as before:
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>About this Documentation Node.js v4.1.0 Manual &amp; Documentation</title>
<title>About this Documentation Node.js v4.1.1 Manual &amp; Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
......@@ -61,7 +61,7 @@
<div id="column1" data-id="all" class="interior">
<header>
<h1>Node.js v4.1.0 Documentation</h1>
<h1>Node.js v4.1.1 Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -1426,7 +1426,6 @@ the following JavaScript code:
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -1542,7 +1541,6 @@ namespace demo {
using v8::Exception;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -1597,7 +1595,6 @@ namespace demo {
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Null;
......@@ -1647,7 +1644,6 @@ the string passed to <code>createObject()</code>:
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -1692,7 +1688,6 @@ namespace demo {
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -1795,7 +1790,6 @@ namespace demo {
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -1884,7 +1878,6 @@ explicitly instantiating them with the <code>new</code> operator in JavaScript,
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -1947,7 +1940,6 @@ namespace demo {
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -2045,7 +2037,6 @@ In the following <code>addon.cc</code> we introduce a function <code>add()</code
namespace demo {
using v8::FunctionCallbackInfo;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Number;
......@@ -2122,7 +2113,6 @@ namespace demo {
using v8::Function;
using v8::FunctionCallbackInfo;
using v8::FunctionTemplate;
using v8::HandleScope;
using v8::Isolate;
using v8::Local;
using v8::Object;
......@@ -2259,7 +2249,7 @@ NODE_MODULE(addon, init);
<pre><code>// test.js
var addon = require(&#39;./build/Release/addon&#39;);</code></pre>
<h1>Assert<span><a class="mark" href="#all_assert" id="all_assert">#</a></span></h1>
<pre class="api_stability_2">Stability: 2 - Stable</pre><p>This module is used for writing unit tests for your applications, you can
<pre class="api_stability_2">Stability: 2 - Stable</pre><p>This module is used for writing unit tests for your applications. You can
access it with <code>require(&#39;assert&#39;)</code>.
</p>
......@@ -2276,7 +2266,8 @@ access it with <code>require(&#39;assert&#39;)</code>.
</p>
<h2>assert.notEqual(actual, expected[, message])<span><a class="mark" href="#all_assert_notequal_actual_expected_message" id="all_assert_notequal_actual_expected_message">#</a></span></h2>
<p>Tests shallow, coercive non-equality with the not equal comparison operator ( <code>!=</code> ).
<p>Tests shallow, coercive inequality with the not equal comparison operator
( <code>!=</code> ).
</p>
<h2>assert.deepEqual(actual, expected[, message])<span><a class="mark" href="#all_assert_deepequal_actual_expected_message" id="all_assert_deepequal_actual_expected_message">#</a></span></h2>
......@@ -2289,12 +2280,12 @@ operator ( <code>==</code> ). Doesn&#39;t take object prototypes into account.
</p>
<h2>assert.strictEqual(actual, expected[, message])<span><a class="mark" href="#all_assert_strictequal_actual_expected_message" id="all_assert_strictequal_actual_expected_message">#</a></span></h2>
<p>Tests strict equality, as determined by the strict equality operator ( <code>===</code> )
<p>Tests strict equality as determined by the strict equality operator ( <code>===</code> ).
</p>
<h2>assert.notStrictEqual(actual, expected[, message])<span><a class="mark" href="#all_assert_notstrictequal_actual_expected_message" id="all_assert_notstrictequal_actual_expected_message">#</a></span></h2>
<p>Tests strict non-equality, as determined by the strict not equal
operator ( <code>!==</code> )
<p>Tests strict inequality as determined by the strict not equal operator
( <code>!==</code> ).
</p>
<h2>assert.deepStrictEqual(actual, expected[, message])<span><a class="mark" href="#all_assert_deepstrictequal_actual_expected_message" id="all_assert_deepstrictequal_actual_expected_message">#</a></span></h2>
......@@ -2307,7 +2298,7 @@ operator ( <code>===</code> ).
</p>
<h2>assert.throws(block[, error][, message])<span><a class="mark" href="#all_assert_throws_block_error_message" id="all_assert_throws_block_error_message">#</a></span></h2>
<p>Expects <code>block</code> to throw an error. <code>error</code> can be constructor, <code>RegExp</code> or
<p>Expects <code>block</code> to throw an error. <code>error</code> can be a constructor, <code>RegExp</code>, or
validation function.
</p>
......@@ -2344,12 +2335,12 @@ validation function.
&quot;unexpected error&quot;
);</code></pre>
<h2>assert.doesNotThrow(block[, message])<span><a class="mark" href="#all_assert_doesnotthrow_block_message" id="all_assert_doesnotthrow_block_message">#</a></span></h2>
<p>Expects <code>block</code> not to throw an error, see <code>assert.throws</code> for details.
<p>Expects <code>block</code> not to throw an error. See <code>assert.throws()</code> for details.
</p>
<h2>assert.ifError(value)<span><a class="mark" href="#all_assert_iferror_value" id="all_assert_iferror_value">#</a></span></h2>
<p>Tests if value is not a false value, throws if it is a true value. Useful when
testing the first argument, <code>error</code> in callbacks.
<p>Throws <code>value</code> if <code>value</code> is truthy. This is useful when testing the <code>error</code>
argument in callbacks.
</p>
<h1>Buffer<span><a class="mark" href="#all_buffer" id="all_buffer">#</a></span></h1>
......@@ -7606,9 +7597,9 @@ provided by Node.js -- even user created event emitters and streams will throw
errors when no error handlers are attached. An example:
</p>
<pre><code class="javascript">var events = require(&#39;events&#39;);
<pre><code class="javascript">var EventEmitter = require(&#39;events&#39;);
var ee = new events.EventEmitter;
var ee = new EventEmitter();
setImmediate(function() {
// this will crash the process because no &quot;error&quot; event
......@@ -7802,7 +7793,7 @@ constructor function. For example:
</p>
<pre><code>&#39;use strict&#39;;
const util = require(&#39;util&#39;);
const EventEmitter = require(&#39;events&#39;).EventEmitter;
const EventEmitter = require(&#39;events&#39;);
function MyEventEmitter() {
// Initialize necessary properties from `EventEmitter` in this instance
......@@ -10678,7 +10669,7 @@ which is probably not what you want to do.
<p>For example suppose we were making a module called <code>a.js</code>
</p>
<pre><code>var EventEmitter = require(&#39;events&#39;).EventEmitter;
<pre><code>var EventEmitter = require(&#39;events&#39;);
module.exports = new EventEmitter();
......@@ -12170,8 +12161,8 @@ checks on the module&#39;s state (like for unit tests). The callback takes one
argument, the code the process is exiting with.
</p>
<p>This event may not be fired if the process terminates due to signals like
<code>SIGINT</code>, <code>SIGTERM</code>, <code>SIGKILL</code>, and <code>SIGHUP</code>.
<p>This event is only emitted when node exits explicitly by process.exit() or
implicitly by the event loop draining.
</p>
<p>Example of listening for <code>exit</code>:
......@@ -12365,12 +12356,12 @@ readable tty is used in raw mode.</li>
<li><code>SIGKILL</code> cannot have a listener installed, it will unconditionally terminate
Node.js on all platforms.</li>
<li><code>SIGSTOP</code> cannot have a listener installed.</li>
<li>Sending <code>SIGINT</code>, <code>SIGTERM</code>, and <code>SIGKILL</code> cause the unconditional exit of the
target process.</li>
</ul>
<p>Note that Windows does not support sending Signals, but Node.js offers some
emulation with <code>process.kill()</code>, and <code>child_process.kill()</code>. Sending signal <code>0</code>
can be used to test for the existence of a process
can be used to test for the existence of a process. Sending <code>SIGINT</code>,
<code>SIGTERM</code>, and <code>SIGKILL</code> cause the unconditional termination of the target
process.
</p>
<h2>process.stdout<span><a class="mark" href="#all_process_stdout" id="all_process_stdout">#</a></span></h2>
......@@ -17133,13 +17124,13 @@ through the <code>constructor.super_</code> property.
</p>
<pre><code>var util = require(&quot;util&quot;);
var events = require(&quot;events&quot;);
var EventEmitter = require(&quot;events&quot;);
function MyStream() {
events.EventEmitter.call(this);
EventEmitter.call(this);
}
util.inherits(MyStream, events.EventEmitter);
util.inherits(MyStream, EventEmitter);
MyStream.prototype.write = function(data) {
this.emit(&quot;data&quot;, data);
......@@ -17147,8 +17138,8 @@ MyStream.prototype.write = function(data) {
var stream = new MyStream();
console.log(stream instanceof events.EventEmitter); // true
console.log(MyStream.super_ === events.EventEmitter); // true
console.log(stream instanceof EventEmitter); // true
console.log(MyStream.super_ === EventEmitter); // true
stream.on(&quot;data&quot;, function(data) {
console.log(&#39;Received data: &quot;&#39; + data + &#39;&quot;&#39;);
......
This diff is collapsed.
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Assert Node.js v4.1.0 Manual &amp; Documentation</title>
<title>Assert Node.js v4.1.1 Manual &amp; Documentation</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700,400italic">
<link rel="stylesheet" href="assets/style.css">
<link rel="stylesheet" href="assets/sh.css">
......@@ -61,7 +61,7 @@
<div id="column1" data-id="assert" class="interior">
<header>
<h1>Node.js v4.1.0 Documentation</h1>
<h1>Node.js v4.1.1 Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -97,7 +97,7 @@
<div id="apicontent">
<h1>Assert<span><a class="mark" href="#assert_assert" id="assert_assert">#</a></span></h1>
<pre class="api_stability_2">Stability: 2 - Stable</pre><p>This module is used for writing unit tests for your applications, you can
<pre class="api_stability_2">Stability: 2 - Stable</pre><p>This module is used for writing unit tests for your applications. You can
access it with <code>require(&#39;assert&#39;)</code>.