Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5.11.0 proposal #6322

Closed
wants to merge 90 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
8da4bad
test: fix pummel test failures
Trott Apr 2, 2016
fbc99ba
src: add missing 'inline' keywords
bnoordhuis Apr 5, 2016
bc0ee06
doc: note about Android support
Trott Apr 4, 2016
a27e952
test: enforce strict mode for test-domain-crypto
Trott Apr 4, 2016
a5f8d0c
build: remove -f{data,function}-sections flags
bnoordhuis Apr 6, 2016
07829b0
doc: simple doc typo fix
BrendonPierson Apr 4, 2016
96ad5c5
doc: update openssl LICENSE using license-builder.sh
srl295 Apr 5, 2016
632e6b9
deps: backport 125ac66 from v8 upstream
Apr 6, 2016
6bb7999
test: refactor test-file-write-stream3
Trott Apr 5, 2016
440d117
doc: add example using algorithms not directly exposed
hillbrad Apr 7, 2016
d44540f
buffer: standardize array index check
trevnorris Apr 6, 2016
a81fca4
doc: add topic - event loop, timers, `nextTick()`
techjeffharris Apr 8, 2016
2254f1a
repl: refactor repl.js
Trott Apr 6, 2016
fc89d17
path: fixing a test that breaks on some machines.
Apr 5, 2016
476535c
test: fix flaky test-http-client-abort
Trott Apr 8, 2016
a40d0e8
doc: fix scrolling on iOS devices
lpinca Mar 23, 2016
a2dd848
tools,doc: fix incomplete json produced by doctool
firedfox Mar 31, 2016
69eb4a6
tools,doc: fix json for grouped optional params
firedfox Mar 31, 2016
5e6915f
doc: describe child.kill() pitfalls on linux
eljefedelrodeodeljefe Apr 5, 2016
daaad47
doc: clarification for maxBuffer and Unicode output
jasnell Apr 9, 2016
b26fea1
doc: add copy about how to curl SHA256.txt
Apr 8, 2016
4392b4a
stream: Fix readableState.awaitDrain mechanism
addaleax Apr 2, 2016
fabc33a
tools: remove simplejson dependency
thefourtheye Apr 7, 2016
a38b614
test: fix flaky test-child-process-fork-net
Trott Apr 9, 2016
a7104e4
deps: cherry-pick 1383d00 from v8 upstream
indutny Apr 13, 2016
f69416c
streams: support unlimited synchronous cork/uncork cycles
mcollina Apr 12, 2016
6bc3bde
doc: fix incorrect references in buffer docs
Amery2010 Apr 14, 2016
1d669ab
deps: upgrade npm to 3.8.6
zkat Apr 11, 2016
f8c0ab9
deps: floating fix for npm's test-node script
zkat Apr 11, 2016
5807f9d
benchmark: add module loader benchmark parameter
mscdex Feb 10, 2016
3364703
doc: add addaleax to collaborators
addaleax Apr 15, 2016
9d3317a
doc: add santigimeno to collaborators
santigimeno Apr 15, 2016
4a2b53a
doc: add iWuzHere to collaborators
imran-iq Apr 15, 2016
02bf459
doc: add stefanmb to collaborators
stefanmb Apr 15, 2016
1796e49
doc: add domain postmortem
trevnorris Apr 11, 2016
01d4522
test,vm: enable strict mode for vm tests
Trott Apr 15, 2016
bb97de0
doc: clarify fs.watch() and inodes on linux, os x
jorangreef Apr 7, 2016
0658632
tools,doc: parse types in braces everywhere
estliberitas Feb 20, 2016
fbb0a06
process: fix incorrect usage of assert.fail()
Trott Apr 15, 2016
90eb765
doc: native module reloading is not supported
bengl Apr 12, 2016
5c4395b
doc: explain differences in console.assert between node and browsers
jasnell Apr 12, 2016
93f91c6
gitignore: ignore VS 2015 *.VC.opendb files
Apr 5, 2016
90aabb9
gitignore: adding .vs/ directory to .gitignore
Apr 13, 2016
fb64630
tools: fix license-builder.sh again for ICU
srl295 Apr 5, 2016
ea8fe04
doc: document intention and dangers of fs module Buffer API
seishun Apr 2, 2016
5bf8d1a
doc: fix http response event, Agent#getName
mdouglass Apr 1, 2016
038801d
doc: DCO anchor that doesn't change
williamkapke Apr 18, 2016
91001d3
doc: replace functions with arrow functions
hiroppy Apr 14, 2016
85cb9bb
assert: respect assert.doesNotThrow message.
Aug 17, 2015
68c3283
test: fix test-net-settimeout flakiness
santigimeno Apr 12, 2016
1af0e44
test: fix flaky test-http-set-timeout-server
santigimeno Apr 15, 2016
3ce59ab
tools: update ESLint to 2.7.0
silverwind Apr 9, 2016
8077b89
test: fix issues for ESLint 2.7.0
silverwind Apr 9, 2016
90c12a9
lib,test,tools: alignment on variable assignments
Trott Apr 16, 2016
7ea5e43
tools: lint for alignment of variable assignments
Trott Apr 16, 2016
713f6ff
tools: improve js linter
mscdex Mar 10, 2016
95e9c06
build: allow test-ci to run tests in parallel
jbergstroem Apr 15, 2016
b0ba16f
test: move the debugger tests back to parallel
santigimeno Apr 15, 2016
9293946
test: move some test from sequential to parallel
santigimeno Apr 5, 2016
b8ae1b8
doc: path.format provide more examples
eversojk Mar 22, 2016
6892536
tools: move message listener to worker objects
mscdex Apr 15, 2016
b74ddea
doc: fix broken references
gromnitsky Apr 13, 2016
8779967
test: move debugger tests to sequential
Trott Apr 14, 2016
8ccfb87
http: unref socket timer on parser execute
indutny Apr 19, 2016
052d87c
stream_base: expose `bytesRead` getter
indutny Apr 19, 2016
36c58da
net: replace __defineGetter__ with defineProperty
indutny Apr 20, 2016
24ec701
buffer: add Buffer.prototype.compare by offset
jasnell Mar 23, 2016
9f2dc70
src: add SIGINFO to supported signals
jamesreggio Apr 7, 2016
b7dd451
deps: update to http-parser 2.7.0
indutny Apr 19, 2016
f6969a1
http: skip body and next message of CONNECT res
indutny Apr 19, 2016
1ef18bd
test: add test for responses to HTTP CONNECT req
slushie Apr 19, 2016
68cf6a5
build: fix make tar-headers for Linux
gibfahn Mar 31, 2016
8877703
tools: enable linting for v8_prof_processor.js
Trott Apr 18, 2016
73eac79
tools: lint rule for assert.fail()
Trott Apr 18, 2016
fb2a978
test,tools: enable linting for undefined vars
Trott Apr 18, 2016
df93d6b
test: assert - fixed error messages to match the tests
suryagh Apr 16, 2016
2e6e2d6
child_process: add nullptr checks after allocs
addaleax Apr 18, 2016
033b21b
test: move more tests from sequential to parallel
santigimeno Apr 9, 2016
5c9dddf
debugger: run last command on presssing enter
Trott Apr 6, 2016
3a5dd02
zlib: detect gzip files when using unzip*
addaleax Mar 24, 2016
2ac14ee
zlib: Make the finish flush flag configurable
addaleax Apr 5, 2016
87e0734
node: make builtin libs available for `--eval`
addaleax Apr 15, 2016
40945e0
repl: keep the built-in modules non-enumerable
addaleax Apr 18, 2016
9f9371b
doc: note that zlib.flush acts after pending writes
addaleax Apr 12, 2016
02a84e2
doc: add full example for zlib.flush()
addaleax Apr 19, 2016
5874502
doc: git mv to .md
eljefedelrodeodeljefe Apr 20, 2016
d9cd449
http: disallow sending obviously invalid status codes
mscdex Apr 20, 2016
4f6f599
zlib: fix use after null when calling .close
lightsofapollo Mar 31, 2016
3bacd19
test: add zlib close-after-error regression test
addaleax Apr 18, 2016
8dc1d5e
2016-04-21, Version 5.11.0 (Stable) Release
Apr 20, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
assert: respect assert.doesNotThrow message.
Special handling to detect when user has supplied a custom message.
Added a test for user message.
When testing if `actual` value is an error use
`util.isError` instead of `instanceof`.

Fixes: #2385
PR-URL: #2407
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
Ilya Shaisultanov authored and MylesBorins committed Apr 21, 2016
commit 85cb9bb31dbe5103c257d2a559f2dc61ad97ea76
9 changes: 8 additions & 1 deletion lib/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,14 @@ function _throws(shouldThrow, block, expected, message) {
fail(actual, expected, 'Missing expected exception' + message);
}

if (!shouldThrow && expectedException(actual, expected)) {
const userProvidedMessage = typeof message === 'string';
const isUnwantedException = !shouldThrow && util.isError(actual);
const isUnexpectedException = !shouldThrow && actual && !expected;

if ((isUnwantedException &&
userProvidedMessage &&
expectedException(actual, expected)) ||
isUnexpectedException) {
fail(actual, expected, 'Got unwanted exception' + message);
}

Expand Down
5 changes: 5 additions & 0 deletions test/parallel/test-assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,11 @@ assert.throws(function() {assert.ifError(new Error('test error'));});
assert.doesNotThrow(function() {assert.ifError(null);});
assert.doesNotThrow(function() {assert.ifError();});

assert.throws(() => {
assert.doesNotThrow(makeBlock(thrower, Error), 'user message');
}, /Got unwanted exception. user message/,
'a.doesNotThrow ignores user message');

// make sure that validating using constructor really works
threw = false;
try {
Expand Down