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 <[email protected]>
Reviewed-By: Ruben Bridgewater <[email protected]>
Reviewed-By: David Carlier <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
addaleax authored and MylesBorins committed Jan 16, 2020
1 parent 0e48d8d commit de6f2be
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 @@ -1392,11 +1392,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 @@ -2319,6 +2320,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 de6f2be

Please sign in to comment.