Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Commit 15aa47e

Browse files
vkurchatkintrevnorris
authored andcommitted
docs: fix smalloc.dispose() example
Also couple of additions about dispose and limitations of smalloc'ed objects. Fixes: #8625 Reviewed-by: Trevor Norris <[email protected]>
1 parent 6a68d64 commit 15aa47e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/api/smalloc.markdown

+7-1
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ possible options are listed in `smalloc.Types`. Example usage:
4848

4949
// { '0': 0, '1': 0.1, '2': 0.2 }
5050

51+
It is not possible to freeze, seal and prevent extensions of objects with
52+
external data using `Object.freeze`, `Object.seal` and
53+
`Object.preventExtensions` respectively.
54+
5155
### smalloc.copyOnto(source, sourceStart, dest, destStart, copyLength);
5256

5357
* `source` {Object} with external array allocation
@@ -105,8 +109,10 @@ careful. Cryptic errors may arise in applications that are difficult to trace.
105109
smalloc.copyOnto(b, 2, a, 0, 2);
106110

107111
// now results in:
108-
// Error: source has no external array data
112+
// RangeError: copy_length > source_length
109113

114+
After `dispose()` is called object still behaves as one with external data, for
115+
example `smalloc.hasExternalData()` returns `true`.
110116
`dispose()` does not support Buffers, and will throw if passed.
111117

112118
### smalloc.hasExternalData(obj)

0 commit comments

Comments
 (0)