mirror of
https://github.com/nodejs/node.git
synced 2025-08-15 13:48:44 +02:00
util: add (typed) array length to the default output
Align the inspect output with the one used in the Chrome dev tools. A recent survey outlined that most users prefer to see the number of set and map entries. This should count as well for array sizes. The size is only added to regular arrays in case the constructor is not the default constructor. Typed arrays always indicate their size. PR-URL: https://github.com/nodejs/node/pull/31027 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
This commit is contained in:
parent
b45eeee017
commit
489e77c119
6 changed files with 71 additions and 75 deletions
|
@ -15,7 +15,7 @@ assert.throws(
|
|||
{
|
||||
code: 'ERR_INVALID_ARG_VALUE',
|
||||
message: 'The argument \'buffer\' is empty and cannot be written. ' +
|
||||
'Received Uint8Array []'
|
||||
'Received Uint8Array(0) []'
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -24,7 +24,7 @@ assert.throws(
|
|||
{
|
||||
code: 'ERR_INVALID_ARG_VALUE',
|
||||
message: 'The argument \'buffer\' is empty and cannot be written. ' +
|
||||
'Received Uint8Array []'
|
||||
'Received Uint8Array(0) []'
|
||||
}
|
||||
);
|
||||
|
||||
|
@ -35,7 +35,7 @@ assert.throws(
|
|||
{
|
||||
code: 'ERR_INVALID_ARG_VALUE',
|
||||
message: 'The argument \'buffer\' is empty and cannot be written. ' +
|
||||
'Received Uint8Array []'
|
||||
'Received Uint8Array(0) []'
|
||||
}
|
||||
);
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue