summaryrefslogtreecommitdiff
path: root/test/parallel/test-util-inspect.js
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-05-01 22:21:00 +0200
committerZYSzys <zyszys98@gmail.com>2019-05-04 23:45:47 +0800
commit7910b025a26839483f4ae1d50a60d00c8d32f81b (patch)
tree6392659347e456a7ebaf68af3dc4ca1f90920b94 /test/parallel/test-util-inspect.js
parenteda4d3c59e02769a99cb58c369674a8f8f25974c (diff)
downloadandroid-node-v8-7910b025a26839483f4ae1d50a60d00c8d32f81b.tar.gz
android-node-v8-7910b025a26839483f4ae1d50a60d00c8d32f81b.tar.bz2
android-node-v8-7910b025a26839483f4ae1d50a60d00c8d32f81b.zip
util: inspect constructor closer
This adds an extra check to `util.inspect` to closer inspect object constructors in case there's not much other information about the constructor. PR-URL: https://github.com/nodejs/node/pull/27522 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com>
Diffstat (limited to 'test/parallel/test-util-inspect.js')
-rw-r--r--test/parallel/test-util-inspect.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/test/parallel/test-util-inspect.js b/test/parallel/test-util-inspect.js
index 1bab0fe0a7..fc69f41ef4 100644
--- a/test/parallel/test-util-inspect.js
+++ b/test/parallel/test-util-inspect.js
@@ -2003,11 +2003,11 @@ assert.strictEqual(
Object.setPrototypeOf(obj, value);
assert.strictEqual(
util.inspect(obj),
- '<[Function (null prototype) (anonymous)]> { a: true }'
+ 'Object <[Function (null prototype) (anonymous)]> { a: true }'
);
assert.strictEqual(
util.inspect(obj, { colors: true }),
- '<\u001b[36m[Function (null prototype) (anonymous)]\u001b[39m> ' +
+ 'Object <\u001b[36m[Function (null prototype) (anonymous)]\u001b[39m> ' +
'{ a: \u001b[33mtrue\u001b[39m }'
);
@@ -2017,14 +2017,14 @@ assert.strictEqual(
Object.setPrototypeOf(obj, value);
assert.strictEqual(
util.inspect(obj),
- '<[Array: null prototype] []> { a: true }'
+ 'Object <[Array: null prototype] []> { a: true }'
);
function StorageObject() {}
StorageObject.prototype = Object.create(null);
assert.strictEqual(
util.inspect(new StorageObject()),
- '<[Object: null prototype] {}> {}'
+ 'StorageObject <[Object: null prototype] {}> {}'
);
obj = [1, 2, 3];
@@ -2034,7 +2034,7 @@ assert.strictEqual(
Object.setPrototypeOf(obj, Object.create(null));
assert.strictEqual(
inspect(obj),
- "<[Object: null prototype] {}> { '0': 1, '1': 2, '2': 3 }"
+ "Array <[Object: null prototype] {}> { '0': 1, '1': 2, '2': 3 }"
);
}