Skip to content

Commit 0410b5b

Browse files
TrottChALkeR
authored andcommitted
doc: remove ES6/ECMAScript 2015 from buffer.md
As the introduction of ES6 features recedes further into the past, it is less and less relevant (and more and more distracting) to cite it in documentation text. Remove mention in buffer.md. PR-URL: nodejs/node#19685 Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Vse Mozhet Byt <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: Colin Ihrig <[email protected]>
1 parent 6696271 commit 0410b5b

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

doc/api/buffer.md

+13-17
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,14 @@
44

55
> Stability: 2 - Stable
66
7-
Prior to the introduction of [`TypedArray`] in [`ECMAScript 2015`] (ES6), the
8-
JavaScript language had no mechanism for reading or manipulating streams
9-
of binary data. The `Buffer` class was introduced as part of the Node.js
10-
API to make it possible to interact with octet streams in the context of things
11-
like TCP streams and file system operations.
7+
Prior to the introduction of [`TypedArray`], the JavaScript language had no
8+
mechanism for reading or manipulating streams of binary data. The `Buffer` class
9+
was introduced as part of the Node.js API to make it possible to interact with
10+
octet streams in the context of things like TCP streams and file system
11+
operations.
1212

13-
Now that [`TypedArray`] has been added in ES6, the `Buffer` class implements the
14-
[`Uint8Array`] API in a manner that is more optimized and suitable for Node.js'
15-
use cases.
13+
With [`TypedArray`] now available, the `Buffer` class implements the
14+
[`Uint8Array`] API in a manner that is more optimized and suitable for Node.js.
1615

1716
Instances of the `Buffer` class are similar to arrays of integers but
1817
correspond to fixed-sized, raw memory allocations outside the V8 heap.
@@ -211,11 +210,10 @@ changes:
211210
-->
212211

213212
`Buffer` instances are also [`Uint8Array`] instances. However, there are subtle
214-
incompatibilities with the TypedArray specification in [`ECMAScript 2015`].
215-
For example, while [`ArrayBuffer#slice()`] creates a copy of the slice, the
216-
implementation of [`Buffer#slice()`][`buf.slice()`] creates a view over the
217-
existing `Buffer` without copying, making [`Buffer#slice()`][`buf.slice()`] far
218-
more efficient.
213+
incompatibilities with [`TypedArray`]. For example, while
214+
[`ArrayBuffer#slice()`] creates a copy of the slice, the implementation of
215+
[`Buffer#slice()`][`buf.slice()`] creates a view over the existing `Buffer`
216+
without copying, making [`Buffer#slice()`][`buf.slice()`] far more efficient.
219217

220218
It is also possible to create new [`TypedArray`] instances from a `Buffer` with
221219
the following caveats:
@@ -289,10 +287,9 @@ function:
289287
* [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][`Buffer.from(arrayBuffer)`]
290288
* [`Buffer.from(string[, encoding])`][`Buffer.from(string)`]
291289

292-
## Buffers and ES6 iteration
290+
## Buffers and iteration
293291

294-
`Buffer` instances can be iterated over using the [`ECMAScript 2015`] (ES6) `for..of`
295-
syntax.
292+
`Buffer` instances can be iterated over using `for..of` syntax:
296293

297294
Example:
298295

@@ -2757,5 +2754,4 @@ This value may depend on the JS engine that is being used.
27572754
[RFC1345]: https://tools.ietf.org/html/rfc1345
27582755
[RFC4648, Section 5]: https://tools.ietf.org/html/rfc4648#section-5
27592756
[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/
2760-
[`ECMAScript 2015`]: https://www.ecma-international.org/ecma-262/6.0/index.html
27612757
[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols

0 commit comments

Comments
 (0)