summaryrefslogtreecommitdiff
path: root/doc/api/buffer.md
diff options
context:
space:
mode:
authorRich Trott <rtrott@gmail.com>2018-03-29 14:23:58 -0700
committerTrivikram Kamat <16024985+trivikr@users.noreply.github.com>2018-03-31 01:21:20 -0700
commita2ffdc9e9b7b7978c87bdf6577dc6b53cfb81b75 (patch)
tree4e0c2200ba5f448455ba14e4a261c285237d2718 /doc/api/buffer.md
parent0d64f33c9658b82897efb9355c0fc2caec034299 (diff)
downloadandroid-node-v8-a2ffdc9e9b7b7978c87bdf6577dc6b53cfb81b75.tar.gz
android-node-v8-a2ffdc9e9b7b7978c87bdf6577dc6b53cfb81b75.tar.bz2
android-node-v8-a2ffdc9e9b7b7978c87bdf6577dc6b53cfb81b75.zip
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: https://github.com/nodejs/node/pull/19685 Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'doc/api/buffer.md')
-rw-r--r--doc/api/buffer.md30
1 files changed, 13 insertions, 17 deletions
diff --git a/doc/api/buffer.md b/doc/api/buffer.md
index 99c9c79d71..314ead2b3e 100644
--- a/doc/api/buffer.md
+++ b/doc/api/buffer.md
@@ -5,15 +5,14 @@
> Stability: 2 - Stable
-Prior to the introduction of [`TypedArray`] in [`ECMAScript 2015`] (ES6), the
-JavaScript language had no mechanism for reading or manipulating streams
-of binary data. The `Buffer` class was introduced as part of the Node.js
-API to make it possible to interact with octet streams in the context of things
-like TCP streams and file system operations.
+Prior to the introduction of [`TypedArray`], the JavaScript language had no
+mechanism for reading or manipulating streams of binary data. The `Buffer` class
+was introduced as part of the Node.js API to make it possible to interact with
+octet streams in the context of things like TCP streams and file system
+operations.
-Now that [`TypedArray`] has been added in ES6, the `Buffer` class implements the
-[`Uint8Array`] API in a manner that is more optimized and suitable for Node.js'
-use cases.
+With [`TypedArray`] now available, the `Buffer` class implements the
+[`Uint8Array`] API in a manner that is more optimized and suitable for Node.js.
Instances of the `Buffer` class are similar to arrays of integers but
correspond to fixed-sized, raw memory allocations outside the V8 heap.
@@ -207,11 +206,10 @@ changes:
-->
`Buffer` instances are also [`Uint8Array`] instances. However, there are subtle
-incompatibilities with the TypedArray specification in [`ECMAScript 2015`].
-For example, while [`ArrayBuffer#slice()`] creates a copy of the slice, the
-implementation of [`Buffer#slice()`][`buf.slice()`] creates a view over the
-existing `Buffer` without copying, making [`Buffer#slice()`][`buf.slice()`] far
-more efficient.
+incompatibilities with [`TypedArray`]. For example, while
+[`ArrayBuffer#slice()`] creates a copy of the slice, the implementation of
+[`Buffer#slice()`][`buf.slice()`] creates a view over the existing `Buffer`
+without copying, making [`Buffer#slice()`][`buf.slice()`] far more efficient.
It is also possible to create new [`TypedArray`] instances from a `Buffer` with
the following caveats:
@@ -278,10 +276,9 @@ function:
* [`Buffer.from(arrayBuffer[, byteOffset [, length]])`][`Buffer.from(arrayBuffer)`]
* [`Buffer.from(string[, encoding])`][`Buffer.from(string)`]
-## Buffers and ES6 iteration
+## Buffers and iteration
-`Buffer` instances can be iterated over using the [`ECMAScript 2015`] (ES6) `for..of`
-syntax.
+`Buffer` instances can be iterated over using `for..of` syntax:
```js
const buf = Buffer.from([1, 2, 3]);
@@ -2592,5 +2589,4 @@ This value may depend on the JS engine that is being used.
[RFC1345]: https://tools.ietf.org/html/rfc1345
[RFC4648, Section 5]: https://tools.ietf.org/html/rfc4648#section-5
[WHATWG Encoding Standard]: https://encoding.spec.whatwg.org/
-[`ECMAScript 2015`]: https://www.ecma-international.org/ecma-262/6.0/index.html
[iterator]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols