Skip to content

Commit c8fa8f1

Browse files
Trotttargos
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: #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 75d23ab commit c8fa8f1

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
@@ -5,15 +5,14 @@
55

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

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

1817
Instances of the `Buffer` class are similar to arrays of integers but
1918
correspond to fixed-sized, raw memory allocations outside the V8 heap.
@@ -207,11 +206,10 @@ changes:
207206
-->
208207

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

216214
It is also possible to create new [`TypedArray`] instances from a `Buffer` with
217215
the following caveats:
@@ -278,10 +276,9 @@ function:
278276
* [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][`Buffer.from(arrayBuffer)`]
279277
* [`Buffer.from(string[, encoding])`][`Buffer.from(string)`]
280278

281-
## Buffers and ES6 iteration
279+
## Buffers and iteration
282280

283-
`Buffer` instances can be iterated over using the [`ECMAScript 2015`] (ES6) `for..of`
284-
syntax.
281+
`Buffer` instances can be iterated over using `for..of` syntax:
285282

286283
```js
287284
const buf = Buffer.from([1, 2, 3]);
@@ -2552,5 +2549,4 @@ This value may depend on the JS engine that is being used.
25522549
[RFC1345]: https://tools.ietf.org/html/rfc1345
25532550
[RFC4648, Section 5]: https://tools.ietf.org/html/rfc4648#section-5
25542551
[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/
2555-
[`ECMAScript 2015`]: https://www.ecma-international.org/ecma-262/6.0/index.html
25562552
[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols

0 commit comments

Comments
 (0)