Skip to content

Commit b4ae0cb

Browse files
addaleaxTrott
authored andcommitted
doc: update description of External
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>
1 parent 5f76f76 commit b4ae0cb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

doc/api/util.md

+7-5
Original file line numberDiff line numberDiff line change
@@ -1392,11 +1392,12 @@ added: v10.0.0
13921392
* Returns: {boolean}
13931393

13941394
Returns `true` if the value is a native `External` value.
1395-
A native `External` value is a special type of object whose
1396-
data is not stored within the JavaScript managed heap
1397-
and does not conform to standard JavaScript types. Such
1398-
objects are created either by Node.js internals or native
1399-
addons and are wrapped by a JavaScript object.
1395+
1396+
A native `External` value is a special type of object that contains a
1397+
raw C++ pointer (`void*`) for access from native code, and has no other
1398+
properties. Such objects are created either by Node.js internals or native
1399+
addons. In JavaScript, they are [frozen][`Object.freeze()`] objects with a
1400+
`null` prototype.
14001401

14011402
### `util.types.isFloat32Array(value)`
14021403
<!-- YAML
@@ -2319,6 +2320,7 @@ util.log('Timestamped message.');
23192320
[`Int8Array`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array
23202321
[`Map`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
23212322
[`Object.assign()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
2323+
[`Object.freeze()`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze
23222324
[`Promise`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise
23232325
[`Proxy`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy
23242326
[`Set`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set

0 commit comments

Comments
 (0)