Skip to content

Commit 63af1ab

Browse files
addaleaxcodebytere
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 <[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]>
1 parent e398137 commit 63af1ab

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
@@ -1391,11 +1391,12 @@ added: v10.0.0
13911391
* Returns: {boolean}
13921392

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

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

0 commit comments

Comments
 (0)