Commit 47b69cb4 authored by Jérémy Lal's avatar Jérémy Lal

Imported Upstream version 5.2.0~dfsg

parent 713b46af
lib/internal/v8_prof_polyfill.js
lib/punycode.js
test/addons/doc-*/
test/fixtures
......
......@@ -44,6 +44,7 @@ ipch/
/config.mk
/config.gypi
/config_fips.gypi
*-nodegyp*
/gyp-mac-tool
/dist-osx
......
This diff is collapsed.
......@@ -74,7 +74,7 @@ clean:
distclean:
-rm -rf out
-rm -f config.gypi icu_config.gypi
-rm -f config.gypi icu_config.gypi config_fips.gypi
-rm -f config.mk
-rm -rf $(NODE_EXE) $(NODE_G_EXE)
-rm -rf node_modules
......
......@@ -3,6 +3,11 @@ 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)
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
efficient. The Node.js package ecosystem, npm, is the largest ecosystem of open
source libraries in the world.
The Node.js project is supported by the
[Node.js Foundation](https://nodejs.org/en/foundation/). Contributions,
policies and releases are managed under an
......@@ -147,7 +152,7 @@ $ man doc/node.1
To test if Node.js was built correctly:
```
$ node -e "console.log('Hello from node.js ' + process.version)"
$ node -e "console.log('Hello from Node.js ' + process.version)"
```
### Windows
......@@ -174,7 +179,7 @@ To run the tests:
To test if Node.js was built correctly:
```
$ node -e "console.log('Hello from node.js ' + process.version)"
$ node -e "console.log('Hello from Node.js ' + process.version)"
```
### Android / Android based devices, aka. Firefox OS
......@@ -350,10 +355,10 @@ Instructions:
## Security
All security bugs in node.js are taken seriously and should be reported by
All security bugs in Node.js are taken seriously and should be reported by
emailing security@nodejs.org. This will be delivered to a subset of the project
team who handle security issues. Please don't disclose security bugs
public until they have been handled by the security team.
publicly until they have been handled by the security team.
Your email will be acknowledged within 24 hours, and you’ll receive a more
detailed response to your email within 48 hours indicating the next steps in
......@@ -389,10 +394,12 @@ information about the governance of the Node.js project, see
* [domenic](https://github.com/domenic) - **Domenic Denicola** <d@domenic.me>
* [evanlucas](https://github.com/evanlucas) - **Evan Lucas** <evanlucas@me.com>
* [geek](https://github.com/geek) - **Wyatt Preul** <wpreul@gmail.com>
* [iarna](https://github.com/iarna) - **Rebecca Turner** <me@re-becca.org>
* [isaacs](https://github.com/isaacs) - **Isaac Z. Schlueter** <i@izs.me>
* [jbergstroem](https://github.com/jbergstroem) - **Johan Bergström** <bugs@bergstroem.nu>
* [joaocgreis](https://github.com/joaocgreis) - **João Reis** <reis@janeasystems.com>
* [julianduque](https://github.com/julianduque) - **Julian Duque** <julianduquej@gmail.com>
* [JungMinu](https://github.com/JungMinu) - **Minwoo Jung** <jmwsoft@gmail.com>
* [lxe](https://github.com/lxe) - **Aleksey Smolenchuk** <lxe@lxe.co>
* [mhdawson](https://github.com/mhdawson) - **Michael Dawson** <michael_dawson@ca.ibm.com>
* [micnic](https://github.com/micnic) - **Nicu Micleușanu** <micnic90@gmail.com>
......@@ -419,6 +426,7 @@ information about the governance of the Node.js project, see
* [tunniclm](https://github.com/tunniclm) - **Mike Tunnicliffe** <m.j.tunnicliffe@gmail.com>
* [vkurchatkin](https://github.com/vkurchatkin) - **Vladimir Kurchatkin** <vladimir.kurchatkin@gmail.com>
* [yosuke-furukawa](https://github.com/yosuke-furukawa) - **Yosuke Furukawa** <yosuke.furukawa@gmail.com>
* [zkat](https://github.com/zkat) - **Kat Marchán** <kzm@sykosomatic.org>
Collaborators & TSC members follow the [COLLABORATOR_GUIDE.md](./COLLABORATOR_GUIDE.md) in
maintaining the Node.js project.
......
......@@ -29,9 +29,13 @@ back in to the TSC.
* [Addon API](#addon-api)
* [Benchmarking](#benchmarking)
* [Post-mortem](#post-mortem)
* [Intl](#intl)
* [HTTP](#http)
#### Process:
* [Starting a Working Group](#starting-a-wg)
* [Bootstrap Governance](#bootstrap-governance)
* [Intl](#Intl)
### [Website](https://github.com/nodejs/website)
......@@ -170,6 +174,19 @@ Their responsibilities are:
* Publishing regular update summaries and other promotional
content.
### [HTTP](https://github.com/nodejs/http)
The HTTP working group is chartered for the support and improvement of the
HTTP implementation in Node. It's responsibilities are:
* Addressing HTTP issues on the Node.js issue tracker.
* Authoring and editing HTTP documentation within the Node.js project.
* Reviewing changes to HTTP functionality within the Node.js project.
* Working with the ecosystem of HTTP related module developers to evolve the
HTTP implementation and APIs in core.
* Advising the CTC on all HTTP related issues and discussions.
* Messaging about the future of HTTP to give the community advance notice of
changes.
### [Roadmap](https://github.com/nodejs/roadmap)
......
......@@ -42,7 +42,7 @@ ab_hello_world() {
data_fn="$dir/$date.data"
echo "Bench $name starts in 3 seconds..."
# let shit calm down
# let things calm down
sleep 3
# hammer that as hard as it can for 10 seconds.
......
......@@ -84,7 +84,21 @@ parser.add_option("--fully-static",
action="store_true",
dest="fully_static",
help="Generate an executable without external dynamic libraries. This "
"will not work on OSX when using default compilation environment")
"will not work on OSX when using the default compilation environment")
parser.add_option("--partly-static",
action="store_true",
dest="partly_static",
help="Generate an executable with libgcc and libstdc++ libraries. This "
"will not work on OSX when using the default compilation environment")
parser.add_option("--enable-vtune-profiling",
action="store_true",
dest="enable_vtune_profiling",
help="Enable profiling support for Intel Vtune profiler to profile"
"JavaScript code executed in nodejs. This feature is only available "
"for ia32, x32 or x64 platform.")
parser.add_option("--link-module",
action="append",
......@@ -679,6 +693,15 @@ def configure_node(o):
o['variables']['node_core_target_name'] = 'node_base'
o['variables']['node_target_type'] = 'static_library'
if target_arch in ('x86', 'x64', 'ia32', 'x32'):
o['variables']['node_enable_v8_vtunejit'] = b(options.enable_vtune_profiling)
elif options.enable_vtune_profiling:
raise Exception(
'vtune profiler for JavaScript is only supported on x86, x32 or x64 '
'platform.')
else:
o['variables']['node_enable_v8_vtunejit'] = 'false'
if flavor in ('solaris', 'mac', 'linux', 'freebsd'):
use_dtrace = not options.without_dtrace
# Don't enable by default on linux and freebsd
......@@ -777,7 +800,7 @@ def configure_v8(o):
o['variables']['v8_no_strict_aliasing'] = 1 # Work around compiler bugs.
o['variables']['v8_optimized_debug'] = 0 # Compile with -O0 in debug builds.
o['variables']['v8_random_seed'] = 0 # Use a random seed for hash tables.
o['variables']['v8_use_snapshot'] = 0 if options.without_snapshot else 1
o['variables']['v8_use_snapshot'] = 'false' if options.without_snapshot else 'true'
def configure_openssl(o):
o['variables']['node_use_openssl'] = b(not options.without_ssl)
......@@ -787,7 +810,7 @@ def configure_openssl(o):
o['variables']['openssl_fips'] = options.openssl_fips
fips_dir = os.path.join(root_dir, 'deps', 'openssl', 'fips')
fips_ld = os.path.abspath(os.path.join(fips_dir, 'fipsld'))
o['make_global_settings'] = [
o['make_fips_settings'] = [
['LINK', fips_ld + ' <(openssl_fips)/bin/fipsld'],
]
else:
......@@ -799,12 +822,19 @@ def configure_openssl(o):
configure_library('openssl', o)
def configure_fullystatic(o):
if options.fully_static:
o['libraries'] += ['-static']
def configure_static(o):
if options.fully_static or options.partly_static:
if flavor == 'mac':
print("Generation of static executable will not work on OSX "
"when using default compilation environment")
"when using the default compilation environment")
return
if options.fully_static:
o['libraries'] += ['-static']
elif options.partly_static:
o['libraries'] += ['-static-libgcc', '-static-libstdc++']
if options.enable_asan:
o['libraries'] += ['-static-libasan']
def configure_winsdk(o):
......@@ -1102,13 +1132,22 @@ configure_v8(output)
configure_openssl(output)
configure_winsdk(output)
configure_intl(output)
configure_fullystatic(output)
configure_static(output)
# variables should be a root level element,
# move everything else to target_defaults
variables = output['variables']
del output['variables']
# make_global_settings for special FIPS linking
# should not be used to compile modules in node-gyp
config_fips = { 'make_global_settings' : [] }
if 'make_fips_settings' in output:
config_fips['make_global_settings'] = output['make_fips_settings']
del output['make_fips_settings']
write('config_fips.gypi', do_not_edit +
pprint.pformat(config_fips, indent=2) + '\n')
# make_global_settings should be a root level element too
if 'make_global_settings' in output:
make_global_settings = output['make_global_settings']
......
......@@ -553,7 +553,7 @@ bool AstNumberingVisitor::Renumber(FunctionLiteral* node) {
Scope* scope = node->scope();
if (scope->HasIllegalRedeclaration()) {
scope->VisitIllegalRedeclaration(this);
Visit(scope->GetIllegalRedeclaration());
DisableOptimization(kFunctionWithIllegalRedeclaration);
return Finish(node);
}
......
......@@ -586,8 +586,7 @@ void AstGraphBuilder::CreateGraphBody(bool stack_check) {
// Visit illegal re-declaration and bail out if it exists.
if (scope->HasIllegalRedeclaration()) {
AstEffectContext for_effect(this);
scope->VisitIllegalRedeclaration(this);
VisitForEffect(scope->GetIllegalRedeclaration());
return;
}
......
......@@ -218,10 +218,10 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
switch (function) {
case Runtime::kAllocateInTargetSpace:
case Runtime::kDateField:
case Runtime::kFinalizeClassDefinition: // TODO(conradw): Is it safe?
case Runtime::kDefineClassMethod: // TODO(jarin): Is it safe?
case Runtime::kDefineGetterPropertyUnchecked: // TODO(jarin): Is it safe?
case Runtime::kDefineSetterPropertyUnchecked: // TODO(jarin): Is it safe?
case Runtime::kFinalizeClassDefinition: // TODO(conradw): Is it safe?
case Runtime::kForInDone:
case Runtime::kForInStep:
case Runtime::kGetOriginalConstructor:
......@@ -244,6 +244,7 @@ int Linkage::FrameStateInputCount(Runtime::FunctionId function) {
case Runtime::kInlineGetCallerJSFunction:
case Runtime::kInlineGetPrototype:
case Runtime::kInlineRegExpExec:
case Runtime::kInlineSubString:
case Runtime::kInlineToObject:
return 1;
case Runtime::kInlineDeoptimizeNow:
......
......@@ -338,7 +338,7 @@ void FullCodeGenerator::Generate() {
// redeclaration.
if (scope()->HasIllegalRedeclaration()) {
Comment cmnt(masm_, "[ Declarations");
scope()->VisitIllegalRedeclaration(this);
VisitForEffect(scope()->GetIllegalRedeclaration());
} else {
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);
......
......@@ -344,7 +344,7 @@ void FullCodeGenerator::Generate() {
// redeclaration.
if (scope()->HasIllegalRedeclaration()) {
Comment cmnt(masm_, "[ Declarations");
scope()->VisitIllegalRedeclaration(this);
VisitForEffect(scope()->GetIllegalRedeclaration());
} else {
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);
......
......@@ -341,7 +341,7 @@ void FullCodeGenerator::Generate() {
// redeclaration.
if (scope()->HasIllegalRedeclaration()) {
Comment cmnt(masm_, "[ Declarations");
scope()->VisitIllegalRedeclaration(this);
VisitForEffect(scope()->GetIllegalRedeclaration());
} else {
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);
......
......@@ -356,7 +356,7 @@ void FullCodeGenerator::Generate() {
// redeclaration.
if (scope()->HasIllegalRedeclaration()) {
Comment cmnt(masm_, "[ Declarations");
scope()->VisitIllegalRedeclaration(this);
VisitForEffect(scope()->GetIllegalRedeclaration());
} else {
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);
......
......@@ -351,7 +351,7 @@ void FullCodeGenerator::Generate() {
// redeclaration.
if (scope()->HasIllegalRedeclaration()) {
Comment cmnt(masm_, "[ Declarations");
scope()->VisitIllegalRedeclaration(this);
VisitForEffect(scope()->GetIllegalRedeclaration());
} else {
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);
......
......@@ -349,7 +349,7 @@ void FullCodeGenerator::Generate() {
// redeclaration.
if (scope()->HasIllegalRedeclaration()) {
Comment cmnt(masm_, "[ Declarations");
scope()->VisitIllegalRedeclaration(this);
VisitForEffect(scope()->GetIllegalRedeclaration());
} else {
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);
......
......@@ -338,7 +338,7 @@ void FullCodeGenerator::Generate() {
// redeclaration.
if (scope()->HasIllegalRedeclaration()) {
Comment cmnt(masm_, "[ Declarations");
scope()->VisitIllegalRedeclaration(this);
VisitForEffect(scope()->GetIllegalRedeclaration());
} else {
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);
......
......@@ -338,7 +338,7 @@ void FullCodeGenerator::Generate() {
// redeclaration.
if (scope()->HasIllegalRedeclaration()) {
Comment cmnt(masm_, "[ Declarations");
scope()->VisitIllegalRedeclaration(this);
VisitForEffect(scope()->GetIllegalRedeclaration());
} else {
PrepareForBailoutForId(BailoutId::FunctionEntry(), NO_REGISTERS);
......
......@@ -1279,9 +1279,14 @@ void Isolate::ComputeLocation(MessageLocation* target) {
Object* script = fun->shared()->script();
if (script->IsScript() &&
!(Script::cast(script)->source()->IsUndefined())) {
int pos = frame->LookupCode()->SourcePosition(frame->pc());
// Compute the location from the function and the reloc info.
Handle<Script> casted_script(Script::cast(script));
// Compute the location from the function and the relocation info of the
// baseline code. For optimized code this will use the deoptimization
// information to get canonical location information.
List<FrameSummary> frames(FLAG_max_inlining_levels + 1);
it.frame()->Summarize(&frames);
FrameSummary& summary = frames.last();
int pos = summary.code()->SourcePosition(summary.pc());
*target = MessageLocation(casted_script, pos, pos + 1, handle(fun));
}
}
......
......@@ -550,9 +550,9 @@ void Scope::SetIllegalRedeclaration(Expression* expression) {
}
void Scope::VisitIllegalRedeclaration(AstVisitor* visitor) {
Expression* Scope::GetIllegalRedeclaration() {
DCHECK(HasIllegalRedeclaration());
illegal_redecl_->Accept(visitor);
return illegal_redecl_;
}
......
......@@ -189,9 +189,9 @@ class Scope: public ZoneObject {
// the additional requests will be silently ignored.
void SetIllegalRedeclaration(Expression* expression);
// Visit the illegal redeclaration expression. Do not call if the
// Retrieve the illegal redeclaration expression. Do not call if the
// scope doesn't have an illegal redeclaration node.
void VisitIllegalRedeclaration(AstVisitor* visitor);
Expression* GetIllegalRedeclaration();
// Check if the scope has (at least) one illegal redeclaration.
bool HasIllegalRedeclaration() const { return illegal_redecl_ != NULL; }
......
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title> Node.js v5.1.1 Manual &amp; Documentation</title>
<title> Node.js v5.2.0 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 v5.1.1 Documentation</h1>
<h1>Node.js v5.2.0 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 v5.1.1 Manual &amp; Documentation</title>
<title>Addons Node.js v5.2.0 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 v5.1.1 Documentation</h1>
<h1>Node.js v5.2.0 Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -220,7 +220,7 @@ console.log(addon.hello()); // &#39;world&#39;</code></pre>
<h2>Addon patterns<span><a class="mark" href="#addons_addon_patterns" id="addons_addon_patterns">#</a></span></h2>
<p>Below are some addon patterns to help you get started. Consult the online
<a href="http://izs.me/v8-docs/main.html">v8 reference</a> for help with the various v8 calls, and v8&#39;s
<a href="http://code.google.com/apis/v8/embed.html">Embedder&#39;s Guide</a> for an explanation of several concepts used such as
<a href="https://code.google.com/apis/v8/embed.html">Embedder&#39;s Guide</a> for an explanation of several concepts used such as
handles, scopes, function templates, etc.
</p>
......
......@@ -871,4 +871,4 @@ Test in JavaScript by running:
[download]: https://github.com/rvagg/node-addon-examples
[node-gyp]: https://github.com/nodejs/node-gyp
[v8 reference]: http://izs.me/v8-docs/main.html
[Embedder's Guide]: http://code.google.com/apis/v8/embed.html
[Embedder's Guide]: https://code.google.com/apis/v8/embed.html
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
......@@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<title>Assert Node.js v5.1.1 Manual &amp; Documentation</title>
<title>Assert Node.js v5.2.0 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 v5.1.1 Documentation</h1>
<h1>Node.js v5.2.0 Documentation</h1>
<div id="gtoc">
<p>
<a href="index.html" name="toc">Index</a> |
......@@ -115,7 +115,7 @@ comparison operator ( <code>==</code> ).
<p>This only considers enumerable properties. It does not test object prototypes,
attached symbols, or non-enumerable properties. This can lead to some
potentially surprising results. For example, this does not throw an
<code>AssertionError</code> because the properties on the <code>Error</code> object are
<code>AssertionError</code> because the properties on the <a href="errors.html#errors_class_error"><code>Error</code></a> object are
non-enumerable:
</p>
......@@ -127,12 +127,12 @@ operator ( <code>===</code> ).
</p>
<h2>assert.doesNotThrow(block[, error][, message])<span><a class="mark" href="#assert_assert_doesnotthrow_block_error_message" id="assert_assert_doesnotthrow_block_error_message">#</a></span></h2>
<p>Expects <code>block</code> not to throw an error. See <a href="#assert_assert_throws_block_error_message">assert.throws()</a> for more details.
<p>Expects <code>block</code> not to throw an error. See <a href="#assert_assert_throws_block_error_message"><code>assert.throws()</code></a> for more details.
</p>
<p>If <code>block</code> throws an error and if it is of a different type from <code>error</code>, the
thrown error will get propagated back to the caller. The following call will
throw the <code>TypeError</code>, since we&#39;re not matching the error types in the
throw the <a href="errors.html#errors_class_typeerror"><code>TypeError</code></a>, since we&#39;re not matching the error types in the
assertion.
</p>
......@@ -167,11 +167,11 @@ argument in callbacks.
</p>
<h2>assert.notDeepEqual(actual, expected[, message])<span><a class="mark" href="#assert_assert_notdeepequal_actual_expected_message" id="assert_assert_notdeepequal_actual_expected_message">#</a></span></h2>
<p>Tests for any deep inequality. Opposite of <code>assert.deepEqual</code>.
<p>Tests for any deep inequality. Opposite of <a href="#assert_assert_deepequal_actual_expected_message"><code>assert.deepEqual</code></a>.
</p>
<h2>assert.notDeepStrictEqual(actual, expected[, message])<span><a class="mark" href="#assert_assert_notdeepstrictequal_actual_expected_message" id="assert_assert_notdeepstrictequal_actual_expected_message">#</a></span></h2>
<p>Tests for deep inequality. Opposite of <code>assert.deepStrictEqual</code>.
<p>Tests for deep inequality. Opposite of <a href="#assert_assert_deepstrictequal_actual_expected_message"><code>assert.deepStrictEqual</code></a>.
</p>
<h2>assert.notEqual(actual, expected[, message])<span><a class="mark" href="#assert_assert_notequal_actual_expected_message" id="assert_assert_notequal_actual_expected_message">#</a></span></h2>
......@@ -189,7 +189,7 @@ argument in callbacks.
</p>
<h2>assert.throws(block[, error][, message])<span><a class="mark" href="#assert_assert_throws_block_error_message" id="assert_assert_throws_block_error_message">#</a></span></h2>
<p>Expects <code>block</code> to throw an error. <code>error</code> can be a constructor, <code>RegExp</code>, or
<p>Expects <code>block</code> to throw an error. <code>error</code> can be a constructor, <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions"><code>RegExp</code></a>, or
validation function.
</p>
......@@ -202,7 +202,7 @@ validation function.
},
Error
);</code></pre>
<p>Validate error message using RegExp:
<p>Validate error message using <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions"><code>RegExp</code></a>:
</p>
<pre><code>assert.throws(
......
......@@ -37,7 +37,7 @@
"textRaw": "assert.deepEqual(actual, expected[, message])",
"type": "method",
"name": "deepEqual",
"desc": "<p>Tests for deep equality. Primitive values are compared with the equal\ncomparison operator ( <code>==</code> ).\n\n</p>\n<p>This only considers enumerable properties. It does not test object prototypes,\nattached symbols, or non-enumerable properties. This can lead to some\npotentially surprising results. For example, this does not throw an\n<code>AssertionError</code> because the properties on the <code>Error</code> object are\nnon-enumerable:\n\n</p>\n<pre><code>// WARNING: This does not throw an AssertionError!\nassert.deepEqual(Error(&#39;a&#39;), Error(&#39;b&#39;));</code></pre>\n",
"desc": "<p>Tests for deep equality. Primitive values are compared with the equal\ncomparison operator ( <code>==</code> ).\n\n</p>\n<p>This only considers enumerable properties. It does not test object prototypes,\nattached symbols, or non-enumerable properties. This can lead to some\npotentially surprising results. For example, this does not throw an\n<code>AssertionError</code> because the properties on the [<code>Error</code>][] object are\nnon-enumerable:\n\n</p>\n<pre><code>// WARNING: This does not throw an AssertionError!\nassert.deepEqual(Error(&#39;a&#39;), Error(&#39;b&#39;));</code></pre>\n",
"signatures": [
{
"params": [
......@@ -81,7 +81,7 @@
"textRaw": "assert.doesNotThrow(block[, error][, message])",
"type": "method",
"name": "doesNotThrow",
"desc": "<p>Expects <code>block</code> not to throw an error. See [assert.throws()][] for more details.\n\n</p>\n<p>If <code>block</code> throws an error and if it is of a different type from <code>error</code>, the\nthrown error will get propagated back to the caller. The following call will\nthrow the <code>TypeError</code>, since we&#39;re not matching the error types in the\nassertion.\n\n</p>\n<pre><code>assert.doesNotThrow(\n function() {\n throw new TypeError(&quot;Wrong value&quot;);\n },\n SyntaxError\n);</code></pre>\n<p>In case <code>error</code> matches with the error thrown by <code>block</code>, an <code>AssertionError</code>\nis thrown instead.\n\n</p>\n<pre><code>assert.doesNotThrow(\n function() {\n throw new TypeError(&quot;Wrong value&quot;);\n },\n TypeError\n);</code></pre>\n",
"desc": "<p>Expects <code>block</code> not to throw an error. See [<code>assert.throws()</code>][] for more details.\n\n</p>\n<p>If <code>block</code> throws an error and if it is of a different type from <code>error</code>, the\nthrown error will get propagated back to the caller. The following call will\nthrow the [<code>TypeError</code>][], since we&#39;re not matching the error types in the\nassertion.\n\n</p>\n<pre><code>assert.doesNotThrow(\n function() {\n throw new TypeError(&quot;Wrong value&quot;);\n },\n SyntaxError\n);</code></pre>\n<p>In case <code>error</code> matches with the error thrown by <code>block</code>, an <code>AssertionError</code>\nis thrown instead.\n\n</p>\n<pre><code>assert.doesNotThrow(\n function() {\n throw new TypeError(&quot;Wrong value&quot;);\n },\n TypeError\n);</code></pre>\n",
"signatures": [
{
"params": [
......@@ -165,7 +165,7 @@
"textRaw": "assert.notDeepEqual(actual, expected[, message])",
"type": "method",
"name": "notDeepEqual",
"desc": "<p>Tests for any deep inequality. Opposite of <code>assert.deepEqual</code>.\n\n</p>\n",
"desc": "<p>Tests for any deep inequality. Opposite of [<code>assert.deepEqual</code>][].\n\n</p>\n",
"signatures": [
{
"params": [
......@@ -187,7 +187,7 @@
"textRaw": "assert.notDeepStrictEqual(actual, expected[, message])",
"type": "method",
"name": "notDeepStrictEqual",
"desc": "<p>Tests for deep inequality. Opposite of <code>assert.deepStrictEqual</code>.\n\n</p>\n",
"desc": "<p>Tests for deep inequality. Opposite of [<code>assert.deepStrictEqual</code>][].\n\n</p>\n",
"signatures": [
{
"params": [
......@@ -275,7 +275,7 @@
"textRaw": "assert.throws(block[, error][, message])",
"type": "method",
"name": "throws",
"desc": "<p>Expects <code>block</code> to throw an error. <code>error</code> can be a constructor, <code>RegExp</code>, or\nvalidation function.\n\n</p>\n<p>Validate instanceof using constructor:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error(&quot;Wrong value&quot;);\n },\n Error\n);</code></pre>\n<p>Validate error message using RegExp:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error(&quot;Wrong value&quot;);\n },\n /value/\n);</code></pre>\n<p>Custom error validation:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error(&quot;Wrong value&quot;);\n },\n function(err) {\n if ( (err instanceof Error) &amp;&amp; /value/.test(err) ) {\n return true;\n }\n },\n &quot;unexpected error&quot;\n);</code></pre>\n",
"desc": "<p>Expects <code>block</code> to throw an error. <code>error</code> can be a constructor, [<code>RegExp</code>][], or\nvalidation function.\n\n</p>\n<p>Validate instanceof using constructor:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error(&quot;Wrong value&quot;);\n },\n Error\n);</code></pre>\n<p>Validate error message using [<code>RegExp</code>][]:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error(&quot;Wrong value&quot;);\n },\n /value/\n);</code></pre>\n<p>Custom error validation:\n\n</p>\n<pre><code>assert.throws(\n function() {\n throw new Error(&quot;Wrong value&quot;);\n },\n function(err) {\n if ( (err instanceof Error) &amp;&amp; /value/.test(err) ) {\n return true;\n }\n },\n &quot;unexpected error&quot;\n);</code></pre>\n",
"signatures": [
{
"params": [
......
......@@ -19,7 +19,7 @@ comparison operator ( `==` ).
This only considers enumerable properties. It does not test object prototypes,
attached symbols, or non-enumerable properties. This can lead to some
potentially surprising results. For example, this does not throw an
`AssertionError` because the properties on the `Error` object are
`AssertionError` because the properties on the [`Error`][] object are
non-enumerable:
// WARNING: This does not throw an AssertionError!
......@@ -32,11 +32,11 @@ operator ( `===` ).
## assert.doesNotThrow(block[, error][, message])
Expects `block` not to throw an error. See [assert.throws()][] for more details.
Expects `block` not to throw an error. See [`assert.throws()`][] for more details.
If `block` throws an error and if it is of a different type from `error`, the
thrown error will get propagated back to the caller. The following call will
throw the `TypeError`, since we're not matching the error types in the
throw the [`TypeError`][], since we're not matching the error types in the
assertion.
assert.doesNotThrow(
......@@ -72,11 +72,11 @@ argument in callbacks.
## assert.notDeepEqual(actual, expected[, message])
Tests for any deep inequality. Opposite of `assert.deepEqual`.
Tests for any deep inequality. Opposite of [`assert.deepEqual`][].
## assert.notDeepStrictEqual(actual, expected[, message])
Tests for deep inequality. Opposite of `assert.deepStrictEqual`.
Tests for deep inequality. Opposite of [`assert.deepStrictEqual`][].
## assert.notEqual(actual, expected[, message])
......@@ -94,7 +94,7 @@ Tests strict equality as determined by the strict equality operator ( `===` ).
## assert.throws(block[, error][, message])
Expects `block` to throw an error. `error` can be a constructor, `RegExp`, or
Expects `block` to throw an error. `error` can be a constructor, [`RegExp`][], or
validation function.
Validate instanceof using constructor:
......@@ -106,7 +106,7 @@ Validate instanceof using constructor:
Error
);
Validate error message using RegExp:
Validate error message using [`RegExp`][]:
assert.throws(
function() {
......@@ -129,4 +129,9 @@ Custom error validation:
"unexpected error"
);
[assert.throws()]: #assert_assert_throws_block_error_message