Skip to content

Commit

Permalink
doc: update description of External
Browse files Browse the repository at this point in the history
The previous description did not mention what an `External`
is and instead only provided some hints around what it is not.
Update the description to be more accurate.

PR-URL: #31255
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: David Carlier <devnexen@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
addaleax authored and codebytere committed Mar 17, 2020
1 parent e398137 commit 63af1ab
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions doc/api/util.md
Original file line number Diff line number Diff line change
Expand Up @@ -1391,11 +1391,12 @@ added: v10.0.0
* Returns: {boolean}

Returns `true` if the value is a native `External` value.
A native `External` value is a special type of object whose
data is not stored within the JavaScript managed heap
and does not conform to standard JavaScript types. Such
objects are created either by Node.js internals or native
addons and are wrapped by a JavaScript object.

A native `External` value is a special type of object that contains a
raw C++ pointer (`void*`) for access from native code, and has no other
properties. Such objects are created either by Node.js internals or native
addons. In JavaScript, they are [frozen][`Object.freeze()`] objects with a
`null` prototype.

### `util.types.isFloat32Array(value)`
<!-- YAML
Expand Down Expand Up @@ -2318,6 +2319,7 @@ util.log('Timestamped message.');
[`Int8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array
[`Map`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
[`Object.assign()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
[`Object.freeze()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
[`Promise`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
[`Proxy`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
[`Set`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
Expand Down

0 comments on commit 63af1ab

Please sign in to comment.