summaryrefslogtreecommitdiff
path: root/test/parallel/test-assert.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-04-14 21:37:03 +0200
committerRuben Bridgewater <ruben@bridgewater.de>2019-05-02 23:22:38 +0200
commitd0667e814e8be53d329a9c7f4849996c192395c9 (patch)
treeb9bd25e8aac5995f464f732c98e27912979a6258 /test/parallel/test-assert.js
parent57fd70fc7d3918a6bd4c714fe479488391a563f6 (diff)
downloadandroid-node-v8-d0667e814e8be53d329a9c7f4849996c192395c9.tar.gz
android-node-v8-d0667e814e8be53d329a9c7f4849996c192395c9.tar.bz2
android-node-v8-d0667e814e8be53d329a9c7f4849996c192395c9.zip
util: improve function inspection
This commit contains the following changes: 1) Add null prototype support for functions. 2) Safely detect async and generator functions. 3) Mark anonymous functions as such instead of just leaving out the name. PR-URL: https://github.com/nodejs/node/pull/27227 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'test/parallel/test-assert.js')
-rw-r--r--test/parallel/test-assert.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/parallel/test-assert.js b/test/parallel/test-assert.js
index 003e67b380..98f728acfa 100644
--- a/test/parallel/test-assert.js
+++ b/test/parallel/test-assert.js
@@ -289,7 +289,7 @@ testAssertionMessage(undefined, 'undefined');
testAssertionMessage(-Infinity, '-Infinity');
testAssertionMessage([1, 2, 3], '[\n+ 1,\n+ 2,\n+ 3\n+ ]');
testAssertionMessage(function f() {}, '[Function: f]');
-testAssertionMessage(function() {}, '[Function]');
+testAssertionMessage(function() {}, '[Function (anonymous)]');
testAssertionMessage(circular, '{\n+ x: [Circular],\n+ y: 1\n+ }');
testAssertionMessage({ a: undefined, b: null },
'{\n+ a: undefined,\n+ b: null\n+ }');
@@ -597,7 +597,7 @@ assert.throws(
'\n' +
'+ {}\n' +
'- {\n' +
- '- [Symbol(nodejs.util.inspect.custom)]: [Function],\n' +
+ '- [Symbol(nodejs.util.inspect.custom)]: [Function (anonymous)],\n' +
"- loop: 'forever'\n" +
'- }'
});