Filip Skokan
daced4ab98
buffer: move SlowBuffer to EOL
...
This commits reverts da69d13623
PR-URL: https://github.com/nodejs/node/pull/58220
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2025-05-09 19:41:31 +00:00
Filip Skokan
da69d13623
Revert "buffer: move SlowBuffer to EOL"
...
This reverts commit 647175ee0b .
PR-URL: https://github.com/nodejs/node/pull/58211
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: LiviaMedeiros <livia@cirno.name >
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com >
Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Chengzhong Wu <legendecas@gmail.com >
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de >
Reviewed-By: Richard Lau <rlau@redhat.com >
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com >
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com >
2025-05-07 19:31:21 +00:00
James M Snell
647175ee0b
buffer: move SlowBuffer to EOL
...
`SlowBuffer` has been deprecated for many years now. Let's remove it.
PR-URL: https://github.com/nodejs/node/pull/58008
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com >
Reviewed-By: Darshan Sen <raisinten@gmail.com >
Reviewed-By: Robert Nagy <ronagy@icloud.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2025-04-27 07:40:37 -07:00
Ruben Bridgewater
489e77c119
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 >
2019-12-25 11:19:43 +01:00
Ruben Bridgewater
d834275a48
buffer: fix custom inspection with extra properties
...
This broke due to a recent change that prevents exposing inspect
internals. It now relies on the public API instead and should be a
bit more robust due to that.
PR-URL: https://github.com/nodejs/node/pull/27074
Reviewed-By: Michaël Zasso <targos@protonmail.com >
Reviewed-By: Yongsheng Zhang <zyszys98@gmail.com >
2019-04-08 08:55:46 +02:00
Ruben Bridgewater
d385e2cc5a
buffer: inspect extra properties
...
This makes sure extra properties on buffers are not ignored anymore
when inspecting the buffer.
PR-URL: https://github.com/nodejs/node/pull/25150
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: James M Snell <jasnell@gmail.com >
2018-12-27 22:32:23 +01:00
Ruben Bridgewater
755520c4c3
buffer: show hidden item count
...
This adds the number of hidden items in case INSPECT_MAX_BYTES is
exceeded.
PR-URL: https://github.com/nodejs/node/pull/22289
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
2018-08-15 23:06:22 +02:00
Ruben Bridgewater
caee112e52
test: remove assert.doesNotThrow()
...
There is actually no reason to use `assert.doesNotThrow()` in the
tests. If a test throws, just let the error bubble up right away
instead of first catching it and then rethrowing it.
PR-URL: https://github.com/nodejs/node/pull/18669
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: Luigi Pinca <luigipinca@gmail.com >
Reviewed-By: Matteo Collina <matteo.collina@gmail.com >
2018-02-16 16:53:47 +01:00
James M Snell
98e54b0bd4
meta: restore original copyright header
...
A prior io.js era commit inappropriately removed the
original copyright statements from the source. This
restores those in any files still remaining from that
edit.
Ref: https://github.com/nodejs/TSC/issues/174
Ref: https://github.com/nodejs/node/pull/10599
PR-URL: https://github.com/nodejs/node/pull/10155
Note: This PR was required, reviewed-by and approved
by the Node.js Foundation Legal Committee and the TSC.
There is no `Approved-By:` meta data.
2017-03-10 11:23:48 -08:00
Gibson Fahnestock
7a0e462f9f
test: use eslint to fix var->const/let
...
Manually fix issues that eslint --fix couldn't do automatically.
PR-URL: https://github.com/nodejs/node/pull/10685
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
Reviewed-By: Roman Reiss <me@silverwind.io >
2017-01-11 11:43:52 +00:00
Charmander
66d54467c5
buffer: use correct name for custom inspect symbol
...
59714cb7b3 introduced the
`util.inspect.custom` symbol, but it was exported as
`customInspectSymbol` by `internal/util.js` and referenced as
`inspectSymbol` by `buffer.js`.
PR-URL: https://github.com/nodejs/node/pull/9289
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Colin Ihrig <cjihrig@gmail.com >
Reviewed-By: James M Snell <jasnell@gmail.com >
2016-10-28 09:07:55 -07:00
James M Snell
4537cf2377
test: additional refactoring/cleanup of buffer tests
...
* Favor use of strictEqual where possible
* Use const as appropriate
* Other miscellaneous cleanups
PR-URL: https://github.com/nodejs/node/pull/8283
Reviewed-By: Anna Henningsen <anna@addaleax.net >
Reviewed-By: Michaël Zasso <mic.besace@gmail.com >
2016-08-29 15:24:03 -07:00
James M Snell
85ab4a5f12
buffer: add .from(), .alloc() and .allocUnsafe()
...
Several changes:
* Soft-Deprecate Buffer() constructors
* Add `Buffer.from()`, `Buffer.alloc()`, and `Buffer.allocUnsafe()`
* Add `--zero-fill-buffers` command line option
* Add byteOffset and length to `new Buffer(arrayBuffer)` constructor
* buffer.fill('') previously had no effect, now zero-fills
* Update the docs
PR-URL: https://github.com/nodejs/node/pull/4682
Reviewed-By: Сковорода Никита Андреевич <chalkerx@gmail.com >
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com >
2016-03-16 08:34:02 -07:00
Rich Trott
082cc8d6d8
test: remove unnecessary assignments
...
common.js needs to be loaded in all tests so that there is checking
for variable leaks and possibly other things. However, it does not
need to be assigned to a variable if nothing in common.js is referred
to elsewhere in the test.
PR-URL: https://github.com/nodejs/node/pull/4408
Reviewed-By: James M Snell <jasnell@gmail.com >
2015-12-26 18:00:02 -08:00
Roman Reiss
fb8811d95e
lib,test: fix whitespace issues
...
PR-URL: https://github.com/nodejs/io.js/pull/1971
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-06-15 16:37:37 +02:00
Roman Reiss
f29762f4dd
test: enable linting for tests
...
Enable linting for the test directory. A number of changes was made so
all tests conform the current rules used by lib and src directories. The
only exception for tests is that unreachable (dead) code is allowed.
test-fs-non-number-arguments-throw had to be excluded from the changes
because of a weird issue on Windows CI.
PR-URL: https://github.com/nodejs/io.js/pull/1721
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
2015-05-19 21:21:27 +02:00
isaacs
3e1b1dd4a9
Remove excessive copyright/license boilerplate
...
The copyright and license notice is already in the LICENSE file. There
is no justifiable reason to also require that it be included in every
file, since the individual files are not individually distributed except
as part of the entire package.
2015-01-12 15:30:28 -08:00
Fedor Indutny
0e19476595
test: split test in parallel/sequential
...
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl >
PR-URL: https://github.com/iojs/io.js/pull/172
Fix : iojs/io.js#139
2014-12-17 20:45:02 +07:00