Creates a Cloner instance which is just a thin wrapper on top of facile-clone and clones an object preserving Buffers and strings according to the options supplied.
(Object)
options applied when cloning objects
Name | Description |
---|---|
$0.bufferLength number?
(default 0 )
|
determines how many elements of Buffers are captured. By default not Buffer data is captured. |
$0.stringLength number?
(default 0 )
|
determines how much of each string is captured. By default no string data is captured. |
Clones the object according to the options supplied in the constructor.
(Object)
the object to clone
Object
:
the cloned object
Creates an instance of ResourceProcessor.
Never call this directly, instead extend it to create a specific processor
for your particular resource type, i.e. NetworkResourceProcessor
.
Makes sure that each resource is only processed once.
(Object)
options specifying if arguments and function source are captured and how they are cloned
Name | Description |
---|---|
$0.cloner Cloner
|
used to clone the resource information |
$0.captureArguments Boolean?
(default false )
|
if
true
arguments of callbacks
are captured when they are processed.
|
$0.captureSource Boolean?
(default false )
|
if
true
the source code of callbacks
is captured when they are processed.
|
Cleans up all captured resources which means that they are processed, meaningful data extracted and the reference to the actual resource removed so it can be GCed.
Cleans the particular resource of the activity found by the uid as part of the activities.
If the uid isn't found in the activities or the activity is null
this function returns
without doing anything.
(Boolean?
= false
)
if
true
it will collect info of all
functions found on the hooks resources.
Scouts functions using function-scout and then adapts the data according to the supplied options. In the process clones function arguments as well and appends them to the returned function info
This function is used by the ResourceProcessor
and most likely you won't have to call
it directly.
Sample return value:
[ { path: [ 'owner', '_events', 'connection' ],
key: 'connection',
level: 2,
info:
FunctionOrigin {
file: '/Volumes/d/dev/js/async-hooks/ah-net/test/one-tcp-server.listen+close.js',
line: 25,
column: 21,
inferredName: '',
name: 'onconnection' },
id: 2,
arguments: null }]
(Object)
the context that should be scouted for functions
(Number)
the id which is appended to each function info
(Object)
options specifying if arguments and function source are captured and how they are cloned
Name | Description |
---|---|
$0.captureArguments Boolean?
(default false )
|
if
true
arguments of callbacks
are captured when they are processed.
|
$0.captureSource Boolean?
(default false )
|
if
true
the source code of callbacks
is captured when they are processed.
|
$0.cloner Cloner
|
used to clone the function arguments |
$0.name String?
(default null )
|
if supplied it will be prepended to all function paths |
Array<Object>
:
array of function information elements, one for each function encountered