diff --git a/website/guide/duktapebuiltins.html b/website/guide/duktapebuiltins.html index 8d21c85c..724794f9 100644 --- a/website/guide/duktapebuiltins.html +++ b/website/guide/duktapebuiltins.html @@ -12,20 +12,25 @@ values.
-stdout
.stderr
.stdout
.stderr
.CommonJS module loading function, see Modules.
-print()
writes to stdout
with an automatic
flush afterwards. The bytes written depend on the arguments:
stderr
. Unlike a browser alert()
, the call
does not block.
-version | Duktape version number: (major * 10000) + (minor * 100) + patch . |
env | Cryptic, version dependent summary of most important effective options like endianness and architecture. |
fin | Set or get finalizer of an object. |
enc | Encode a value (hex, base-64, JX, JC): Duktape.enc('hex', 'foo') . |
dec | Decode a value (hex, base-64, JX, JC): Duktape.dec('base64', 'Zm9v') . |
info | Get internal information (such as heap address and alloc size) of a value in a version specific format. |
act | Get information about call stack entry. |
gc | Trigger mark-and-sweep garbage collection. |
compact | Compact the memory allocated for a value (object). |
errCreate | Callback to modify/replace a created error. |
errThrow | Callback to modify/replace an error about to be thrown. |
modSearch | Module search function, must be provided by user code if using modules. |
modLoaded | Internal tracking table for loaded modules, maps resolved identifier to exported symbols. |
Buffer | Buffer constructor (function). |
Pointer | Pointer constructor (function). |
Thread | Thread constructor (function). |
Logger | Logger constructor (function). |
version | +Duktape version number: (major * 10000) + (minor * 100) + patch . |
env | +Cryptic, version dependent summary of most important effective options like endianness and architecture. |
fin | +Set or get finalizer of an object. |
enc | +Encode a value (hex, base-64, JX, JC): Duktape.enc('hex', 'foo') . |
dec | +Decode a value (hex, base-64, JX, JC): Duktape.dec('base64', 'Zm9v') . |
info | +Get internal information (such as heap address and alloc size) of a value in a version specific format. |
act | +Get information about call stack entry. |
gc | +Trigger mark-and-sweep garbage collection. |
compact | +Compact the memory allocated for a value (object). |
errCreate | +Callback to modify/replace a created error. |
errThrow | +Callback to modify/replace an error about to be thrown. |
modSearch | +Module search function, must be provided by user code if using modules. |
modLoaded | +Internal tracking table for loaded modules, maps resolved identifier to exported symbols. |
Buffer | +Buffer constructor (function). |
Pointer | +Pointer constructor (function). |
Thread | +Thread constructor (function). |
Logger | +Logger constructor (function). |
The version
property allows version-based feature detection and
behavior. Version numbers can be compared directly: a logically higher version
@@ -117,7 +139,7 @@ if (typeof Duktape !== 'object') {
}
-
env
summarizes the most important effective compile options
in a version specific, quite cryptic manner. The format is version specific
@@ -135,7 +157,7 @@ ll u p2 a4 x64 linux gcc // l|b|m integer endianness, l|b|m IEEE double endi
// gcc|clang|msvc|etc: compiler
-
When called with a single argument, gets the current finalizer of an object:
@@ -148,7 +170,7 @@ Duktape.fin(o, function(x) { print('finalizer called'); }); Duktape.fin(o, undefined); // disable-
enc()
encodes its argument value into chosen format.
The first argument is a format (currently supported are "hex", "base64",
@@ -172,7 +194,7 @@ var result = Duktape.enc('jx', { foo: 123 }, null, 4);
print(result); // prints JX encoded {foo:123} with 4-space indent
-
dec()
provides the reverse function of enc()
.
When given an arbitrary input value, Duktape.info()
returns an
array of values with internal information related to the value. The format of
@@ -393,7 +415,7 @@ debugging and diagnosis, e.g. when estimating rough memory usage of objects.
Get information about a call stack entry. Takes a single number argument indicating depth in the call stack: -1 is the top entry, -2 is the one below @@ -443,7 +465,7 @@ print('running on line:', getCurrentLine()); The properties provided for call stack entries may change between versions. -
Trigger a forced mark-and-sweep collection. If mark-and-sweep is disabled, this call is a no-op.
@@ -452,7 +474,7 @@ this call is a no-op. Not sure what the best return value would be. --> -Minimize the memory allocated for a target object. Same as the C API call
duk_compact()
but accessible from Ecmascript code. If called with
@@ -467,7 +489,7 @@ var obj = {
This call is useful when you know that an object is unlikely to gain new properties, but you don't want to seal or freeze the object in case it does.
-These can be set by user code to process/replace errors when they are created
(errCreate
) or thrown (errThrow
). Both values are
@@ -477,7 +499,7 @@ initially non-existent.
modSearch()
is a module search function which must be provided
by user code to support module loading.
@@ -488,7 +510,7 @@ or currently being loaded.
See Modules for details.
-