diff options
author | Teddy Katz <teddy.katz@gmail.com> | 2018-06-24 00:20:17 -0700 |
---|---|---|
committer | Teddy Katz <teddy.katz@gmail.com> | 2018-06-27 19:04:55 -0700 |
commit | 80496a55708967d1fb124cdbaf296b86eca31ff3 (patch) | |
tree | ea151ef321a3319910b4e358038cc868964c8d43 /test | |
parent | dcb371ff1f334410a32b9ad5fb96427c7484b43a (diff) | |
download | android-node-v8-80496a55708967d1fb124cdbaf296b86eca31ff3.tar.gz android-node-v8-80496a55708967d1fb124cdbaf296b86eca31ff3.tar.bz2 android-node-v8-80496a55708967d1fb124cdbaf296b86eca31ff3.zip |
util: add inspect suffix to BigInt64Array elements
This commit updates `util.inspect` to add an `n` suffix to BigInts that
appear in BigInt64Arrays. BigInts are formatted with an `n` suffix in
most cases, but this did not occur in BigInt64Arrays due to an apparent
oversight where the implementation of `inspect` for typed arrays assumed
that all typed array elements are numbers.
PR-URL: https://github.com/nodejs/node/pull/21499
Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Yuta Hiroto <hello@hiroppy.me>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-util-inspect-bigint.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/test/parallel/test-util-inspect-bigint.js b/test/parallel/test-util-inspect-bigint.js index 5e0233640e..92ddd66690 100644 --- a/test/parallel/test-util-inspect-bigint.js +++ b/test/parallel/test-util-inspect-bigint.js @@ -10,3 +10,5 @@ const { inspect } = require('util'); assert.strictEqual(inspect(1n), '1n'); assert.strictEqual(inspect(Object(-1n)), '[BigInt: -1n]'); assert.strictEqual(inspect(Object(13n)), '[BigInt: 13n]'); +assert.strictEqual(inspect(new BigInt64Array([0n])), 'BigInt64Array [ 0n ]'); +assert.strictEqual(inspect(new BigUint64Array([0n])), 'BigUint64Array [ 0n ]'); |