Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
duk_builtins.h File Reference

Go to the source code of this file.

Macros

#define DUK_STRIDX_UC_UNDEFINED   0 /* 'Undefined' */
 
#define DUK_HEAP_STRING_UC_UNDEFINED(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_UNDEFINED)
 
#define DUK_HTHREAD_STRING_UC_UNDEFINED(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_UNDEFINED)
 
#define DUK_STRIDX_UC_NULL   1 /* 'Null' */
 
#define DUK_HEAP_STRING_UC_NULL(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_NULL)
 
#define DUK_HTHREAD_STRING_UC_NULL(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_NULL)
 
#define DUK_STRIDX_UC_ARGUMENTS   2 /* 'Arguments' */
 
#define DUK_HEAP_STRING_UC_ARGUMENTS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_ARGUMENTS)
 
#define DUK_HTHREAD_STRING_UC_ARGUMENTS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_ARGUMENTS)
 
#define DUK_STRIDX_UC_OBJECT   3 /* 'Object' */
 
#define DUK_HEAP_STRING_UC_OBJECT(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_OBJECT)
 
#define DUK_HTHREAD_STRING_UC_OBJECT(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_OBJECT)
 
#define DUK_STRIDX_UC_FUNCTION   4 /* 'Function' */
 
#define DUK_HEAP_STRING_UC_FUNCTION(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_FUNCTION)
 
#define DUK_HTHREAD_STRING_UC_FUNCTION(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_FUNCTION)
 
#define DUK_STRIDX_ARRAY   5 /* 'Array' */
 
#define DUK_HEAP_STRING_ARRAY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ARRAY)
 
#define DUK_HTHREAD_STRING_ARRAY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ARRAY)
 
#define DUK_STRIDX_UC_STRING   6 /* 'String' */
 
#define DUK_HEAP_STRING_UC_STRING(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_STRING)
 
#define DUK_HTHREAD_STRING_UC_STRING(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_STRING)
 
#define DUK_STRIDX_UC_BOOLEAN   7 /* 'Boolean' */
 
#define DUK_HEAP_STRING_UC_BOOLEAN(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_BOOLEAN)
 
#define DUK_HTHREAD_STRING_UC_BOOLEAN(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_BOOLEAN)
 
#define DUK_STRIDX_UC_NUMBER   8 /* 'Number' */
 
#define DUK_HEAP_STRING_UC_NUMBER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_NUMBER)
 
#define DUK_HTHREAD_STRING_UC_NUMBER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_NUMBER)
 
#define DUK_STRIDX_DATE   9 /* 'Date' */
 
#define DUK_HEAP_STRING_DATE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DATE)
 
#define DUK_HTHREAD_STRING_DATE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DATE)
 
#define DUK_STRIDX_REG_EXP   10 /* 'RegExp' */
 
#define DUK_HEAP_STRING_REG_EXP(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_REG_EXP)
 
#define DUK_HTHREAD_STRING_REG_EXP(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_REG_EXP)
 
#define DUK_STRIDX_UC_ERROR   11 /* 'Error' */
 
#define DUK_HEAP_STRING_UC_ERROR(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_ERROR)
 
#define DUK_HTHREAD_STRING_UC_ERROR(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_ERROR)
 
#define DUK_STRIDX_MATH   12 /* 'Math' */
 
#define DUK_HEAP_STRING_MATH(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MATH)
 
#define DUK_HTHREAD_STRING_MATH(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MATH)
 
#define DUK_STRIDX_JSON   13 /* 'JSON' */
 
#define DUK_HEAP_STRING_JSON(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON)
 
#define DUK_HTHREAD_STRING_JSON(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON)
 
#define DUK_STRIDX_EMPTY_STRING   14 /* '' */
 
#define DUK_HEAP_STRING_EMPTY_STRING(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EMPTY_STRING)
 
#define DUK_HTHREAD_STRING_EMPTY_STRING(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EMPTY_STRING)
 
#define DUK_STRIDX_ARRAY_BUFFER   15 /* 'ArrayBuffer' */
 
#define DUK_HEAP_STRING_ARRAY_BUFFER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ARRAY_BUFFER)
 
#define DUK_HTHREAD_STRING_ARRAY_BUFFER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ARRAY_BUFFER)
 
#define DUK_STRIDX_DATA_VIEW   16 /* 'DataView' */
 
#define DUK_HEAP_STRING_DATA_VIEW(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DATA_VIEW)
 
#define DUK_HTHREAD_STRING_DATA_VIEW(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DATA_VIEW)
 
#define DUK_STRIDX_INT8_ARRAY   17 /* 'Int8Array' */
 
#define DUK_HEAP_STRING_INT8_ARRAY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT8_ARRAY)
 
#define DUK_HTHREAD_STRING_INT8_ARRAY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT8_ARRAY)
 
#define DUK_STRIDX_UINT8_ARRAY   18 /* 'Uint8Array' */
 
#define DUK_HEAP_STRING_UINT8_ARRAY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UINT8_ARRAY)
 
#define DUK_HTHREAD_STRING_UINT8_ARRAY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UINT8_ARRAY)
 
#define DUK_STRIDX_UINT8_CLAMPED_ARRAY   19 /* 'Uint8ClampedArray' */
 
#define DUK_HEAP_STRING_UINT8_CLAMPED_ARRAY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UINT8_CLAMPED_ARRAY)
 
#define DUK_HTHREAD_STRING_UINT8_CLAMPED_ARRAY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UINT8_CLAMPED_ARRAY)
 
#define DUK_STRIDX_INT16_ARRAY   20 /* 'Int16Array' */
 
#define DUK_HEAP_STRING_INT16_ARRAY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT16_ARRAY)
 
#define DUK_HTHREAD_STRING_INT16_ARRAY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT16_ARRAY)
 
#define DUK_STRIDX_UINT16_ARRAY   21 /* 'Uint16Array' */
 
#define DUK_HEAP_STRING_UINT16_ARRAY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UINT16_ARRAY)
 
#define DUK_HTHREAD_STRING_UINT16_ARRAY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UINT16_ARRAY)
 
#define DUK_STRIDX_INT32_ARRAY   22 /* 'Int32Array' */
 
#define DUK_HEAP_STRING_INT32_ARRAY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT32_ARRAY)
 
#define DUK_HTHREAD_STRING_INT32_ARRAY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT32_ARRAY)
 
#define DUK_STRIDX_UINT32_ARRAY   23 /* 'Uint32Array' */
 
#define DUK_HEAP_STRING_UINT32_ARRAY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UINT32_ARRAY)
 
#define DUK_HTHREAD_STRING_UINT32_ARRAY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UINT32_ARRAY)
 
#define DUK_STRIDX_FLOAT32_ARRAY   24 /* 'Float32Array' */
 
#define DUK_HEAP_STRING_FLOAT32_ARRAY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FLOAT32_ARRAY)
 
#define DUK_HTHREAD_STRING_FLOAT32_ARRAY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FLOAT32_ARRAY)
 
#define DUK_STRIDX_FLOAT64_ARRAY   25 /* 'Float64Array' */
 
#define DUK_HEAP_STRING_FLOAT64_ARRAY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FLOAT64_ARRAY)
 
#define DUK_HTHREAD_STRING_FLOAT64_ARRAY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FLOAT64_ARRAY)
 
#define DUK_STRIDX_GLOBAL   26 /* 'global' */
 
#define DUK_HEAP_STRING_GLOBAL(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_GLOBAL)
 
#define DUK_HTHREAD_STRING_GLOBAL(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_GLOBAL)
 
#define DUK_STRIDX_OBJ_ENV   27 /* 'ObjEnv' */
 
#define DUK_HEAP_STRING_OBJ_ENV(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_OBJ_ENV)
 
#define DUK_HTHREAD_STRING_OBJ_ENV(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_OBJ_ENV)
 
#define DUK_STRIDX_DEC_ENV   28 /* 'DecEnv' */
 
#define DUK_HEAP_STRING_DEC_ENV(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DEC_ENV)
 
#define DUK_HTHREAD_STRING_DEC_ENV(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DEC_ENV)
 
#define DUK_STRIDX_UC_BUFFER   29 /* 'Buffer' */
 
#define DUK_HEAP_STRING_UC_BUFFER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_BUFFER)
 
#define DUK_HTHREAD_STRING_UC_BUFFER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_BUFFER)
 
#define DUK_STRIDX_UC_POINTER   30 /* 'Pointer' */
 
#define DUK_HEAP_STRING_UC_POINTER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_POINTER)
 
#define DUK_HTHREAD_STRING_UC_POINTER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_POINTER)
 
#define DUK_STRIDX_UC_THREAD   31 /* 'Thread' */
 
#define DUK_HEAP_STRING_UC_THREAD(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_THREAD)
 
#define DUK_HTHREAD_STRING_UC_THREAD(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_THREAD)
 
#define DUK_STRIDX_EVAL   32 /* 'eval' */
 
#define DUK_HEAP_STRING_EVAL(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EVAL)
 
#define DUK_HTHREAD_STRING_EVAL(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EVAL)
 
#define DUK_STRIDX_DEFINE_PROPERTY   33 /* 'defineProperty' */
 
#define DUK_HEAP_STRING_DEFINE_PROPERTY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DEFINE_PROPERTY)
 
#define DUK_HTHREAD_STRING_DEFINE_PROPERTY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DEFINE_PROPERTY)
 
#define DUK_STRIDX_VALUE   34 /* 'value' */
 
#define DUK_HEAP_STRING_VALUE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_VALUE)
 
#define DUK_HTHREAD_STRING_VALUE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_VALUE)
 
#define DUK_STRIDX_WRITABLE   35 /* 'writable' */
 
#define DUK_HEAP_STRING_WRITABLE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_WRITABLE)
 
#define DUK_HTHREAD_STRING_WRITABLE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_WRITABLE)
 
#define DUK_STRIDX_CONFIGURABLE   36 /* 'configurable' */
 
#define DUK_HEAP_STRING_CONFIGURABLE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CONFIGURABLE)
 
#define DUK_HTHREAD_STRING_CONFIGURABLE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CONFIGURABLE)
 
#define DUK_STRIDX_ENUMERABLE   37 /* 'enumerable' */
 
#define DUK_HEAP_STRING_ENUMERABLE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ENUMERABLE)
 
#define DUK_HTHREAD_STRING_ENUMERABLE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ENUMERABLE)
 
#define DUK_STRIDX_JOIN   38 /* 'join' */
 
#define DUK_HEAP_STRING_JOIN(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JOIN)
 
#define DUK_HTHREAD_STRING_JOIN(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JOIN)
 
#define DUK_STRIDX_TO_LOCALE_STRING   39 /* 'toLocaleString' */
 
#define DUK_HEAP_STRING_TO_LOCALE_STRING(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_LOCALE_STRING)
 
#define DUK_HTHREAD_STRING_TO_LOCALE_STRING(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_LOCALE_STRING)
 
#define DUK_STRIDX_VALUE_OF   40 /* 'valueOf' */
 
#define DUK_HEAP_STRING_VALUE_OF(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_VALUE_OF)
 
#define DUK_HTHREAD_STRING_VALUE_OF(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_VALUE_OF)
 
#define DUK_STRIDX_TO_UTC_STRING   41 /* 'toUTCString' */
 
#define DUK_HEAP_STRING_TO_UTC_STRING(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_UTC_STRING)
 
#define DUK_HTHREAD_STRING_TO_UTC_STRING(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_UTC_STRING)
 
#define DUK_STRIDX_TO_ISO_STRING   42 /* 'toISOString' */
 
#define DUK_HEAP_STRING_TO_ISO_STRING(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_ISO_STRING)
 
#define DUK_HTHREAD_STRING_TO_ISO_STRING(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_ISO_STRING)
 
#define DUK_STRIDX_TO_GMT_STRING   43 /* 'toGMTString' */
 
#define DUK_HEAP_STRING_TO_GMT_STRING(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_GMT_STRING)
 
#define DUK_HTHREAD_STRING_TO_GMT_STRING(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_GMT_STRING)
 
#define DUK_STRIDX_SOURCE   44 /* 'source' */
 
#define DUK_HEAP_STRING_SOURCE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SOURCE)
 
#define DUK_HTHREAD_STRING_SOURCE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SOURCE)
 
#define DUK_STRIDX_IGNORE_CASE   45 /* 'ignoreCase' */
 
#define DUK_HEAP_STRING_IGNORE_CASE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IGNORE_CASE)
 
#define DUK_HTHREAD_STRING_IGNORE_CASE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IGNORE_CASE)
 
#define DUK_STRIDX_MULTILINE   46 /* 'multiline' */
 
#define DUK_HEAP_STRING_MULTILINE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MULTILINE)
 
#define DUK_HTHREAD_STRING_MULTILINE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MULTILINE)
 
#define DUK_STRIDX_LAST_INDEX   47 /* 'lastIndex' */
 
#define DUK_HEAP_STRING_LAST_INDEX(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LAST_INDEX)
 
#define DUK_HTHREAD_STRING_LAST_INDEX(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LAST_INDEX)
 
#define DUK_STRIDX_ESCAPED_EMPTY_REGEXP   48 /* '(?:)' */
 
#define DUK_HEAP_STRING_ESCAPED_EMPTY_REGEXP(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ESCAPED_EMPTY_REGEXP)
 
#define DUK_HTHREAD_STRING_ESCAPED_EMPTY_REGEXP(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ESCAPED_EMPTY_REGEXP)
 
#define DUK_STRIDX_INDEX   49 /* 'index' */
 
#define DUK_HEAP_STRING_INDEX(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INDEX)
 
#define DUK_HTHREAD_STRING_INDEX(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INDEX)
 
#define DUK_STRIDX_PROTOTYPE   50 /* 'prototype' */
 
#define DUK_HEAP_STRING_PROTOTYPE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PROTOTYPE)
 
#define DUK_HTHREAD_STRING_PROTOTYPE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PROTOTYPE)
 
#define DUK_STRIDX_CONSTRUCTOR   51 /* 'constructor' */
 
#define DUK_HEAP_STRING_CONSTRUCTOR(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CONSTRUCTOR)
 
#define DUK_HTHREAD_STRING_CONSTRUCTOR(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CONSTRUCTOR)
 
#define DUK_STRIDX_MESSAGE   52 /* 'message' */
 
#define DUK_HEAP_STRING_MESSAGE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MESSAGE)
 
#define DUK_HTHREAD_STRING_MESSAGE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MESSAGE)
 
#define DUK_STRIDX_LC_BOOLEAN   53 /* 'boolean' */
 
#define DUK_HEAP_STRING_LC_BOOLEAN(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_BOOLEAN)
 
#define DUK_HTHREAD_STRING_LC_BOOLEAN(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_BOOLEAN)
 
#define DUK_STRIDX_LC_NUMBER   54 /* 'number' */
 
#define DUK_HEAP_STRING_LC_NUMBER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_NUMBER)
 
#define DUK_HTHREAD_STRING_LC_NUMBER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_NUMBER)
 
#define DUK_STRIDX_LC_STRING   55 /* 'string' */
 
#define DUK_HEAP_STRING_LC_STRING(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_STRING)
 
#define DUK_HTHREAD_STRING_LC_STRING(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_STRING)
 
#define DUK_STRIDX_LC_OBJECT   56 /* 'object' */
 
#define DUK_HEAP_STRING_LC_OBJECT(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_OBJECT)
 
#define DUK_HTHREAD_STRING_LC_OBJECT(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_OBJECT)
 
#define DUK_STRIDX_LC_UNDEFINED   57 /* 'undefined' */
 
#define DUK_HEAP_STRING_LC_UNDEFINED(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_UNDEFINED)
 
#define DUK_HTHREAD_STRING_LC_UNDEFINED(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_UNDEFINED)
 
#define DUK_STRIDX_NAN   58 /* 'NaN' */
 
#define DUK_HEAP_STRING_NAN(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_NAN)
 
#define DUK_HTHREAD_STRING_NAN(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_NAN)
 
#define DUK_STRIDX_INFINITY   59 /* 'Infinity' */
 
#define DUK_HEAP_STRING_INFINITY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INFINITY)
 
#define DUK_HTHREAD_STRING_INFINITY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INFINITY)
 
#define DUK_STRIDX_MINUS_INFINITY   60 /* '-Infinity' */
 
#define DUK_HEAP_STRING_MINUS_INFINITY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MINUS_INFINITY)
 
#define DUK_HTHREAD_STRING_MINUS_INFINITY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MINUS_INFINITY)
 
#define DUK_STRIDX_MINUS_ZERO   61 /* '-0' */
 
#define DUK_HEAP_STRING_MINUS_ZERO(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MINUS_ZERO)
 
#define DUK_HTHREAD_STRING_MINUS_ZERO(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MINUS_ZERO)
 
#define DUK_STRIDX_COMMA   62 /* ',' */
 
#define DUK_HEAP_STRING_COMMA(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_COMMA)
 
#define DUK_HTHREAD_STRING_COMMA(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_COMMA)
 
#define DUK_STRIDX_SPACE   63 /* ' ' */
 
#define DUK_HEAP_STRING_SPACE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SPACE)
 
#define DUK_HTHREAD_STRING_SPACE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SPACE)
 
#define DUK_STRIDX_NEWLINE_4SPACE   64 /* '\n ' */
 
#define DUK_HEAP_STRING_NEWLINE_4SPACE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_NEWLINE_4SPACE)
 
#define DUK_HTHREAD_STRING_NEWLINE_4SPACE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_NEWLINE_4SPACE)
 
#define DUK_STRIDX_BRACKETED_ELLIPSIS   65 /* '[...]' */
 
#define DUK_HEAP_STRING_BRACKETED_ELLIPSIS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BRACKETED_ELLIPSIS)
 
#define DUK_HTHREAD_STRING_BRACKETED_ELLIPSIS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BRACKETED_ELLIPSIS)
 
#define DUK_STRIDX_INVALID_DATE   66 /* 'Invalid Date' */
 
#define DUK_HEAP_STRING_INVALID_DATE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INVALID_DATE)
 
#define DUK_HTHREAD_STRING_INVALID_DATE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INVALID_DATE)
 
#define DUK_STRIDX_LC_ARGUMENTS   67 /* 'arguments' */
 
#define DUK_HEAP_STRING_LC_ARGUMENTS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_ARGUMENTS)
 
#define DUK_HTHREAD_STRING_LC_ARGUMENTS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_ARGUMENTS)
 
#define DUK_STRIDX_CALLEE   68 /* 'callee' */
 
#define DUK_HEAP_STRING_CALLEE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CALLEE)
 
#define DUK_HTHREAD_STRING_CALLEE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CALLEE)
 
#define DUK_STRIDX_CALLER   69 /* 'caller' */
 
#define DUK_HEAP_STRING_CALLER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CALLER)
 
#define DUK_HTHREAD_STRING_CALLER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CALLER)
 
#define DUK_STRIDX_HAS   70 /* 'has' */
 
#define DUK_HEAP_STRING_HAS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_HAS)
 
#define DUK_HTHREAD_STRING_HAS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_HAS)
 
#define DUK_STRIDX_GET   71 /* 'get' */
 
#define DUK_HEAP_STRING_GET(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_GET)
 
#define DUK_HTHREAD_STRING_GET(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_GET)
 
#define DUK_STRIDX_DELETE_PROPERTY   72 /* 'deleteProperty' */
 
#define DUK_HEAP_STRING_DELETE_PROPERTY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DELETE_PROPERTY)
 
#define DUK_HTHREAD_STRING_DELETE_PROPERTY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DELETE_PROPERTY)
 
#define DUK_STRIDX_ENUMERATE   73 /* 'enumerate' */
 
#define DUK_HEAP_STRING_ENUMERATE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ENUMERATE)
 
#define DUK_HTHREAD_STRING_ENUMERATE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ENUMERATE)
 
#define DUK_STRIDX_OWN_KEYS   74 /* 'ownKeys' */
 
#define DUK_HEAP_STRING_OWN_KEYS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_OWN_KEYS)
 
#define DUK_HTHREAD_STRING_OWN_KEYS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_OWN_KEYS)
 
#define DUK_STRIDX_SET_PROTOTYPE_OF   75 /* 'setPrototypeOf' */
 
#define DUK_HEAP_STRING_SET_PROTOTYPE_OF(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SET_PROTOTYPE_OF)
 
#define DUK_HTHREAD_STRING_SET_PROTOTYPE_OF(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SET_PROTOTYPE_OF)
 
#define DUK_STRIDX___PROTO__   76 /* '__proto__' */
 
#define DUK_HEAP_STRING___PROTO__(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX___PROTO__)
 
#define DUK_HTHREAD_STRING___PROTO__(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX___PROTO__)
 
#define DUK_STRIDX_REQUIRE   77 /* 'require' */
 
#define DUK_HEAP_STRING_REQUIRE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_REQUIRE)
 
#define DUK_HTHREAD_STRING_REQUIRE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_REQUIRE)
 
#define DUK_STRIDX_ID   78 /* 'id' */
 
#define DUK_HEAP_STRING_ID(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ID)
 
#define DUK_HTHREAD_STRING_ID(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ID)
 
#define DUK_STRIDX_EXPORTS   79 /* 'exports' */
 
#define DUK_HEAP_STRING_EXPORTS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EXPORTS)
 
#define DUK_HTHREAD_STRING_EXPORTS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EXPORTS)
 
#define DUK_STRIDX_FILENAME   80 /* 'filename' */
 
#define DUK_HEAP_STRING_FILENAME(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FILENAME)
 
#define DUK_HTHREAD_STRING_FILENAME(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FILENAME)
 
#define DUK_STRIDX_TO_STRING   81 /* 'toString' */
 
#define DUK_HEAP_STRING_TO_STRING(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_STRING)
 
#define DUK_HTHREAD_STRING_TO_STRING(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_STRING)
 
#define DUK_STRIDX_TO_JSON   82 /* 'toJSON' */
 
#define DUK_HEAP_STRING_TO_JSON(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_JSON)
 
#define DUK_HTHREAD_STRING_TO_JSON(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_JSON)
 
#define DUK_STRIDX_TYPE   83 /* 'type' */
 
#define DUK_HEAP_STRING_TYPE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TYPE)
 
#define DUK_HTHREAD_STRING_TYPE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TYPE)
 
#define DUK_STRIDX_DATA   84 /* 'data' */
 
#define DUK_HEAP_STRING_DATA(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DATA)
 
#define DUK_HTHREAD_STRING_DATA(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DATA)
 
#define DUK_STRIDX_LENGTH   85 /* 'length' */
 
#define DUK_HEAP_STRING_LENGTH(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LENGTH)
 
#define DUK_HTHREAD_STRING_LENGTH(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LENGTH)
 
#define DUK_STRIDX_BYTE_LENGTH   86 /* 'byteLength' */
 
#define DUK_HEAP_STRING_BYTE_LENGTH(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BYTE_LENGTH)
 
#define DUK_HTHREAD_STRING_BYTE_LENGTH(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BYTE_LENGTH)
 
#define DUK_STRIDX_BYTE_OFFSET   87 /* 'byteOffset' */
 
#define DUK_HEAP_STRING_BYTE_OFFSET(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BYTE_OFFSET)
 
#define DUK_HTHREAD_STRING_BYTE_OFFSET(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BYTE_OFFSET)
 
#define DUK_STRIDX_BYTES_PER_ELEMENT   88 /* 'BYTES_PER_ELEMENT' */
 
#define DUK_HEAP_STRING_BYTES_PER_ELEMENT(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BYTES_PER_ELEMENT)
 
#define DUK_HTHREAD_STRING_BYTES_PER_ELEMENT(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BYTES_PER_ELEMENT)
 
#define DUK_STRIDX_SET   89 /* 'set' */
 
#define DUK_HEAP_STRING_SET(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SET)
 
#define DUK_HTHREAD_STRING_SET(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SET)
 
#define DUK_STRIDX_STACK   90 /* 'stack' */
 
#define DUK_HEAP_STRING_STACK(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_STACK)
 
#define DUK_HTHREAD_STRING_STACK(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_STACK)
 
#define DUK_STRIDX_PC   91 /* 'pc' */
 
#define DUK_HEAP_STRING_PC(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PC)
 
#define DUK_HTHREAD_STRING_PC(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PC)
 
#define DUK_STRIDX_LINE_NUMBER   92 /* 'lineNumber' */
 
#define DUK_HEAP_STRING_LINE_NUMBER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LINE_NUMBER)
 
#define DUK_HTHREAD_STRING_LINE_NUMBER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LINE_NUMBER)
 
#define DUK_STRIDX_INT_TRACEDATA   93 /* '\xffTracedata' */
 
#define DUK_HEAP_STRING_INT_TRACEDATA(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_TRACEDATA)
 
#define DUK_HTHREAD_STRING_INT_TRACEDATA(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_TRACEDATA)
 
#define DUK_STRIDX_NAME   94 /* 'name' */
 
#define DUK_HEAP_STRING_NAME(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_NAME)
 
#define DUK_HTHREAD_STRING_NAME(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_NAME)
 
#define DUK_STRIDX_FILE_NAME   95 /* 'fileName' */
 
#define DUK_HEAP_STRING_FILE_NAME(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FILE_NAME)
 
#define DUK_HTHREAD_STRING_FILE_NAME(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FILE_NAME)
 
#define DUK_STRIDX_LC_BUFFER   96 /* 'buffer' */
 
#define DUK_HEAP_STRING_LC_BUFFER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_BUFFER)
 
#define DUK_HTHREAD_STRING_LC_BUFFER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_BUFFER)
 
#define DUK_STRIDX_LC_POINTER   97 /* 'pointer' */
 
#define DUK_HEAP_STRING_LC_POINTER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_POINTER)
 
#define DUK_HTHREAD_STRING_LC_POINTER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_POINTER)
 
#define DUK_STRIDX_INT_VALUE   98 /* '\xffValue' */
 
#define DUK_HEAP_STRING_INT_VALUE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_VALUE)
 
#define DUK_HTHREAD_STRING_INT_VALUE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_VALUE)
 
#define DUK_STRIDX_INT_NEXT   99 /* '\xffNext' */
 
#define DUK_HEAP_STRING_INT_NEXT(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_NEXT)
 
#define DUK_HTHREAD_STRING_INT_NEXT(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_NEXT)
 
#define DUK_STRIDX_INT_BYTECODE   100 /* '\xffBytecode' */
 
#define DUK_HEAP_STRING_INT_BYTECODE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_BYTECODE)
 
#define DUK_HTHREAD_STRING_INT_BYTECODE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_BYTECODE)
 
#define DUK_STRIDX_INT_FORMALS   101 /* '\xffFormals' */
 
#define DUK_HEAP_STRING_INT_FORMALS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_FORMALS)
 
#define DUK_HTHREAD_STRING_INT_FORMALS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_FORMALS)
 
#define DUK_STRIDX_INT_VARMAP   102 /* '\xffVarmap' */
 
#define DUK_HEAP_STRING_INT_VARMAP(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_VARMAP)
 
#define DUK_HTHREAD_STRING_INT_VARMAP(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_VARMAP)
 
#define DUK_STRIDX_INT_LEXENV   103 /* '\xffLexenv' */
 
#define DUK_HEAP_STRING_INT_LEXENV(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_LEXENV)
 
#define DUK_HTHREAD_STRING_INT_LEXENV(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_LEXENV)
 
#define DUK_STRIDX_INT_VARENV   104 /* '\xffVarenv' */
 
#define DUK_HEAP_STRING_INT_VARENV(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_VARENV)
 
#define DUK_HTHREAD_STRING_INT_VARENV(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_VARENV)
 
#define DUK_STRIDX_INT_SOURCE   105 /* '\xffSource' */
 
#define DUK_HEAP_STRING_INT_SOURCE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_SOURCE)
 
#define DUK_HTHREAD_STRING_INT_SOURCE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_SOURCE)
 
#define DUK_STRIDX_INT_PC2LINE   106 /* '\xffPc2line' */
 
#define DUK_HEAP_STRING_INT_PC2LINE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_PC2LINE)
 
#define DUK_HTHREAD_STRING_INT_PC2LINE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_PC2LINE)
 
#define DUK_STRIDX_INT_ARGS   107 /* '\xffArgs' */
 
#define DUK_HEAP_STRING_INT_ARGS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_ARGS)
 
#define DUK_HTHREAD_STRING_INT_ARGS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_ARGS)
 
#define DUK_STRIDX_INT_MAP   108 /* '\xffMap' */
 
#define DUK_HEAP_STRING_INT_MAP(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_MAP)
 
#define DUK_HTHREAD_STRING_INT_MAP(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_MAP)
 
#define DUK_STRIDX_INT_FINALIZER   109 /* '\xffFinalizer' */
 
#define DUK_HEAP_STRING_INT_FINALIZER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_FINALIZER)
 
#define DUK_HTHREAD_STRING_INT_FINALIZER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_FINALIZER)
 
#define DUK_STRIDX_INT_HANDLER   110 /* '\xffHandler' */
 
#define DUK_HEAP_STRING_INT_HANDLER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_HANDLER)
 
#define DUK_HTHREAD_STRING_INT_HANDLER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_HANDLER)
 
#define DUK_STRIDX_INT_CALLEE   111 /* '\xffCallee' */
 
#define DUK_HEAP_STRING_INT_CALLEE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_CALLEE)
 
#define DUK_HTHREAD_STRING_INT_CALLEE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_CALLEE)
 
#define DUK_STRIDX_INT_THREAD   112 /* '\xffThread' */
 
#define DUK_HEAP_STRING_INT_THREAD(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_THREAD)
 
#define DUK_HTHREAD_STRING_INT_THREAD(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_THREAD)
 
#define DUK_STRIDX_INT_REGBASE   113 /* '\xffRegbase' */
 
#define DUK_HEAP_STRING_INT_REGBASE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_REGBASE)
 
#define DUK_HTHREAD_STRING_INT_REGBASE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_REGBASE)
 
#define DUK_STRIDX_INT_TARGET   114 /* '\xffTarget' */
 
#define DUK_HEAP_STRING_INT_TARGET(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_TARGET)
 
#define DUK_HTHREAD_STRING_INT_TARGET(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_TARGET)
 
#define DUK_STRIDX_INT_THIS   115 /* '\xffThis' */
 
#define DUK_HEAP_STRING_INT_THIS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_THIS)
 
#define DUK_HTHREAD_STRING_INT_THIS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_THIS)
 
#define DUK_STRIDX_COMPILE   116 /* 'compile' */
 
#define DUK_HEAP_STRING_COMPILE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_COMPILE)
 
#define DUK_HTHREAD_STRING_COMPILE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_COMPILE)
 
#define DUK_STRIDX_INPUT   117 /* 'input' */
 
#define DUK_HEAP_STRING_INPUT(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INPUT)
 
#define DUK_HTHREAD_STRING_INPUT(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INPUT)
 
#define DUK_STRIDX_ERR_CREATE   118 /* 'errCreate' */
 
#define DUK_HEAP_STRING_ERR_CREATE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ERR_CREATE)
 
#define DUK_HTHREAD_STRING_ERR_CREATE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ERR_CREATE)
 
#define DUK_STRIDX_ERR_THROW   119 /* 'errThrow' */
 
#define DUK_HEAP_STRING_ERR_THROW(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ERR_THROW)
 
#define DUK_HTHREAD_STRING_ERR_THROW(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ERR_THROW)
 
#define DUK_STRIDX_MOD_SEARCH   120 /* 'modSearch' */
 
#define DUK_HEAP_STRING_MOD_SEARCH(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MOD_SEARCH)
 
#define DUK_HTHREAD_STRING_MOD_SEARCH(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MOD_SEARCH)
 
#define DUK_STRIDX_MOD_LOADED   121 /* 'modLoaded' */
 
#define DUK_HEAP_STRING_MOD_LOADED(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MOD_LOADED)
 
#define DUK_HTHREAD_STRING_MOD_LOADED(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MOD_LOADED)
 
#define DUK_STRIDX_ENV   122 /* 'env' */
 
#define DUK_HEAP_STRING_ENV(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ENV)
 
#define DUK_HTHREAD_STRING_ENV(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ENV)
 
#define DUK_STRIDX_HEX   123 /* 'hex' */
 
#define DUK_HEAP_STRING_HEX(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_HEX)
 
#define DUK_HTHREAD_STRING_HEX(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_HEX)
 
#define DUK_STRIDX_BASE64   124 /* 'base64' */
 
#define DUK_HEAP_STRING_BASE64(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BASE64)
 
#define DUK_HTHREAD_STRING_BASE64(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BASE64)
 
#define DUK_STRIDX_JX   125 /* 'jx' */
 
#define DUK_HEAP_STRING_JX(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JX)
 
#define DUK_HTHREAD_STRING_JX(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JX)
 
#define DUK_STRIDX_JC   126 /* 'jc' */
 
#define DUK_HEAP_STRING_JC(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JC)
 
#define DUK_HTHREAD_STRING_JC(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JC)
 
#define DUK_STRIDX_RESUME   127 /* 'resume' */
 
#define DUK_HEAP_STRING_RESUME(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_RESUME)
 
#define DUK_HTHREAD_STRING_RESUME(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_RESUME)
 
#define DUK_STRIDX_FMT   128 /* 'fmt' */
 
#define DUK_HEAP_STRING_FMT(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FMT)
 
#define DUK_HTHREAD_STRING_FMT(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FMT)
 
#define DUK_STRIDX_RAW   129 /* 'raw' */
 
#define DUK_HEAP_STRING_RAW(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_RAW)
 
#define DUK_HTHREAD_STRING_RAW(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_RAW)
 
#define DUK_STRIDX_LC_TRACE   130 /* 'trace' */
 
#define DUK_HEAP_STRING_LC_TRACE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_TRACE)
 
#define DUK_HTHREAD_STRING_LC_TRACE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_TRACE)
 
#define DUK_STRIDX_LC_DEBUG   131 /* 'debug' */
 
#define DUK_HEAP_STRING_LC_DEBUG(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_DEBUG)
 
#define DUK_HTHREAD_STRING_LC_DEBUG(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_DEBUG)
 
#define DUK_STRIDX_LC_INFO   132 /* 'info' */
 
#define DUK_HEAP_STRING_LC_INFO(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_INFO)
 
#define DUK_HTHREAD_STRING_LC_INFO(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_INFO)
 
#define DUK_STRIDX_LC_WARN   133 /* 'warn' */
 
#define DUK_HEAP_STRING_LC_WARN(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_WARN)
 
#define DUK_HTHREAD_STRING_LC_WARN(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_WARN)
 
#define DUK_STRIDX_LC_ERROR   134 /* 'error' */
 
#define DUK_HEAP_STRING_LC_ERROR(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_ERROR)
 
#define DUK_HTHREAD_STRING_LC_ERROR(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_ERROR)
 
#define DUK_STRIDX_LC_FATAL   135 /* 'fatal' */
 
#define DUK_HEAP_STRING_LC_FATAL(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_FATAL)
 
#define DUK_HTHREAD_STRING_LC_FATAL(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_FATAL)
 
#define DUK_STRIDX_LC_N   136 /* 'n' */
 
#define DUK_HEAP_STRING_LC_N(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_N)
 
#define DUK_HTHREAD_STRING_LC_N(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_N)
 
#define DUK_STRIDX_LC_L   137 /* 'l' */
 
#define DUK_HEAP_STRING_LC_L(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_L)
 
#define DUK_HTHREAD_STRING_LC_L(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_L)
 
#define DUK_STRIDX_CLOG   138 /* 'clog' */
 
#define DUK_HEAP_STRING_CLOG(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CLOG)
 
#define DUK_HTHREAD_STRING_CLOG(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CLOG)
 
#define DUK_STRIDX_TO_LOG_STRING   139 /* 'toLogString' */
 
#define DUK_HEAP_STRING_TO_LOG_STRING(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_LOG_STRING)
 
#define DUK_HTHREAD_STRING_TO_LOG_STRING(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_LOG_STRING)
 
#define DUK_STRIDX_JSON_EXT_UNDEFINED   140 /* '{"_undef":true}' */
 
#define DUK_HEAP_STRING_JSON_EXT_UNDEFINED(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_UNDEFINED)
 
#define DUK_HTHREAD_STRING_JSON_EXT_UNDEFINED(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_UNDEFINED)
 
#define DUK_STRIDX_JSON_EXT_NAN   141 /* '{"_nan":true}' */
 
#define DUK_HEAP_STRING_JSON_EXT_NAN(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_NAN)
 
#define DUK_HTHREAD_STRING_JSON_EXT_NAN(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_NAN)
 
#define DUK_STRIDX_JSON_EXT_POSINF   142 /* '{"_inf":true}' */
 
#define DUK_HEAP_STRING_JSON_EXT_POSINF(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_POSINF)
 
#define DUK_HTHREAD_STRING_JSON_EXT_POSINF(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_POSINF)
 
#define DUK_STRIDX_JSON_EXT_NEGINF   143 /* '{"_ninf":true}' */
 
#define DUK_HEAP_STRING_JSON_EXT_NEGINF(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_NEGINF)
 
#define DUK_HTHREAD_STRING_JSON_EXT_NEGINF(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_NEGINF)
 
#define DUK_STRIDX_JSON_EXT_FUNCTION1   144 /* '{"_func":true}' */
 
#define DUK_HEAP_STRING_JSON_EXT_FUNCTION1(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_FUNCTION1)
 
#define DUK_HTHREAD_STRING_JSON_EXT_FUNCTION1(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_FUNCTION1)
 
#define DUK_STRIDX_JSON_EXT_FUNCTION2   145 /* '{_func:true}' */
 
#define DUK_HEAP_STRING_JSON_EXT_FUNCTION2(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_FUNCTION2)
 
#define DUK_HTHREAD_STRING_JSON_EXT_FUNCTION2(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_FUNCTION2)
 
#define DUK_STRIDX_BREAK   146 /* 'break' */
 
#define DUK_HEAP_STRING_BREAK(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BREAK)
 
#define DUK_HTHREAD_STRING_BREAK(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BREAK)
 
#define DUK_STRIDX_CASE   147 /* 'case' */
 
#define DUK_HEAP_STRING_CASE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CASE)
 
#define DUK_HTHREAD_STRING_CASE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CASE)
 
#define DUK_STRIDX_CATCH   148 /* 'catch' */
 
#define DUK_HEAP_STRING_CATCH(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CATCH)
 
#define DUK_HTHREAD_STRING_CATCH(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CATCH)
 
#define DUK_STRIDX_CONTINUE   149 /* 'continue' */
 
#define DUK_HEAP_STRING_CONTINUE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CONTINUE)
 
#define DUK_HTHREAD_STRING_CONTINUE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CONTINUE)
 
#define DUK_STRIDX_DEBUGGER   150 /* 'debugger' */
 
#define DUK_HEAP_STRING_DEBUGGER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DEBUGGER)
 
#define DUK_HTHREAD_STRING_DEBUGGER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DEBUGGER)
 
#define DUK_STRIDX_DEFAULT   151 /* 'default' */
 
#define DUK_HEAP_STRING_DEFAULT(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DEFAULT)
 
#define DUK_HTHREAD_STRING_DEFAULT(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DEFAULT)
 
#define DUK_STRIDX_DELETE   152 /* 'delete' */
 
#define DUK_HEAP_STRING_DELETE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DELETE)
 
#define DUK_HTHREAD_STRING_DELETE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DELETE)
 
#define DUK_STRIDX_DO   153 /* 'do' */
 
#define DUK_HEAP_STRING_DO(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DO)
 
#define DUK_HTHREAD_STRING_DO(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DO)
 
#define DUK_STRIDX_ELSE   154 /* 'else' */
 
#define DUK_HEAP_STRING_ELSE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ELSE)
 
#define DUK_HTHREAD_STRING_ELSE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ELSE)
 
#define DUK_STRIDX_FINALLY   155 /* 'finally' */
 
#define DUK_HEAP_STRING_FINALLY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FINALLY)
 
#define DUK_HTHREAD_STRING_FINALLY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FINALLY)
 
#define DUK_STRIDX_FOR   156 /* 'for' */
 
#define DUK_HEAP_STRING_FOR(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FOR)
 
#define DUK_HTHREAD_STRING_FOR(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FOR)
 
#define DUK_STRIDX_LC_FUNCTION   157 /* 'function' */
 
#define DUK_HEAP_STRING_LC_FUNCTION(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_FUNCTION)
 
#define DUK_HTHREAD_STRING_LC_FUNCTION(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_FUNCTION)
 
#define DUK_STRIDX_IF   158 /* 'if' */
 
#define DUK_HEAP_STRING_IF(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IF)
 
#define DUK_HTHREAD_STRING_IF(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IF)
 
#define DUK_STRIDX_IN   159 /* 'in' */
 
#define DUK_HEAP_STRING_IN(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IN)
 
#define DUK_HTHREAD_STRING_IN(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IN)
 
#define DUK_STRIDX_INSTANCEOF   160 /* 'instanceof' */
 
#define DUK_HEAP_STRING_INSTANCEOF(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INSTANCEOF)
 
#define DUK_HTHREAD_STRING_INSTANCEOF(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INSTANCEOF)
 
#define DUK_STRIDX_NEW   161 /* 'new' */
 
#define DUK_HEAP_STRING_NEW(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_NEW)
 
#define DUK_HTHREAD_STRING_NEW(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_NEW)
 
#define DUK_STRIDX_RETURN   162 /* 'return' */
 
#define DUK_HEAP_STRING_RETURN(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_RETURN)
 
#define DUK_HTHREAD_STRING_RETURN(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_RETURN)
 
#define DUK_STRIDX_SWITCH   163 /* 'switch' */
 
#define DUK_HEAP_STRING_SWITCH(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SWITCH)
 
#define DUK_HTHREAD_STRING_SWITCH(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SWITCH)
 
#define DUK_STRIDX_THIS   164 /* 'this' */
 
#define DUK_HEAP_STRING_THIS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_THIS)
 
#define DUK_HTHREAD_STRING_THIS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_THIS)
 
#define DUK_STRIDX_THROW   165 /* 'throw' */
 
#define DUK_HEAP_STRING_THROW(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_THROW)
 
#define DUK_HTHREAD_STRING_THROW(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_THROW)
 
#define DUK_STRIDX_TRY   166 /* 'try' */
 
#define DUK_HEAP_STRING_TRY(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TRY)
 
#define DUK_HTHREAD_STRING_TRY(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TRY)
 
#define DUK_STRIDX_TYPEOF   167 /* 'typeof' */
 
#define DUK_HEAP_STRING_TYPEOF(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TYPEOF)
 
#define DUK_HTHREAD_STRING_TYPEOF(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TYPEOF)
 
#define DUK_STRIDX_VAR   168 /* 'var' */
 
#define DUK_HEAP_STRING_VAR(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_VAR)
 
#define DUK_HTHREAD_STRING_VAR(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_VAR)
 
#define DUK_STRIDX_CONST   169 /* 'const' */
 
#define DUK_HEAP_STRING_CONST(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CONST)
 
#define DUK_HTHREAD_STRING_CONST(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CONST)
 
#define DUK_STRIDX_VOID   170 /* 'void' */
 
#define DUK_HEAP_STRING_VOID(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_VOID)
 
#define DUK_HTHREAD_STRING_VOID(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_VOID)
 
#define DUK_STRIDX_WHILE   171 /* 'while' */
 
#define DUK_HEAP_STRING_WHILE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_WHILE)
 
#define DUK_HTHREAD_STRING_WHILE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_WHILE)
 
#define DUK_STRIDX_WITH   172 /* 'with' */
 
#define DUK_HEAP_STRING_WITH(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_WITH)
 
#define DUK_HTHREAD_STRING_WITH(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_WITH)
 
#define DUK_STRIDX_CLASS   173 /* 'class' */
 
#define DUK_HEAP_STRING_CLASS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CLASS)
 
#define DUK_HTHREAD_STRING_CLASS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CLASS)
 
#define DUK_STRIDX_ENUM   174 /* 'enum' */
 
#define DUK_HEAP_STRING_ENUM(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ENUM)
 
#define DUK_HTHREAD_STRING_ENUM(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ENUM)
 
#define DUK_STRIDX_EXPORT   175 /* 'export' */
 
#define DUK_HEAP_STRING_EXPORT(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EXPORT)
 
#define DUK_HTHREAD_STRING_EXPORT(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EXPORT)
 
#define DUK_STRIDX_EXTENDS   176 /* 'extends' */
 
#define DUK_HEAP_STRING_EXTENDS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EXTENDS)
 
#define DUK_HTHREAD_STRING_EXTENDS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EXTENDS)
 
#define DUK_STRIDX_IMPORT   177 /* 'import' */
 
#define DUK_HEAP_STRING_IMPORT(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IMPORT)
 
#define DUK_HTHREAD_STRING_IMPORT(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IMPORT)
 
#define DUK_STRIDX_SUPER   178 /* 'super' */
 
#define DUK_HEAP_STRING_SUPER(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SUPER)
 
#define DUK_HTHREAD_STRING_SUPER(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SUPER)
 
#define DUK_STRIDX_LC_NULL   179 /* 'null' */
 
#define DUK_HEAP_STRING_LC_NULL(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_NULL)
 
#define DUK_HTHREAD_STRING_LC_NULL(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_NULL)
 
#define DUK_STRIDX_TRUE   180 /* 'true' */
 
#define DUK_HEAP_STRING_TRUE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TRUE)
 
#define DUK_HTHREAD_STRING_TRUE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TRUE)
 
#define DUK_STRIDX_FALSE   181 /* 'false' */
 
#define DUK_HEAP_STRING_FALSE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FALSE)
 
#define DUK_HTHREAD_STRING_FALSE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FALSE)
 
#define DUK_STRIDX_IMPLEMENTS   182 /* 'implements' */
 
#define DUK_HEAP_STRING_IMPLEMENTS(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IMPLEMENTS)
 
#define DUK_HTHREAD_STRING_IMPLEMENTS(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IMPLEMENTS)
 
#define DUK_STRIDX_INTERFACE   183 /* 'interface' */
 
#define DUK_HEAP_STRING_INTERFACE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INTERFACE)
 
#define DUK_HTHREAD_STRING_INTERFACE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INTERFACE)
 
#define DUK_STRIDX_LET   184 /* 'let' */
 
#define DUK_HEAP_STRING_LET(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LET)
 
#define DUK_HTHREAD_STRING_LET(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LET)
 
#define DUK_STRIDX_PACKAGE   185 /* 'package' */
 
#define DUK_HEAP_STRING_PACKAGE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PACKAGE)
 
#define DUK_HTHREAD_STRING_PACKAGE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PACKAGE)
 
#define DUK_STRIDX_PRIVATE   186 /* 'private' */
 
#define DUK_HEAP_STRING_PRIVATE(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PRIVATE)
 
#define DUK_HTHREAD_STRING_PRIVATE(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PRIVATE)
 
#define DUK_STRIDX_PROTECTED   187 /* 'protected' */
 
#define DUK_HEAP_STRING_PROTECTED(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PROTECTED)
 
#define DUK_HTHREAD_STRING_PROTECTED(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PROTECTED)
 
#define DUK_STRIDX_PUBLIC   188 /* 'public' */
 
#define DUK_HEAP_STRING_PUBLIC(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PUBLIC)
 
#define DUK_HTHREAD_STRING_PUBLIC(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PUBLIC)
 
#define DUK_STRIDX_STATIC   189 /* 'static' */
 
#define DUK_HEAP_STRING_STATIC(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_STATIC)
 
#define DUK_HTHREAD_STRING_STATIC(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_STATIC)
 
#define DUK_STRIDX_YIELD   190 /* 'yield' */
 
#define DUK_HEAP_STRING_YIELD(heap)   DUK_HEAP_GET_STRING((heap),DUK_STRIDX_YIELD)
 
#define DUK_HTHREAD_STRING_YIELD(thr)   DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_YIELD)
 
#define DUK_HEAP_NUM_STRINGS   191
 
#define DUK_STRIDX_START_RESERVED   146
 
#define DUK_STRIDX_START_STRICT_RESERVED   182
 
#define DUK_STRIDX_END_RESERVED   191 /* exclusive endpoint */
 
#define DUK_STRDATA_MAX_STRLEN   17
 
#define DUK_STRDATA_DATA_LENGTH   1049
 
#define DUK_BIDX_GLOBAL   0
 
#define DUK_BIDX_GLOBAL_ENV   1
 
#define DUK_BIDX_OBJECT_CONSTRUCTOR   2
 
#define DUK_BIDX_OBJECT_PROTOTYPE   3
 
#define DUK_BIDX_FUNCTION_CONSTRUCTOR   4
 
#define DUK_BIDX_FUNCTION_PROTOTYPE   5
 
#define DUK_BIDX_ARRAY_CONSTRUCTOR   6
 
#define DUK_BIDX_ARRAY_PROTOTYPE   7
 
#define DUK_BIDX_STRING_CONSTRUCTOR   8
 
#define DUK_BIDX_STRING_PROTOTYPE   9
 
#define DUK_BIDX_BOOLEAN_CONSTRUCTOR   10
 
#define DUK_BIDX_BOOLEAN_PROTOTYPE   11
 
#define DUK_BIDX_NUMBER_CONSTRUCTOR   12
 
#define DUK_BIDX_NUMBER_PROTOTYPE   13
 
#define DUK_BIDX_DATE_CONSTRUCTOR   14
 
#define DUK_BIDX_DATE_PROTOTYPE   15
 
#define DUK_BIDX_REGEXP_CONSTRUCTOR   16
 
#define DUK_BIDX_REGEXP_PROTOTYPE   17
 
#define DUK_BIDX_ERROR_CONSTRUCTOR   18
 
#define DUK_BIDX_ERROR_PROTOTYPE   19
 
#define DUK_BIDX_EVAL_ERROR_CONSTRUCTOR   20
 
#define DUK_BIDX_EVAL_ERROR_PROTOTYPE   21
 
#define DUK_BIDX_RANGE_ERROR_CONSTRUCTOR   22
 
#define DUK_BIDX_RANGE_ERROR_PROTOTYPE   23
 
#define DUK_BIDX_REFERENCE_ERROR_CONSTRUCTOR   24
 
#define DUK_BIDX_REFERENCE_ERROR_PROTOTYPE   25
 
#define DUK_BIDX_SYNTAX_ERROR_CONSTRUCTOR   26
 
#define DUK_BIDX_SYNTAX_ERROR_PROTOTYPE   27
 
#define DUK_BIDX_TYPE_ERROR_CONSTRUCTOR   28
 
#define DUK_BIDX_TYPE_ERROR_PROTOTYPE   29
 
#define DUK_BIDX_URI_ERROR_CONSTRUCTOR   30
 
#define DUK_BIDX_URI_ERROR_PROTOTYPE   31
 
#define DUK_BIDX_MATH   32
 
#define DUK_BIDX_JSON   33
 
#define DUK_BIDX_TYPE_ERROR_THROWER   34
 
#define DUK_BIDX_PROXY_CONSTRUCTOR   35
 
#define DUK_BIDX_DUKTAPE   36
 
#define DUK_BIDX_THREAD_CONSTRUCTOR   37
 
#define DUK_BIDX_THREAD_PROTOTYPE   38
 
#define DUK_BIDX_BUFFER_CONSTRUCTOR   39
 
#define DUK_BIDX_BUFFER_PROTOTYPE   40
 
#define DUK_BIDX_POINTER_CONSTRUCTOR   41
 
#define DUK_BIDX_POINTER_PROTOTYPE   42
 
#define DUK_BIDX_LOGGER_CONSTRUCTOR   43
 
#define DUK_BIDX_LOGGER_PROTOTYPE   44
 
#define DUK_BIDX_DOUBLE_ERROR   45
 
#define DUK_BIDX_ARRAYBUFFER_CONSTRUCTOR   46
 
#define DUK_BIDX_ARRAYBUFFER_PROTOTYPE   47
 
#define DUK_BIDX_DATAVIEW_CONSTRUCTOR   48
 
#define DUK_BIDX_DATAVIEW_PROTOTYPE   49
 
#define DUK_BIDX_TYPEDARRAY_PROTOTYPE   50
 
#define DUK_BIDX_INT8ARRAY_CONSTRUCTOR   51
 
#define DUK_BIDX_INT8ARRAY_PROTOTYPE   52
 
#define DUK_BIDX_UINT8ARRAY_CONSTRUCTOR   53
 
#define DUK_BIDX_UINT8ARRAY_PROTOTYPE   54
 
#define DUK_BIDX_UINT8CLAMPEDARRAY_CONSTRUCTOR   55
 
#define DUK_BIDX_UINT8CLAMPEDARRAY_PROTOTYPE   56
 
#define DUK_BIDX_INT16ARRAY_CONSTRUCTOR   57
 
#define DUK_BIDX_INT16ARRAY_PROTOTYPE   58
 
#define DUK_BIDX_UINT16ARRAY_CONSTRUCTOR   59
 
#define DUK_BIDX_UINT16ARRAY_PROTOTYPE   60
 
#define DUK_BIDX_INT32ARRAY_CONSTRUCTOR   61
 
#define DUK_BIDX_INT32ARRAY_PROTOTYPE   62
 
#define DUK_BIDX_UINT32ARRAY_CONSTRUCTOR   63
 
#define DUK_BIDX_UINT32ARRAY_PROTOTYPE   64
 
#define DUK_BIDX_FLOAT32ARRAY_CONSTRUCTOR   65
 
#define DUK_BIDX_FLOAT32ARRAY_PROTOTYPE   66
 
#define DUK_BIDX_FLOAT64ARRAY_CONSTRUCTOR   67
 
#define DUK_BIDX_FLOAT64ARRAY_PROTOTYPE   68
 
#define DUK_BIDX_NODEJS_BUFFER_CONSTRUCTOR   69
 
#define DUK_BIDX_NODEJS_BUFFER_PROTOTYPE   70
 
#define DUK_NUM_BUILTINS   71
 
#define DUK_NUM_BIDX_BUILTINS   71
 
#define DUK_NUM_ALL_BUILTINS   71
 

Functions

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_function_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_boolean_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_regexp_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_constructor_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_type_error_thrower (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_proxy_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_thread_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_pointer_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_logger_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_arraybuffer_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_dataview_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_typedarray_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_constructor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_eval (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_parse_int (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_parse_float (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_is_nan (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_is_finite (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_decode_uri (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_decode_uri_component (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_encode_uri (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_encode_uri_component (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_escape (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_unescape (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_print_helper (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_require (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_getprototype_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_setprototype_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_get_own_property_descriptor (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_keys_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_create (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_define_property (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_define_properties (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_seal_freeze_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_prevent_extensions (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_is_sealed_frozen_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_is_extensible (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_to_string (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_to_locale_string (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_value_of (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_has_own_property (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_is_prototype_of (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_property_is_enumerable (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_to_string (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_apply (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_call (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_bind (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_constructor_is_array (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_to_string (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_join_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_concat (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_pop (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_push (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_reverse (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_shift (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_slice (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_sort (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_splice (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_unshift (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_indexof_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_iter_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_reduce_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_constructor_from_char_code (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_to_string (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_char_at (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_char_code_at (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_concat (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_indexof_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_locale_compare (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_match (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_replace (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_search (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_slice (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_split (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_substring (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_caseconv_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_trim (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_substr (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_boolean_prototype_tostring_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_string (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_locale_string (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_value_of (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_fixed (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_exponential (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_precision (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_constructor_parse (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_constructor_utc (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_constructor_now (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_tostring_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_to_json (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_value_of (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_get_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_get_timezone_offset (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_set_time (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_set_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_regexp_prototype_exec (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_regexp_prototype_test (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_regexp_prototype_to_string (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_stack_getter (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_stack_setter (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_filename_getter (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_filename_setter (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_linenumber_getter (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_linenumber_setter (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_to_string (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_math_object_onearg_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_math_object_twoarg_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_math_object_max (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_math_object_min (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_math_object_random (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_json_object_parse (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_json_object_stringify (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_info (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_act (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_gc (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_fin (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_enc (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_dec (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_compact (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_thread_yield (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_thread_resume (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_thread_current (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_prototype_tostring_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_pointer_prototype_tostring_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_logger_prototype_fmt (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_logger_prototype_raw (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_logger_prototype_log_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_arraybuffer_isview (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_slice_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_readfield (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_writefield (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_typedarray_set (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_concat (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_is_encoding (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_is_buffer (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_byte_length (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_compare_shared (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_tostring (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_tojson (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_fill (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_copy (duk_context *ctx)
 
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_write (duk_context *ctx)
 

Variables

DUK_INTERNAL_DECL const duk_uint8_t duk_strings_data [1049]
 
DUK_INTERNAL_DECL const duk_c_function duk_bi_native_functions [149]
 

Macro Definition Documentation

◆ DUK_BIDX_ARRAY_CONSTRUCTOR

#define DUK_BIDX_ARRAY_CONSTRUCTOR   6

Definition at line 767 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_ARRAY_PROTOTYPE

#define DUK_BIDX_ARRAY_PROTOTYPE   7

Definition at line 768 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_ARRAYBUFFER_CONSTRUCTOR

#define DUK_BIDX_ARRAYBUFFER_CONSTRUCTOR   46

Definition at line 807 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_ARRAYBUFFER_PROTOTYPE

#define DUK_BIDX_ARRAYBUFFER_PROTOTYPE   47

Definition at line 808 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_BOOLEAN_CONSTRUCTOR

#define DUK_BIDX_BOOLEAN_CONSTRUCTOR   10

Definition at line 771 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_BOOLEAN_PROTOTYPE

#define DUK_BIDX_BOOLEAN_PROTOTYPE   11

Definition at line 772 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_BUFFER_CONSTRUCTOR

#define DUK_BIDX_BUFFER_CONSTRUCTOR   39

Definition at line 800 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_BUFFER_PROTOTYPE

#define DUK_BIDX_BUFFER_PROTOTYPE   40

Definition at line 801 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_DATAVIEW_CONSTRUCTOR

#define DUK_BIDX_DATAVIEW_CONSTRUCTOR   48

Definition at line 809 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_DATAVIEW_PROTOTYPE

#define DUK_BIDX_DATAVIEW_PROTOTYPE   49

Definition at line 810 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_DATE_CONSTRUCTOR

#define DUK_BIDX_DATE_CONSTRUCTOR   14

Definition at line 775 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_DATE_PROTOTYPE

#define DUK_BIDX_DATE_PROTOTYPE   15

Definition at line 776 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_DOUBLE_ERROR

#define DUK_BIDX_DOUBLE_ERROR   45

Definition at line 806 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_DUKTAPE

#define DUK_BIDX_DUKTAPE   36

Definition at line 797 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_ERROR_CONSTRUCTOR

#define DUK_BIDX_ERROR_CONSTRUCTOR   18

Definition at line 779 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_ERROR_PROTOTYPE

#define DUK_BIDX_ERROR_PROTOTYPE   19

Definition at line 780 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_EVAL_ERROR_CONSTRUCTOR

#define DUK_BIDX_EVAL_ERROR_CONSTRUCTOR   20

Definition at line 781 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_EVAL_ERROR_PROTOTYPE

#define DUK_BIDX_EVAL_ERROR_PROTOTYPE   21

Definition at line 782 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_FLOAT32ARRAY_CONSTRUCTOR

#define DUK_BIDX_FLOAT32ARRAY_CONSTRUCTOR   65

Definition at line 826 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_FLOAT32ARRAY_PROTOTYPE

#define DUK_BIDX_FLOAT32ARRAY_PROTOTYPE   66

Definition at line 827 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_FLOAT64ARRAY_CONSTRUCTOR

#define DUK_BIDX_FLOAT64ARRAY_CONSTRUCTOR   67

Definition at line 828 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_FLOAT64ARRAY_PROTOTYPE

#define DUK_BIDX_FLOAT64ARRAY_PROTOTYPE   68

Definition at line 829 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_FUNCTION_CONSTRUCTOR

#define DUK_BIDX_FUNCTION_CONSTRUCTOR   4

Definition at line 765 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_FUNCTION_PROTOTYPE

#define DUK_BIDX_FUNCTION_PROTOTYPE   5

Definition at line 766 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_GLOBAL

#define DUK_BIDX_GLOBAL   0

Definition at line 761 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_GLOBAL_ENV

#define DUK_BIDX_GLOBAL_ENV   1

Definition at line 762 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_INT16ARRAY_CONSTRUCTOR

#define DUK_BIDX_INT16ARRAY_CONSTRUCTOR   57

Definition at line 818 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_INT16ARRAY_PROTOTYPE

#define DUK_BIDX_INT16ARRAY_PROTOTYPE   58

Definition at line 819 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_INT32ARRAY_CONSTRUCTOR

#define DUK_BIDX_INT32ARRAY_CONSTRUCTOR   61

Definition at line 822 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_INT32ARRAY_PROTOTYPE

#define DUK_BIDX_INT32ARRAY_PROTOTYPE   62

Definition at line 823 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_INT8ARRAY_CONSTRUCTOR

#define DUK_BIDX_INT8ARRAY_CONSTRUCTOR   51

Definition at line 812 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_INT8ARRAY_PROTOTYPE

#define DUK_BIDX_INT8ARRAY_PROTOTYPE   52

Definition at line 813 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_JSON

#define DUK_BIDX_JSON   33

Definition at line 794 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_LOGGER_CONSTRUCTOR

#define DUK_BIDX_LOGGER_CONSTRUCTOR   43

Definition at line 804 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_LOGGER_PROTOTYPE

#define DUK_BIDX_LOGGER_PROTOTYPE   44

Definition at line 805 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_MATH

#define DUK_BIDX_MATH   32

Definition at line 793 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_NODEJS_BUFFER_CONSTRUCTOR

#define DUK_BIDX_NODEJS_BUFFER_CONSTRUCTOR   69

Definition at line 830 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_NODEJS_BUFFER_PROTOTYPE

#define DUK_BIDX_NODEJS_BUFFER_PROTOTYPE   70

Definition at line 831 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_NUMBER_CONSTRUCTOR

#define DUK_BIDX_NUMBER_CONSTRUCTOR   12

Definition at line 773 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_NUMBER_PROTOTYPE

#define DUK_BIDX_NUMBER_PROTOTYPE   13

Definition at line 774 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_OBJECT_CONSTRUCTOR

#define DUK_BIDX_OBJECT_CONSTRUCTOR   2

Definition at line 763 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_OBJECT_PROTOTYPE

#define DUK_BIDX_OBJECT_PROTOTYPE   3

Definition at line 764 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_POINTER_CONSTRUCTOR

#define DUK_BIDX_POINTER_CONSTRUCTOR   41

Definition at line 802 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_POINTER_PROTOTYPE

#define DUK_BIDX_POINTER_PROTOTYPE   42

Definition at line 803 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_PROXY_CONSTRUCTOR

#define DUK_BIDX_PROXY_CONSTRUCTOR   35

Definition at line 796 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_RANGE_ERROR_CONSTRUCTOR

#define DUK_BIDX_RANGE_ERROR_CONSTRUCTOR   22

Definition at line 783 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_RANGE_ERROR_PROTOTYPE

#define DUK_BIDX_RANGE_ERROR_PROTOTYPE   23

Definition at line 784 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_REFERENCE_ERROR_CONSTRUCTOR

#define DUK_BIDX_REFERENCE_ERROR_CONSTRUCTOR   24

Definition at line 785 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_REFERENCE_ERROR_PROTOTYPE

#define DUK_BIDX_REFERENCE_ERROR_PROTOTYPE   25

Definition at line 786 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_REGEXP_CONSTRUCTOR

#define DUK_BIDX_REGEXP_CONSTRUCTOR   16

Definition at line 777 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_REGEXP_PROTOTYPE

#define DUK_BIDX_REGEXP_PROTOTYPE   17

Definition at line 778 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_STRING_CONSTRUCTOR

#define DUK_BIDX_STRING_CONSTRUCTOR   8

Definition at line 769 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_STRING_PROTOTYPE

#define DUK_BIDX_STRING_PROTOTYPE   9

Definition at line 770 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_SYNTAX_ERROR_CONSTRUCTOR

#define DUK_BIDX_SYNTAX_ERROR_CONSTRUCTOR   26

Definition at line 787 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_SYNTAX_ERROR_PROTOTYPE

#define DUK_BIDX_SYNTAX_ERROR_PROTOTYPE   27

Definition at line 788 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_THREAD_CONSTRUCTOR

#define DUK_BIDX_THREAD_CONSTRUCTOR   37

Definition at line 798 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_THREAD_PROTOTYPE

#define DUK_BIDX_THREAD_PROTOTYPE   38

Definition at line 799 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_TYPE_ERROR_CONSTRUCTOR

#define DUK_BIDX_TYPE_ERROR_CONSTRUCTOR   28

Definition at line 789 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_TYPE_ERROR_PROTOTYPE

#define DUK_BIDX_TYPE_ERROR_PROTOTYPE   29

Definition at line 790 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_TYPE_ERROR_THROWER

#define DUK_BIDX_TYPE_ERROR_THROWER   34

Definition at line 795 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_TYPEDARRAY_PROTOTYPE

#define DUK_BIDX_TYPEDARRAY_PROTOTYPE   50

Definition at line 811 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_UINT16ARRAY_CONSTRUCTOR

#define DUK_BIDX_UINT16ARRAY_CONSTRUCTOR   59

Definition at line 820 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_UINT16ARRAY_PROTOTYPE

#define DUK_BIDX_UINT16ARRAY_PROTOTYPE   60

Definition at line 821 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_UINT32ARRAY_CONSTRUCTOR

#define DUK_BIDX_UINT32ARRAY_CONSTRUCTOR   63

Definition at line 824 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_UINT32ARRAY_PROTOTYPE

#define DUK_BIDX_UINT32ARRAY_PROTOTYPE   64

Definition at line 825 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_UINT8ARRAY_CONSTRUCTOR

#define DUK_BIDX_UINT8ARRAY_CONSTRUCTOR   53

Definition at line 814 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_UINT8ARRAY_PROTOTYPE

#define DUK_BIDX_UINT8ARRAY_PROTOTYPE   54

Definition at line 815 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_UINT8CLAMPEDARRAY_CONSTRUCTOR

#define DUK_BIDX_UINT8CLAMPEDARRAY_CONSTRUCTOR   55

Definition at line 816 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_UINT8CLAMPEDARRAY_PROTOTYPE

#define DUK_BIDX_UINT8CLAMPEDARRAY_PROTOTYPE   56

Definition at line 817 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_URI_ERROR_CONSTRUCTOR

#define DUK_BIDX_URI_ERROR_CONSTRUCTOR   30

Definition at line 791 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_BIDX_URI_ERROR_PROTOTYPE

#define DUK_BIDX_URI_ERROR_PROTOTYPE   31

Definition at line 792 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_NUM_STRINGS

#define DUK_HEAP_NUM_STRINGS   191

Definition at line 585 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING___PROTO__

#define DUK_HEAP_STRING___PROTO__ ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX___PROTO__)

Definition at line 240 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ARRAY

#define DUK_HEAP_STRING_ARRAY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ARRAY)

Definition at line 27 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ARRAY_BUFFER

#define DUK_HEAP_STRING_ARRAY_BUFFER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ARRAY_BUFFER)

Definition at line 57 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_BASE64

#define DUK_HEAP_STRING_BASE64 ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BASE64)

Definition at line 384 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_BRACKETED_ELLIPSIS

#define DUK_HEAP_STRING_BRACKETED_ELLIPSIS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BRACKETED_ELLIPSIS)

Definition at line 207 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_BREAK

#define DUK_HEAP_STRING_BREAK ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BREAK)

Definition at line 450 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_BYTE_LENGTH

#define DUK_HEAP_STRING_BYTE_LENGTH ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BYTE_LENGTH)

Definition at line 270 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_BYTE_OFFSET

#define DUK_HEAP_STRING_BYTE_OFFSET ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BYTE_OFFSET)

Definition at line 273 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_BYTES_PER_ELEMENT

#define DUK_HEAP_STRING_BYTES_PER_ELEMENT ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_BYTES_PER_ELEMENT)

Definition at line 276 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_CALLEE

#define DUK_HEAP_STRING_CALLEE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CALLEE)

Definition at line 216 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_CALLER

#define DUK_HEAP_STRING_CALLER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CALLER)

Definition at line 219 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_CASE

#define DUK_HEAP_STRING_CASE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CASE)

Definition at line 453 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_CATCH

#define DUK_HEAP_STRING_CATCH ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CATCH)

Definition at line 456 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_CLASS

#define DUK_HEAP_STRING_CLASS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CLASS)

Definition at line 531 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_CLOG

#define DUK_HEAP_STRING_CLOG ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CLOG)

Definition at line 426 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_COMMA

#define DUK_HEAP_STRING_COMMA ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_COMMA)

Definition at line 198 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_COMPILE

#define DUK_HEAP_STRING_COMPILE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_COMPILE)

Definition at line 360 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_CONFIGURABLE

#define DUK_HEAP_STRING_CONFIGURABLE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CONFIGURABLE)

Definition at line 120 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_CONST

#define DUK_HEAP_STRING_CONST ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CONST)

Definition at line 519 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_CONSTRUCTOR

#define DUK_HEAP_STRING_CONSTRUCTOR ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CONSTRUCTOR)

Definition at line 165 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_CONTINUE

#define DUK_HEAP_STRING_CONTINUE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_CONTINUE)

Definition at line 459 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_DATA

#define DUK_HEAP_STRING_DATA ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DATA)

Definition at line 264 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_DATA_VIEW

#define DUK_HEAP_STRING_DATA_VIEW ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DATA_VIEW)

Definition at line 60 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_DATE

#define DUK_HEAP_STRING_DATE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DATE)

Definition at line 39 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_DEBUGGER

#define DUK_HEAP_STRING_DEBUGGER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DEBUGGER)

Definition at line 462 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_DEC_ENV

#define DUK_HEAP_STRING_DEC_ENV ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DEC_ENV)

Definition at line 96 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_DEFAULT

#define DUK_HEAP_STRING_DEFAULT ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DEFAULT)

Definition at line 465 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_DEFINE_PROPERTY

#define DUK_HEAP_STRING_DEFINE_PROPERTY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DEFINE_PROPERTY)

Definition at line 111 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_DELETE

#define DUK_HEAP_STRING_DELETE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DELETE)

Definition at line 468 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_DELETE_PROPERTY

#define DUK_HEAP_STRING_DELETE_PROPERTY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DELETE_PROPERTY)

Definition at line 228 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_DO

#define DUK_HEAP_STRING_DO ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_DO)

Definition at line 471 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ELSE

#define DUK_HEAP_STRING_ELSE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ELSE)

Definition at line 474 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_EMPTY_STRING

#define DUK_HEAP_STRING_EMPTY_STRING ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EMPTY_STRING)

Definition at line 54 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ENUM

#define DUK_HEAP_STRING_ENUM ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ENUM)

Definition at line 534 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ENUMERABLE

#define DUK_HEAP_STRING_ENUMERABLE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ENUMERABLE)

Definition at line 123 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ENUMERATE

#define DUK_HEAP_STRING_ENUMERATE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ENUMERATE)

Definition at line 231 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ENV

#define DUK_HEAP_STRING_ENV ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ENV)

Definition at line 378 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ERR_CREATE

#define DUK_HEAP_STRING_ERR_CREATE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ERR_CREATE)

Definition at line 366 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ERR_THROW

#define DUK_HEAP_STRING_ERR_THROW ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ERR_THROW)

Definition at line 369 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ESCAPED_EMPTY_REGEXP

#define DUK_HEAP_STRING_ESCAPED_EMPTY_REGEXP ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ESCAPED_EMPTY_REGEXP)

Definition at line 156 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_EVAL

#define DUK_HEAP_STRING_EVAL ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EVAL)

Definition at line 108 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_EXPORT

#define DUK_HEAP_STRING_EXPORT ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EXPORT)

Definition at line 537 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_EXPORTS

#define DUK_HEAP_STRING_EXPORTS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EXPORTS)

Definition at line 249 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_EXTENDS

#define DUK_HEAP_STRING_EXTENDS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_EXTENDS)

Definition at line 540 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_FALSE

#define DUK_HEAP_STRING_FALSE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FALSE)

Definition at line 555 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_FILE_NAME

#define DUK_HEAP_STRING_FILE_NAME ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FILE_NAME)

Definition at line 297 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_FILENAME

#define DUK_HEAP_STRING_FILENAME ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FILENAME)

Definition at line 252 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_FINALLY

#define DUK_HEAP_STRING_FINALLY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FINALLY)

Definition at line 477 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_FLOAT32_ARRAY

#define DUK_HEAP_STRING_FLOAT32_ARRAY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FLOAT32_ARRAY)

Definition at line 84 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_FLOAT64_ARRAY

#define DUK_HEAP_STRING_FLOAT64_ARRAY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FLOAT64_ARRAY)

Definition at line 87 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_FMT

#define DUK_HEAP_STRING_FMT ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FMT)

Definition at line 396 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_FOR

#define DUK_HEAP_STRING_FOR ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_FOR)

Definition at line 480 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_GET

#define DUK_HEAP_STRING_GET ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_GET)

Definition at line 225 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_GLOBAL

#define DUK_HEAP_STRING_GLOBAL ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_GLOBAL)

Definition at line 90 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_HAS

#define DUK_HEAP_STRING_HAS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_HAS)

Definition at line 222 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_HEX

#define DUK_HEAP_STRING_HEX ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_HEX)

Definition at line 381 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_ID

#define DUK_HEAP_STRING_ID ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_ID)

Definition at line 246 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_IF

#define DUK_HEAP_STRING_IF ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IF)

Definition at line 486 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_IGNORE_CASE

#define DUK_HEAP_STRING_IGNORE_CASE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IGNORE_CASE)

Definition at line 147 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_IMPLEMENTS

#define DUK_HEAP_STRING_IMPLEMENTS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IMPLEMENTS)

Definition at line 558 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_IMPORT

#define DUK_HEAP_STRING_IMPORT ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IMPORT)

Definition at line 543 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_IN

#define DUK_HEAP_STRING_IN ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_IN)

Definition at line 489 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INDEX

#define DUK_HEAP_STRING_INDEX ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INDEX)

Definition at line 159 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INFINITY

#define DUK_HEAP_STRING_INFINITY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INFINITY)

Definition at line 189 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INPUT

#define DUK_HEAP_STRING_INPUT ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INPUT)

Definition at line 363 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INSTANCEOF

#define DUK_HEAP_STRING_INSTANCEOF ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INSTANCEOF)

Definition at line 492 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT16_ARRAY

#define DUK_HEAP_STRING_INT16_ARRAY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT16_ARRAY)

Definition at line 72 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT32_ARRAY

#define DUK_HEAP_STRING_INT32_ARRAY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT32_ARRAY)

Definition at line 78 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT8_ARRAY

#define DUK_HEAP_STRING_INT8_ARRAY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT8_ARRAY)

Definition at line 63 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_ARGS

#define DUK_HEAP_STRING_INT_ARGS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_ARGS)

Definition at line 333 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_BYTECODE

#define DUK_HEAP_STRING_INT_BYTECODE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_BYTECODE)

Definition at line 312 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_CALLEE

#define DUK_HEAP_STRING_INT_CALLEE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_CALLEE)

Definition at line 345 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_FINALIZER

#define DUK_HEAP_STRING_INT_FINALIZER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_FINALIZER)

Definition at line 339 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_FORMALS

#define DUK_HEAP_STRING_INT_FORMALS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_FORMALS)

Definition at line 315 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_HANDLER

#define DUK_HEAP_STRING_INT_HANDLER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_HANDLER)

Definition at line 342 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_LEXENV

#define DUK_HEAP_STRING_INT_LEXENV ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_LEXENV)

Definition at line 321 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_MAP

#define DUK_HEAP_STRING_INT_MAP ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_MAP)

Definition at line 336 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_NEXT

#define DUK_HEAP_STRING_INT_NEXT ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_NEXT)

Definition at line 309 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_PC2LINE

#define DUK_HEAP_STRING_INT_PC2LINE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_PC2LINE)

Definition at line 330 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_REGBASE

#define DUK_HEAP_STRING_INT_REGBASE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_REGBASE)

Definition at line 351 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_SOURCE

#define DUK_HEAP_STRING_INT_SOURCE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_SOURCE)

Definition at line 327 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_TARGET

#define DUK_HEAP_STRING_INT_TARGET ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_TARGET)

Definition at line 354 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_THIS

#define DUK_HEAP_STRING_INT_THIS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_THIS)

Definition at line 357 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_THREAD

#define DUK_HEAP_STRING_INT_THREAD ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_THREAD)

Definition at line 348 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_TRACEDATA

#define DUK_HEAP_STRING_INT_TRACEDATA ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_TRACEDATA)

Definition at line 291 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_VALUE

#define DUK_HEAP_STRING_INT_VALUE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_VALUE)

Definition at line 306 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_VARENV

#define DUK_HEAP_STRING_INT_VARENV ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_VARENV)

Definition at line 324 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INT_VARMAP

#define DUK_HEAP_STRING_INT_VARMAP ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INT_VARMAP)

Definition at line 318 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INTERFACE

#define DUK_HEAP_STRING_INTERFACE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INTERFACE)

Definition at line 561 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_INVALID_DATE

#define DUK_HEAP_STRING_INVALID_DATE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_INVALID_DATE)

Definition at line 210 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_JC

#define DUK_HEAP_STRING_JC ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JC)

Definition at line 390 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_JOIN

#define DUK_HEAP_STRING_JOIN ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JOIN)

Definition at line 126 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_JSON

#define DUK_HEAP_STRING_JSON ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON)

Definition at line 51 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_JSON_EXT_FUNCTION1

#define DUK_HEAP_STRING_JSON_EXT_FUNCTION1 ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_FUNCTION1)

Definition at line 444 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_JSON_EXT_FUNCTION2

#define DUK_HEAP_STRING_JSON_EXT_FUNCTION2 ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_FUNCTION2)

Definition at line 447 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_JSON_EXT_NAN

#define DUK_HEAP_STRING_JSON_EXT_NAN ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_NAN)

Definition at line 435 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_JSON_EXT_NEGINF

#define DUK_HEAP_STRING_JSON_EXT_NEGINF ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_NEGINF)

Definition at line 441 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_JSON_EXT_POSINF

#define DUK_HEAP_STRING_JSON_EXT_POSINF ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_POSINF)

Definition at line 438 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_JSON_EXT_UNDEFINED

#define DUK_HEAP_STRING_JSON_EXT_UNDEFINED ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JSON_EXT_UNDEFINED)

Definition at line 432 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_JX

#define DUK_HEAP_STRING_JX ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_JX)

Definition at line 387 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LAST_INDEX

#define DUK_HEAP_STRING_LAST_INDEX ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LAST_INDEX)

Definition at line 153 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_ARGUMENTS

#define DUK_HEAP_STRING_LC_ARGUMENTS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_ARGUMENTS)

Definition at line 213 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_BOOLEAN

#define DUK_HEAP_STRING_LC_BOOLEAN ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_BOOLEAN)

Definition at line 171 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_BUFFER

#define DUK_HEAP_STRING_LC_BUFFER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_BUFFER)

Definition at line 300 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_DEBUG

#define DUK_HEAP_STRING_LC_DEBUG ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_DEBUG)

Definition at line 405 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_ERROR

#define DUK_HEAP_STRING_LC_ERROR ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_ERROR)

Definition at line 414 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_FATAL

#define DUK_HEAP_STRING_LC_FATAL ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_FATAL)

Definition at line 417 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_FUNCTION

#define DUK_HEAP_STRING_LC_FUNCTION ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_FUNCTION)

Definition at line 483 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_INFO

#define DUK_HEAP_STRING_LC_INFO ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_INFO)

Definition at line 408 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_L

#define DUK_HEAP_STRING_LC_L ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_L)

Definition at line 423 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_N

#define DUK_HEAP_STRING_LC_N ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_N)

Definition at line 420 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_NULL

#define DUK_HEAP_STRING_LC_NULL ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_NULL)

Definition at line 549 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_NUMBER

#define DUK_HEAP_STRING_LC_NUMBER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_NUMBER)

Definition at line 174 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_OBJECT

#define DUK_HEAP_STRING_LC_OBJECT ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_OBJECT)

Definition at line 180 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_POINTER

#define DUK_HEAP_STRING_LC_POINTER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_POINTER)

Definition at line 303 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_STRING

#define DUK_HEAP_STRING_LC_STRING ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_STRING)

Definition at line 177 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_TRACE

#define DUK_HEAP_STRING_LC_TRACE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_TRACE)

Definition at line 402 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_UNDEFINED

#define DUK_HEAP_STRING_LC_UNDEFINED ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_UNDEFINED)

Definition at line 183 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LC_WARN

#define DUK_HEAP_STRING_LC_WARN ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LC_WARN)

Definition at line 411 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LENGTH

#define DUK_HEAP_STRING_LENGTH ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LENGTH)

Definition at line 267 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LET

#define DUK_HEAP_STRING_LET ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LET)

Definition at line 564 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_LINE_NUMBER

#define DUK_HEAP_STRING_LINE_NUMBER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_LINE_NUMBER)

Definition at line 288 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_MATH

#define DUK_HEAP_STRING_MATH ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MATH)

Definition at line 48 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_MESSAGE

#define DUK_HEAP_STRING_MESSAGE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MESSAGE)

Definition at line 168 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_MINUS_INFINITY

#define DUK_HEAP_STRING_MINUS_INFINITY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MINUS_INFINITY)

Definition at line 192 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_MINUS_ZERO

#define DUK_HEAP_STRING_MINUS_ZERO ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MINUS_ZERO)

Definition at line 195 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_MOD_LOADED

#define DUK_HEAP_STRING_MOD_LOADED ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MOD_LOADED)

Definition at line 375 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_MOD_SEARCH

#define DUK_HEAP_STRING_MOD_SEARCH ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MOD_SEARCH)

Definition at line 372 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_MULTILINE

#define DUK_HEAP_STRING_MULTILINE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_MULTILINE)

Definition at line 150 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_NAME

#define DUK_HEAP_STRING_NAME ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_NAME)

Definition at line 294 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_NAN

#define DUK_HEAP_STRING_NAN ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_NAN)

Definition at line 186 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_NEW

#define DUK_HEAP_STRING_NEW ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_NEW)

Definition at line 495 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_NEWLINE_4SPACE

#define DUK_HEAP_STRING_NEWLINE_4SPACE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_NEWLINE_4SPACE)

Definition at line 204 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_OBJ_ENV

#define DUK_HEAP_STRING_OBJ_ENV ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_OBJ_ENV)

Definition at line 93 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_OWN_KEYS

#define DUK_HEAP_STRING_OWN_KEYS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_OWN_KEYS)

Definition at line 234 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_PACKAGE

#define DUK_HEAP_STRING_PACKAGE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PACKAGE)

Definition at line 567 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_PC

#define DUK_HEAP_STRING_PC ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PC)

Definition at line 285 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_PRIVATE

#define DUK_HEAP_STRING_PRIVATE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PRIVATE)

Definition at line 570 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_PROTECTED

#define DUK_HEAP_STRING_PROTECTED ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PROTECTED)

Definition at line 573 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_PROTOTYPE

#define DUK_HEAP_STRING_PROTOTYPE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PROTOTYPE)

Definition at line 162 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_PUBLIC

#define DUK_HEAP_STRING_PUBLIC ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_PUBLIC)

Definition at line 576 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_RAW

#define DUK_HEAP_STRING_RAW ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_RAW)

Definition at line 399 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_REG_EXP

#define DUK_HEAP_STRING_REG_EXP ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_REG_EXP)

Definition at line 42 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_REQUIRE

#define DUK_HEAP_STRING_REQUIRE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_REQUIRE)

Definition at line 243 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_RESUME

#define DUK_HEAP_STRING_RESUME ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_RESUME)

Definition at line 393 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_RETURN

#define DUK_HEAP_STRING_RETURN ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_RETURN)

Definition at line 498 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_SET

#define DUK_HEAP_STRING_SET ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SET)

Definition at line 279 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_SET_PROTOTYPE_OF

#define DUK_HEAP_STRING_SET_PROTOTYPE_OF ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SET_PROTOTYPE_OF)

Definition at line 237 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_SOURCE

#define DUK_HEAP_STRING_SOURCE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SOURCE)

Definition at line 144 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_SPACE

#define DUK_HEAP_STRING_SPACE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SPACE)

Definition at line 201 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_STACK

#define DUK_HEAP_STRING_STACK ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_STACK)

Definition at line 282 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_STATIC

#define DUK_HEAP_STRING_STATIC ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_STATIC)

Definition at line 579 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_SUPER

#define DUK_HEAP_STRING_SUPER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SUPER)

Definition at line 546 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_SWITCH

#define DUK_HEAP_STRING_SWITCH ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_SWITCH)

Definition at line 501 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_THIS

#define DUK_HEAP_STRING_THIS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_THIS)

Definition at line 504 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_THROW

#define DUK_HEAP_STRING_THROW ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_THROW)

Definition at line 507 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TO_GMT_STRING

#define DUK_HEAP_STRING_TO_GMT_STRING ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_GMT_STRING)

Definition at line 141 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TO_ISO_STRING

#define DUK_HEAP_STRING_TO_ISO_STRING ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_ISO_STRING)

Definition at line 138 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TO_JSON

#define DUK_HEAP_STRING_TO_JSON ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_JSON)

Definition at line 258 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TO_LOCALE_STRING

#define DUK_HEAP_STRING_TO_LOCALE_STRING ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_LOCALE_STRING)

Definition at line 129 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TO_LOG_STRING

#define DUK_HEAP_STRING_TO_LOG_STRING ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_LOG_STRING)

Definition at line 429 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TO_STRING

#define DUK_HEAP_STRING_TO_STRING ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_STRING)

Definition at line 255 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TO_UTC_STRING

#define DUK_HEAP_STRING_TO_UTC_STRING ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TO_UTC_STRING)

Definition at line 135 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TRUE

#define DUK_HEAP_STRING_TRUE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TRUE)

Definition at line 552 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TRY

#define DUK_HEAP_STRING_TRY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TRY)

Definition at line 510 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TYPE

#define DUK_HEAP_STRING_TYPE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TYPE)

Definition at line 261 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_TYPEOF

#define DUK_HEAP_STRING_TYPEOF ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_TYPEOF)

Definition at line 513 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_ARGUMENTS

#define DUK_HEAP_STRING_UC_ARGUMENTS ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_ARGUMENTS)

Definition at line 18 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_BOOLEAN

#define DUK_HEAP_STRING_UC_BOOLEAN ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_BOOLEAN)

Definition at line 33 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_BUFFER

#define DUK_HEAP_STRING_UC_BUFFER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_BUFFER)

Definition at line 99 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_ERROR

#define DUK_HEAP_STRING_UC_ERROR ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_ERROR)

Definition at line 45 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_FUNCTION

#define DUK_HEAP_STRING_UC_FUNCTION ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_FUNCTION)

Definition at line 24 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_NULL

#define DUK_HEAP_STRING_UC_NULL ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_NULL)

Definition at line 15 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_NUMBER

#define DUK_HEAP_STRING_UC_NUMBER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_NUMBER)

Definition at line 36 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_OBJECT

#define DUK_HEAP_STRING_UC_OBJECT ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_OBJECT)

Definition at line 21 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_POINTER

#define DUK_HEAP_STRING_UC_POINTER ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_POINTER)

Definition at line 102 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_STRING

#define DUK_HEAP_STRING_UC_STRING ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_STRING)

Definition at line 30 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_THREAD

#define DUK_HEAP_STRING_UC_THREAD ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_THREAD)

Definition at line 105 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UC_UNDEFINED

#define DUK_HEAP_STRING_UC_UNDEFINED ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UC_UNDEFINED)

Definition at line 12 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UINT16_ARRAY

#define DUK_HEAP_STRING_UINT16_ARRAY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UINT16_ARRAY)

Definition at line 75 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UINT32_ARRAY

#define DUK_HEAP_STRING_UINT32_ARRAY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UINT32_ARRAY)

Definition at line 81 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UINT8_ARRAY

#define DUK_HEAP_STRING_UINT8_ARRAY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UINT8_ARRAY)

Definition at line 66 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_UINT8_CLAMPED_ARRAY

#define DUK_HEAP_STRING_UINT8_CLAMPED_ARRAY ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_UINT8_CLAMPED_ARRAY)

Definition at line 69 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_VALUE

#define DUK_HEAP_STRING_VALUE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_VALUE)

Definition at line 114 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_VALUE_OF

#define DUK_HEAP_STRING_VALUE_OF ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_VALUE_OF)

Definition at line 132 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_VAR

#define DUK_HEAP_STRING_VAR ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_VAR)

Definition at line 516 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_VOID

#define DUK_HEAP_STRING_VOID ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_VOID)

Definition at line 522 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_WHILE

#define DUK_HEAP_STRING_WHILE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_WHILE)

Definition at line 525 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_WITH

#define DUK_HEAP_STRING_WITH ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_WITH)

Definition at line 528 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_WRITABLE

#define DUK_HEAP_STRING_WRITABLE ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_WRITABLE)

Definition at line 117 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HEAP_STRING_YIELD

#define DUK_HEAP_STRING_YIELD ( heap)    DUK_HEAP_GET_STRING((heap),DUK_STRIDX_YIELD)

Definition at line 582 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING___PROTO__

#define DUK_HTHREAD_STRING___PROTO__ ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX___PROTO__)

Definition at line 241 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ARRAY

#define DUK_HTHREAD_STRING_ARRAY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ARRAY)

Definition at line 28 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ARRAY_BUFFER

#define DUK_HTHREAD_STRING_ARRAY_BUFFER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ARRAY_BUFFER)

Definition at line 58 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_BASE64

#define DUK_HTHREAD_STRING_BASE64 ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BASE64)

Definition at line 385 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_BRACKETED_ELLIPSIS

#define DUK_HTHREAD_STRING_BRACKETED_ELLIPSIS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BRACKETED_ELLIPSIS)

Definition at line 208 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_BREAK

#define DUK_HTHREAD_STRING_BREAK ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BREAK)

Definition at line 451 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_BYTE_LENGTH

#define DUK_HTHREAD_STRING_BYTE_LENGTH ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BYTE_LENGTH)

Definition at line 271 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_BYTE_OFFSET

#define DUK_HTHREAD_STRING_BYTE_OFFSET ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BYTE_OFFSET)

Definition at line 274 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_BYTES_PER_ELEMENT

#define DUK_HTHREAD_STRING_BYTES_PER_ELEMENT ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_BYTES_PER_ELEMENT)

Definition at line 277 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_CALLEE

#define DUK_HTHREAD_STRING_CALLEE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CALLEE)

Definition at line 217 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_CALLER

#define DUK_HTHREAD_STRING_CALLER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CALLER)

Definition at line 220 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_CASE

#define DUK_HTHREAD_STRING_CASE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CASE)

Definition at line 454 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_CATCH

#define DUK_HTHREAD_STRING_CATCH ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CATCH)

Definition at line 457 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_CLASS

#define DUK_HTHREAD_STRING_CLASS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CLASS)

Definition at line 532 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_CLOG

#define DUK_HTHREAD_STRING_CLOG ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CLOG)

Definition at line 427 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_COMMA

#define DUK_HTHREAD_STRING_COMMA ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_COMMA)

Definition at line 199 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_COMPILE

#define DUK_HTHREAD_STRING_COMPILE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_COMPILE)

Definition at line 361 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_CONFIGURABLE

#define DUK_HTHREAD_STRING_CONFIGURABLE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CONFIGURABLE)

Definition at line 121 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_CONST

#define DUK_HTHREAD_STRING_CONST ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CONST)

Definition at line 520 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_CONSTRUCTOR

#define DUK_HTHREAD_STRING_CONSTRUCTOR ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CONSTRUCTOR)

Definition at line 166 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_CONTINUE

#define DUK_HTHREAD_STRING_CONTINUE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_CONTINUE)

Definition at line 460 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_DATA

#define DUK_HTHREAD_STRING_DATA ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DATA)

Definition at line 265 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_DATA_VIEW

#define DUK_HTHREAD_STRING_DATA_VIEW ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DATA_VIEW)

Definition at line 61 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_DATE

#define DUK_HTHREAD_STRING_DATE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DATE)

Definition at line 40 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_DEBUGGER

#define DUK_HTHREAD_STRING_DEBUGGER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DEBUGGER)

Definition at line 463 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_DEC_ENV

#define DUK_HTHREAD_STRING_DEC_ENV ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DEC_ENV)

Definition at line 97 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_DEFAULT

#define DUK_HTHREAD_STRING_DEFAULT ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DEFAULT)

Definition at line 466 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_DEFINE_PROPERTY

#define DUK_HTHREAD_STRING_DEFINE_PROPERTY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DEFINE_PROPERTY)

Definition at line 112 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_DELETE

#define DUK_HTHREAD_STRING_DELETE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DELETE)

Definition at line 469 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_DELETE_PROPERTY

#define DUK_HTHREAD_STRING_DELETE_PROPERTY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DELETE_PROPERTY)

Definition at line 229 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_DO

#define DUK_HTHREAD_STRING_DO ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_DO)

Definition at line 472 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ELSE

#define DUK_HTHREAD_STRING_ELSE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ELSE)

Definition at line 475 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_EMPTY_STRING

#define DUK_HTHREAD_STRING_EMPTY_STRING ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EMPTY_STRING)

Definition at line 55 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ENUM

#define DUK_HTHREAD_STRING_ENUM ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ENUM)

Definition at line 535 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ENUMERABLE

#define DUK_HTHREAD_STRING_ENUMERABLE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ENUMERABLE)

Definition at line 124 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ENUMERATE

#define DUK_HTHREAD_STRING_ENUMERATE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ENUMERATE)

Definition at line 232 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ENV

#define DUK_HTHREAD_STRING_ENV ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ENV)

Definition at line 379 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ERR_CREATE

#define DUK_HTHREAD_STRING_ERR_CREATE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ERR_CREATE)

Definition at line 367 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ERR_THROW

#define DUK_HTHREAD_STRING_ERR_THROW ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ERR_THROW)

Definition at line 370 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ESCAPED_EMPTY_REGEXP

#define DUK_HTHREAD_STRING_ESCAPED_EMPTY_REGEXP ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ESCAPED_EMPTY_REGEXP)

Definition at line 157 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_EVAL

#define DUK_HTHREAD_STRING_EVAL ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EVAL)

Definition at line 109 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_EXPORT

#define DUK_HTHREAD_STRING_EXPORT ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EXPORT)

Definition at line 538 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_EXPORTS

#define DUK_HTHREAD_STRING_EXPORTS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EXPORTS)

Definition at line 250 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_EXTENDS

#define DUK_HTHREAD_STRING_EXTENDS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_EXTENDS)

Definition at line 541 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_FALSE

#define DUK_HTHREAD_STRING_FALSE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FALSE)

Definition at line 556 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_FILE_NAME

#define DUK_HTHREAD_STRING_FILE_NAME ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FILE_NAME)

Definition at line 298 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_FILENAME

#define DUK_HTHREAD_STRING_FILENAME ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FILENAME)

Definition at line 253 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_FINALLY

#define DUK_HTHREAD_STRING_FINALLY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FINALLY)

Definition at line 478 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_FLOAT32_ARRAY

#define DUK_HTHREAD_STRING_FLOAT32_ARRAY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FLOAT32_ARRAY)

Definition at line 85 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_FLOAT64_ARRAY

#define DUK_HTHREAD_STRING_FLOAT64_ARRAY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FLOAT64_ARRAY)

Definition at line 88 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_FMT

#define DUK_HTHREAD_STRING_FMT ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FMT)

Definition at line 397 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_FOR

#define DUK_HTHREAD_STRING_FOR ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_FOR)

Definition at line 481 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_GET

#define DUK_HTHREAD_STRING_GET ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_GET)

Definition at line 226 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_GLOBAL

#define DUK_HTHREAD_STRING_GLOBAL ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_GLOBAL)

Definition at line 91 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_HAS

#define DUK_HTHREAD_STRING_HAS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_HAS)

Definition at line 223 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_HEX

#define DUK_HTHREAD_STRING_HEX ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_HEX)

Definition at line 382 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_ID

#define DUK_HTHREAD_STRING_ID ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_ID)

Definition at line 247 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_IF

#define DUK_HTHREAD_STRING_IF ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IF)

Definition at line 487 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_IGNORE_CASE

#define DUK_HTHREAD_STRING_IGNORE_CASE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IGNORE_CASE)

Definition at line 148 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_IMPLEMENTS

#define DUK_HTHREAD_STRING_IMPLEMENTS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IMPLEMENTS)

Definition at line 559 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_IMPORT

#define DUK_HTHREAD_STRING_IMPORT ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IMPORT)

Definition at line 544 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_IN

#define DUK_HTHREAD_STRING_IN ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_IN)

Definition at line 490 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INDEX

#define DUK_HTHREAD_STRING_INDEX ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INDEX)

Definition at line 160 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INFINITY

#define DUK_HTHREAD_STRING_INFINITY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INFINITY)

Definition at line 190 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INPUT

#define DUK_HTHREAD_STRING_INPUT ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INPUT)

Definition at line 364 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INSTANCEOF

#define DUK_HTHREAD_STRING_INSTANCEOF ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INSTANCEOF)

Definition at line 493 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT16_ARRAY

#define DUK_HTHREAD_STRING_INT16_ARRAY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT16_ARRAY)

Definition at line 73 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT32_ARRAY

#define DUK_HTHREAD_STRING_INT32_ARRAY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT32_ARRAY)

Definition at line 79 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT8_ARRAY

#define DUK_HTHREAD_STRING_INT8_ARRAY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT8_ARRAY)

Definition at line 64 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_ARGS

#define DUK_HTHREAD_STRING_INT_ARGS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_ARGS)

Definition at line 334 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_BYTECODE

#define DUK_HTHREAD_STRING_INT_BYTECODE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_BYTECODE)

Definition at line 313 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_CALLEE

#define DUK_HTHREAD_STRING_INT_CALLEE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_CALLEE)

Definition at line 346 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_FINALIZER

#define DUK_HTHREAD_STRING_INT_FINALIZER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_FINALIZER)

Definition at line 340 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_FORMALS

#define DUK_HTHREAD_STRING_INT_FORMALS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_FORMALS)

Definition at line 316 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_HANDLER

#define DUK_HTHREAD_STRING_INT_HANDLER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_HANDLER)

Definition at line 343 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_LEXENV

#define DUK_HTHREAD_STRING_INT_LEXENV ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_LEXENV)

Definition at line 322 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_MAP

#define DUK_HTHREAD_STRING_INT_MAP ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_MAP)

Definition at line 337 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_NEXT

#define DUK_HTHREAD_STRING_INT_NEXT ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_NEXT)

Definition at line 310 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_PC2LINE

#define DUK_HTHREAD_STRING_INT_PC2LINE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_PC2LINE)

Definition at line 331 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_REGBASE

#define DUK_HTHREAD_STRING_INT_REGBASE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_REGBASE)

Definition at line 352 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_SOURCE

#define DUK_HTHREAD_STRING_INT_SOURCE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_SOURCE)

Definition at line 328 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_TARGET

#define DUK_HTHREAD_STRING_INT_TARGET ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_TARGET)

Definition at line 355 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_THIS

#define DUK_HTHREAD_STRING_INT_THIS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_THIS)

Definition at line 358 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_THREAD

#define DUK_HTHREAD_STRING_INT_THREAD ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_THREAD)

Definition at line 349 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_TRACEDATA

#define DUK_HTHREAD_STRING_INT_TRACEDATA ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_TRACEDATA)

Definition at line 292 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_VALUE

#define DUK_HTHREAD_STRING_INT_VALUE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_VALUE)

Definition at line 307 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_VARENV

#define DUK_HTHREAD_STRING_INT_VARENV ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_VARENV)

Definition at line 325 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INT_VARMAP

#define DUK_HTHREAD_STRING_INT_VARMAP ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INT_VARMAP)

Definition at line 319 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INTERFACE

#define DUK_HTHREAD_STRING_INTERFACE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INTERFACE)

Definition at line 562 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_INVALID_DATE

#define DUK_HTHREAD_STRING_INVALID_DATE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_INVALID_DATE)

Definition at line 211 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_JC

#define DUK_HTHREAD_STRING_JC ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JC)

Definition at line 391 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_JOIN

#define DUK_HTHREAD_STRING_JOIN ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JOIN)

Definition at line 127 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_JSON

#define DUK_HTHREAD_STRING_JSON ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON)

Definition at line 52 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_JSON_EXT_FUNCTION1

#define DUK_HTHREAD_STRING_JSON_EXT_FUNCTION1 ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_FUNCTION1)

Definition at line 445 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_JSON_EXT_FUNCTION2

#define DUK_HTHREAD_STRING_JSON_EXT_FUNCTION2 ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_FUNCTION2)

Definition at line 448 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_JSON_EXT_NAN

#define DUK_HTHREAD_STRING_JSON_EXT_NAN ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_NAN)

Definition at line 436 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_JSON_EXT_NEGINF

#define DUK_HTHREAD_STRING_JSON_EXT_NEGINF ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_NEGINF)

Definition at line 442 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_JSON_EXT_POSINF

#define DUK_HTHREAD_STRING_JSON_EXT_POSINF ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_POSINF)

Definition at line 439 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_JSON_EXT_UNDEFINED

#define DUK_HTHREAD_STRING_JSON_EXT_UNDEFINED ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JSON_EXT_UNDEFINED)

Definition at line 433 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_JX

#define DUK_HTHREAD_STRING_JX ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_JX)

Definition at line 388 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LAST_INDEX

#define DUK_HTHREAD_STRING_LAST_INDEX ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LAST_INDEX)

Definition at line 154 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_ARGUMENTS

#define DUK_HTHREAD_STRING_LC_ARGUMENTS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_ARGUMENTS)

Definition at line 214 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_BOOLEAN

#define DUK_HTHREAD_STRING_LC_BOOLEAN ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_BOOLEAN)

Definition at line 172 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_BUFFER

#define DUK_HTHREAD_STRING_LC_BUFFER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_BUFFER)

Definition at line 301 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_DEBUG

#define DUK_HTHREAD_STRING_LC_DEBUG ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_DEBUG)

Definition at line 406 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_ERROR

#define DUK_HTHREAD_STRING_LC_ERROR ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_ERROR)

Definition at line 415 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_FATAL

#define DUK_HTHREAD_STRING_LC_FATAL ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_FATAL)

Definition at line 418 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_FUNCTION

#define DUK_HTHREAD_STRING_LC_FUNCTION ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_FUNCTION)

Definition at line 484 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_INFO

#define DUK_HTHREAD_STRING_LC_INFO ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_INFO)

Definition at line 409 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_L

#define DUK_HTHREAD_STRING_LC_L ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_L)

Definition at line 424 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_N

#define DUK_HTHREAD_STRING_LC_N ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_N)

Definition at line 421 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_NULL

#define DUK_HTHREAD_STRING_LC_NULL ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_NULL)

Definition at line 550 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_NUMBER

#define DUK_HTHREAD_STRING_LC_NUMBER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_NUMBER)

Definition at line 175 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_OBJECT

#define DUK_HTHREAD_STRING_LC_OBJECT ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_OBJECT)

Definition at line 181 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_POINTER

#define DUK_HTHREAD_STRING_LC_POINTER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_POINTER)

Definition at line 304 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_STRING

#define DUK_HTHREAD_STRING_LC_STRING ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_STRING)

Definition at line 178 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_TRACE

#define DUK_HTHREAD_STRING_LC_TRACE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_TRACE)

Definition at line 403 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_UNDEFINED

#define DUK_HTHREAD_STRING_LC_UNDEFINED ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_UNDEFINED)

Definition at line 184 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LC_WARN

#define DUK_HTHREAD_STRING_LC_WARN ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LC_WARN)

Definition at line 412 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LENGTH

#define DUK_HTHREAD_STRING_LENGTH ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LENGTH)

Definition at line 268 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LET

#define DUK_HTHREAD_STRING_LET ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LET)

Definition at line 565 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_LINE_NUMBER

#define DUK_HTHREAD_STRING_LINE_NUMBER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_LINE_NUMBER)

Definition at line 289 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_MATH

#define DUK_HTHREAD_STRING_MATH ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MATH)

Definition at line 49 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_MESSAGE

#define DUK_HTHREAD_STRING_MESSAGE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MESSAGE)

Definition at line 169 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_MINUS_INFINITY

#define DUK_HTHREAD_STRING_MINUS_INFINITY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MINUS_INFINITY)

Definition at line 193 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_MINUS_ZERO

#define DUK_HTHREAD_STRING_MINUS_ZERO ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MINUS_ZERO)

Definition at line 196 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_MOD_LOADED

#define DUK_HTHREAD_STRING_MOD_LOADED ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MOD_LOADED)

Definition at line 376 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_MOD_SEARCH

#define DUK_HTHREAD_STRING_MOD_SEARCH ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MOD_SEARCH)

Definition at line 373 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_MULTILINE

#define DUK_HTHREAD_STRING_MULTILINE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_MULTILINE)

Definition at line 151 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_NAME

#define DUK_HTHREAD_STRING_NAME ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_NAME)

Definition at line 295 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_NAN

#define DUK_HTHREAD_STRING_NAN ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_NAN)

Definition at line 187 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_NEW

#define DUK_HTHREAD_STRING_NEW ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_NEW)

Definition at line 496 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_NEWLINE_4SPACE

#define DUK_HTHREAD_STRING_NEWLINE_4SPACE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_NEWLINE_4SPACE)

Definition at line 205 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_OBJ_ENV

#define DUK_HTHREAD_STRING_OBJ_ENV ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_OBJ_ENV)

Definition at line 94 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_OWN_KEYS

#define DUK_HTHREAD_STRING_OWN_KEYS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_OWN_KEYS)

Definition at line 235 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_PACKAGE

#define DUK_HTHREAD_STRING_PACKAGE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PACKAGE)

Definition at line 568 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_PC

#define DUK_HTHREAD_STRING_PC ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PC)

Definition at line 286 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_PRIVATE

#define DUK_HTHREAD_STRING_PRIVATE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PRIVATE)

Definition at line 571 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_PROTECTED

#define DUK_HTHREAD_STRING_PROTECTED ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PROTECTED)

Definition at line 574 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_PROTOTYPE

#define DUK_HTHREAD_STRING_PROTOTYPE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PROTOTYPE)

Definition at line 163 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_PUBLIC

#define DUK_HTHREAD_STRING_PUBLIC ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_PUBLIC)

Definition at line 577 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_RAW

#define DUK_HTHREAD_STRING_RAW ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_RAW)

Definition at line 400 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_REG_EXP

#define DUK_HTHREAD_STRING_REG_EXP ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_REG_EXP)

Definition at line 43 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_REQUIRE

#define DUK_HTHREAD_STRING_REQUIRE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_REQUIRE)

Definition at line 244 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_RESUME

#define DUK_HTHREAD_STRING_RESUME ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_RESUME)

Definition at line 394 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_RETURN

#define DUK_HTHREAD_STRING_RETURN ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_RETURN)

Definition at line 499 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_SET

#define DUK_HTHREAD_STRING_SET ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SET)

Definition at line 280 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_SET_PROTOTYPE_OF

#define DUK_HTHREAD_STRING_SET_PROTOTYPE_OF ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SET_PROTOTYPE_OF)

Definition at line 238 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_SOURCE

#define DUK_HTHREAD_STRING_SOURCE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SOURCE)

Definition at line 145 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_SPACE

#define DUK_HTHREAD_STRING_SPACE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SPACE)

Definition at line 202 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_STACK

#define DUK_HTHREAD_STRING_STACK ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_STACK)

Definition at line 283 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_STATIC

#define DUK_HTHREAD_STRING_STATIC ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_STATIC)

Definition at line 580 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_SUPER

#define DUK_HTHREAD_STRING_SUPER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SUPER)

Definition at line 547 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_SWITCH

#define DUK_HTHREAD_STRING_SWITCH ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_SWITCH)

Definition at line 502 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_THIS

#define DUK_HTHREAD_STRING_THIS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_THIS)

Definition at line 505 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_THROW

#define DUK_HTHREAD_STRING_THROW ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_THROW)

Definition at line 508 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TO_GMT_STRING

#define DUK_HTHREAD_STRING_TO_GMT_STRING ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_GMT_STRING)

Definition at line 142 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TO_ISO_STRING

#define DUK_HTHREAD_STRING_TO_ISO_STRING ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_ISO_STRING)

Definition at line 139 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TO_JSON

#define DUK_HTHREAD_STRING_TO_JSON ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_JSON)

Definition at line 259 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TO_LOCALE_STRING

#define DUK_HTHREAD_STRING_TO_LOCALE_STRING ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_LOCALE_STRING)

Definition at line 130 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TO_LOG_STRING

#define DUK_HTHREAD_STRING_TO_LOG_STRING ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_LOG_STRING)

Definition at line 430 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TO_STRING

#define DUK_HTHREAD_STRING_TO_STRING ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_STRING)

Definition at line 256 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TO_UTC_STRING

#define DUK_HTHREAD_STRING_TO_UTC_STRING ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TO_UTC_STRING)

Definition at line 136 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TRUE

#define DUK_HTHREAD_STRING_TRUE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TRUE)

Definition at line 553 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TRY

#define DUK_HTHREAD_STRING_TRY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TRY)

Definition at line 511 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TYPE

#define DUK_HTHREAD_STRING_TYPE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TYPE)

Definition at line 262 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_TYPEOF

#define DUK_HTHREAD_STRING_TYPEOF ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_TYPEOF)

Definition at line 514 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_ARGUMENTS

#define DUK_HTHREAD_STRING_UC_ARGUMENTS ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_ARGUMENTS)

Definition at line 19 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_BOOLEAN

#define DUK_HTHREAD_STRING_UC_BOOLEAN ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_BOOLEAN)

Definition at line 34 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_BUFFER

#define DUK_HTHREAD_STRING_UC_BUFFER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_BUFFER)

Definition at line 100 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_ERROR

#define DUK_HTHREAD_STRING_UC_ERROR ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_ERROR)

Definition at line 46 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_FUNCTION

#define DUK_HTHREAD_STRING_UC_FUNCTION ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_FUNCTION)

Definition at line 25 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_NULL

#define DUK_HTHREAD_STRING_UC_NULL ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_NULL)

Definition at line 16 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_NUMBER

#define DUK_HTHREAD_STRING_UC_NUMBER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_NUMBER)

Definition at line 37 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_OBJECT

#define DUK_HTHREAD_STRING_UC_OBJECT ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_OBJECT)

Definition at line 22 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_POINTER

#define DUK_HTHREAD_STRING_UC_POINTER ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_POINTER)

Definition at line 103 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_STRING

#define DUK_HTHREAD_STRING_UC_STRING ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_STRING)

Definition at line 31 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_THREAD

#define DUK_HTHREAD_STRING_UC_THREAD ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_THREAD)

Definition at line 106 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UC_UNDEFINED

#define DUK_HTHREAD_STRING_UC_UNDEFINED ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UC_UNDEFINED)

Definition at line 13 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UINT16_ARRAY

#define DUK_HTHREAD_STRING_UINT16_ARRAY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UINT16_ARRAY)

Definition at line 76 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UINT32_ARRAY

#define DUK_HTHREAD_STRING_UINT32_ARRAY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UINT32_ARRAY)

Definition at line 82 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UINT8_ARRAY

#define DUK_HTHREAD_STRING_UINT8_ARRAY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UINT8_ARRAY)

Definition at line 67 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_UINT8_CLAMPED_ARRAY

#define DUK_HTHREAD_STRING_UINT8_CLAMPED_ARRAY ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_UINT8_CLAMPED_ARRAY)

Definition at line 70 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_VALUE

#define DUK_HTHREAD_STRING_VALUE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_VALUE)

Definition at line 115 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_VALUE_OF

#define DUK_HTHREAD_STRING_VALUE_OF ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_VALUE_OF)

Definition at line 133 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_VAR

#define DUK_HTHREAD_STRING_VAR ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_VAR)

Definition at line 517 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_VOID

#define DUK_HTHREAD_STRING_VOID ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_VOID)

Definition at line 523 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_WHILE

#define DUK_HTHREAD_STRING_WHILE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_WHILE)

Definition at line 526 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_WITH

#define DUK_HTHREAD_STRING_WITH ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_WITH)

Definition at line 529 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_WRITABLE

#define DUK_HTHREAD_STRING_WRITABLE ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_WRITABLE)

Definition at line 118 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_HTHREAD_STRING_YIELD

#define DUK_HTHREAD_STRING_YIELD ( thr)    DUK_HTHREAD_GET_STRING((thr),DUK_STRIDX_YIELD)

Definition at line 583 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_NUM_ALL_BUILTINS

#define DUK_NUM_ALL_BUILTINS   71

Definition at line 834 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_NUM_BIDX_BUILTINS

#define DUK_NUM_BIDX_BUILTINS   71

Definition at line 833 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_NUM_BUILTINS

#define DUK_NUM_BUILTINS   71

Definition at line 832 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRDATA_DATA_LENGTH

#define DUK_STRDATA_DATA_LENGTH   1049

Definition at line 597 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRDATA_MAX_STRLEN

#define DUK_STRDATA_MAX_STRLEN   17

Definition at line 596 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX___PROTO__

#define DUK_STRIDX___PROTO__   76 /* '__proto__' */

Definition at line 239 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ARRAY

#define DUK_STRIDX_ARRAY   5 /* 'Array' */

Definition at line 26 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ARRAY_BUFFER

#define DUK_STRIDX_ARRAY_BUFFER   15 /* 'ArrayBuffer' */

Definition at line 56 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_BASE64

#define DUK_STRIDX_BASE64   124 /* 'base64' */

Definition at line 383 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_BRACKETED_ELLIPSIS

#define DUK_STRIDX_BRACKETED_ELLIPSIS   65 /* '[...]' */

Definition at line 206 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_BREAK

#define DUK_STRIDX_BREAK   146 /* 'break' */

Definition at line 449 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_BYTE_LENGTH

#define DUK_STRIDX_BYTE_LENGTH   86 /* 'byteLength' */

Definition at line 269 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_BYTE_OFFSET

#define DUK_STRIDX_BYTE_OFFSET   87 /* 'byteOffset' */

Definition at line 272 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_BYTES_PER_ELEMENT

#define DUK_STRIDX_BYTES_PER_ELEMENT   88 /* 'BYTES_PER_ELEMENT' */

Definition at line 275 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_CALLEE

#define DUK_STRIDX_CALLEE   68 /* 'callee' */

Definition at line 215 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_CALLER

#define DUK_STRIDX_CALLER   69 /* 'caller' */

Definition at line 218 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_CASE

#define DUK_STRIDX_CASE   147 /* 'case' */

Definition at line 452 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_CATCH

#define DUK_STRIDX_CATCH   148 /* 'catch' */

Definition at line 455 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_CLASS

#define DUK_STRIDX_CLASS   173 /* 'class' */

Definition at line 530 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_CLOG

#define DUK_STRIDX_CLOG   138 /* 'clog' */

Definition at line 425 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_COMMA

#define DUK_STRIDX_COMMA   62 /* ',' */

Definition at line 197 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_COMPILE

#define DUK_STRIDX_COMPILE   116 /* 'compile' */

Definition at line 359 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_CONFIGURABLE

#define DUK_STRIDX_CONFIGURABLE   36 /* 'configurable' */

Definition at line 119 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_CONST

#define DUK_STRIDX_CONST   169 /* 'const' */

Definition at line 518 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_CONSTRUCTOR

#define DUK_STRIDX_CONSTRUCTOR   51 /* 'constructor' */

Definition at line 164 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_CONTINUE

#define DUK_STRIDX_CONTINUE   149 /* 'continue' */

Definition at line 458 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_DATA

#define DUK_STRIDX_DATA   84 /* 'data' */

Definition at line 263 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_DATA_VIEW

#define DUK_STRIDX_DATA_VIEW   16 /* 'DataView' */

Definition at line 59 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_DATE

#define DUK_STRIDX_DATE   9 /* 'Date' */

Definition at line 38 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_DEBUGGER

#define DUK_STRIDX_DEBUGGER   150 /* 'debugger' */

Definition at line 461 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_DEC_ENV

#define DUK_STRIDX_DEC_ENV   28 /* 'DecEnv' */

Definition at line 95 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_DEFAULT

#define DUK_STRIDX_DEFAULT   151 /* 'default' */

Definition at line 464 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_DEFINE_PROPERTY

#define DUK_STRIDX_DEFINE_PROPERTY   33 /* 'defineProperty' */

Definition at line 110 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_DELETE

#define DUK_STRIDX_DELETE   152 /* 'delete' */

Definition at line 467 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_DELETE_PROPERTY

#define DUK_STRIDX_DELETE_PROPERTY   72 /* 'deleteProperty' */

Definition at line 227 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_DO

#define DUK_STRIDX_DO   153 /* 'do' */

Definition at line 470 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ELSE

#define DUK_STRIDX_ELSE   154 /* 'else' */

Definition at line 473 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_EMPTY_STRING

#define DUK_STRIDX_EMPTY_STRING   14 /* '' */

Definition at line 53 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_END_RESERVED

#define DUK_STRIDX_END_RESERVED   191 /* exclusive endpoint */

Definition at line 588 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ENUM

#define DUK_STRIDX_ENUM   174 /* 'enum' */

Definition at line 533 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ENUMERABLE

#define DUK_STRIDX_ENUMERABLE   37 /* 'enumerable' */

Definition at line 122 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ENUMERATE

#define DUK_STRIDX_ENUMERATE   73 /* 'enumerate' */

Definition at line 230 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ENV

#define DUK_STRIDX_ENV   122 /* 'env' */

Definition at line 377 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ERR_CREATE

#define DUK_STRIDX_ERR_CREATE   118 /* 'errCreate' */

Definition at line 365 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ERR_THROW

#define DUK_STRIDX_ERR_THROW   119 /* 'errThrow' */

Definition at line 368 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ESCAPED_EMPTY_REGEXP

#define DUK_STRIDX_ESCAPED_EMPTY_REGEXP   48 /* '(?:)' */

Definition at line 155 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_EVAL

#define DUK_STRIDX_EVAL   32 /* 'eval' */

Definition at line 107 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_EXPORT

#define DUK_STRIDX_EXPORT   175 /* 'export' */

Definition at line 536 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_EXPORTS

#define DUK_STRIDX_EXPORTS   79 /* 'exports' */

Definition at line 248 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_EXTENDS

#define DUK_STRIDX_EXTENDS   176 /* 'extends' */

Definition at line 539 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_FALSE

#define DUK_STRIDX_FALSE   181 /* 'false' */

Definition at line 554 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_FILE_NAME

#define DUK_STRIDX_FILE_NAME   95 /* 'fileName' */

Definition at line 296 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_FILENAME

#define DUK_STRIDX_FILENAME   80 /* 'filename' */

Definition at line 251 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_FINALLY

#define DUK_STRIDX_FINALLY   155 /* 'finally' */

Definition at line 476 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_FLOAT32_ARRAY

#define DUK_STRIDX_FLOAT32_ARRAY   24 /* 'Float32Array' */

Definition at line 83 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_FLOAT64_ARRAY

#define DUK_STRIDX_FLOAT64_ARRAY   25 /* 'Float64Array' */

Definition at line 86 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_FMT

#define DUK_STRIDX_FMT   128 /* 'fmt' */

Definition at line 395 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_FOR

#define DUK_STRIDX_FOR   156 /* 'for' */

Definition at line 479 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_GET

#define DUK_STRIDX_GET   71 /* 'get' */

Definition at line 224 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_GLOBAL

#define DUK_STRIDX_GLOBAL   26 /* 'global' */

Definition at line 89 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_HAS

#define DUK_STRIDX_HAS   70 /* 'has' */

Definition at line 221 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_HEX

#define DUK_STRIDX_HEX   123 /* 'hex' */

Definition at line 380 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_ID

#define DUK_STRIDX_ID   78 /* 'id' */

Definition at line 245 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_IF

#define DUK_STRIDX_IF   158 /* 'if' */

Definition at line 485 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_IGNORE_CASE

#define DUK_STRIDX_IGNORE_CASE   45 /* 'ignoreCase' */

Definition at line 146 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_IMPLEMENTS

#define DUK_STRIDX_IMPLEMENTS   182 /* 'implements' */

Definition at line 557 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_IMPORT

#define DUK_STRIDX_IMPORT   177 /* 'import' */

Definition at line 542 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_IN

#define DUK_STRIDX_IN   159 /* 'in' */

Definition at line 488 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INDEX

#define DUK_STRIDX_INDEX   49 /* 'index' */

Definition at line 158 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INFINITY

#define DUK_STRIDX_INFINITY   59 /* 'Infinity' */

Definition at line 188 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INPUT

#define DUK_STRIDX_INPUT   117 /* 'input' */

Definition at line 362 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INSTANCEOF

#define DUK_STRIDX_INSTANCEOF   160 /* 'instanceof' */

Definition at line 491 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT16_ARRAY

#define DUK_STRIDX_INT16_ARRAY   20 /* 'Int16Array' */

Definition at line 71 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT32_ARRAY

#define DUK_STRIDX_INT32_ARRAY   22 /* 'Int32Array' */

Definition at line 77 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT8_ARRAY

#define DUK_STRIDX_INT8_ARRAY   17 /* 'Int8Array' */

Definition at line 62 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_ARGS

#define DUK_STRIDX_INT_ARGS   107 /* '\xffArgs' */

Definition at line 332 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_BYTECODE

#define DUK_STRIDX_INT_BYTECODE   100 /* '\xffBytecode' */

Definition at line 311 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_CALLEE

#define DUK_STRIDX_INT_CALLEE   111 /* '\xffCallee' */

Definition at line 344 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_FINALIZER

#define DUK_STRIDX_INT_FINALIZER   109 /* '\xffFinalizer' */

Definition at line 338 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_FORMALS

#define DUK_STRIDX_INT_FORMALS   101 /* '\xffFormals' */

Definition at line 314 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_HANDLER

#define DUK_STRIDX_INT_HANDLER   110 /* '\xffHandler' */

Definition at line 341 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_LEXENV

#define DUK_STRIDX_INT_LEXENV   103 /* '\xffLexenv' */

Definition at line 320 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_MAP

#define DUK_STRIDX_INT_MAP   108 /* '\xffMap' */

Definition at line 335 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_NEXT

#define DUK_STRIDX_INT_NEXT   99 /* '\xffNext' */

Definition at line 308 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_PC2LINE

#define DUK_STRIDX_INT_PC2LINE   106 /* '\xffPc2line' */

Definition at line 329 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_REGBASE

#define DUK_STRIDX_INT_REGBASE   113 /* '\xffRegbase' */

Definition at line 350 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_SOURCE

#define DUK_STRIDX_INT_SOURCE   105 /* '\xffSource' */

Definition at line 326 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_TARGET

#define DUK_STRIDX_INT_TARGET   114 /* '\xffTarget' */

Definition at line 353 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_THIS

#define DUK_STRIDX_INT_THIS   115 /* '\xffThis' */

Definition at line 356 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_THREAD

#define DUK_STRIDX_INT_THREAD   112 /* '\xffThread' */

Definition at line 347 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_TRACEDATA

#define DUK_STRIDX_INT_TRACEDATA   93 /* '\xffTracedata' */

Definition at line 290 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_VALUE

#define DUK_STRIDX_INT_VALUE   98 /* '\xffValue' */

Definition at line 305 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_VARENV

#define DUK_STRIDX_INT_VARENV   104 /* '\xffVarenv' */

Definition at line 323 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INT_VARMAP

#define DUK_STRIDX_INT_VARMAP   102 /* '\xffVarmap' */

Definition at line 317 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INTERFACE

#define DUK_STRIDX_INTERFACE   183 /* 'interface' */

Definition at line 560 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_INVALID_DATE

#define DUK_STRIDX_INVALID_DATE   66 /* 'Invalid Date' */

Definition at line 209 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_JC

#define DUK_STRIDX_JC   126 /* 'jc' */

Definition at line 389 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_JOIN

#define DUK_STRIDX_JOIN   38 /* 'join' */

Definition at line 125 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_JSON

#define DUK_STRIDX_JSON   13 /* 'JSON' */

Definition at line 50 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_JSON_EXT_FUNCTION1

#define DUK_STRIDX_JSON_EXT_FUNCTION1   144 /* '{"_func":true}' */

Definition at line 443 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_JSON_EXT_FUNCTION2

#define DUK_STRIDX_JSON_EXT_FUNCTION2   145 /* '{_func:true}' */

Definition at line 446 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_JSON_EXT_NAN

#define DUK_STRIDX_JSON_EXT_NAN   141 /* '{"_nan":true}' */

Definition at line 434 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_JSON_EXT_NEGINF

#define DUK_STRIDX_JSON_EXT_NEGINF   143 /* '{"_ninf":true}' */

Definition at line 440 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_JSON_EXT_POSINF

#define DUK_STRIDX_JSON_EXT_POSINF   142 /* '{"_inf":true}' */

Definition at line 437 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_JSON_EXT_UNDEFINED

#define DUK_STRIDX_JSON_EXT_UNDEFINED   140 /* '{"_undef":true}' */

Definition at line 431 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_JX

#define DUK_STRIDX_JX   125 /* 'jx' */

Definition at line 386 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LAST_INDEX

#define DUK_STRIDX_LAST_INDEX   47 /* 'lastIndex' */

Definition at line 152 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_ARGUMENTS

#define DUK_STRIDX_LC_ARGUMENTS   67 /* 'arguments' */

Definition at line 212 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_BOOLEAN

#define DUK_STRIDX_LC_BOOLEAN   53 /* 'boolean' */

Definition at line 170 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_BUFFER

#define DUK_STRIDX_LC_BUFFER   96 /* 'buffer' */

Definition at line 299 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_DEBUG

#define DUK_STRIDX_LC_DEBUG   131 /* 'debug' */

Definition at line 404 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_ERROR

#define DUK_STRIDX_LC_ERROR   134 /* 'error' */

Definition at line 413 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_FATAL

#define DUK_STRIDX_LC_FATAL   135 /* 'fatal' */

Definition at line 416 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_FUNCTION

#define DUK_STRIDX_LC_FUNCTION   157 /* 'function' */

Definition at line 482 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_INFO

#define DUK_STRIDX_LC_INFO   132 /* 'info' */

Definition at line 407 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_L

#define DUK_STRIDX_LC_L   137 /* 'l' */

Definition at line 422 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_N

#define DUK_STRIDX_LC_N   136 /* 'n' */

Definition at line 419 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_NULL

#define DUK_STRIDX_LC_NULL   179 /* 'null' */

Definition at line 548 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_NUMBER

#define DUK_STRIDX_LC_NUMBER   54 /* 'number' */

Definition at line 173 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_OBJECT

#define DUK_STRIDX_LC_OBJECT   56 /* 'object' */

Definition at line 179 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_POINTER

#define DUK_STRIDX_LC_POINTER   97 /* 'pointer' */

Definition at line 302 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_STRING

#define DUK_STRIDX_LC_STRING   55 /* 'string' */

Definition at line 176 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_TRACE

#define DUK_STRIDX_LC_TRACE   130 /* 'trace' */

Definition at line 401 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_UNDEFINED

#define DUK_STRIDX_LC_UNDEFINED   57 /* 'undefined' */

Definition at line 182 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LC_WARN

#define DUK_STRIDX_LC_WARN   133 /* 'warn' */

Definition at line 410 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LENGTH

#define DUK_STRIDX_LENGTH   85 /* 'length' */

Definition at line 266 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LET

#define DUK_STRIDX_LET   184 /* 'let' */

Definition at line 563 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_LINE_NUMBER

#define DUK_STRIDX_LINE_NUMBER   92 /* 'lineNumber' */

Definition at line 287 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_MATH

#define DUK_STRIDX_MATH   12 /* 'Math' */

Definition at line 47 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_MESSAGE

#define DUK_STRIDX_MESSAGE   52 /* 'message' */

Definition at line 167 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_MINUS_INFINITY

#define DUK_STRIDX_MINUS_INFINITY   60 /* '-Infinity' */

Definition at line 191 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_MINUS_ZERO

#define DUK_STRIDX_MINUS_ZERO   61 /* '-0' */

Definition at line 194 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_MOD_LOADED

#define DUK_STRIDX_MOD_LOADED   121 /* 'modLoaded' */

Definition at line 374 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_MOD_SEARCH

#define DUK_STRIDX_MOD_SEARCH   120 /* 'modSearch' */

Definition at line 371 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_MULTILINE

#define DUK_STRIDX_MULTILINE   46 /* 'multiline' */

Definition at line 149 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_NAME

#define DUK_STRIDX_NAME   94 /* 'name' */

Definition at line 293 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_NAN

#define DUK_STRIDX_NAN   58 /* 'NaN' */

Definition at line 185 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_NEW

#define DUK_STRIDX_NEW   161 /* 'new' */

Definition at line 494 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_NEWLINE_4SPACE

#define DUK_STRIDX_NEWLINE_4SPACE   64 /* '\n ' */

Definition at line 203 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_OBJ_ENV

#define DUK_STRIDX_OBJ_ENV   27 /* 'ObjEnv' */

Definition at line 92 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_OWN_KEYS

#define DUK_STRIDX_OWN_KEYS   74 /* 'ownKeys' */

Definition at line 233 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_PACKAGE

#define DUK_STRIDX_PACKAGE   185 /* 'package' */

Definition at line 566 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_PC

#define DUK_STRIDX_PC   91 /* 'pc' */

Definition at line 284 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_PRIVATE

#define DUK_STRIDX_PRIVATE   186 /* 'private' */

Definition at line 569 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_PROTECTED

#define DUK_STRIDX_PROTECTED   187 /* 'protected' */

Definition at line 572 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_PROTOTYPE

#define DUK_STRIDX_PROTOTYPE   50 /* 'prototype' */

Definition at line 161 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_PUBLIC

#define DUK_STRIDX_PUBLIC   188 /* 'public' */

Definition at line 575 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_RAW

#define DUK_STRIDX_RAW   129 /* 'raw' */

Definition at line 398 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_REG_EXP

#define DUK_STRIDX_REG_EXP   10 /* 'RegExp' */

Definition at line 41 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_REQUIRE

#define DUK_STRIDX_REQUIRE   77 /* 'require' */

Definition at line 242 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_RESUME

#define DUK_STRIDX_RESUME   127 /* 'resume' */

Definition at line 392 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_RETURN

#define DUK_STRIDX_RETURN   162 /* 'return' */

Definition at line 497 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_SET

#define DUK_STRIDX_SET   89 /* 'set' */

Definition at line 278 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_SET_PROTOTYPE_OF

#define DUK_STRIDX_SET_PROTOTYPE_OF   75 /* 'setPrototypeOf' */

Definition at line 236 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_SOURCE

#define DUK_STRIDX_SOURCE   44 /* 'source' */

Definition at line 143 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_SPACE

#define DUK_STRIDX_SPACE   63 /* ' ' */

Definition at line 200 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_STACK

#define DUK_STRIDX_STACK   90 /* 'stack' */

Definition at line 281 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_START_RESERVED

#define DUK_STRIDX_START_RESERVED   146

Definition at line 586 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_START_STRICT_RESERVED

#define DUK_STRIDX_START_STRICT_RESERVED   182

Definition at line 587 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_STATIC

#define DUK_STRIDX_STATIC   189 /* 'static' */

Definition at line 578 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_SUPER

#define DUK_STRIDX_SUPER   178 /* 'super' */

Definition at line 545 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_SWITCH

#define DUK_STRIDX_SWITCH   163 /* 'switch' */

Definition at line 500 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_THIS

#define DUK_STRIDX_THIS   164 /* 'this' */

Definition at line 503 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_THROW

#define DUK_STRIDX_THROW   165 /* 'throw' */

Definition at line 506 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TO_GMT_STRING

#define DUK_STRIDX_TO_GMT_STRING   43 /* 'toGMTString' */

Definition at line 140 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TO_ISO_STRING

#define DUK_STRIDX_TO_ISO_STRING   42 /* 'toISOString' */

Definition at line 137 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TO_JSON

#define DUK_STRIDX_TO_JSON   82 /* 'toJSON' */

Definition at line 257 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TO_LOCALE_STRING

#define DUK_STRIDX_TO_LOCALE_STRING   39 /* 'toLocaleString' */

Definition at line 128 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TO_LOG_STRING

#define DUK_STRIDX_TO_LOG_STRING   139 /* 'toLogString' */

Definition at line 428 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TO_STRING

#define DUK_STRIDX_TO_STRING   81 /* 'toString' */

Definition at line 254 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TO_UTC_STRING

#define DUK_STRIDX_TO_UTC_STRING   41 /* 'toUTCString' */

Definition at line 134 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TRUE

#define DUK_STRIDX_TRUE   180 /* 'true' */

Definition at line 551 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TRY

#define DUK_STRIDX_TRY   166 /* 'try' */

Definition at line 509 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TYPE

#define DUK_STRIDX_TYPE   83 /* 'type' */

Definition at line 260 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_TYPEOF

#define DUK_STRIDX_TYPEOF   167 /* 'typeof' */

Definition at line 512 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_ARGUMENTS

#define DUK_STRIDX_UC_ARGUMENTS   2 /* 'Arguments' */

Definition at line 17 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_BOOLEAN

#define DUK_STRIDX_UC_BOOLEAN   7 /* 'Boolean' */

Definition at line 32 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_BUFFER

#define DUK_STRIDX_UC_BUFFER   29 /* 'Buffer' */

Definition at line 98 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_ERROR

#define DUK_STRIDX_UC_ERROR   11 /* 'Error' */

Definition at line 44 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_FUNCTION

#define DUK_STRIDX_UC_FUNCTION   4 /* 'Function' */

Definition at line 23 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_NULL

#define DUK_STRIDX_UC_NULL   1 /* 'Null' */

Definition at line 14 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_NUMBER

#define DUK_STRIDX_UC_NUMBER   8 /* 'Number' */

Definition at line 35 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_OBJECT

#define DUK_STRIDX_UC_OBJECT   3 /* 'Object' */

Definition at line 20 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_POINTER

#define DUK_STRIDX_UC_POINTER   30 /* 'Pointer' */

Definition at line 101 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_STRING

#define DUK_STRIDX_UC_STRING   6 /* 'String' */

Definition at line 29 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_THREAD

#define DUK_STRIDX_UC_THREAD   31 /* 'Thread' */

Definition at line 104 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UC_UNDEFINED

#define DUK_STRIDX_UC_UNDEFINED   0 /* 'Undefined' */

Definition at line 11 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UINT16_ARRAY

#define DUK_STRIDX_UINT16_ARRAY   21 /* 'Uint16Array' */

Definition at line 74 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UINT32_ARRAY

#define DUK_STRIDX_UINT32_ARRAY   23 /* 'Uint32Array' */

Definition at line 80 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UINT8_ARRAY

#define DUK_STRIDX_UINT8_ARRAY   18 /* 'Uint8Array' */

Definition at line 65 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_UINT8_CLAMPED_ARRAY

#define DUK_STRIDX_UINT8_CLAMPED_ARRAY   19 /* 'Uint8ClampedArray' */

Definition at line 68 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_VALUE

#define DUK_STRIDX_VALUE   34 /* 'value' */

Definition at line 113 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_VALUE_OF

#define DUK_STRIDX_VALUE_OF   40 /* 'valueOf' */

Definition at line 131 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_VAR

#define DUK_STRIDX_VAR   168 /* 'var' */

Definition at line 515 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_VOID

#define DUK_STRIDX_VOID   170 /* 'void' */

Definition at line 521 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_WHILE

#define DUK_STRIDX_WHILE   171 /* 'while' */

Definition at line 524 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_WITH

#define DUK_STRIDX_WITH   172 /* 'with' */

Definition at line 527 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_WRITABLE

#define DUK_STRIDX_WRITABLE   35 /* 'writable' */

Definition at line 116 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ DUK_STRIDX_YIELD

#define DUK_STRIDX_YIELD   190 /* 'yield' */

Definition at line 581 of file duktape-1.5.2/src-separate/duk_builtins.h.

Function Documentation

◆ duk_bi_array_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_constructor ( duk_context * ctx)

Definition at line 20029 of file duktape-1.5.2/src-noline/duktape.c.

20030 {
20031 /* Range limited to [0, 0x7fffffff] range, i.e. range that can be
20032 * represented with duk_int32_t. Use this when the method doesn't
20033 * handle the full 32-bit unsigned range correctly.
20034 */
20035 duk_uint32_t ret = duk__push_this_obj_len_u32(ctx);
20036 if (DUK_UNLIKELY(ret >= 0x80000000UL)) {
20038 }
20039 return ret;
20040}
20041
20042/*
20043 * Constructor
20044 */
20045
20047 duk_idx_t nargs;
20048 duk_double_t d;
20049 duk_uint32_t len;
20050 duk_idx_t i;
20051
20052 nargs = duk_get_top(ctx);
20053 duk_push_array(ctx);
20054
20055 if (nargs == 1 && duk_is_number(ctx, 0)) {
20056 /* XXX: expensive check (also shared elsewhere - so add a shared internal API call?) */
20057 d = duk_get_number(ctx, 0);
20058 len = duk_to_uint32(ctx, 0);
20059 if (((duk_double_t) len) != d) {
20060 return DUK_RET_RANGE_ERROR;
20061 }
20062
20063 /* XXX: if 'len' is low, may want to ensure array part is kept:
20064 * the caller is likely to want a dense array.
20065 */
20066 duk_push_u32(ctx, len);
duk_small_int_t duk_ret_t
#define DUK_ERROR_RANGE(thr, msg)
DUK_EXTERNAL duk_double_t duk_get_number(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL duk_bool_t duk_is_number(duk_context *ctx, duk_idx_t index)
#define DUK_STR_ARRAY_LENGTH_OVER_2G
DUK_EXTERNAL duk_idx_t duk_get_top(duk_context *ctx)
DUK_LOCAL duk_uint32_t duk__push_this_obj_len_u32(duk_context *ctx)
DUK_EXTERNAL duk_uint32_t duk_to_uint32(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL duk_idx_t duk_push_array(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_constructor(duk_context *ctx)
#define duk_push_u32(ctx, val)
#define DUK_RET_RANGE_ERROR

◆ duk_bi_array_constructor_is_array()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_constructor_is_array ( duk_context * ctx)

Definition at line 20072 of file duktape-1.5.2/src-noline/duktape.c.

20075 {
20076 duk_dup(ctx, i);
20078 }
#define duk_xdef_prop_index_wec(ctx, obj_index, arr_index)
DUK_EXTERNAL void duk_dup(duk_context *ctx, duk_idx_t from_index)

◆ duk_bi_array_prototype_concat()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_concat ( duk_context * ctx)

Definition at line 20123 of file duktape-1.5.2/src-noline/duktape.c.

20128 : func=%!iT, this=%!iT",
20129 (duk_tval *) duk_get_tval(ctx, -2),
20130 (duk_tval *) duk_get_tval(ctx, -1)));
20131 duk_call_method(ctx, 0);
20132
20133 return 1;
20134}
20135
20136/*
20137 * concat()
20138 */
20139
20140DUK_INTERNAL duk_ret_t duk_bi_array_prototype_concat(duk_context *ctx) {
20141 duk_idx_t i, n;
20142 duk_uarridx_t idx, idx_last;
20143 duk_uarridx_t j, len;
20144 duk_hobject *h;
20145
20146 /* XXX: the insert here is a bit expensive if there are a lot of items.
20147 * It could also be special cased in the outermost for loop quite easily
20148 * (as the element is dup()'d anyway).
20149 */
20150
20151 (void) duk_push_this_coercible_to_object(ctx);
20152 duk_insert(ctx, 0);
20153 n = duk_get_top(ctx);
20154 duk_push_array(ctx); /* -> [ ToObject(this) item1 ... itemN arr ] */
20155
20156 /* NOTE: The Array special behaviors are NOT invoked by duk_xdef_prop_index()
20157 * (which differs from the official algorithm). If no error is thrown, this
20158 * doesn't matter as the length is updated at the end. However, if an error
20159 * is thrown, the length will be unset. That shouldn't matter because the
20160 * caller won't get a reference to the intermediate value.
20161 */
20162
20163 idx = 0;
20164 idx_last = 0;
20165 for (i = 0; i < n; i++) {
20166 DUK_ASSERT_TOP(ctx, n + 1);
20167
20168 /* [ ToObject(this) item1 ... itemN arr ] */
20169
20170 duk_dup(ctx, i);
20171 h = duk_get_hobject_with_class(ctx, -1, DUK_HOBJECT_CLASS_ARRAY);
20172 if (!h) {
20173 duk_xdef_prop_index_wec(ctx, -2, idx++);
20174 idx_last = idx;
20175 continue;
20176 }
20177
20178 /* [ ToObject(this) item1 ... itemN arr item(i) ] */
20179
20180 /* XXX: an array can have length higher than 32 bits; this is not handled
20181 * correctly now.
20182 */
20183 len = (duk_uarridx_t) duk_get_length(ctx, -1);
20184 for (j = 0; j < len; j++) {
20185 if (duk_get_prop_index(ctx, -1, j)) {
20186 /* [ ToObject(this) item1 ... itemN arr item(i) item(i)[j] ] */
20187 duk_xdef_prop_index_wec(ctx, -3, idx++);
20188 idx_last = idx;
20189 } else {
20190 idx++;
20191 duk_pop(ctx);
20192#if defined(DUK_USE_NONSTD_ARRAY_CONCAT_TRAILER)
20193 /* According to E5.1 Section 15.4.4.4 nonexistent trailing
20194 * elements do not affect 'length' of the result. Test262
20195 * and other engines disagree, so update idx_last here too.
20196 */
20197 idx_last = idx;
20198#else
20199 /* Strict standard behavior, ignore trailing elements for
20200 * result 'length'.

◆ duk_bi_array_prototype_indexof_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_indexof_shared ( duk_context * ctx)

Definition at line 21065 of file duktape-1.5.2/src-noline/duktape.c.

21082 {
21083 duk_idx_t nargs;
21084 duk_int_t i, len;
21085 duk_int_t from_index;
21086 duk_small_int_t idx_step = duk_get_current_magic(ctx); /* idx_step is +1 for indexOf, -1 for lastIndexOf */
21087
21088 /* lastIndexOf() needs to be a vararg function because we must distinguish
21089 * between an undefined fromIndex and a "not given" fromIndex; indexOf() is
21090 * made vararg for symmetry although it doesn't strictly need to be.
21091 */
21092
21093 nargs = duk_get_top(ctx);
21094 duk_set_top(ctx, 2);
21095
21096 /* XXX: must be able to represent -len */
21098 if (len == 0) {
21099 goto not_found;
21100 }
21101
21102 /* Index clamping is a bit tricky, we must ensure that we'll only iterate
21103 * through elements that exist and that the specific requirements from E5.1
21104 * Sections 15.4.4.14 and 15.4.4.15 are fulfilled; especially:
21105 *
21106 * - indexOf: clamp to [-len,len], negative handling -> [0,len],
21107 * if clamped result is len, for-loop bails out immediately
21108 *
21109 * - lastIndexOf: clamp to [-len-1, len-1], negative handling -> [-1, len-1],
21110 * if clamped result is -1, for-loop bails out immediately
21111 *
21112 * If fromIndex is not given, ToInteger(undefined) = 0, which is correct
21113 * for indexOf() but incorrect for lastIndexOf(). Hence special handling,
21114 * and why lastIndexOf() needs to be a vararg function.
21115 */
21116
21117 if (nargs >= 2) {
21118 /* indexOf: clamp fromIndex to [-len, len]
21119 * (if fromIndex == len, for-loop terminates directly)
21120 *
21121 * lastIndexOf: clamp fromIndex to [-len - 1, len - 1]
21122 * (if clamped to -len-1 -> fromIndex becomes -1, terminates for-loop directly)
21123 */
21124 from_index = duk_to_int_clamped(ctx,
21125 1,
21126 (idx_step > 0 ? -len : -len - 1),
21127 (idx_step > 0 ? len : len - 1));
21128 if (from_index < 0) {
21129 /* for lastIndexOf, result may be -1 (mark immediate termination) */
21130 from_index = len + from_index;
21131 }
21132 } else {
21133 /* for indexOf, ToInteger(undefined) would be 0, i.e. correct, but
21134 * handle both indexOf and lastIndexOf specially here.
21135 */
21136 if (idx_step > 0) {
21137 from_index = 0;
21138 } else {
21139 from_index = len - 1;
21140 }
21141 }
21142
21143 /* stack[0] = searchElement
21144 * stack[1] = fromIndex
21145 * stack[2] = object
21146 * stack[3] = length (not needed, but not popped above)
21147 */
21148
21149 for (i = from_index; i >= 0 && i < len; i += idx_step) {
duk_int_fast32_t duk_int_t
DUK_INTERNAL_DECL duk_int_t duk_to_int_clamped(duk_context *ctx, duk_idx_t index, duk_int_t minval, duk_int_t maxval)
DUK_EXTERNAL void duk_set_top(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL duk_int_t duk_get_current_magic(duk_context *ctx)
DUK_LOCAL duk_uint32_t duk__push_this_obj_len_u32_limited(duk_context *ctx)

◆ duk_bi_array_prototype_iter_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_iter_shared ( duk_context * ctx)

Definition at line 21166 of file duktape-1.5.2/src-noline/duktape.c.

21183 {
21184 duk_uint32_t len;
21185 duk_uint32_t i;
21186 duk_uarridx_t k;
21187 duk_bool_t bval;
21188 duk_small_int_t iter_type = duk_get_current_magic(ctx);
21189 duk_uint32_t res_length = 0;
21190
21191 /* each call this helper serves has nargs==2 */
21192 DUK_ASSERT_TOP(ctx, 2);
21193
21194 len = duk__push_this_obj_len_u32(ctx);
21195 duk_require_callable(ctx, 0);
21196 /* if thisArg not supplied, behave as if undefined was supplied */
21197
21198 if (iter_type == DUK__ITER_MAP || iter_type == DUK__ITER_FILTER) {
21199 duk_push_array(ctx);
21200 } else {
21201 duk_push_undefined(ctx);
21202 }
21203
21204 /* stack[0] = callback
21205 * stack[1] = thisArg
21206 * stack[2] = object
21207 * stack[3] = ToUint32(length) (unused, but avoid unnecessary pop)
21208 * stack[4] = result array (or undefined)
21209 */
21210
21211 k = 0; /* result index for filter() */
21212 for (i = 0; i < len; i++) {
21213 DUK_ASSERT_TOP(ctx, 5);
21214
21215 if (!duk_get_prop_index(ctx, 2, (duk_uarridx_t) i)) {
21216#if defined(DUK_USE_NONSTD_ARRAY_MAP_TRAILER)
21217 /* Real world behavior for map(): trailing non-existent
21218 * elements don't invoke the user callback, but are still
21219 * counted towards result 'length'.
21220 */
21221 if (iter_type == DUK__ITER_MAP) {
21222 res_length = i + 1;
21223 }
21224#else
21225 /* Standard behavior for map(): trailing non-existent
21226 * elements don't invoke the user callback and are not
21227 * counted towards result 'length'.
21228 */
21229#endif
21230 duk_pop(ctx);
21231 continue;
21232 }
21233
21234 /* The original value needs to be preserved for filter(), hence
21235 * this funny order. We can't re-get the value because of side
21236 * effects.
21237 */
21238
21239 duk_dup(ctx, 0);
21240 duk_dup(ctx, 1);
21241 duk_dup(ctx, -3);
21242 duk_push_u32(ctx, i);
21243 duk_dup(ctx, 2); /* [ ... val callback thisArg val i obj ] */
21244 duk_call_method(ctx, 3); /* -> [ ... val retval ] */
21245
21246 switch (iter_type) {
21247 case DUK__ITER_EVERY:
21248 bval = duk_to_boolean(ctx, -1);
21249 if (!bval) {
21250 /* stack top contains 'false' */
21251 return 1;
21252 }
21253 break;
21254 case DUK__ITER_SOME:
21255 bval = duk_to_boolean(ctx, -1);
21256 if (bval) {
21257 /* stack top contains 'true' */
21258 return 1;
21259 }
21260 break;
21261 case DUK__ITER_FOREACH:
21262 /* nop */
21263 break;
21264 case DUK__ITER_MAP:
21265 duk_dup(ctx, -1);
21266 duk_xdef_prop_index_wec(ctx, 4, (duk_uarridx_t) i); /* retval to result[i] */
21267 res_length = i + 1;
21268 break;
21269 case DUK__ITER_FILTER:
21270 bval = duk_to_boolean(ctx, -1);
21271 if (bval) {
21272 duk_dup(ctx, -2); /* orig value */
21274 k++;
21275 res_length = k;
21276 }
21277 break;
21278 default:
21280 break;
21281 }
21282 duk_pop_2(ctx);
21283
21284 DUK_ASSERT_TOP(ctx, 5);
21285 }
21286
21287 switch (iter_type) {
21288 case DUK__ITER_EVERY:
21289 duk_push_true(ctx);
21290 break;
21291 case DUK__ITER_SOME:
21292 duk_push_false(ctx);
21293 break;
duk_small_int_t duk_bool_t
DUK_EXTERNAL void duk_pop_2(duk_context *ctx)
DUK_EXTERNAL void duk_push_true(duk_context *ctx)
DUK_EXTERNAL duk_bool_t duk_to_boolean(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL duk_bool_t duk_get_prop_index(duk_context *ctx, duk_idx_t obj_index, duk_uarridx_t arr_index)
DUK_EXTERNAL void duk_push_undefined(duk_context *ctx)
DUK_EXTERNAL void duk_call_method(duk_context *ctx, duk_idx_t nargs)
#define DUK_ASSERT_TOP(ctx, n)
DUK_EXTERNAL void duk_push_false(duk_context *ctx)
DUK_EXTERNAL void duk_pop(duk_context *ctx)
#define duk_require_callable(ctx, index)

◆ duk_bi_array_prototype_join_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_join_shared ( duk_context * ctx)

Definition at line 20215 of file duktape-1.5.2/src-noline/duktape.c.

20232 {
20233 duk_uint32_t len, count;
20234 duk_uint32_t idx;
20235 duk_small_int_t to_locale_string = duk_get_current_magic(ctx);
20236 duk_idx_t valstack_required;
20237
20238 /* For join(), nargs is 1. For toLocaleString(), nargs is 0 and
20239 * setting the top essentially pushes an undefined to the stack,
20240 * thus defaulting to a comma separator.
20241 */
20242 duk_set_top(ctx, 1);
20243 if (duk_is_undefined(ctx, 0)) {
20244 duk_pop(ctx);
20246 } else {
20247 duk_to_string(ctx, 0);
20248 }
20249
20250 len = duk__push_this_obj_len_u32(ctx);
20251
20252 /* [ sep ToObject(this) len ] */
20253
20254 DUK_DDD(DUK_DDDPRINT("sep=%!T, this=%!T, len=%lu",
20255 (duk_tval *) duk_get_tval(ctx, 0),
20256 (duk_tval *) duk_get_tval(ctx, 1),
20257 (unsigned long) len));
20258
20259 /* The extra (+4) is tight. */
20260 valstack_required = (len >= DUK__ARRAY_MID_JOIN_LIMIT ?
20261 DUK__ARRAY_MID_JOIN_LIMIT : len) + 4;
20262 duk_require_stack(ctx, valstack_required);
20263
20264 duk_dup(ctx, 0);
20265
20266 /* [ sep ToObject(this) len sep ] */
20267
20268 count = 0;
20269 idx = 0;
20270 for (;;) {
20271 if (count >= DUK__ARRAY_MID_JOIN_LIMIT || /* intermediate join to avoid valstack overflow */
20272 idx >= len) { /* end of loop (careful with len==0) */
20273 /* [ sep ToObject(this) len sep str0 ... str(count-1) ] */
20274 DUK_DDD(DUK_DDDPRINT("mid/final join, count=%ld, idx=%ld, len=%ld",
20275 (long) count, (long) idx, (long) len));
20276 duk_join(ctx, (duk_idx_t) count); /* -> [ sep ToObject(this) len str ] */
20277 duk_dup(ctx, 0); /* -> [ sep ToObject(this) len str sep ] */
20278 duk_insert(ctx, -2); /* -> [ sep ToObject(this) len sep str ] */
20279 count = 1;
20280 }
20281 if (idx >= len) {
20282 /* if true, the stack already contains the final result */
20283 break;
20284 }
20285
20286 duk_get_prop_index(ctx, 1, (duk_uarridx_t) idx);
20287 if (duk_is_null_or_undefined(ctx, -1)) {
20288 duk_pop(ctx);
20290 } else {
20291 if (to_locale_string) {
20292 duk_to_object(ctx, -1);
DUK_EXTERNAL duk_bool_t duk_is_undefined(duk_context *ctx, duk_idx_t index)
DUK_INTERNAL_DECL void duk_push_hstring_stridx(duk_context *ctx, duk_small_int_t stridx)
DUK_EXTERNAL void duk_require_stack(duk_context *ctx, duk_idx_t extra)
#define DUK_STRIDX_EMPTY_STRING
DUK_EXTERNAL void duk_insert(duk_context *ctx, duk_idx_t to_index)
#define DUK__ARRAY_MID_JOIN_LIMIT
DUK_EXTERNAL duk_bool_t duk_is_null_or_undefined(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL void duk_to_object(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL const char * duk_to_string(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL void duk_join(duk_context *ctx, duk_idx_t count)
DUK_INTERNAL_DECL duk_tval * duk_get_tval(duk_context *ctx, duk_idx_t index)

◆ duk_bi_array_prototype_pop()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_pop ( duk_context * ctx)

Definition at line 20298 of file duktape-1.5.2/src-noline/duktape.c.

20315 {
20316 duk_uint32_t len;

◆ duk_bi_array_prototype_push()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_push ( duk_context * ctx)

Definition at line 20318 of file duktape-1.5.2/src-noline/duktape.c.

20321 {
20322 duk_push_int(ctx, 0);
20324 return 0;
20325 }
20326 idx = len - 1;
20327
20328 duk_get_prop_index(ctx, 0, (duk_uarridx_t) idx);
20329 duk_del_prop_index(ctx, 0, (duk_uarridx_t) idx);
20330 duk_push_u32(ctx, idx);
20332 return 1;
20333}
20334
20336 /* Note: 'this' is not necessarily an Array object. The push()
20337 * algorithm is supposed to work for other kinds of objects too,
20338 * so the algorithm has e.g. an explicit update for the 'length'
20339 * property which is normally "magical" in arrays.
20340 */
20341
20342 duk_uint32_t len;
20343 duk_idx_t i, n;
20344
20345 n = duk_get_top(ctx);
20346 len = duk__push_this_obj_len_u32(ctx);
20347
20348 /* [ arg1 ... argN obj length ] */
20349
20350 /* Technically Array.prototype.push() can create an Array with length
20351 * longer than 2^32-1, i.e. outside the 32-bit range. The final length
20352 * is *not* wrapped to 32 bits in the specification.
20353 *
20354 * This implementation tracks length with a uint32 because it's much
20355 * more practical.
20356 *
20357 * See: test-bi-array-push-maxlen.js.
20358 */
20359
20360 if (len + (duk_uint32_t) n < len) {
DUK_INTERNAL_DECL duk_bool_t duk_put_prop_stridx(duk_context *ctx, duk_idx_t obj_index, duk_small_int_t stridx)
DUK_EXTERNAL duk_bool_t duk_del_prop_index(duk_context *ctx, duk_idx_t obj_index, duk_uarridx_t arr_index)
DUK_EXTERNAL void duk_push_int(duk_context *ctx, duk_int_t val)
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_push(duk_context *ctx)

◆ duk_bi_array_prototype_reduce_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_reduce_shared ( duk_context * ctx)

Definition at line 21299 of file duktape-1.5.2/src-noline/duktape.c.

21304 :
21306 break;
21307 }
21308
21309 return 1;
21310}
21311
21312/*
21313 * reduce(), reduceRight()
21314 */
21315
21317 duk_idx_t nargs;
21318 duk_bool_t have_acc;
21319 duk_uint32_t i, len;
21320 duk_small_int_t idx_step = duk_get_current_magic(ctx); /* idx_step is +1 for reduce, -1 for reduceRight */
21321
21322 /* We're a varargs function because we need to detect whether
21323 * initialValue was given or not.
21324 */
21325 nargs = duk_get_top(ctx);
21326 DUK_DDD(DUK_DDDPRINT("nargs=%ld", (long) nargs));
21327
21328 duk_set_top(ctx, 2);
21329 len = duk__push_this_obj_len_u32(ctx);
21330 if (!duk_is_callable(ctx, 0)) {
21331 goto type_error;
21332 }
21333
21334 /* stack[0] = callback fn
21335 * stack[1] = initialValue
21336 * stack[2] = object (coerced this)
21337 * stack[3] = length (not needed, but not popped above)
21338 * stack[4] = accumulator
21339 */
21340
21341 have_acc = 0;
21342 if (nargs >= 2) {
21343 duk_dup(ctx, 1);
21344 have_acc = 1;
21345 }
21346 DUK_DDD(DUK_DDDPRINT("have_acc=%ld, acc=%!T",
21347 (long) have_acc, (duk_tval *) duk_get_tval(ctx, 3)));
21348
21349 /* For len == 0, i is initialized to len - 1 which underflows.
21350 * The condition (i < len) will then exit the for-loop on the
21351 * first round which is correct. Similarly, loop termination
21352 * happens by i underflowing.
21353 */
21354
21355 for (i = (idx_step >= 0 ? 0 : len - 1);
21356 i < len; /* i >= 0 would always be true */
21357 i += idx_step) {
21358 DUK_DDD(DUK_DDDPRINT("i=%ld, len=%ld, have_acc=%ld, top=%ld, acc=%!T",
21359 (long) i, (long) len, (long) have_acc,
21360 (long) duk_get_top(ctx),
21361 (duk_tval *) duk_get_tval(ctx, 4)));
21362
21363 DUK_ASSERT((have_acc && duk_get_top(ctx) == 5) ||
21364 (!have_acc && duk_get_top(ctx) == 4));
21365
21366 if (!duk_has_prop_index(ctx, 2, (duk_uarridx_t) i)) {
21367 continue;
21368 }
21369
21370 if (!have_acc) {
21371 DUK_ASSERT_TOP(ctx, 4);
21372 duk_get_prop_index(ctx, 2, (duk_uarridx_t) i);
21373 have_acc = 1;
21374 DUK_ASSERT_TOP(ctx, 5);
21375 } else {
21376 DUK_ASSERT_TOP(ctx, 5);
21377 duk_dup(ctx, 0);
21378 duk_dup(ctx, 4);
21379 duk_get_prop_index(ctx, 2, (duk_uarridx_t) i);
21380 duk_push_u32(ctx, i);
21381 duk_dup(ctx, 2);
21382 DUK_DDD(DUK_DDDPRINT("calling reduce function: func=%!T, prev=%!T, curr=%!T, idx=%!T, obj=%!T",
21383 (duk_tval *) duk_get_tval(ctx, -5), (duk_tval *) duk_get_tval(ctx, -4),
21384 (duk_tval *) duk_get_tval(ctx, -3), (duk_tval *) duk_get_tval(ctx, -2),
21385 (duk_tval *) duk_get_tval(ctx, -1)));
DUK_EXTERNAL duk_bool_t duk_has_prop_index(duk_context *ctx, duk_idx_t obj_index, duk_uarridx_t arr_index)
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_reduce_shared(duk_context *ctx)
#define duk_is_callable(ctx, index)

◆ duk_bi_array_prototype_reverse()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_reverse ( duk_context * ctx)

Definition at line 20848 of file duktape-1.5.2/src-noline/duktape.c.

20865 {
20866 duk_uint32_t len;
20867 duk_uint32_t middle;
20868 duk_uint32_t lower, upper;
20869 duk_bool_t have_lower, have_upper;
20870
20871 len = duk__push_this_obj_len_u32(ctx);
20872 middle = len / 2;
20873
20874 /* If len <= 1, middle will be 0 and for-loop bails out
20875 * immediately (0 < 0 -> false).
20876 */
20877
20878 for (lower = 0; lower < middle; lower++) {
20879 DUK_ASSERT(len >= 2);
20880 DUK_ASSERT_TOP(ctx, 2);
20881
20882 DUK_ASSERT(len >= lower + 1);
20883 upper = len - lower - 1;
20884
20885 have_lower = duk_get_prop_index(ctx, -2, (duk_uarridx_t) lower);
20886 have_upper = duk_get_prop_index(ctx, -3, (duk_uarridx_t) upper);
20887
20888 /* [ ToObject(this) ToUint32(length) lowerValue upperValue ] */
20889
20890 if (have_upper) {
20891 duk_put_prop_index(ctx, -4, (duk_uarridx_t) lower);
20892 } else {
20893 duk_del_prop_index(ctx, -4, (duk_uarridx_t) lower);
DUK_EXTERNAL duk_bool_t duk_put_prop_index(duk_context *ctx, duk_idx_t obj_idx, duk_uarridx_t arr_idx)

◆ duk_bi_array_prototype_shift()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_shift ( duk_context * ctx)

Definition at line 20961 of file duktape-1.5.2/src-noline/duktape.c.

20978 {
20979 duk_uint32_t len;
20980 duk_uint32_t i;
20981
20982 len = duk__push_this_obj_len_u32(ctx);
20983 if (len == 0) {
20984 duk_push_int(ctx, 0);
20986 return 0;
20987 }
20988
20989 duk_get_prop_index(ctx, 0, 0);
20990
20991 /* stack[0] = object (this)
20992 * stack[1] = ToUint32(length)
20993 * stack[2] = elem at index 0 (retval)
20994 */
20995
20996 for (i = 1; i < len; i++) {
20997 DUK_ASSERT_TOP(ctx, 3);

◆ duk_bi_array_prototype_slice()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_slice ( duk_context * ctx)

Definition at line 20899 of file duktape-1.5.2/src-noline/duktape.c.

20899 {
20900 duk_del_prop_index(ctx, -3, (duk_uarridx_t) upper);
20901 duk_pop(ctx);
20902 }
20903
20904 DUK_ASSERT_TOP(ctx, 2);
20905 }
20906
20907 DUK_ASSERT_TOP(ctx, 2);
20908 duk_pop(ctx); /* -> [ ToObject(this) ] */
20909 return 1;
20910}
20911
20912/*
20913 * slice()
20914 */
20915
20917 duk_uint32_t len;
20918 duk_int_t start, end;
20919 duk_int_t i;
20920 duk_uarridx_t idx;
20921 duk_uint32_t res_length = 0;
20922
20923 /* XXX: len >= 0x80000000 won't work below because we need to be
20924 * able to represent -len.
20925 */
20927 duk_push_array(ctx);
20928
20929 /* stack[0] = start
20930 * stack[1] = end
20931 * stack[2] = ToObject(this)
20932 * stack[3] = ToUint32(length)
20933 * stack[4] = result array
20934 */
20935
20936 start = duk_to_int_clamped(ctx, 0, -((duk_int_t) len), (duk_int_t) len);
20937 if (start < 0) {
20938 start = len + start;
20939 }
20940 /* XXX: could duk_is_undefined() provide defaulting undefined to 'len'
20941 * (the upper limit)?
20942 */
20943 if (duk_is_undefined(ctx, 1)) {
20944 end = len;
20945 } else {
20946 end = duk_to_int_clamped(ctx, 1, -((duk_int_t) len), (duk_int_t) len);
20947 if (end < 0) {
20948 end = len + end;
20949 }
20950 }
20951 DUK_ASSERT(start >= 0 && (duk_uint32_t) start <= len);
20952 DUK_ASSERT(end >= 0 && (duk_uint32_t) end <= len);
20953
20954 idx = 0;
20955 for (i = start; i < end; i++) {
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_slice(duk_context *ctx)

◆ duk_bi_array_prototype_sort()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_sort ( duk_context * ctx)

Definition at line 20648 of file duktape-1.5.2/src-noline/duktape.c.

20653 : %!T", (duk_tval *) duk_get_tval(ctx, 1)));
20654 duk__array_sort_swap(ctx, lo, r);
20655
20656#if defined(DUK_USE_DDDPRINT)
20657 duk__debuglog_qsort_state(ctx, lo, hi, r);
20658#endif
20659
20660 DUK_DDD(DUK_DDDPRINT("recurse: pivot=%ld, obj=%!T", (long) r, (duk_tval *) duk_get_tval(ctx, 1)));
20661 duk__array_qsort(ctx, lo, r - 1);
20662 duk__array_qsort(ctx, r + 1, hi);
20663}
20664
20665DUK_INTERNAL duk_ret_t duk_bi_array_prototype_sort(duk_context *ctx) {
20666 duk_uint32_t len;
20667
20668 /* XXX: len >= 0x80000000 won't work below because a signed type
20669 * is needed by qsort.

◆ duk_bi_array_prototype_splice()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_splice ( duk_context * ctx)

Definition at line 20684 of file duktape-1.5.2/src-noline/duktape.c.

20701 {
20702 duk_idx_t nargs;
20703 duk_uint32_t len;
20704 duk_bool_t have_delcount;
20705 duk_int_t item_count;
20706 duk_int_t act_start;
20707 duk_int_t del_count;
20708 duk_int_t i, n;
20709
20710 DUK_UNREF(have_delcount);
20711
20712 nargs = duk_get_top(ctx);
20713 if (nargs < 2) {
20714 duk_set_top(ctx, 2);
20715 nargs = 2;
20716 have_delcount = 0;
20717 } else {
20718 have_delcount = 1;
20719 }
20720
20721 /* XXX: len >= 0x80000000 won't work below because we need to be
20722 * able to represent -len.
20723 */
20725
20726 act_start = duk_to_int_clamped(ctx, 0, -((duk_int_t) len), (duk_int_t) len);
20727 if (act_start < 0) {
20728 act_start = len + act_start;
20729 }
20730 DUK_ASSERT(act_start >= 0 && act_start <= (duk_int_t) len);
20731
20732#ifdef DUK_USE_NONSTD_ARRAY_SPLICE_DELCOUNT
20733 if (have_delcount) {
20734#endif
20735 del_count = duk_to_int_clamped(ctx, 1, 0, len - act_start);
20736#ifdef DUK_USE_NONSTD_ARRAY_SPLICE_DELCOUNT
20737 } else {
20738 /* E5.1 standard behavior when deleteCount is not given would be
20739 * to treat it just like if 'undefined' was given, which coerces
20740 * ultimately to 0. Real world behavior is to splice to the end
20741 * of array, see test-bi-array-proto-splice-no-delcount.js.
20742 */
20743 del_count = len - act_start;
20744 }
20745#endif
20746
20747 DUK_ASSERT(nargs >= 2);
20748 item_count = (duk_int_t) (nargs - 2);
20749
20750 DUK_ASSERT(del_count >= 0 && del_count <= (duk_int_t) len - act_start);
20751 DUK_ASSERT(del_count + act_start <= (duk_int_t) len);
20752
20753 /* For now, restrict result array into 32-bit length range. */
20754 if (((duk_double_t) len) - ((duk_double_t) del_count) + ((duk_double_t) item_count) > (duk_double_t) DUK_UINT32_MAX) {
20755 DUK_D(DUK_DPRINT("Array.prototype.splice() would go beyond 32-bit length, throw"));
20756 return DUK_RET_RANGE_ERROR;
20757 }
20758
20759 duk_push_array(ctx);
20760
20761 /* stack[0] = start
20762 * stack[1] = deleteCount
20763 * stack[2...nargs-1] = items
20764 * stack[nargs] = ToObject(this) -3
20765 * stack[nargs+1] = ToUint32(length) -2
20766 * stack[nargs+2] = result array -1
20767 */
20768
20769 DUK_ASSERT_TOP(ctx, nargs + 3);
20770
20771 /* Step 9: copy elements-to-be-deleted into the result array */
20772
20773 for (i = 0; i < del_count; i++) {
20774 if (duk_get_prop_index(ctx, -3, (duk_uarridx_t) (act_start + i))) {
20775 duk_xdef_prop_index_wec(ctx, -2, i); /* throw flag irrelevant (false in std alg) */
20776 } else {
20777 duk_pop(ctx);
20778 }
20779 }
20780 duk_push_u32(ctx, (duk_uint32_t) del_count);
20782
20783 /* Steps 12 and 13: reorganize elements to make room for itemCount elements */
20784
20785 if (item_count < del_count) {
20786 /* [ A B C D E F G H ] rel_index = 2, del_count 3, item count 1
20787 * -> [ A B F G H ] (conceptual intermediate step)
20788 * -> [ A B . F G H ] (placeholder marked)
20789 * [ A B C F G H ] (actual result at this point, C will be replaced)
20790 */
20791
20792 DUK_ASSERT_TOP(ctx, nargs + 3);
20793
20794 n = len - del_count;
20795 for (i = act_start; i < n; i++) {
20796 if (duk_get_prop_index(ctx, -3, (duk_uarridx_t) (i + del_count))) {
20797 duk_put_prop_index(ctx, -4, (duk_uarridx_t) (i + item_count));
20798 } else {
20799 duk_pop(ctx);
20800 duk_del_prop_index(ctx, -3, (duk_uarridx_t) (i + item_count));
20801 }
20802 }
20803
20804 DUK_ASSERT_TOP(ctx, nargs + 3);
20805
20806 /* loop iterator init and limit changed from standard algorithm */
20807 n = len - del_count + item_count;
20808 for (i = len - 1; i >= n; i--) {
20809 duk_del_prop_index(ctx, -3, (duk_uarridx_t) i);
20810 }
20811
20812 DUK_ASSERT_TOP(ctx, nargs + 3);
20813 } else if (item_count > del_count) {
20814 /* [ A B C D E F G H ] rel_index = 2, del_count 3, item count 4
20815 * -> [ A B F G H ] (conceptual intermediate step)
20816 * -> [ A B . . . . F G H ] (placeholder marked)
20817 * [ A B C D E F F G H ] (actual result at this point)
20818 */
20819
20820 DUK_ASSERT_TOP(ctx, nargs + 3);
20821
20822 /* loop iterator init and limit changed from standard algorithm */
20823 for (i = len - del_count - 1; i >= act_start; i--) {
20824 if (duk_get_prop_index(ctx, -3, (duk_uarridx_t) (i + del_count))) {
20825 duk_put_prop_index(ctx, -4, (duk_uarridx_t) (i + item_count));
20826 } else {
20827 duk_pop(ctx);
20828 duk_del_prop_index(ctx, -3, (duk_uarridx_t) (i + item_count));
20829 }
20830 }
20831
20832 DUK_ASSERT_TOP(ctx, nargs + 3);
20833 } else {
20834 /* [ A B C D E F G H ] rel_index = 2, del_count 3, item count 3
20835 * -> [ A B F G H ] (conceptual intermediate step)
20836 * -> [ A B . . . F G H ] (placeholder marked)
20837 * [ A B C D E F G H ] (actual result at this point)
20838 */
20839 }
20840 DUK_ASSERT_TOP(ctx, nargs + 3);
20841
20842 /* Step 15: insert itemCount elements into the hole made above */
DUK_INTERNAL_DECL void duk_xdef_prop_stridx(duk_context *ctx, duk_idx_t obj_index, duk_small_int_t stridx, duk_small_uint_t desc_flags)

◆ duk_bi_array_prototype_to_string()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_to_string ( duk_context * ctx)

Definition at line 20084 of file duktape-1.5.2/src-noline/duktape.c.

20089 {
20090 duk_hobject *h;
20091
20093 duk_push_boolean(ctx, (h != NULL));
20094 return 1;
20095}
20096
20097/*
20098 * toString()
20099 */
20100
20104
20105 /* [ ... this func ] */
20106 if (!duk_is_callable(ctx, -1)) {
20107 /* Fall back to the initial (original) Object.toString(). We don't
20108 * currently have pointers to the built-in functions, only the top
20109 * level global objects (like "Array") so this is now done in a bit
20110 * of a hacky manner. It would be cleaner to push the (original)
20111 * function and use duk_call_method().
20112 */
20113
20114 /* XXX: 'this' will be ToObject() coerced twice, which is incorrect
20115 * but should have no visible side effects.
20116 */
20117 DUK_DDD(DUK_DDDPRINT("this.join is not callable, fall back to (original) Object.toString"));
DUK_INTERNAL_DECL duk_bool_t duk_get_prop_stridx(duk_context *ctx, duk_idx_t obj_index, duk_small_int_t stridx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_to_string(duk_context *ctx)
DUK_EXTERNAL void duk_push_boolean(duk_context *ctx, duk_bool_t val)
#define DUK_HOBJECT_CLASS_ARRAY
DUK_INTERNAL_DECL duk_hobject * duk_push_this_coercible_to_object(duk_context *ctx)
DUK_INTERNAL_DECL duk_hobject * duk_get_hobject_with_class(duk_context *ctx, duk_idx_t index, duk_small_uint_t classnum)
#define NULL
Definition gmacros.h:924

◆ duk_bi_array_prototype_unshift()

DUK_INTERNAL_DECL duk_ret_t duk_bi_array_prototype_unshift ( duk_context * ctx)

Definition at line 21003 of file duktape-1.5.2/src-noline/duktape.c.

21020 {
21021 duk_idx_t nargs;
21022 duk_uint32_t len;
21023 duk_uint32_t i;
21024
21025 nargs = duk_get_top(ctx);
21026 len = duk__push_this_obj_len_u32(ctx);
21027
21028 /* stack[0...nargs-1] = unshift args (vararg)
21029 * stack[nargs] = ToObject(this)
21030 * stack[nargs+1] = ToUint32(length)
21031 */
21032
21033 DUK_ASSERT_TOP(ctx, nargs + 2);
21034
21035 /* Note: unshift() may operate on indices above unsigned 32-bit range
21036 * and the final length may be >= 2**32. However, we restrict the
21037 * final result to 32-bit range for practicality.
21038 */
21039
21040 if (len + (duk_uint32_t) nargs < len) {
21041 DUK_D(DUK_DPRINT("Array.prototype.unshift() would go beyond 32-bit length, throw"));
21042 return DUK_RET_RANGE_ERROR;
21043 }
21044
21045 i = len;
21046 while (i > 0) {
21047 DUK_ASSERT_TOP(ctx, nargs + 2);
21048 i--;
21049 /* k+argCount-1; note that may be above 32-bit range */
21050
21051 if (duk_get_prop_index(ctx, -2, (duk_uarridx_t) i)) {
21052 /* fromPresent = true */
21053 /* [ ... ToObject(this) ToUint32(length) val ] */
21054 duk_put_prop_index(ctx, -3, (duk_uarridx_t) (i + nargs)); /* -> [ ... ToObject(this) ToUint32(length) ] */
21055 } else {
21056 /* fromPresent = false */
21057 /* [ ... ToObject(this) ToUint32(length) val ] */
21058 duk_pop(ctx);
21059 duk_del_prop_index(ctx, -2, (duk_uarridx_t) (i + nargs)); /* -> [ ... ToObject(this) ToUint32(length) ] */

◆ duk_bi_arraybuffer_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_arraybuffer_constructor ( duk_context * ctx)

Definition at line 22133 of file duktape-1.5.2/src-noline/duktape.c.

22139 {
22140 DUK_UNREF(ctx);
22142}
22143#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
22144
22145/*
22146 * ArrayBuffer, DataView, and TypedArray constructors
22147 */
22148
22149#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
22151 duk_hthread *thr;
22152 duk_hbufferobject *h_bufobj;
22153 duk_hbuffer *h_val;
22154
22156 thr = (duk_hthread *) ctx;
22157 DUK_UNREF(thr);
22158
22159 /* XXX: function flag to make this automatic? */
22160 if (!duk_is_constructor_call(ctx)) {
22161 return DUK_RET_TYPE_ERROR;
22162 }
22163
22164 if (duk_is_buffer(ctx, 0)) {
22165 /* Custom behavior: plain buffer is used as internal buffer
22166 * without making a copy (matches Duktape.Buffer).
22167 */
22168
22169 h_val = duk_get_hbuffer(ctx, 0);
22170 DUK_ASSERT(h_val != NULL);
22171
22172 /* XXX: accept any duk_hbufferobject type as an input also? */
22173 } else {
22174 duk_int_t len;
22175 len = duk_to_int(ctx, 0);
22176 if (len < 0) {
22177 goto fail_length;
22178 }
22179 (void) duk_push_fixed_buffer(ctx, (duk_size_t) len);
22180 h_val = (duk_hbuffer *) duk_get_hbuffer(ctx, -1);
22181 DUK_ASSERT(h_val != NULL);
22182
22183#if !defined(DUK_USE_ZERO_BUFFER_DATA)
22184 /* Khronos/ES6 requires zeroing even when DUK_USE_ZERO_BUFFER_DATA
22185 * is not set.
22186 */
22188 DUK_MEMZERO((void *) DUK_HBUFFER_FIXED_GET_DATA_PTR(thr->heap, h_val), (duk_size_t) len);
22189#endif
#define DUK_MEMZERO(p, n)
#define DUK_ASSERT_CTX_VALID(ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_arraybuffer_constructor(duk_context *ctx)
DUK_INTERNAL_DECL duk_hbuffer * duk_get_hbuffer(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL duk_bool_t duk_is_buffer(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL duk_bool_t duk_is_constructor_call(duk_context *ctx)
#define DUK_HBUFFER_FIXED_GET_DATA_PTR(heap, x)
#define DUK_HBUFFER_HAS_DYNAMIC(x)
DUK_EXTERNAL duk_int_t duk_to_int(duk_context *ctx, duk_idx_t index)
#define duk_push_fixed_buffer(ctx, size)
#define DUK_RET_UNSUPPORTED_ERROR

◆ duk_bi_arraybuffer_isview()

DUK_INTERNAL_DECL duk_ret_t duk_bi_arraybuffer_isview ( duk_context * ctx)

Definition at line 22632 of file duktape-1.5.2/src-noline/duktape.c.

22638 {
22639 DUK_UNREF(ctx);
22641}
22642#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */

◆ duk_bi_boolean_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_boolean_constructor ( duk_context * ctx)

Definition at line 21439 of file duktape-1.5.2/src-noline/duktape.c.

21440 {
21442 DUK_ASSERT(duk_is_boolean(ctx, -1));
21443 goto type_ok;
21444 }
21445 }
21446
21447 return DUK_RET_TYPE_ERROR;
21448
21449 type_ok:
21450 if (coerce_tostring) {
21451 duk_to_string(ctx, -1);
21452 }
21453 return 1;
21454}
21455
21457 duk_hthread *thr = (duk_hthread *) ctx;
21458 duk_hobject *h_this;
21459
21460 DUK_UNREF(thr);
21461
DUK_INTERNAL_DECL duk_ret_t duk_bi_boolean_constructor(duk_context *ctx)
DUK_EXTERNAL duk_bool_t duk_is_boolean(duk_context *ctx, duk_idx_t index)

◆ duk_bi_boolean_prototype_tostring_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_boolean_prototype_tostring_shared ( duk_context * ctx)

Definition at line 21403 of file duktape-1.5.2/src-noline/duktape.c.

21420 {
21421 duk_tval *tv;
21422 duk_hobject *h;
21423 duk_small_int_t coerce_tostring = duk_get_current_magic(ctx);
21424
21425 /* XXX: there is room to use a shared helper here, many built-ins
21426 * check the 'this' type, and if it's an object, check its class,
21427 * then get its internal value, etc.
21428 */
21429
21430 duk_push_this(ctx);
21431 tv = duk_get_tval(ctx, -1);
21432 DUK_ASSERT(tv != NULL);
21433
21434 if (DUK_TVAL_IS_BOOLEAN(tv)) {
21435 goto type_ok;
21436 } else if (DUK_TVAL_IS_OBJECT(tv)) {
21437 h = DUK_TVAL_GET_OBJECT(tv);
DUK_EXTERNAL void duk_push_this(duk_context *ctx)
#define DUK_TVAL_GET_OBJECT(tv)
#define DUK_TVAL_IS_OBJECT(tv)
#define DUK_TVAL_IS_BOOLEAN(tv)

◆ duk_bi_buffer_compare_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_compare_shared ( duk_context * ctx)

Definition at line 22824 of file duktape-1.5.2/src-noline/duktape.c.

22828 {
22829 DUK_UNREF(ctx);
22831}
22832#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
22833
22834/*
22835 * Node.js Buffer.prototype.equals()
22836 * Node.js Buffer.prototype.compare()
22837 * Node.js Buffer.compare()
22838 */
22839
22840#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
22842 duk_hthread *thr;
22843 duk_small_uint_t magic;
22844 duk_hbufferobject *h_bufarg1;
22845 duk_hbufferobject *h_bufarg2;
22846 duk_small_int_t comp_res;
22847
22848 thr = (duk_hthread *) ctx;
22849 DUK_UNREF(thr);
22850
22851 magic = duk_get_current_magic(ctx);
22852 if (magic & 0x02) {
22853 /* Static call style. */
22854 h_bufarg1 = duk__require_bufobj_value(ctx, 0);
22855 h_bufarg2 = duk__require_bufobj_value(ctx, 1);
22856 } else {
22857 h_bufarg1 = duk__require_bufobj_this(ctx);
22858 h_bufarg2 = duk__require_bufobj_value(ctx, 0);
22859 }
22860 DUK_ASSERT(h_bufarg1 != NULL);
22861 DUK_ASSERT(h_bufarg2 != NULL);
22862
22863 /* We want to compare the slice/view areas of the arguments.
22864 * If either slice/view is invalid (underlying buffer is shorter)
22865 * ensure equals() is false, but otherwise the only thing that
22866 * matters is to be memory safe.
22867 */
22868
22869 if (DUK_HBUFFEROBJECT_VALID_SLICE(h_bufarg1) &&
22870 DUK_HBUFFEROBJECT_VALID_SLICE(h_bufarg2)) {
22871 comp_res = duk_js_data_compare((const duk_uint8_t *) DUK_HBUFFER_GET_DATA_PTR(thr->heap, h_bufarg1->buf) + h_bufarg1->offset,
unsigned int duk_small_uint_t
#define DUK_HBUFFEROBJECT_VALID_SLICE(h)
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_compare_shared(duk_context *ctx)
DUK_INTERNAL_DECL duk_small_int_t duk_js_data_compare(const duk_uint8_t *buf1, const duk_uint8_t *buf2, duk_size_t len1, duk_size_t len2)
#define DUK_HBUFFER_GET_DATA_PTR(heap, x)
DUK_LOCAL duk_hbufferobject * duk__require_bufobj_value(duk_context *ctx, duk_idx_t index)
DUK_LOCAL duk_hbufferobject * duk__require_bufobj_this(duk_context *ctx)

◆ duk_bi_buffer_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_constructor ( duk_context * ctx)

Definition at line 21949 of file duktape-1.5.2/src-noline/duktape.c.

21951 :
21952 du.d = (duk_double_t) duk_to_number(ctx, -1);
21953 break;
21954#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
21955 default:
21957 }
21958
21959 DUK_MEMCPY((void *) p, (const void *) du.uc, (size_t) elem_size);
21960}
21961
21962/*
21963 * Duktape.Buffer: constructor
21964 */
21965
21967 duk_hthread *thr;
21968 duk_size_t buf_size;
21969 duk_small_int_t buf_dynamic;
21970 duk_uint8_t *buf_data;
21971 const duk_uint8_t *src_data;
21972
21973 thr = (duk_hthread *) ctx;
21974 DUK_UNREF(thr);
21975
21976 /*
21977 * Constructor arguments are currently somewhat compatible with
21978 * (keep it that way if possible):
21979 *
21980 * http://nodejs.org/api/buffer.html
21981 *
21982 * Note that the ToBuffer() coercion (duk_to_buffer()) does NOT match
21983 * the constructor behavior.
21984 */
21985
21986 buf_dynamic = duk_get_boolean(ctx, 1); /* default to false */
21987
21988 switch (duk_get_type(ctx, 0)) {
21989 case DUK_TYPE_NUMBER: {
21990 /* new buffer of specified size */
21991 buf_size = (duk_size_t) duk_to_int(ctx, 0);
21992 (void) duk_push_buffer(ctx, buf_size, buf_dynamic);
21993 break;
21994 }
21995 case DUK_TYPE_BUFFER: {
21996 /* return input buffer, converted to a Duktape.Buffer object
21997 * if called as a constructor (no change if called as a
21998 * function).
21999 */
22000 duk_set_top(ctx, 1);
22001 break;
22002 }
22003 case DUK_TYPE_STRING: {
22004 /* new buffer with string contents */
22005 src_data = (const duk_uint8_t *) duk_get_lstring(ctx, 0, &buf_size);
22006 DUK_ASSERT(src_data != NULL); /* even for zero-length string */
22007 buf_data = (duk_uint8_t *) duk_push_buffer(ctx, buf_size, buf_dynamic);
22008 DUK_MEMCPY((void *) buf_data, (const void *) src_data, (size_t) buf_size);
22009 break;
22010 }
22011 case DUK_TYPE_OBJECT: {
22012 /* For all duk_hbufferobjects, get the plain buffer inside
22013 * without making a copy. This is compatible with Duktape 1.2
22014 * but means that a slice/view information is ignored and the
22015 * full underlying buffer is returned.
22016 *
22017 * If called as a constructor, a new Duktape.Buffer object
22018 * pointing to the same plain buffer is created below.
22019 */
22020 duk_hbufferobject *h_bufobj;
22021 h_bufobj = (duk_hbufferobject *) duk_get_hobject(ctx, 0);
22022 DUK_ASSERT(h_bufobj != NULL);
22023 if (!DUK_HOBJECT_IS_BUFFEROBJECT((duk_hobject *) h_bufobj)) {
22024 return DUK_RET_TYPE_ERROR;
22025 }
22026 if (h_bufobj->buf == NULL) {
22027 return DUK_RET_TYPE_ERROR;
22028 }
22029 duk_push_hbuffer(ctx, h_bufobj->buf);
22030 break;
22031 }
22032 case DUK_TYPE_NONE:
22033 default: {
22034 return DUK_RET_TYPE_ERROR;
22035 }
22036 }
22037 DUK_ASSERT(duk_is_buffer(ctx, -1));
22038
22039 /* stack is unbalanced, but: [ <something> buf ] */
22040
22041 if (duk_is_constructor_call(ctx)) {
22042 duk_hbufferobject *h_bufobj;
22043 duk_hbuffer *h_val;
22044
22045 h_val = duk_get_hbuffer(ctx, -1);
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_constructor(duk_context *ctx)
DUK_EXTERNAL const char * duk_get_lstring(duk_context *ctx, duk_idx_t index, duk_size_t *out_len)
DUK_EXTERNAL duk_bool_t duk_get_boolean(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL duk_double_t duk_to_number(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL duk_int_t duk_get_type(duk_context *ctx, duk_idx_t index)
#define DUK_HOBJECT_IS_BUFFEROBJECT(h)
DUK_INTERNAL_DECL duk_hobject * duk_get_hobject(duk_context *ctx, duk_idx_t index)
DUK_INTERNAL_DECL void duk_push_hbuffer(duk_context *ctx, duk_hbuffer *h)
#define duk_push_buffer(ctx, size, dynamic)

◆ duk_bi_buffer_prototype_tostring_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_prototype_tostring_shared ( duk_context * ctx)

Definition at line 22712 of file duktape-1.5.2/src-noline/duktape.c.

22714 :
22715 return DUK_RET_TYPE_ERROR;
22716}
22717#else /* DUK_USE_BUFFEROBJECT_SUPPORT */
22719 DUK_UNREF(ctx);
22721}
22722#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
22723
22724/*
22725 * Duktape.Buffer: toString(), valueOf()
22726 */
22727
22728#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
22730 duk_hthread *thr;
22731 duk_tval *tv;
22732 duk_small_int_t to_string = duk_get_current_magic(ctx);
22733
22734 thr = (duk_hthread *) ctx;
22735 DUK_UNREF(thr);
22736
22738 DUK_ASSERT(tv != NULL);
22739
22740 if (DUK_TVAL_IS_BUFFER(tv)) {
22741 duk_hbuffer *h_buf;
22742 h_buf = DUK_TVAL_GET_BUFFER(tv);
22743 DUK_ASSERT(h_buf != NULL);
22744 duk_push_hbuffer(ctx, h_buf);
22745 } else if (DUK_TVAL_IS_OBJECT(tv)) {
22746 duk_hobject *h;
22747 duk_hbufferobject *h_bufobj;
22748
22749 /* Accept any duk_hbufferobject, though we're only normally
22750 * called for Duktape.Buffer values.
22751 */
22752 h = DUK_TVAL_GET_OBJECT(tv);
22753 DUK_ASSERT(h != NULL);
22755 DUK_DD(DUK_DDPRINT("toString/valueOf() called for a non-bufferobject object"));
22756 goto type_error;
22757 }
22758 h_bufobj = (duk_hbufferobject *) h;
22760
#define DUK_TVAL_IS_BUFFER(tv)
#define DUK_TVAL_GET_BUFFER(tv)
#define DUK_ASSERT_HBUFFEROBJECT_VALID(h)
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_tostring(duk_context *ctx)
DUK_INTERNAL_DECL duk_tval * duk_get_borrowed_this_tval(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_prototype_tostring_shared(duk_context *ctx)

◆ duk_bi_buffer_readfield()

DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_readfield ( duk_context * ctx)

Definition at line 23788 of file duktape-1.5.2/src-noline/duktape.c.

23805 {
23806 duk_hthread *thr;
23808 duk_small_int_t magic_ftype;
23809 duk_small_int_t magic_bigendian;
23810 duk_small_int_t magic_signed;
23811 duk_small_int_t magic_typedarray;
23812 duk_small_int_t endswap;
23813 duk_hbufferobject *h_this;
23814 duk_bool_t no_assert;
23815 duk_int_t offset_signed;
23816 duk_uint_t offset;
23817 duk_uint_t buffer_length;
23818 duk_uint_t check_length;
23819 duk_uint8_t *buf;
23821
23822 thr = (duk_hthread *) ctx;
23823 DUK_UNREF(thr);
23824
23825 magic_ftype = magic & 0x0007;
23826 magic_bigendian = magic & 0x0008;
23827 magic_signed = magic & 0x0010;
23828 magic_typedarray = magic & 0x0020;
23829
23830 h_this = duk__require_bufobj_this(ctx);
23831 DUK_ASSERT(h_this != NULL);
23832 buffer_length = h_this->length;
23833
23834 /* [ offset noAssert ], when ftype != DUK__FLD_VARINT */
23835 /* [ offset fieldByteLength noAssert ], when ftype == DUK__FLD_VARINT */
23836 /* [ offset littleEndian ], when DUK__FLD_TYPEDARRAY (regardless of ftype) */
23837
23838 /* Handle TypedArray vs. Node.js Buffer arg differences */
23839 if (magic_typedarray) {
23840 no_assert = 0;
23841#if defined(DUK_USE_INTEGER_LE)
23842 endswap = !duk_to_boolean(ctx, 1); /* 1=little endian */
23843#else
23844 endswap = duk_to_boolean(ctx, 1); /* 1=little endian */
23845#endif
23846 } else {
23847 no_assert = duk_to_boolean(ctx, (magic_ftype == DUK__FLD_VARINT) ? 2 : 1);
23848#if defined(DUK_USE_INTEGER_LE)
23849 endswap = magic_bigendian;
23850#else
23851 endswap = !magic_bigendian;
23852#endif
23853 }
23854
23855 /* Offset is coerced first to signed integer range and then to unsigned.
23856 * This ensures we can add a small byte length (1-8) to the offset in
23857 * bound checks and not wrap.
23858 */
23859 offset_signed = duk_to_int(ctx, 0);
23860 offset = (duk_uint_t) offset_signed;
23861 if (offset_signed < 0) {
23862 goto fail_bounds;
23863 }
23864
23865 DUK_DDD(DUK_DDDPRINT("readfield, buffer_length=%ld, offset=%ld, no_assert=%d, "
23866 "magic=%04x, magic_fieldtype=%d, magic_bigendian=%d, magic_signed=%d, "
23867 "endswap=%d",
23868 (long) buffer_length, (long) offset, (int) no_assert,
23869 (unsigned int) magic, (int) magic_ftype, (int) (magic_bigendian >> 3),
23870 (int) (magic_signed >> 4), (int) endswap));
23871
23872 /* Update 'buffer_length' to be the effective, safe limit which
23873 * takes into account the underlying buffer. This value will be
23874 * potentially invalidated by any side effect.
23875 */
23876 check_length = DUK_HBUFFEROBJECT_CLAMP_BYTELENGTH(h_this, buffer_length);
23877 DUK_DDD(DUK_DDDPRINT("buffer_length=%ld, check_length=%ld",
23878 (long) buffer_length, (long) check_length));
23879
23880 if (h_this->buf) {
23881 buf = DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_this);
23882 } else {
23883 /* Neutered. We could go into the switch-case safely with
23884 * buf == NULL because check_length == 0. To avoid scanbuild
23885 * warnings, fail directly instead.
23886 */
23887 DUK_ASSERT(check_length == 0);
23888 goto fail_neutered;
23889 }
23890 DUK_ASSERT(buf != NULL);
23891
23892 switch (magic_ftype) {
23893 case DUK__FLD_8BIT: {
23894 duk_uint8_t tmp;
23895 if (offset + 1U > check_length) {
23896 goto fail_bounds;
23897 }
23898 tmp = buf[offset];
23899 if (magic_signed) {
23900 duk_push_int(ctx, (duk_int_t) ((duk_int8_t) tmp));
23901 } else {
23902 duk_push_uint(ctx, (duk_uint_t) tmp);
23903 }
23904 break;
23905 }
23906 case DUK__FLD_16BIT: {
23907 duk_uint16_t tmp;
23908 if (offset + 2U > check_length) {
23909 goto fail_bounds;
23910 }
23911 DUK_MEMCPY((void *) du.uc, (const void *) (buf + offset), 2);
23912 tmp = du.us[0];
23913 if (endswap) {
23914 tmp = DUK_BSWAP16(tmp);
23915 }
23916 if (magic_signed) {
23917 duk_push_int(ctx, (duk_int_t) ((duk_int16_t) tmp));
23918 } else {
23919 duk_push_uint(ctx, (duk_uint_t) tmp);
23920 }
23921 break;
23922 }
23923 case DUK__FLD_32BIT: {
23924 duk_uint32_t tmp;
23925 if (offset + 4U > check_length) {
23926 goto fail_bounds;
23927 }
23928 DUK_MEMCPY((void *) du.uc, (const void *) (buf + offset), 4);
23929 tmp = du.ui[0];
23930 if (endswap) {
23931 tmp = DUK_BSWAP32(tmp);
23932 }
23933 if (magic_signed) {
23934 duk_push_int(ctx, (duk_int_t) ((duk_int32_t) tmp));
23935 } else {
23936 duk_push_uint(ctx, (duk_uint_t) tmp);
23937 }
23938 break;
23939 }
23940 case DUK__FLD_FLOAT: {
23941 duk_uint32_t tmp;
23942 if (offset + 4U > check_length) {
23943 goto fail_bounds;
23944 }
23945 DUK_MEMCPY((void *) du.uc, (const void *) (buf + offset), 4);
23946 if (endswap) {
23947 tmp = du.ui[0];
23948 tmp = DUK_BSWAP32(tmp);
23949 du.ui[0] = tmp;
23950 }
23951 duk_push_number(ctx, (duk_double_t) du.f[0]);
23952 break;
23953 }
23954 case DUK__FLD_DOUBLE: {
23955 if (offset + 8U > check_length) {
23956 goto fail_bounds;
23957 }
23958 DUK_MEMCPY((void *) du.uc, (const void *) (buf + offset), 8);
23959 if (endswap) {
23961 }
23962 duk_push_number(ctx, (duk_double_t) du.d);
23963 break;
23964 }
23965 case DUK__FLD_VARINT: {
23966 /* Node.js Buffer variable width integer field. We don't really
23967 * care about speed here, so aim for shortest algorithm.
23968 */
23969 duk_int_t field_bytelen;
23970 duk_int_t i, i_step, i_end;
23971#if defined(DUK_USE_64BIT_OPS)
23972 duk_int64_t tmp;
23973 duk_small_uint_t shift_tmp;
23974#else
23975 duk_double_t tmp;
23976 duk_small_int_t highbyte;
23977#endif
23978 const duk_uint8_t *p;
23979
23980 field_bytelen = duk_get_int(ctx, 1); /* avoid side effects! */
23981 if (field_bytelen < 1 || field_bytelen > 6) {
23982 goto fail_field_length;
23983 }
23984 if (offset + (duk_uint_t) field_bytelen > check_length) {
23985 goto fail_bounds;
23986 }
23987 p = (const duk_uint8_t *) (buf + offset);
23988
23989 /* Slow gathering of value using either 64-bit arithmetic
23990 * or IEEE doubles if 64-bit types not available. Handling
23991 * of negative numbers is a bit non-obvious in both cases.
23992 */
23993
23994 if (magic_bigendian) {
23995 /* Gather in big endian */
23996 i = 0;
23997 i_step = 1;
23998 i_end = field_bytelen; /* one i_step over */
23999 } else {
24000 /* Gather in little endian */
24001 i = field_bytelen - 1;
24002 i_step = -1;
24003 i_end = -1; /* one i_step over */
24004 }
24005
24006#if defined(DUK_USE_64BIT_OPS)
24007 tmp = 0;
24008 do {
24009 DUK_ASSERT(i >= 0 && i < field_bytelen);
24010 tmp = (tmp << 8) + (duk_int64_t) p[i];
24011 i += i_step;
24012 } while (i != i_end);
24013
24014 if (magic_signed) {
24015 /* Shift to sign extend. */
24016 shift_tmp = 64 - (field_bytelen * 8);
24017 tmp = (tmp << shift_tmp) >> shift_tmp;
24018 }
24019
24020 duk_push_i64(ctx, tmp);
24021#else
24022 highbyte = p[i];
24023 if (magic_signed && (highbyte & 0x80) != 0) {
24024 /* 0xff => 255 - 256 = -1; 0x80 => 128 - 256 = -128 */
24025 tmp = (duk_double_t) (highbyte - 256);
24026 } else {
24027 tmp = (duk_double_t) highbyte;
24028 }
24029 for (;;) {
24030 i += i_step;
24031 if (i == i_end) {
24032 break;
24033 }
24034 DUK_ASSERT(i >= 0 && i < field_bytelen);
24035 tmp = (tmp * 256.0) + (duk_double_t) p[i];
24036 }
24037
24038 duk_push_number(ctx, tmp);
24039#endif
24040 break;
24041 }
24042 default: { /* should never happen but default here */
24043 goto fail_bounds;
24044 }
duk_uint_fast32_t duk_uint_t
#define DUK_HBUFFEROBJECT_CLAMP_BYTELENGTH(h, len)
DUK_EXTERNAL duk_int_t duk_get_int(duk_context *ctx, duk_idx_t index)
#define duk_push_i64(ctx, val)
#define DUK_HBUFFEROBJECT_GET_SLICE_BASE(heap, h)
DUK_EXTERNAL void duk_push_uint(duk_context *ctx, duk_uint_t val)
DUK_EXTERNAL void duk_push_number(duk_context *ctx, duk_double_t val)
#define DUK_DBLUNION_BSWAP64(u)

◆ duk_bi_buffer_slice_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_slice_shared ( duk_context * ctx)

Definition at line 23437 of file duktape-1.5.2/src-noline/duktape.c.

23442 :
23443 *
23444 * - Copy/view behavior; Node.js .slice() and TypedArray .subarray() create
23445 * views, ArrayBuffer .slice() creates a copy
23446 *
23447 * - Resulting object has a different class and prototype depending on the
23448 * call (or 'this' argument)
23449 *
23450 * - TypedArray .subarray() arguments are element indices, not byte offsets
23451 */
23452
23453#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
23455 duk_hthread *thr;
23456 duk_small_int_t magic;
23457 duk_small_uint_t res_class_num;
23458 duk_hobject *res_proto;
23459 duk_hbufferobject *h_this;
23460 duk_hbufferobject *h_bufobj;
23461 duk_hbuffer *h_val;
23462 duk_int_t start_offset, end_offset;
23463 duk_uint_t slice_length;
23464
23465 thr = (duk_hthread *) ctx;
23466 DUK_UNREF(thr);
23467
23468 /* [ start end ] */
23469
23470 magic = duk_get_current_magic(ctx);
23471 h_this = duk__require_bufobj_this(ctx);
23472
23473 /* Slice offsets are element (not byte) offsets, which only matters
23474 * for TypedArray views, Node.js Buffer and ArrayBuffer have shift
23475 * zero so byte and element offsets are the same. Negative indices
23476 * are counted from end of slice, crossed indices are allowed (and
23477 * result in zero length result), and final values are clamped
23478 * against the current slice. There's intentionally no check
23479 * against the underlying buffer here.
23480 */
23481
23482 duk__clamp_startend_negidx_shifted(ctx, h_this, 0 /*idx_start*/, 1 /*idx_end*/, &start_offset, &end_offset);
23483 DUK_ASSERT(end_offset >= start_offset);
23484 slice_length = (duk_uint_t) (end_offset - start_offset);
23485
23486 /* The resulting buffer object gets the same class and prototype as
23487 * the buffer in 'this', e.g. if the input is a Node.js Buffer the
23488 * result is a Node.js Buffer; if the input is a Float32Array, the
23489 * result is a Float32Array.
23490 *
23491 * For the class number this seems correct. The internal prototype
23492 * is not so clear: if 'this' is a bufferobject with a non-standard
23493 * prototype object, that value gets copied over into the result
23494 * (instead of using the standard prototype for that object type).
23495 */
23496
23497 res_class_num = DUK_HOBJECT_GET_CLASS_NUMBER((duk_hobject *) h_this);
23498 h_bufobj = duk_push_bufferobject_raw(ctx,
23501 DUK_HOBJECT_CLASS_AS_FLAGS(res_class_num),
23502 DUK_BIDX_OBJECT_PROTOTYPE); /* replaced */
23503 DUK_ASSERT(h_bufobj != NULL);
23504 res_proto = DUK_HOBJECT_GET_PROTOTYPE(thr->heap, (duk_hobject *) h_this); /* may be NULL */
23505 DUK_HOBJECT_SET_PROTOTYPE_UPDREF(thr, (duk_hobject *) h_bufobj, res_proto);
23506
23507 h_bufobj->length = slice_length;
23508 h_bufobj->shift = h_this->shift; /* inherit */
23509 h_bufobj->elem_type = h_this->elem_type; /* inherit */
23510 h_bufobj->is_view = magic & 0x01;
23511 DUK_ASSERT(h_bufobj->is_view == 0 || h_bufobj->is_view == 1);
23512
23513 h_val = h_this->buf;
23514 if (h_val == NULL) {
23515 return DUK_RET_TYPE_ERROR;
23516 }
23517
23518 if (magic & 0x02) {
23519 /* non-zero: make copy */
23520 duk_uint8_t *p_copy;
23521 duk_size_t copy_length;
23522
23523 p_copy = (duk_uint8_t *) duk_push_fixed_buffer(ctx, (duk_size_t) slice_length);
23524 DUK_ASSERT(p_copy != NULL);
23525
23526 /* Copy slice, respecting underlying buffer limits; remainder
23527 * is left as zero.
23528 */
23529 copy_length = DUK_HBUFFEROBJECT_CLAMP_BYTELENGTH(h_this, slice_length);
23530 DUK_MEMCPY((void *) p_copy,
23531 (const void *) (DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_this) + start_offset),
23532 copy_length);
23533
23534 h_val = duk_get_hbuffer(ctx, -1);
23535 DUK_ASSERT(h_val != NULL);
23536
23537 h_bufobj->buf = h_val;
23538 DUK_HBUFFER_INCREF(thr, h_val);
23539 DUK_ASSERT(h_bufobj->offset == 0);
23540
23541 duk_pop(ctx); /* reachable so pop OK */
23542 } else {
23543 h_bufobj->buf = h_val;
23544 DUK_HBUFFER_INCREF(thr, h_val);
23545 h_bufobj->offset = (duk_uint_t) (h_this->offset + start_offset);
23546
23547 /* Copy the .buffer property, needed for TypedArray.prototype.subarray().
#define DUK_HOBJECT_GET_PROTOTYPE(heap, h)
#define DUK_HBUFFER_INCREF(thr, h)
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_slice_shared(duk_context *ctx)
#define DUK_BIDX_OBJECT_PROTOTYPE
#define DUK_HOBJECT_SET_PROTOTYPE_UPDREF(thr, h, p)
#define DUK_HOBJECT_FLAG_BUFFEROBJECT
#define DUK_HOBJECT_CLASS_AS_FLAGS(v)
DUK_INTERNAL_DECL duk_hbufferobject * duk_push_bufferobject_raw(duk_context *ctx, duk_uint_t hobject_flags_and_class, duk_small_int_t prototype_bidx)
#define DUK_HOBJECT_FLAG_EXTENSIBLE
#define DUK_HOBJECT_GET_CLASS_NUMBER(h)
DUK_LOCAL void duk__clamp_startend_negidx_shifted(duk_context *ctx, duk_hbufferobject *h_bufobj, duk_idx_t idx_start, duk_idx_t idx_end, duk_int_t *out_start_offset, duk_int_t *out_end_offset)

◆ duk_bi_buffer_writefield()

DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_writefield ( duk_context * ctx)

Definition at line 24054 of file duktape-1.5.2/src-noline/duktape.c.

24063 {
24064 DUK_UNREF(ctx);
24066}
24067#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
24068
24069#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
24070/* XXX: split into separate functions for each field type? */
24072 duk_hthread *thr;
24074 duk_small_int_t magic_ftype;
24075 duk_small_int_t magic_bigendian;
24076 duk_small_int_t magic_signed;
24077 duk_small_int_t magic_typedarray;
24078 duk_small_int_t endswap;
24079 duk_hbufferobject *h_this;
24080 duk_bool_t no_assert;
24081 duk_int_t offset_signed;
24082 duk_uint_t offset;
24083 duk_uint_t buffer_length;
24084 duk_uint_t check_length;
24085 duk_uint8_t *buf;
24087 duk_int_t nbytes = 0;
24088
24089 thr = (duk_hthread *) ctx;
24090 DUK_UNREF(thr);
24091
24092 magic_ftype = magic & 0x0007;
24093 magic_bigendian = magic & 0x0008;
24094 magic_signed = magic & 0x0010;
24095 magic_typedarray = magic & 0x0020;
24096 DUK_UNREF(magic_signed);
24097
24098 h_this = duk__require_bufobj_this(ctx);
24099 DUK_ASSERT(h_this != NULL);
24100 buffer_length = h_this->length;
24101
24102 /* [ value offset noAssert ], when ftype != DUK__FLD_VARINT */
24103 /* [ value offset fieldByteLength noAssert ], when ftype == DUK__FLD_VARINT */
24104 /* [ offset value littleEndian ], when DUK__FLD_TYPEDARRAY (regardless of ftype) */
24105
24106 /* Handle TypedArray vs. Node.js Buffer arg differences */
24107 if (magic_typedarray) {
24108 no_assert = 0;
24109#if defined(DUK_USE_INTEGER_LE)
24110 endswap = !duk_to_boolean(ctx, 2); /* 1=little endian */
24111#else
24112 endswap = duk_to_boolean(ctx, 2); /* 1=little endian */
24113#endif
24114 duk_swap(ctx, 0, 1); /* offset/value order different from Node.js */
24115 } else {
24116 no_assert = duk_to_boolean(ctx, (magic_ftype == DUK__FLD_VARINT) ? 3 : 2);
24117#if defined(DUK_USE_INTEGER_LE)
24118 endswap = magic_bigendian;
24119#else
24120 endswap = !magic_bigendian;
24121#endif
24122 }
24123
24124 /* Offset is coerced first to signed integer range and then to unsigned.
24125 * This ensures we can add a small byte length (1-8) to the offset in
24126 * bound checks and not wrap.
24127 */
24128 offset_signed = duk_to_int(ctx, 1);
24129 offset = (duk_uint_t) offset_signed;
24130
24131 /* We need 'nbytes' even for a failed offset; return value must be
24132 * (offset + nbytes) even when write fails due to invalid offset.
24133 */
24134 if (magic_ftype != DUK__FLD_VARINT) {
24135 DUK_ASSERT(magic_ftype >= 0 && magic_ftype < (duk_small_int_t) (sizeof(duk__buffer_nbytes_from_fldtype) / sizeof(duk_uint8_t)));
24136 nbytes = duk__buffer_nbytes_from_fldtype[magic_ftype];
24137 } else {
24138 nbytes = duk_get_int(ctx, 2);
24139 if (nbytes < 1 || nbytes > 6) {
24140 goto fail_field_length;
24141 }
24142 }
24143 DUK_ASSERT(nbytes >= 1 && nbytes <= 8);
24144
24145 /* Now we can check offset validity. */
24146 if (offset_signed < 0) {
24147 goto fail_bounds;
24148 }
24149
24150 DUK_DDD(DUK_DDDPRINT("writefield, value=%!T, buffer_length=%ld, offset=%ld, no_assert=%d, "
24151 "magic=%04x, magic_fieldtype=%d, magic_bigendian=%d, magic_signed=%d, "
24152 "endswap=%d",
24153 duk_get_tval(ctx, 0), (long) buffer_length, (long) offset, (int) no_assert,
24154 (unsigned int) magic, (int) magic_ftype, (int) (magic_bigendian >> 3),
24155 (int) (magic_signed >> 4), (int) endswap));
24156
24157 /* Coerce value to a number before computing check_length, so that
24158 * the field type specific coercion below can't have side effects
24159 * that would invalidate check_length.
24160 */
24161 duk_to_number(ctx, 0);
24162
24163 /* Update 'buffer_length' to be the effective, safe limit which
24164 * takes into account the underlying buffer. This value will be
24165 * potentially invalidated by any side effect.
24166 */
24167 check_length = DUK_HBUFFEROBJECT_CLAMP_BYTELENGTH(h_this, buffer_length);
24168 DUK_DDD(DUK_DDDPRINT("buffer_length=%ld, check_length=%ld",
24169 (long) buffer_length, (long) check_length));
24170
24171 if (h_this->buf) {
24172 buf = DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_this);
24173 } else {
24174 /* Neutered. We could go into the switch-case safely with
24175 * buf == NULL because check_length == 0. To avoid scanbuild
24176 * warnings, fail directly instead.
24177 */
24178 DUK_ASSERT(check_length == 0);
24179 goto fail_neutered;
24180 }
24181 DUK_ASSERT(buf != NULL);
24182
24183 switch (magic_ftype) {
24184 case DUK__FLD_8BIT: {
24185 if (offset + 1U > check_length) {
24186 goto fail_bounds;
24187 }
24188 /* sign doesn't matter when writing */
24189 buf[offset] = (duk_uint8_t) duk_to_uint32(ctx, 0);
24190 break;
24191 }
24192 case DUK__FLD_16BIT: {
24193 duk_uint16_t tmp;
24194 if (offset + 2U > check_length) {
24195 goto fail_bounds;
24196 }
24197 tmp = (duk_uint16_t) duk_to_uint32(ctx, 0);
24198 if (endswap) {
24199 tmp = DUK_BSWAP16(tmp);
24200 }
24201 du.us[0] = tmp;
24202 /* sign doesn't matter when writing */
24203 DUK_MEMCPY((void *) (buf + offset), (const void *) du.uc, 2);
24204 break;
24205 }
24206 case DUK__FLD_32BIT: {
24207 duk_uint32_t tmp;
24208 if (offset + 4U > check_length) {
24209 goto fail_bounds;
24210 }
24211 tmp = (duk_uint32_t) duk_to_uint32(ctx, 0);
24212 if (endswap) {
24213 tmp = DUK_BSWAP32(tmp);
24214 }
24215 du.ui[0] = tmp;
24216 /* sign doesn't matter when writing */
24217 DUK_MEMCPY((void *) (buf + offset), (const void *) du.uc, 4);
24218 break;
24219 }
24220 case DUK__FLD_FLOAT: {
24221 duk_uint32_t tmp;
24222 if (offset + 4U > check_length) {
24223 goto fail_bounds;
24224 }
24225 du.f[0] = (duk_float_t) duk_to_number(ctx, 0);
24226 if (endswap) {
24227 tmp = du.ui[0];
24228 tmp = DUK_BSWAP32(tmp);
24229 du.ui[0] = tmp;
24230 }
24231 /* sign doesn't matter when writing */
24232 DUK_MEMCPY((void *) (buf + offset), (const void *) du.uc, 4);
24233 break;
24234 }
24235 case DUK__FLD_DOUBLE: {
24236 if (offset + 8U > check_length) {
24237 goto fail_bounds;
24238 }
24239 du.d = (duk_double_t) duk_to_number(ctx, 0);
24240 if (endswap) {
24242 }
24243 /* sign doesn't matter when writing */
24244 DUK_MEMCPY((void *) (buf + offset), (const void *) du.uc, 8);
24245 break;
24246 }
24247 case DUK__FLD_VARINT: {
24248 /* Node.js Buffer variable width integer field. We don't really
24249 * care about speed here, so aim for shortest algorithm.
24250 */
24251 duk_int_t field_bytelen;
24252 duk_int_t i, i_step, i_end;
24253#if defined(DUK_USE_64BIT_OPS)
24254 duk_int64_t tmp;
24255#else
24256 duk_double_t tmp;
24257#endif
24258 duk_uint8_t *p;
24259
24260 field_bytelen = (duk_int_t) nbytes;
24261 if (offset + (duk_uint_t) field_bytelen > check_length) {
24262 goto fail_bounds;
24263 }
24264
24265 /* Slow writing of value using either 64-bit arithmetic
24266 * or IEEE doubles if 64-bit types not available. There's
24267 * no special sign handling when writing varints.
24268 */
24269
24270 if (magic_bigendian) {
24271 /* Write in big endian */
24272 i = field_bytelen; /* one i_step added at top of loop */
24273 i_step = -1;
24274 i_end = 0;
24275 } else {
24276 /* Write in little endian */
24277 i = -1; /* one i_step added at top of loop */
24278 i_step = 1;
24279 i_end = field_bytelen - 1;
24280 }
24281
24282 /* XXX: The duk_to_number() cast followed by integer coercion
24283 * is platform specific so NaN, +/- Infinity, and out-of-bounds
24284 * values result in platform specific output now.
24285 * See: test-bi-nodejs-buffer-proto-varint-special.js
24286 */
24287
24288#if defined(DUK_USE_64BIT_OPS)
24289 tmp = (duk_int64_t) duk_to_number(ctx, 0);
24290 p = (duk_uint8_t *) (buf + offset);
24291 do {
24292 i += i_step;
24293 DUK_ASSERT(i >= 0 && i < field_bytelen);
24294 p[i] = (duk_uint8_t) (tmp & 0xff);
24295 tmp = tmp >> 8; /* unnecessary shift for last byte */
24296 } while (i != i_end);
24297#else
24298 tmp = duk_to_number(ctx, 0);
24299 p = (duk_uint8_t *) (buf + offset);
24300 do {
24301 i += i_step;
24302 tmp = DUK_FLOOR(tmp);
24303 DUK_ASSERT(i >= 0 && i < field_bytelen);
24304 p[i] = (duk_uint8_t) (DUK_FMOD(tmp, 256.0));
24305 tmp = tmp / 256.0; /* unnecessary div for last byte */
24306 } while (i != i_end);
24307#endif
24308 break;
24309 }
24310 default: { /* should never happen but default here */
24311 goto fail_bounds;
24312 }
24313 }
24314
24315 /* Node.js Buffer: return offset + #bytes written (i.e. next
24316 * write offset).
24317 */
24318 if (magic_typedarray) {
24319 /* For TypedArrays 'undefined' return value is specified
24320 * by ES6 (matches V8).
24321 */
24322 return 0;
24323 }
24324 duk_push_uint(ctx, offset + nbytes);
24325 return 1;
24326
24327 fail_neutered:
DUK_INTERNAL_DECL duk_ret_t duk_bi_buffer_writefield(duk_context *ctx)
DUK_EXTERNAL void duk_swap(duk_context *ctx, duk_idx_t index1, duk_idx_t index2)
static const duk_uint8_t duk__buffer_nbytes_from_fldtype[6]

◆ duk_bi_dataview_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_dataview_constructor ( duk_context * ctx)

Definition at line 22565 of file duktape-1.5.2/src-noline/duktape.c.

22571 :
22572 return DUK_RET_RANGE_ERROR;
22573}
22574#else /* DUK_USE_BUFFEROBJECT_SUPPORT */
22576 DUK_UNREF(ctx);
22578}
22579#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
22580
22581#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
22583 duk_hbufferobject *h_bufarg;
22584 duk_hbufferobject *h_bufobj;
22585 duk_hbuffer *h_val;
22586 duk_uint_t offset;
22587 duk_uint_t length;
22588
22589 /* XXX: function flag to make this automatic? */
22590 if (!duk_is_constructor_call(ctx)) {
22591 return DUK_RET_TYPE_ERROR;
22592 }
22593
22594 h_bufarg = duk__require_bufobj_value(ctx, 0);
22595 DUK_ASSERT(h_bufarg != NULL);
22596
22597 duk__resolve_offset_opt_length(ctx, h_bufarg, 1, 2, &offset, &length, 1 /*throw_flag*/);
22598 DUK_ASSERT(offset <= h_bufarg->length);
22599 DUK_ASSERT(offset + length <= h_bufarg->length);
22600
22601 h_bufobj = duk_push_bufferobject_raw(ctx,
22606
22607 h_val = h_bufarg->buf;
22608 if (h_val == NULL) {
22609 return DUK_RET_TYPE_ERROR;
22610 }
22611 h_bufobj->buf = h_val;
22612 DUK_HBUFFER_INCREF(thr, h_val);
22613 h_bufobj->offset = h_bufarg->offset + offset;
22614 h_bufobj->length = length;
22615 DUK_ASSERT(h_bufobj->shift == 0);
22617 h_bufobj->is_view = 1;
22618
22619 /* The DataView .buffer property is ordinarily set to the argument
DUK_INTERNAL_DECL duk_ret_t duk_bi_dataview_constructor(duk_context *ctx)
#define DUK_BIDX_DATAVIEW_PROTOTYPE
DUK_LOCAL void duk__resolve_offset_opt_length(duk_context *ctx, duk_hbufferobject *h_bufarg, duk_idx_t idx_offset, duk_idx_t idx_length, duk_uint_t *out_offset, duk_uint_t *out_length, duk_bool_t throw_flag)
DUK_INTERNAL_DECL duk_ret_t duk_bi_typedarray_constructor(duk_context *ctx)
#define DUK_HOBJECT_CLASS_DATAVIEW
#define DUK_HBUFFEROBJECT_ELEM_UINT8

◆ duk_bi_date_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_constructor ( duk_context * ctx)

Definition at line 25776 of file duktape-1.5.2/src-noline/duktape.c.

25783 {
25785 DUK_ASSERT(magicidx >= 0 && magicidx < (duk_small_int_t) (sizeof(duk__date_magics) / sizeof(duk_uint16_t)));
25786 return (duk_small_uint_t) duk__date_magics[magicidx];
25787}
25788
25789/*
25790 * Constructor calls
25791 */
25792
25794 duk_idx_t nargs = duk_get_top(ctx);
25795 duk_bool_t is_cons = duk_is_constructor_call(ctx);
25797 duk_double_t d;
25798
25799 DUK_DDD(DUK_DDDPRINT("Date constructor, nargs=%ld, is_cons=%ld", (long) nargs, (long) is_cons));
25800
25805
25806 /* Unlike most built-ins, the internal [[PrimitiveValue]] of a Date
25807 * is mutable.
25808 */
25809
25810 if (nargs == 0 || !is_cons) {
25811 d = duk__timeclip(DUK_USE_DATE_GET_NOW(ctx));
25812 duk_push_number(ctx, d);
25814 if (!is_cons) {
25815 /* called as a normal function: return new Date().toString() */
25816 duk_to_string(ctx, -1);
25817 }
25818 return 1;
25819 } else if (nargs == 1) {
25821 if (duk_is_string(ctx, 0)) {
DUK_EXTERNAL void duk_to_primitive(duk_context *ctx, duk_idx_t index, duk_int_t hint)
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_constructor(duk_context *ctx)
#define DUK_HOBJECT_CLASS_DATE
DUK_INTERNAL_DECL duk_idx_t duk_push_object_helper(duk_context *ctx, duk_uint_t hobject_flags_and_class, duk_small_int_t prototype_bidx)
static duk_uint16_t duk__date_magics[]
DUK_EXTERNAL duk_bool_t duk_is_string(duk_context *ctx, duk_idx_t index)
#define DUK_BIDX_DATE_PROTOTYPE
DUK_LOCAL duk_double_t duk__timeclip(duk_double_t x)
#define DUK_DATE_IDX_NUM_PARTS

◆ duk_bi_date_constructor_now()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_constructor_now ( duk_context * ctx)

Definition at line 25846 of file duktape-1.5.2/src-noline/duktape.c.

25853 {

◆ duk_bi_date_constructor_parse()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_constructor_parse ( duk_context * ctx)

Definition at line 25823 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_date_constructor_utc()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_constructor_utc ( duk_context * ctx)

Definition at line 25827 of file duktape-1.5.2/src-noline/duktape.c.

25840 {
25841 return duk__parse_string(ctx, duk_to_string(ctx, 0));
25842}
25843
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_constructor_utc(duk_context *ctx)
DUK_LOCAL duk_ret_t duk__parse_string(duk_context *ctx, const char *str)

◆ duk_bi_date_prototype_get_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_get_shared ( duk_context * ctx)

Definition at line 25971 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_date_prototype_get_timezone_offset()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_get_timezone_offset ( duk_context * ctx)

Definition at line 25976 of file duktape-1.5.2/src-noline/duktape.c.

25977 :
25978 *
25979 * - Date.prototype.getDate(): 'date' means day-of-month, and is
25980 * zero-based in internal calculations but public API expects it to
25981 * be one-based.
25982 *
25983 * - Date.prototype.getTime() and Date.prototype.valueOf() have identical
25984 * behavior. They have separate function objects, but share the same C
25985 * function (duk_bi_date_prototype_value_of).
25986 */
25987
25990 return duk__get_part_helper(ctx, flags_and_idx);
25991}
25992
25994 /*
25995 * Return (t - LocalTime(t)) in minutes:
25996 *
25997 * t - LocalTime(t) = t - (t + LocalTZA + DaylightSavingTA(t))
25998 * = -(LocalTZA + DaylightSavingTA(t))
25999 *
26000 * where DaylightSavingTA() is checked for time 't'.
26001 *
26002 * Note that the sign of the result is opposite to common usage,
26003 * e.g. for EE(S)T which normally is +2h or +3h from UTC, this
26004 * function returns -120 or -180.
26005 *
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_get_timezone_offset(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_value_of(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_get_shared(duk_context *ctx)
DUK_LOCAL duk_ret_t duk__get_part_helper(duk_context *ctx, duk_small_uint_t flags_and_idx)
DUK_LOCAL duk_small_uint_t duk__date_get_indirect_magic(duk_context *ctx)

◆ duk_bi_date_prototype_set_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_set_shared ( duk_context * ctx)

Definition at line 26056 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_date_prototype_set_time()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_set_time ( duk_context * ctx)

Definition at line 26061 of file duktape-1.5.2/src-noline/duktape.c.

26062 : special year check
26063 * is omitted. NaN / Infinity will just flow through and ultimately
26064 * result in a NaN internal time value.
26065 *
26066 * - Date.prototype.setYear() does not have optional arguments for
26067 * setting month and day-in-month (like setFullYear()), but we indicate
26068 * 'maxnargs' to be 3 to get the year written to the correct component
26069 * index in duk__set_part_helper(). The function has nargs == 1, so only
26070 * the year will be set regardless of actual argument count.
26071 */
guint index
DUK_LOCAL duk_ret_t duk__set_part_helper(duk_context *ctx, duk_small_uint_t flags_and_maxnargs)
int value
Definition lsqlite3.c:2155
#define check(x)

◆ duk_bi_date_prototype_to_json()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_to_json ( duk_context * ctx)

Definition at line 25905 of file duktape-1.5.2/src-noline/duktape.c.

25906 {
25908 return duk__to_string_helper(ctx, flags);
25909}
25910
25912 /* This native function is also used for Date.prototype.getTime()
25913 * as their behavior is identical.
25914 */
25915
25916 duk_double_t d = duk__push_this_get_timeval(ctx, 0 /*flags*/); /* -> [ this ] */
25918 duk_push_number(ctx, d);
25919 return 1;
25920}
25921
25923 /* Note: toJSON() is a generic function which works even if 'this'
25924 * is not a Date. The sole argument is ignored.
25925 */
25926
25927 duk_push_this(ctx);
25928 duk_to_object(ctx, -1);
DUK_LOCAL_DECL duk_double_t duk__push_this_get_timeval(duk_context *ctx, duk_small_uint_t flags)
DUK_LOCAL duk_ret_t duk__to_string_helper(duk_context *ctx, duk_small_uint_t flags)
DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_to_json(duk_context *ctx)

◆ duk_bi_date_prototype_tostring_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_tostring_shared ( duk_context * ctx)

Definition at line 25889 of file duktape-1.5.2/src-noline/duktape.c.

25891 :
25892 *

◆ duk_bi_date_prototype_value_of()

DUK_INTERNAL_DECL duk_ret_t duk_bi_date_prototype_value_of ( duk_context * ctx)

Definition at line 25894 of file duktape-1.5.2/src-noline/duktape.c.

25897 : E5.1 specification does not require a
25898 * specific format, but result should be human readable. The
25899 * specification suggests using ISO 8601 format with a space (instead
25900 * of 'T') separator if a more human readable format is not available.
25901 *
25902 * - Date.prototype.toISOString(): unlike other conversion functions,
25903 * toISOString() requires a RangeError for invalid date values.
json_t format(printf, 1, 2)))
static int readable(const char *filename)

◆ duk_bi_duktape_object_act()

DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_act ( duk_context * ctx)

Definition at line 26612 of file duktape-1.5.2/src-noline/duktape.c.

26617 :
26618 /* set values into ret array */
26619 /* XXX: primitive to make array from valstack slice */
26620 n = duk_get_top(ctx);
26621 for (i = 2; i < n; i++) {
26622 duk_dup(ctx, i);
26623 duk_put_prop_index(ctx, 1, i - 2);
26624 }
26625 duk_dup(ctx, 1);
26626 return 1;
26627}
26628
26630 duk_hthread *thr = (duk_hthread *) ctx;
26631 duk_activation *act;
26633 duk_uint_fast32_t line;
26634 duk_int_t level;
26635
26636 /* -1 = top callstack entry, callstack[callstack_top - 1]
26637 * -callstack_top = bottom callstack entry, callstack[0]
26638 */
26639 level = duk_to_int(ctx, 0);
26640 if (level >= 0 || -level > (duk_int_t) thr->callstack_top) {
26641 return 0;
26642 }
26643 DUK_ASSERT(level >= -((duk_int_t) thr->callstack_top) && level <= -1);
26644 act = thr->callstack + thr->callstack_top + level;
26645
26646 duk_push_object(ctx);
26647
26648 duk_push_tval(ctx, &act->tv_func);
26649
26650 /* Relevant PC is just before current one because PC is
26651 * post-incremented. This should match what error augment
26652 * code does.
26653 */
26654 pc = duk_hthread_get_act_prev_pc(thr, act);
26655 duk_push_uint(ctx, (duk_uint_t) pc);
26656
26657#if defined(DUK_USE_PC2LINE)
26658 line = duk_hobject_pc2line_query(ctx, -2, pc);
26659#else
26660 line = 0;
duk_uint32_t duk_uint_fast32_t
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_act(duk_context *ctx)
DUK_INTERNAL_DECL duk_uint_fast32_t duk_hobject_pc2line_query(duk_context *ctx, duk_idx_t idx_func, duk_uint_fast32_t pc)
DUK_EXTERNAL duk_idx_t duk_push_object(duk_context *ctx)
DUK_INTERNAL_DECL void duk_push_tval(duk_context *ctx, duk_tval *tv)
DUK_INTERNAL_DECL duk_uint_fast32_t duk_hthread_get_act_prev_pc(duk_hthread *thr, duk_activation *act)

◆ duk_bi_duktape_object_compact()

DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_compact ( duk_context * ctx)

Definition at line 26795 of file duktape-1.5.2/src-noline/duktape.c.

26796 {
26798 1 /*idx_value*/,
26799 2 /*idx_replacer*/,
DUK_INTERNAL_DECL void duk_bi_json_parse_helper(duk_context *ctx, duk_idx_t idx_value, duk_idx_t idx_reviver, duk_small_uint_t flags)

◆ duk_bi_duktape_object_dec()

DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_dec ( duk_context * ctx)

Definition at line 26749 of file duktape-1.5.2/src-noline/duktape.c.

26752 {
26754 1 /*idx_value*/,
26755 2 /*idx_replacer*/,
26756 3 /*idx_space*/,
26758 DUK_JSON_FLAG_ASCII_ONLY /*flags*/);
26759#endif
26760 } else {
26761 return DUK_RET_TYPE_ERROR;
26762 }
26763 return 1;
26764}
26765
26767 duk_hthread *thr = (duk_hthread *) ctx;
26768 duk_hstring *h_str;
26769
26770 DUK_UNREF(thr);
26771
26772 /* Vararg function: must be careful to check/require arguments.
26773 * The JSON helpers accept invalid indices and treat them like
26774 * non-existent optional parameters.
26775 */
26776
26777 h_str = duk_require_hstring(ctx, 0);
26779
26780 if (h_str == DUK_HTHREAD_STRING_HEX(thr)) {
26781 duk_set_top(ctx, 2);
26782 duk_hex_decode(ctx, 1);
26783 DUK_ASSERT_TOP(ctx, 2);
26784 } else if (h_str == DUK_HTHREAD_STRING_BASE64(thr)) {
26785 duk_set_top(ctx, 2);
26786 duk_base64_decode(ctx, 1);
26787 DUK_ASSERT_TOP(ctx, 2);
26788#ifdef DUK_USE_JX
26789 } else if (h_str == DUK_HTHREAD_STRING_JX(thr)) {
#define DUK_HTHREAD_STRING_BASE64(thr)
DUK_INTERNAL_DECL void duk_bi_json_stringify_helper(duk_context *ctx, duk_idx_t idx_value, duk_idx_t idx_replacer, duk_idx_t idx_space, duk_small_uint_t flags)
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_dec(duk_context *ctx)
#define DUK_HTHREAD_STRING_JX(thr)
DUK_EXTERNAL void duk_require_valid_index(duk_context *ctx, duk_idx_t index)
#define DUK_HTHREAD_STRING_HEX(thr)
DUK_EXTERNAL void duk_base64_decode(duk_context *ctx, duk_idx_t index)
#define DUK_JSON_FLAG_EXT_COMPATIBLE
DUK_INTERNAL_DECL duk_hstring * duk_require_hstring(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL void duk_hex_decode(duk_context *ctx, duk_idx_t index)
#define DUK_JSON_FLAG_ASCII_ONLY

◆ duk_bi_duktape_object_enc()

DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_enc ( duk_context * ctx)

Definition at line 26702 of file duktape-1.5.2/src-noline/duktape.c.

26711 {
26712 /* Get. */
26713 DUK_ASSERT(duk_get_top(ctx) == 1);
26715 return 1;
26716 }
26717}
26718
26720 duk_hthread *thr = (duk_hthread *) ctx;
26721 duk_hstring *h_str;
26722
26723 DUK_UNREF(thr);
26724
26725 /* Vararg function: must be careful to check/require arguments.
26726 * The JSON helpers accept invalid indices and treat them like
26727 * non-existent optional parameters.
26728 */
26729
26730 h_str = duk_require_hstring(ctx, 0);
26732
26733 if (h_str == DUK_HTHREAD_STRING_HEX(thr)) {
26734 duk_set_top(ctx, 2);
26735 duk_hex_encode(ctx, 1);
26736 DUK_ASSERT_TOP(ctx, 2);
26737 } else if (h_str == DUK_HTHREAD_STRING_BASE64(thr)) {
26738 duk_set_top(ctx, 2);
26739 duk_base64_encode(ctx, 1);
26740 DUK_ASSERT_TOP(ctx, 2);
26741#ifdef DUK_USE_JX
26742 } else if (h_str == DUK_HTHREAD_STRING_JX(thr)) {
26744 1 /*idx_value*/,
26745 2 /*idx_replacer*/,
26746 3 /*idx_space*/,
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_enc(duk_context *ctx)
DUK_EXTERNAL const char * duk_hex_encode(duk_context *ctx, duk_idx_t index)
#define DUK_STRIDX_INT_FINALIZER
#define DUK_JSON_FLAG_EXT_CUSTOM
DUK_EXTERNAL const char * duk_base64_encode(duk_context *ctx, duk_idx_t index)

◆ duk_bi_duktape_object_fin()

DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_fin ( duk_context * ctx)

Definition at line 26682 of file duktape-1.5.2/src-noline/duktape.c.

26699 {
26700 (void) duk_require_hobject(ctx, 0);
DUK_INTERNAL_DECL duk_hobject * duk_require_hobject(duk_context *ctx, duk_idx_t index)

◆ duk_bi_duktape_object_gc()

DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_gc ( duk_context * ctx)

Definition at line 26662 of file duktape-1.5.2/src-noline/duktape.c.

26679 {
26680#ifdef DUK_USE_MARK_AND_SWEEP

◆ duk_bi_duktape_object_info()

DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_info ( duk_context * ctx)

Definition at line 26498 of file duktape-1.5.2/src-noline/duktape.c.

26499 : it might seem that vararg multipurpose functions
26500 * like fin(), enc(), and dec() are not very size optimal, but using a single
26501 * user-visible Ecmascript function saves a lot of run-time footprint; each
26502 * Function instance takes >100 bytes. Using a shared native helper and a
26503 * 'magic' value won't save much if there are multiple Function instances
26504 * anyway.
26505 */
26506
26507/* include removed: duk_internal.h */
26508
26509/* Raw helper to extract internal information / statistics about a value.
26510 * The return values are version specific and must not expose anything
26511 * that would lead to security issues (e.g. exposing compiled function
26512 * 'data' buffer might be an issue). Currently only counts and sizes and
26513 * such are given so there should not be a security impact.
26514 */
26516 duk_hthread *thr = (duk_hthread *) ctx;
26517 duk_tval *tv;
26518 duk_heaphdr *h;
26519 duk_int_t i, n;
26520
26521 DUK_UNREF(thr);
26522
26523 /* result array */
26524 duk_push_array(ctx); /* -> [ val arr ] */
26525
26526 /* type tag (public) */
26527 duk_push_int(ctx, duk_get_type(ctx, 0));
26528
26529 /* address */
26530 tv = duk_get_tval(ctx, 0);
26531 DUK_ASSERT(tv != NULL); /* because arg count is 1 */
26533 h = DUK_TVAL_GET_HEAPHDR(tv);
26534 duk_push_pointer(ctx, (void *) h);
26535 } else {
26536 /* internal type tag */
26538 goto done;
26539 }
26540 DUK_ASSERT(h != NULL);
26541
26542 /* refcount */
26543#ifdef DUK_USE_REFERENCE_COUNTING
26545#else
26546 duk_push_undefined(ctx);
26547#endif
26548
26549 /* heaphdr size and additional allocation size, followed by
26550 * type specific stuff (with varying value count)
26551 */
26553 case DUK_HTYPE_STRING: {
26554 duk_hstring *h_str = (duk_hstring *) h;
26555 duk_push_uint(ctx, (duk_uint_t) (sizeof(duk_hstring) + DUK_HSTRING_GET_BYTELEN(h_str) + 1));
26556 break;
26557 }
26558 case DUK_HTYPE_OBJECT: {
26559 duk_hobject *h_obj = (duk_hobject *) h;
26560 duk_small_uint_t hdr_size;
26562 hdr_size = (duk_small_uint_t) sizeof(duk_hcompiledfunction);
26563 } else if (DUK_HOBJECT_IS_NATIVEFUNCTION(h_obj)) {
26564 hdr_size = (duk_small_uint_t) sizeof(duk_hnativefunction);
26565 } else if (DUK_HOBJECT_IS_THREAD(h_obj)) {
26566 hdr_size = (duk_small_uint_t) sizeof(duk_hthread);
26567#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
26568 } else if (DUK_HOBJECT_IS_BUFFEROBJECT(h_obj)) {
26569 hdr_size = (duk_small_uint_t) sizeof(duk_hbufferobject);
26570#endif
26571 } else {
26572 hdr_size = (duk_small_uint_t) sizeof(duk_hobject);
26573 }
26574 duk_push_uint(ctx, (duk_uint_t) hdr_size);
26577 /* Note: e_next indicates the number of gc-reachable entries
26578 * in the entry part, and also indicates the index where the
26579 * next new property would be inserted. It does *not* indicate
26580 * the number of non-NULL keys present in the object. That
26581 * value could be counted separately but requires a pass through
26582 * the key list.
26583 */
26589 if (h_data) {
26591 } else {
26592 duk_push_uint(ctx, 0);
26593 }
26594 }
26595 break;
26596 }
26597 case DUK_HTYPE_BUFFER: {
26598 duk_hbuffer *h_buf = (duk_hbuffer *) h;
26599 if (DUK_HBUFFER_HAS_DYNAMIC(h_buf)) {
26600 if (DUK_HBUFFER_HAS_EXTERNAL(h_buf)) {
26602 } else {
26603 /* When alloc_size == 0 the second allocation may not
26604 * actually exist.
26605 */
26607 }
26609 } else {
26610 duk_push_uint(ctx, (duk_uint_t) (sizeof(duk_hbuffer_fixed) + DUK_HBUFFER_GET_SIZE(h_buf) + 1));
#define DUK_HEAPHDR_GET_TYPE(h)
#define DUK_HOBJECT_GET_ENEXT(h)
#define DUK_HOBJECT_IS_COMPILEDFUNCTION(h)
#define duk_push_size_t(ctx, val)
#define DUK_TVAL_GET_TAG(tv)
#define DUK_HOBJECT_GET_ASIZE(h)
#define DUK_HEAPHDR_GET_REFCOUNT(h)
#define DUK_HOBJECT_IS_THREAD(h)
DUK_EXTERNAL void duk_push_pointer(duk_context *ctx, void *val)
#define DUK_HOBJECT_IS_NATIVEFUNCTION(h)
#define DUK_HOBJECT_GET_HSIZE(h)
#define DUK_HSTRING_GET_BYTELEN(x)
#define DUK_TVAL_IS_HEAP_ALLOCATED(tv)
#define DUK_HCOMPILEDFUNCTION_GET_DATA(heap, h)
#define DUK_TVAL_GET_HEAPHDR(tv)
#define DUK_HOBJECT_GET_ESIZE(h)
#define DUK_HBUFFER_HAS_EXTERNAL(x)
#define DUK_HOBJECT_P_ALLOC_SIZE(h)
DUK_INTERNAL_DECL duk_ret_t duk_bi_duktape_object_info(duk_context *ctx)
#define DUK_HBUFFER_GET_SIZE(x)
static void save(LexState *ls, int c)
static union @102 native

◆ duk_bi_error_constructor_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_error_constructor_shared ( duk_context * ctx)

Definition at line 26806 of file duktape-1.5.2/src-noline/duktape.c.

26812 {
26813 DUK_ASSERT_TOP(ctx, 1);
26814 duk_compact(ctx, 0);
26815 return 1; /* return the argument object */
26816}
26817/*
26818 * Error built-ins
26819 */
26820
26821/* include removed: duk_internal.h */
26822
26824 /* Behavior for constructor and non-constructor call is
26825 * the same except for augmenting the created error. When
26826 * called as a constructor, the caller (duk_new()) will handle
26827 * augmentation; when called as normal function, we need to do
26828 * it here.
26829 */
26830
26831 duk_hthread *thr = (duk_hthread *) ctx;
26832 duk_small_int_t bidx_prototype = duk_get_current_magic(ctx);
26833
26834 /* same for both error and each subclass like TypeError */
26835 duk_uint_t flags_and_class = DUK_HOBJECT_FLAG_EXTENSIBLE |
26837
26838 DUK_UNREF(thr);
26839
26840 duk_push_object_helper(ctx, flags_and_class, bidx_prototype);
26841
26842 /* If message is undefined, the own property 'message' is not set at
26843 * all to save property space. An empty message is inherited anyway.
26844 */
26845 if (!duk_is_undefined(ctx, 0)) {
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_constructor_shared(duk_context *ctx)
DUK_EXTERNAL void duk_compact(duk_context *ctx, duk_idx_t obj_index)
#define DUK_HOBJECT_CLASS_ERROR

◆ duk_bi_error_prototype_filename_getter()

DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_filename_getter ( duk_context * ctx)

Definition at line 27101 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_error_prototype_filename_setter()

DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_filename_setter ( duk_context * ctx)

Definition at line 27176 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_error_prototype_linenumber_getter()

DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_linenumber_getter ( duk_context * ctx)

Definition at line 27105 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_error_prototype_linenumber_setter()

DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_linenumber_setter ( duk_context * ctx)

Definition at line 27180 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_error_prototype_stack_getter()

DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_stack_getter ( duk_context * ctx)

Definition at line 27097 of file duktape-1.5.2/src-noline/duktape.c.

27098 {
27099 return 0;

◆ duk_bi_error_prototype_stack_setter()

DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_stack_setter ( duk_context * ctx)

Definition at line 27172 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_error_prototype_to_string()

DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_to_string ( duk_context * ctx)

Definition at line 26847 of file duktape-1.5.2/src-noline/duktape.c.

26856 {
26857 duk_err_augment_error_create(thr, thr, NULL, 0, 1 /*noblame_fileline*/);
26858 }
26859#endif
26860
26861 return 1;
26862}
26863
26865 /* XXX: optimize with more direct internal access */
26866
26867 duk_push_this(ctx);
26869
26870 /* [ ... this ] */
26871
26873 if (duk_is_undefined(ctx, -1)) {
26874 duk_pop(ctx);
26875 duk_push_string(ctx, "Error");
26876 } else {
26877 duk_to_string(ctx, -1);
26878 }
26879
26880 /* [ ... this name ] */
26881
26882 /* XXX: Are steps 6 and 7 in E5 Section 15.11.4.4 duplicated by
26883 * accident or are they actually needed? The first ToString()
26884 * could conceivably return 'undefined'.
26885 */
26887 if (duk_is_undefined(ctx, -1)) {
26888 duk_pop(ctx);
26889 duk_push_string(ctx, "");
26890 } else {
26891 duk_to_string(ctx, -1);
26892 }
26893
DUK_EXTERNAL const char * duk_push_string(duk_context *ctx, const char *str)
DUK_INTERNAL_DECL void duk_err_augment_error_create(duk_hthread *thr, duk_hthread *thr_callstack, const char *filename, duk_int_t line, duk_bool_t noblame_fileline)
DUK_INTERNAL_DECL duk_hobject * duk_require_hobject_or_lfunc_coerce(duk_context *ctx, duk_idx_t index)
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_to_string(duk_context *ctx)

◆ duk_bi_function_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_function_constructor ( duk_context * ctx)

Definition at line 27189 of file duktape-1.5.2/src-noline/duktape.c.

27189 {
27191}
27192
27195}
27196
27199}
27200/*
27201 * Function built-ins
27202 */
27203
27204/* include removed: duk_internal.h */
27205
27207 duk_hthread *thr = (duk_hthread *) ctx;
27208 duk_hstring *h_sourcecode;
27209 duk_idx_t nargs;
27210 duk_idx_t i;
27211 duk_small_uint_t comp_flags;
27213 duk_hobject *outer_lex_env;
27214 duk_hobject *outer_var_env;
27215
27216 /* normal and constructor calls have identical semantics */
27217
27218 nargs = duk_get_top(ctx);
27219 for (i = 0; i < nargs; i++) {
27220 duk_to_string(ctx, i);
27221 }
27222
27223 if (nargs == 0) {
27224 duk_push_string(ctx, "");
27225 duk_push_string(ctx, "");
27226 } else if (nargs == 1) {
27227 /* XXX: cover this with the generic >1 case? */
27228 duk_push_string(ctx, "");
27229 } else {
27230 duk_insert(ctx, 0); /* [ arg1 ... argN-1 body] -> [body arg1 ... argN-1] */
27231 duk_push_string(ctx, ",");
27232 duk_insert(ctx, 1);
27233 duk_join(ctx, nargs - 1);
27234 }
27235
27236 /* [ body formals ], formals is comma separated list that needs to be parsed */
27237
27238 DUK_ASSERT_TOP(ctx, 2);
27239
27240 /* XXX: this placeholder is not always correct, but use for now.
27241 * It will fail in corner cases; see test-dev-func-cons-args.js.
27242 */
27243 duk_push_string(ctx, "function(");
27244 duk_dup(ctx, 1);
27245 duk_push_string(ctx, "){");
27246 duk_dup(ctx, 0);
27247 duk_push_string(ctx, "}");
27248 duk_concat(ctx, 5);
27249
27250 /* [ body formals source ] */
27251
27252 DUK_ASSERT_TOP(ctx, 3);
27253
27254 /* strictness is not inherited, intentional */
27255 comp_flags = DUK_JS_COMPILE_FLAG_FUNCEXPR;
27256
27257 duk_push_hstring_stridx(ctx, DUK_STRIDX_COMPILE); /* XXX: copy from caller? */ /* XXX: ignored now */
27258 h_sourcecode = duk_require_hstring(ctx, -2);
27259 duk_js_compile(thr,
27260 (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h_sourcecode),
27261 (duk_size_t) DUK_HSTRING_GET_BYTELEN(h_sourcecode),
27262 comp_flags);
27263 func = (duk_hcompiledfunction *) duk_get_hobject(ctx, -1);
27264 DUK_ASSERT(func != NULL);
DUK_EXTERNAL void duk_concat(duk_context *ctx, duk_idx_t count)
#define DUK_HSTRING_GET_DATA(x)
#define DUK_STRIDX_LINE_NUMBER
DUK_INTERNAL_DECL duk_ret_t duk_bi_function_constructor(duk_context *ctx)
DUK_LOCAL duk_ret_t duk__error_setter_helper(duk_context *ctx, duk_small_uint_t stridx_key)
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_filename_setter(duk_context *ctx)
DUK_INTERNAL_DECL void duk_js_compile(duk_hthread *thr, const duk_uint8_t *src_buffer, duk_size_t src_length, duk_small_uint_t flags)
#define DUK_JS_COMPILE_FLAG_FUNCEXPR
DUK_INTERNAL_DECL duk_ret_t duk_bi_error_prototype_linenumber_setter(duk_context *ctx)

◆ duk_bi_function_prototype()

DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype ( duk_context * ctx)

Definition at line 27266 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_function_prototype_apply()

DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_apply ( duk_context * ctx)

Definition at line 27339 of file duktape-1.5.2/src-noline/duktape.c.

27339 {
27340 duk_push_sprintf(ctx, "function %s() {\"bound\"}", (const char *) func_name);
27341 } else {
27342 goto type_error;
27343 }
27344 } else if (DUK_TVAL_IS_LIGHTFUNC(tv)) {
27346 } else {
27347 goto type_error;
27348 }
27349
27350 return 1;
27351
27352 type_error:
27353 return DUK_RET_TYPE_ERROR;
27354}
27355
27357 duk_idx_t len;
27358 duk_idx_t i;
27359
27360 DUK_ASSERT_TOP(ctx, 2); /* not a vararg function */
27361
27362 duk_push_this(ctx);
27363 if (!duk_is_callable(ctx, -1)) {
27364 DUK_DDD(DUK_DDDPRINT("func is not callable"));
27365 goto type_error;
27366 }
27367 duk_insert(ctx, 0);
27368 DUK_ASSERT_TOP(ctx, 3);
27369
27370 DUK_DDD(DUK_DDDPRINT("func=%!iT, thisArg=%!iT, argArray=%!iT",
27371 (duk_tval *) duk_get_tval(ctx, 0),
27372 (duk_tval *) duk_get_tval(ctx, 1),
27373 (duk_tval *) duk_get_tval(ctx, 2)));
27374
27375 /* [ func thisArg argArray ] */
27376
27377 if (duk_is_null_or_undefined(ctx, 2)) {
27378 DUK_DDD(DUK_DDDPRINT("argArray is null/undefined, no args"));
27379 len = 0;
27380 } else if (!duk_is_object(ctx, 2)) {
27381 goto type_error;
27382 } else {
27383 DUK_DDD(DUK_DDDPRINT("argArray is an object"));
27384
27385 /* XXX: make this an internal helper */
27387 len = (duk_idx_t) duk_to_uint32(ctx, -1); /* ToUint32() coercion required */
27388 duk_pop(ctx);
27389
27390 duk_require_stack(ctx, len);
27391
27392 DUK_DDD(DUK_DDDPRINT("argArray length is %ld", (long) len));
27393 for (i = 0; i < len; i++) {
27394 duk_get_prop_index(ctx, 2, i);
DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_apply(duk_context *ctx)
DUK_INTERNAL_DECL void duk_push_lightfunc_tostring(duk_context *ctx, duk_tval *tv)
DUK_EXTERNAL duk_bool_t duk_is_object(duk_context *ctx, duk_idx_t index)
#define DUK_TVAL_IS_LIGHTFUNC(tv)
DUK_EXTERNAL const char * duk_push_sprintf(duk_context *ctx, const char *fmt,...)

◆ duk_bi_function_prototype_bind()

DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_bind ( duk_context * ctx)

Definition at line 27433 of file duktape-1.5.2/src-noline/duktape.c.

27450 {
27451 duk_hobject *h_bound;
27452 duk_hobject *h_target;
27453 duk_idx_t nargs;
27454 duk_idx_t i;
27455
27456 /* vararg function, careful arg handling (e.g. thisArg may not be present) */
27457 nargs = duk_get_top(ctx); /* = 1 + arg count */
27458 if (nargs == 0) {
27459 duk_push_undefined(ctx);
27460 nargs++;
27461 }
27462 DUK_ASSERT(nargs >= 1);
27463
27464 duk_push_this(ctx);
27465 if (!duk_is_callable(ctx, -1)) {
27466 DUK_DDD(DUK_DDDPRINT("func is not callable"));
27467 goto type_error;
27468 }
27469
27470 /* [ thisArg arg1 ... argN func ] (thisArg+args == nargs total) */
27471 DUK_ASSERT_TOP(ctx, nargs + 1);
27472
27473 /* create bound function object */
27480 h_bound = duk_get_hobject(ctx, -1);
27481 DUK_ASSERT(h_bound != NULL);
27482
27483 /* [ thisArg arg1 ... argN func boundFunc ] */
27484 duk_dup(ctx, -2); /* func */
27486
27487 duk_dup(ctx, 0); /* thisArg */
27489
27490 duk_push_array(ctx);
27491
27492 /* [ thisArg arg1 ... argN func boundFunc argArray ] */
27493
27494 for (i = 0; i < nargs - 1; i++) {
27495 duk_dup(ctx, 1 + i);
27496 duk_put_prop_index(ctx, -2, i);
27497 }
27499
27500 /* [ thisArg arg1 ... argN func boundFunc ] */
27501
27502 /* bound function 'length' property is interesting */
27503 h_target = duk_get_hobject(ctx, -2);
27504 if (h_target == NULL || /* lightfunc */
27506 /* For lightfuncs, simply read the virtual property. */
27507 duk_int_t tmp;
27509 tmp = duk_to_int(ctx, -1) - (nargs - 1); /* step 15.a */
27510 duk_pop(ctx);
27511 duk_push_int(ctx, (tmp < 0 ? 0 : tmp));
27512 } else {
27513 duk_push_int(ctx, 0);
27514 }
27515 duk_xdef_prop_stridx(ctx, -2, DUK_STRIDX_LENGTH, DUK_PROPDESC_FLAGS_NONE); /* attrs in E5 Section 15.3.5.1 */
27516
27517 /* caller and arguments must use the same thrower, [[ThrowTypeError]] */
27520
27521 /* these non-standard properties are copied for convenience */
27522 /* XXX: 'copy properties' API call? */
27527
27528 /* The 'strict' flag is copied to get the special [[Get]] of E5.1
#define DUK_HOBJECT_FLAG_CONSTRUCTABLE
#define DUK_STRIDX_LC_ARGUMENTS
#define DUK_BIDX_FUNCTION_PROTOTYPE
#define DUK_PROPDESC_FLAGS_NONE
#define DUK_HOBJECT_CLASS_FUNCTION
#define DUK_HOBJECT_FLAG_BOUND
#define DUK_STRIDX_INT_TARGET
#define DUK_PROPDESC_FLAGS_WC
DUK_INTERNAL_DECL void duk_xdef_prop_stridx_thrower(duk_context *ctx, duk_idx_t obj_index, duk_small_int_t stridx, duk_small_uint_t desc_flags)

◆ duk_bi_function_prototype_call()

DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_call ( duk_context * ctx)

Definition at line 27396 of file duktape-1.5.2/src-noline/duktape.c.

27409 :
27410 return DUK_RET_TYPE_ERROR;
27411}
27412
27414 duk_idx_t nargs;
27415
27416 /* Step 1 is not necessary because duk_call_method() will take
27417 * care of it.
27418 */
27419
27420 /* vararg function, thisArg needs special handling */
27421 nargs = duk_get_top(ctx); /* = 1 + arg count */
27422 if (nargs == 0) {
27423 duk_push_undefined(ctx);
27424 nargs++;
27425 }
DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_call(duk_context *ctx)

◆ duk_bi_function_prototype_to_string()

DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_to_string ( duk_context * ctx)

Definition at line 27272 of file duktape-1.5.2/src-noline/duktape.c.

27283 {
27284 /* ignore arguments, return undefined (E5 Section 15.3.4) */
27285 DUK_UNREF(ctx);
27286 return 0;
27287}
27288
27290 duk_tval *tv;
27291
27292 /*
27293 * E5 Section 15.3.4.2 places few requirements on the output of
27294 * this function:
27295 *
27296 * - The result is an implementation dependent representation
27297 * of the function; in particular
27298 *
27299 * - The result must follow the syntax of a FunctionDeclaration.
27300 * In particular, the function must have a name (even in the
27301 * case of an anonymous function or a function with an empty
27302 * name).
27303 *
27304 * - Note in particular that the output does NOT need to compile
27305 * into anything useful.
27306 */
27307
27308
27309 /* XXX: faster internal way to get this */
27310 duk_push_this(ctx);
27311 tv = duk_get_tval(ctx, -1);
27312 DUK_ASSERT(tv != NULL);
27313
27314 if (DUK_TVAL_IS_OBJECT(tv)) {
27316 const char *func_name;
27317
27318 /* Function name: missing/undefined is mapped to empty string,
27319 * otherwise coerce to string.
27320 */
27321 /* XXX: currently no handling for non-allowed identifier characters,
27322 * e.g. a '{' in the function name.
27323 */
27325 if (duk_is_undefined(ctx, -1)) {
27326 func_name = "";
27327 } else {
27328 func_name = duk_to_string(ctx, -1);
27329 DUK_ASSERT(func_name != NULL);
27330 }
27331
27332 /* Indicate function type in the function body using a dummy
27333 * directive.
27334 */
27336 duk_push_sprintf(ctx, "function %s() {\"ecmascript\"}", (const char *) func_name);
27337 } else if (DUK_HOBJECT_HAS_NATIVEFUNCTION(obj)) {
DUK_INTERNAL_DECL duk_ret_t duk_bi_function_prototype_to_string(duk_context *ctx)
#define DUK_HOBJECT_HAS_NATIVEFUNCTION(h)
#define DUK_HOBJECT_HAS_COMPILEDFUNCTION(h)

◆ duk_bi_global_object_decode_uri()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_decode_uri ( duk_context * ctx)

Definition at line 28215 of file duktape-1.5.2/src-noline/duktape.c.

28216 {
28217 duk_double_t d = duk_to_number(ctx, 0);

◆ duk_bi_global_object_decode_uri_component()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_decode_uri_component ( duk_context * ctx)

Definition at line 28219 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_global_object_encode_uri()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_encode_uri ( duk_context * ctx)

Definition at line 28223 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_global_object_encode_uri_component()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_encode_uri_component ( duk_context * ctx)

Definition at line 28227 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_global_object_escape()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_escape ( duk_context * ctx)

Definition at line 28232 of file duktape-1.5.2/src-noline/duktape.c.

28232 {
28234}
DUK_LOCAL const duk_uint8_t duk__decode_uri_reserved_table[16]
DUK_LOCAL void duk__transform_callback_decode_uri(duk__transform_context *tfm_ctx, const void *udata, duk_codepoint_t cp)
DUK_LOCAL int duk__transform_helper(duk_context *ctx, duk__transform_callback callback, const void *udata)

◆ duk_bi_global_object_eval()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_eval ( duk_context * ctx)

Definition at line 27949 of file duktape-1.5.2/src-noline/duktape.c.

27966 {
27967 duk_hthread *thr = (duk_hthread *) ctx;
27968 duk_hstring *h;
27969 duk_activation *act_caller;
27970 duk_activation *act_eval;
27971 duk_activation *act;
27973 duk_hobject *outer_lex_env;
27974 duk_hobject *outer_var_env;
27975 duk_bool_t this_to_global = 1;
27976 duk_small_uint_t comp_flags;
27977 duk_int_t level = -2;
27978
27979 DUK_ASSERT(duk_get_top(ctx) == 1 || duk_get_top(ctx) == 2); /* 2 when called by debugger */
27980 DUK_ASSERT(thr->callstack_top >= 1); /* at least this function exists */
27981 DUK_ASSERT(((thr->callstack + thr->callstack_top - 1)->flags & DUK_ACT_FLAG_DIRECT_EVAL) == 0 || /* indirect eval */
27982 (thr->callstack_top >= 2)); /* if direct eval, calling activation must exist */
27983
27984 /*
27985 * callstack_top - 1 --> this function
27986 * callstack_top - 2 --> caller (may not exist)
27987 *
27988 * If called directly from C, callstack_top might be 1. If calling
27989 * activation doesn't exist, call must be indirect.
27990 */
27991
27992 h = duk_get_hstring(ctx, 0);
27993 if (!h) {
27994 return 1; /* return arg as-is */
27995 }
27996
27997#if defined(DUK_USE_DEBUGGER_SUPPORT)
27998 /* NOTE: level is used only by the debugger and should never be present
27999 * for an Ecmascript eval().
28000 */
28001 DUK_ASSERT(level == -2); /* by default, use caller's environment */
28002 if (duk_get_top(ctx) >= 2 && duk_is_number(ctx, 1)) {
28003 level = duk_get_int(ctx, 1);
28004 }
28005 DUK_ASSERT(level <= -2); /* This is guaranteed by debugger code. */
28006#endif
28007
28008 /* [ source ] */
28009
28010 comp_flags = DUK_JS_COMPILE_FLAG_EVAL;
28011 act_eval = thr->callstack + thr->callstack_top - 1; /* this function */
28012 if (thr->callstack_top >= (duk_size_t) -level) {
28013 /* Have a calling activation, check for direct eval (otherwise
28014 * assume indirect eval.
28015 */
28016 act_caller = thr->callstack + thr->callstack_top + level; /* caller */
28017 if ((act_caller->flags & DUK_ACT_FLAG_STRICT) &&
28018 (act_eval->flags & DUK_ACT_FLAG_DIRECT_EVAL)) {
28019 /* Only direct eval inherits strictness from calling code
28020 * (E5.1 Section 10.1.1).
28021 */
28022 comp_flags |= DUK_JS_COMPILE_FLAG_STRICT;
28023 }
28024 } else {
28025 DUK_ASSERT((act_eval->flags & DUK_ACT_FLAG_DIRECT_EVAL) == 0);
28026 }
28027 act_caller = NULL; /* avoid dereference after potential callstack realloc */
28028 act_eval = NULL;
28029
28030 duk_push_hstring_stridx(ctx, DUK_STRIDX_INPUT); /* XXX: copy from caller? */
28031 duk_js_compile(thr,
28032 (const duk_uint8_t *) DUK_HSTRING_GET_DATA(h),
28034 comp_flags);
28035 func = (duk_hcompiledfunction *) duk_get_hobject(ctx, -1);
28036 DUK_ASSERT(func != NULL);
28038
28039 /* [ source template ] */
28040
28041 /* E5 Section 10.4.2 */
28042 DUK_ASSERT(thr->callstack_top >= 1);
28043 act = thr->callstack + thr->callstack_top - 1; /* this function */
28044 if (act->flags & DUK_ACT_FLAG_DIRECT_EVAL) {
28045 DUK_ASSERT(thr->callstack_top >= 2);
28046 act = thr->callstack + thr->callstack_top + level; /* caller */
28047 if (act->lex_env == NULL) {
28048 DUK_ASSERT(act->var_env == NULL);
28049 DUK_DDD(DUK_DDDPRINT("delayed environment initialization"));
28050
28051 /* this may have side effects, so re-lookup act */
28053 act = thr->callstack + thr->callstack_top + level;
28054 }
28055 DUK_ASSERT(act->lex_env != NULL);
28056 DUK_ASSERT(act->var_env != NULL);
28057
28058 this_to_global = 0;
28059
28060 if (DUK_HOBJECT_HAS_STRICT((duk_hobject *) func)) {
28061 duk_hobject *new_env;
28062 duk_hobject *act_lex_env;
28063
28064 DUK_DDD(DUK_DDDPRINT("direct eval call to a strict function -> "
28065 "var_env and lex_env to a fresh env, "
28066 "this_binding to caller's this_binding"));
28067
28068 act = thr->callstack + thr->callstack_top + level; /* caller */
28069 act_lex_env = act->lex_env;
28070 act = NULL; /* invalidated */
28071
28075 act_lex_env);
28076 new_env = duk_require_hobject(ctx, -1);
28077 DUK_ASSERT(new_env != NULL);
28078 DUK_DDD(DUK_DDDPRINT("new_env allocated: %!iO",
28079 (duk_heaphdr *) new_env));
28080
28081 outer_lex_env = new_env;
28082 outer_var_env = new_env;
28083
28084 duk_insert(ctx, 0); /* stash to bottom of value stack to keep new_env reachable for duration of eval */
28085
28086 /* compiler's responsibility */
28088 } else {
28089 DUK_DDD(DUK_DDDPRINT("direct eval call to a non-strict function -> "
28090 "var_env and lex_env to caller's envs, "
28091 "this_binding to caller's this_binding"));
28092
28093 outer_lex_env = act->lex_env;
28094 outer_var_env = act->var_env;
28095
28096 /* compiler's responsibility */
28098 }
28099 } else {
28100 DUK_DDD(DUK_DDDPRINT("indirect eval call -> var_env and lex_env to "
28101 "global object, this_binding to global object"));
28102
28103 this_to_global = 1;
28104 outer_lex_env = thr->builtins[DUK_BIDX_GLOBAL_ENV];
28105 outer_var_env = thr->builtins[DUK_BIDX_GLOBAL_ENV];
28106 }
28107 act = NULL;
28108
28109 /* Eval code doesn't need an automatic .prototype object. */
28110 duk_js_push_closure(thr, func, outer_var_env, outer_lex_env, 0 /*add_auto_proto*/);
28111
28112 /* [ source template closure ] */
28113
28114 if (this_to_global) {
28117 } else {
28118 duk_tval *tv;
28119 DUK_ASSERT(thr->callstack_top >= 2);
28120 act = thr->callstack + thr->callstack_top + level; /* caller */
28121 tv = thr->valstack + act->idx_bottom - 1; /* this is just beneath bottom */
DUK_INTERNAL_DECL void duk_js_init_activation_environment_records_delayed(duk_hthread *thr, duk_activation *act)
DUK_INTERNAL_DECL duk_idx_t duk_push_object_helper_proto(duk_context *ctx, duk_uint_t hobject_flags_and_class, duk_hobject *proto)
#define DUK_JS_COMPILE_FLAG_EVAL
DUK_INTERNAL_DECL void duk_js_push_closure(duk_hthread *thr, duk_hcompiledfunction *fun_temp, duk_hobject *outer_var_env, duk_hobject *outer_lex_env, duk_bool_t add_auto_proto)
#define DUK_ACT_FLAG_DIRECT_EVAL
DUK_INTERNAL_DECL void duk_push_hobject_bidx(duk_context *ctx, duk_small_int_t builtin_idx)
#define DUK_HOBJECT_CLASS_DECENV
#define DUK_JS_COMPILE_FLAG_STRICT
#define DUK_HOBJECT_HAS_NEWENV(h)
DUK_INTERNAL_DECL duk_hstring * duk_get_hstring(duk_context *ctx, duk_idx_t index)
#define DUK_HOBJECT_HAS_STRICT(h)
duk_hobject * builtins[DUK_NUM_BUILTINS]

◆ duk_bi_global_object_is_finite()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_is_finite ( duk_context * ctx)

Definition at line 28205 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_global_object_is_nan()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_is_nan ( duk_context * ctx)

Definition at line 28199 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_global_object_parse_float()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_parse_float ( duk_context * ctx)

Definition at line 28170 of file duktape-1.5.2/src-noline/duktape.c.

28171 {
28172 s2n_flags &= ~DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT;
28173 }
28174 } else {
28175 radix = 10;
28176 }
28177
28178 duk_dup(ctx, 0);
28179 duk_numconv_parse(ctx, radix, s2n_flags);
28180 return 1;
28181
28182 ret_nan:
28183 duk_push_nan(ctx);
28184 return 1;
28185}
28186
28188 duk_small_uint_t s2n_flags;
28189 duk_int32_t radix;
28190
28191 DUK_ASSERT_TOP(ctx, 1);
28192 duk_to_string(ctx, 0);
28193
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_parse_float(duk_context *ctx)
DUK_INTERNAL_DECL void duk_numconv_parse(duk_context *ctx, duk_small_int_t radix, duk_small_uint_t flags)
DUK_EXTERNAL void duk_push_nan(duk_context *ctx)

◆ duk_bi_global_object_parse_int()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_parse_int ( duk_context * ctx)

Definition at line 28127 of file duktape-1.5.2/src-noline/duktape.c.

28144 {
28145 duk_int32_t radix;
28146 duk_small_uint_t s2n_flags;
28147
28148 DUK_ASSERT_TOP(ctx, 2);
28149 duk_to_string(ctx, 0);
28150
28151 radix = duk_to_int32(ctx, 1);
28152
28153 s2n_flags = DUK_S2N_FLAG_TRIM_WHITE |
28159
28160 /* Specification stripPrefix maps to DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT.
28161 *
28162 * Don't autodetect octals (from leading zeroes), require user code to
28163 * provide an explicit radix 8 for parsing octal. See write-up from Mozilla:
28164 * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt#ECMAScript_5_Removes_Octal_Interpretation
28165 */
28166
28167 if (radix != 0) {
28168 if (radix < 2 || radix > 36) {
#define DUK_S2N_FLAG_ALLOW_MINUS
#define DUK_S2N_FLAG_ALLOW_AUTO_HEX_INT
DUK_EXTERNAL duk_int32_t duk_to_int32(duk_context *ctx, duk_idx_t index)
#define DUK_S2N_FLAG_ALLOW_PLUS
#define DUK_S2N_FLAG_TRIM_WHITE
#define DUK_S2N_FLAG_ALLOW_LEADING_ZERO
#define DUK_S2N_FLAG_ALLOW_GARBAGE

◆ duk_bi_global_object_print_helper()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_print_helper ( duk_context * ctx)

Definition at line 28252 of file duktape-1.5.2/src-noline/duktape.c.

28253 {
28254 return duk__transform_helper(ctx, duk__transform_callback_unescape, (const void *) NULL);
28255}
28256#else /* DUK_USE_SECTION_B */
28258 DUK_UNREF(ctx);
28260}
28261
28263 DUK_UNREF(ctx);
28265}
28266#endif /* DUK_USE_SECTION_B */
28267
28268#if defined(DUK_USE_BROWSER_LIKE) && (defined(DUK_USE_FILE_IO) || defined(DUK_USE_DEBUGGER_SUPPORT))
28270 duk_hthread *thr = (duk_hthread *) ctx;
28271 duk_int_t magic;
28272 duk_idx_t nargs;
28273 const duk_uint8_t *buf;
28274 duk_size_t sz_buf;
28275 const char nl = (const char) DUK_ASC_LF;
28276#ifndef DUK_USE_PREFER_SIZE
28277 duk_uint8_t buf_stack[256];
28278#endif
28279#ifdef DUK_USE_FILE_IO
28280 duk_file *f_out;
28281#endif
28282
28283 DUK_UNREF(thr);
28284
28285 magic = duk_get_current_magic(ctx);
28286 DUK_UNREF(magic);
28287
28288 nargs = duk_get_top(ctx);
28289
28290 /* If argument count is 1 and first argument is a buffer, write the buffer
28291 * as raw data into the file without a newline; this allows exact control
28292 * over stdout/stderr without an additional entrypoint (useful for now).
28293 *
28294 * Otherwise current print/alert semantics are to ToString() coerce
28295 * arguments, join them with a single space, and append a newline.
28296 */
28297
28298 if (nargs == 1 && duk_is_buffer(ctx, 0)) {
28299 buf = (const duk_uint8_t *) duk_get_buffer(ctx, 0, &sz_buf);
28300 DUK_ASSERT(buf != NULL);
28301 } else if (nargs > 0) {
28302#ifdef DUK_USE_PREFER_SIZE
28303 /* Compact but lots of churn. */
28305 duk_insert(ctx, 0);
28306 duk_join(ctx, nargs);
28307 duk_push_string(thr, "\n");
28308 duk_concat(ctx, 2);
28309 buf = (const duk_uint8_t *) duk_get_lstring(ctx, -1, &sz_buf);
28310 DUK_ASSERT(buf != NULL);
28311#else /* DUK_USE_PREFER_SIZE */
28312 /* Higher footprint, less churn. */
28313 duk_idx_t i;
28314 duk_size_t sz_str;
28315 const duk_uint8_t *p_str;
28316 duk_uint8_t *p;
28317
28318 sz_buf = (duk_size_t) nargs; /* spaces (nargs - 1) + newline */
28319 for (i = 0; i < nargs; i++) {
28320 (void) duk_to_lstring(ctx, i, &sz_str);
28321 sz_buf += sz_str;
28322 }
28323
28324 if (sz_buf <= sizeof(buf_stack)) {
28325 p = (duk_uint8_t *) buf_stack;
28326 } else {
28327 p = (duk_uint8_t *) duk_push_fixed_buffer(ctx, sz_buf);
28328 DUK_ASSERT(p != NULL);
28329 }
28330
28331 buf = (const duk_uint8_t *) p;
28332 for (i = 0; i < nargs; i++) {
28333 p_str = (const duk_uint8_t *) duk_get_lstring(ctx, i, &sz_str);
28334 DUK_ASSERT(p_str != NULL);
28335 DUK_MEMCPY((void *) p, (const void *) p_str, sz_str);
28336 p += sz_str;
28337 *p++ = (duk_uint8_t) (i == nargs - 1 ? DUK_ASC_LF : DUK_ASC_SPACE);
28338 }
28339 DUK_ASSERT((const duk_uint8_t *) p == buf + sz_buf);
28340#endif /* DUK_USE_PREFER_SIZE */
28341 } else {
28342 buf = (const duk_uint8_t *) &nl;
28343 sz_buf = 1;
28344 }
28345
28346 /* 'buf' contains the string to write, 'sz_buf' contains the length
28347 * (which may be zero).
28348 */
28349 DUK_ASSERT(buf != NULL);
28350
28351 if (sz_buf == 0) {
28352 return 0;
DUK_EXTERNAL void * duk_get_buffer(duk_context *ctx, duk_idx_t index, duk_size_t *out_size)
DUK_EXTERNAL const char * duk_to_lstring(duk_context *ctx, duk_idx_t index, duk_size_t *out_len)
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_unescape(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_escape(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_print_helper(duk_context *ctx)
DUK_LOCAL void duk__transform_callback_unescape(duk__transform_context *tfm_ctx, const void *udata, duk_codepoint_t cp)

◆ duk_bi_global_object_require()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_require ( duk_context * ctx)

Definition at line 28554 of file duktape-1.5.2/src-noline/duktape.c.

28571 {
28572 const char *str_req_id; /* requested identifier */
28573 const char *str_mod_id; /* require.id of current module */
28574 duk_int_t pcall_rc;
28575
28576 /* NOTE: we try to minimize code size by avoiding unnecessary pops,
28577 * so the stack looks a bit cluttered in this function. DUK_ASSERT_TOP()
28578 * assertions are used to ensure stack configuration is correct at each
28579 * step.
28580 */
28581
28582 /*
28583 * Resolve module identifier into canonical absolute form.
28584 */
28585
28586 str_req_id = duk_require_string(ctx, DUK__IDX_REQUESTED_ID);
28589 str_mod_id = duk_get_string(ctx, DUK__IDX_REQUIRE_ID); /* ignore non-strings */
28590 DUK_DDD(DUK_DDDPRINT("resolve module id: requested=%!T, currentmodule=%!T",
28593 duk__bi_global_resolve_module_id(ctx, str_req_id, str_mod_id);
28594 str_req_id = NULL;
28595 str_mod_id = NULL;
28596 DUK_DDD(DUK_DDDPRINT("resolved module id: requested=%!T, currentmodule=%!T, result=%!T, lastcomp=%!T",
28601
28602 /* [ requested_id require require.id resolved_id last_comp ] */
28604
28605 /*
28606 * Cached module check.
28607 *
28608 * If module has been loaded or its loading has already begun without
28609 * finishing, return the same cached value ('exports'). The value is
28610 * registered when module load starts so that circular references can
28611 * be supported to some extent.
28612 */
28613
28615 duk_get_prop_stridx(ctx, DUK__IDX_DUKTAPE, DUK_STRIDX_MOD_LOADED); /* Duktape.modLoaded */
28618
28620 if (duk_get_prop(ctx, DUK__IDX_MODLOADED)) {
28621 /* [ requested_id require require.id resolved_id last_comp Duktape Duktape.modLoaded Duktape.modLoaded[id] ] */
28622 DUK_DD(DUK_DDPRINT("module already loaded: %!T",
28624 duk_get_prop_stridx(ctx, -1, DUK_STRIDX_EXPORTS); /* return module.exports */
28625 return 1;
28626 }
28628
28629 /* [ requested_id require require.id resolved_id last_comp Duktape Duktape.modLoaded undefined ] */
28630
28631 /*
28632 * Module not loaded (and loading not started previously).
28633 *
28634 * Create a new require() function with 'id' set to resolved ID
28635 * of module being loaded. Also create 'exports' and 'module'
28636 * tables but don't register exports to the loaded table yet.
28637 * We don't want to do that unless the user module search callbacks
28638 * succeeds in finding the module.
28639 */
28640
28641 DUK_D(DUK_DPRINT("loading module %!T, resolution base %!T, requested ID %!T -> resolved ID %!T, last component %!T",
28647
28648 /* Fresh require: require.id is left configurable (but not writable)
28649 * so that is not easy to accidentally tweak it, but it can still be
28650 * done with Object.defineProperty().
28651 *
28652 * XXX: require.id could also be just made non-configurable, as there
28653 * is no practical reason to touch it.
28654 */
28659 duk_xdef_prop_stridx(ctx, DUK__IDX_FRESH_REQUIRE, DUK_STRIDX_ID, DUK_PROPDESC_FLAGS_C); /* a fresh require() with require.id = resolved target module id */
28660
28661 /* Module table:
28662 * - module.exports: initial exports table (may be replaced by user)
28663 * - module.id is non-writable and non-configurable, as the CommonJS
28664 * spec suggests this if possible
28665 * - module.filename: not set, defaults to resolved ID if not explicitly
28666 * set by modSearch() (note capitalization, not .fileName, matches Node.js)
28667 * - module.name: not set, defaults to last component of resolved ID if
28668 * not explicitly set by modSearch()
28669 */
28670 duk_push_object(ctx); /* exports */
28671 duk_push_object(ctx); /* module */
28674 duk_dup(ctx, DUK__IDX_RESOLVED_ID); /* resolved id: require(id) must return this same module */
28675 duk_xdef_prop_stridx(ctx, DUK__IDX_MODULE, DUK_STRIDX_ID, DUK_PROPDESC_FLAGS_NONE); /* module.id = resolved_id */
28676 duk_compact(ctx, DUK__IDX_MODULE); /* module table remains registered to modLoaded, minimize its size */
28678
28679 DUK_DD(DUK_DDPRINT("module table created: %!T", duk_get_tval(ctx, DUK__IDX_MODULE)));
28680
28681 /* [ requested_id require require.id resolved_id last_comp Duktape Duktape.modLoaded undefined fresh_require exports module ] */
28682
28683 /* Register the module table early to modLoaded[] so that we can
28684 * support circular references even in modSearch(). If an error
28685 * is thrown, we'll delete the reference.
28686 */
28689 duk_put_prop(ctx, DUK__IDX_MODLOADED); /* Duktape.modLoaded[resolved_id] = module */
28690
28691 /*
28692 * Call user provided module search function and build the wrapped
28693 * module source code (if necessary). The module search function
28694 * can be used to implement pure Ecmacsript, pure C, and mixed
28695 * Ecmascript/C modules.
28696 *
28697 * The module search function can operate on the exports table directly
28698 * (e.g. DLL code can register values to it). It can also return a
28699 * string which is interpreted as module source code (if a non-string
28700 * is returned the module is assumed to be a pure C one). If a module
28701 * cannot be found, an error must be thrown by the user callback.
28702 *
28703 * Because Duktape.modLoaded[] already contains the module being
28704 * loaded, circular references for C modules should also work
28705 * (although expected to be quite rare).
28706 */
28707
28708 duk_push_string(ctx, "(function(require,exports,module){");
28709
28710 /* Duktape.modSearch(resolved_id, fresh_require, exports, module). */
28711 duk_get_prop_stridx(ctx, DUK__IDX_DUKTAPE, DUK_STRIDX_MOD_SEARCH); /* Duktape.modSearch */
28715 duk_dup(ctx, DUK__IDX_MODULE); /* [ ... Duktape.modSearch resolved_id last_comp fresh_require exports module ] */
28716 pcall_rc = duk_pcall(ctx, 4 /*nargs*/); /* -> [ ... source ] */
28718
28719 if (pcall_rc != DUK_EXEC_SUCCESS) {
28720 /* Delete entry in Duktape.modLoaded[] and rethrow. */
28721 goto delete_rethrow;
28722 }
28723
28724 /* If user callback did not return source code, module loading
28725 * is finished (user callback initialized exports table directly).
28726 */
28727 if (!duk_is_string(ctx, -1)) {
28728 /* User callback did not return source code, so module loading
28729 * is finished: just update modLoaded with final module.exports
28730 * and we're done.
28731 */
28732 goto return_exports;
28733 }
28734
28735 /* Finish the wrapped module source. Force module.filename as the
28736 * function .fileName so it gets set for functions defined within a
28737 * module. This also ensures loggers created within the module get
28738 * the module ID (or overridden filename) as their default logger name.
28739 * (Note capitalization: .filename matches Node.js while .fileName is
28740 * used elsewhere in Duktape.)
28741 */
28742 duk_push_string(ctx, "})");
28743 duk_concat(ctx, 3);
28745 /* module.filename for .fileName, default to resolved ID if
28746 * not present.
28747 */
28748 duk_pop(ctx);
28750 }
28752
28753 /* Module has now evaluated to a wrapped module function. Force its
28754 * .name to match module.name (defaults to last component of resolved
28755 * ID) so that it is shown in stack traces too. Note that we must not
28756 * introduce an actual name binding into the function scope (which is
28757 * usually the case with a named function) because it would affect the
28758 * scope seen by the module and shadow accesses to globals of the same name.
28759 * This is now done by compiling the function as anonymous and then forcing
28760 * its .name without setting a "has name binding" flag.
28761 */
28762
28765 /* module.name for .name, default to last component if
28766 * not present.
28767 */
28768 duk_pop(ctx);
28770 }
28772
28773 /*
28774 * Call the wrapped module function.
28775 *
28776 * Use a protected call so that we can update Duktape.modLoaded[resolved_id]
28777 * even if the module throws an error.
28778 */
28779
28780 /* [ requested_id require require.id resolved_id last_comp Duktape Duktape.modLoaded undefined fresh_require exports module mod_func ] */
28782
28783 duk_dup(ctx, DUK__IDX_EXPORTS); /* exports (this binding) */
28784 duk_dup(ctx, DUK__IDX_FRESH_REQUIRE); /* fresh require (argument) */
28785 duk_get_prop_stridx(ctx, DUK__IDX_MODULE, DUK_STRIDX_EXPORTS); /* relookup exports from module.exports in case it was changed by modSearch */
28786 duk_dup(ctx, DUK__IDX_MODULE); /* module (argument) */
28788
28789 /* [ requested_id require require.id resolved_id last_comp Duktape Duktape.modLoaded undefined fresh_require exports module mod_func exports fresh_require exports module ] */
28790
28791 pcall_rc = duk_pcall_method(ctx, 3 /*nargs*/);
28792 if (pcall_rc != DUK_EXEC_SUCCESS) {
28793 /* Module loading failed. Node.js will forget the module
28794 * registration so that another require() will try to load
28795 * the module again. Mimic that behavior.
28796 */
28797 goto delete_rethrow;
28798 }
DUK_EXTERNAL void duk_def_prop(duk_context *ctx, duk_idx_t obj_index, duk_uint_t flags)
#define DUK_STRIDX_MOD_LOADED
DUK_EXTERNAL duk_idx_t duk_push_c_function(duk_context *ctx, duk_c_function func, duk_int_t nargs)
DUK_EXTERNAL void duk_push_current_function(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_require(duk_context *ctx)
DUK_EXTERNAL const char * duk_get_string(duk_context *ctx, duk_idx_t index)
#define DUK_STRIDX_MOD_SEARCH
DUK_EXTERNAL duk_int_t duk_pcall_method(duk_context *ctx, duk_idx_t nargs)
DUK_EXTERNAL duk_bool_t duk_get_prop(duk_context *ctx, duk_idx_t obj_index)
DUK_LOCAL void duk__bi_global_resolve_module_id(duk_context *ctx, const char *req_id, const char *mod_id)
DUK_EXTERNAL duk_int_t duk_eval_raw(duk_context *ctx, const char *src_buffer, duk_size_t src_length, duk_uint_t flags)
DUK_EXTERNAL const char * duk_require_string(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL duk_int_t duk_pcall(duk_context *ctx, duk_idx_t nargs)
DUK_EXTERNAL duk_bool_t duk_put_prop(duk_context *ctx, duk_idx_t obj_idx)
#define DUK_DEFPROP_HAVE_VALUE

◆ duk_bi_global_object_unescape()

DUK_INTERNAL_DECL duk_ret_t duk_bi_global_object_unescape ( duk_context * ctx)

Definition at line 28236 of file duktape-1.5.2/src-noline/duktape.c.

28236 {
28238}
DUK_LOCAL const duk_uint8_t duk__decode_uri_component_reserved_table[16]

◆ duk_bi_json_object_parse()

DUK_INTERNAL_DECL duk_ret_t duk_bi_json_object_parse ( duk_context * ctx)

Definition at line 31938 of file duktape-1.5.2/src-noline/duktape.c.

31939 : value=%!T, replacer=%!T, space=%!T, "
31940 "flags=0x%08lx, result=%!T, stack_top=%ld",
31941 (duk_tval *) duk_get_tval(ctx, idx_value),
31942 (duk_tval *) duk_get_tval(ctx, idx_replacer),
31943 (duk_tval *) duk_get_tval(ctx, idx_space),
31944 (unsigned long) flags,

◆ duk_bi_json_object_stringify()

DUK_INTERNAL_DECL duk_ret_t duk_bi_json_object_stringify ( duk_context * ctx)

Definition at line 31946 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_logger_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_logger_constructor ( duk_context * ctx)

Definition at line 31977 of file duktape-1.5.2/src-noline/duktape.c.

31984 {
31985 (duk_uint8_t) DUK_ASC_UC_T, (duk_uint8_t) DUK_ASC_UC_R, (duk_uint8_t) DUK_ASC_UC_C,
31986 (duk_uint8_t) DUK_ASC_UC_D, (duk_uint8_t) DUK_ASC_UC_B, (duk_uint8_t) DUK_ASC_UC_G,
31987 (duk_uint8_t) DUK_ASC_UC_I, (duk_uint8_t) DUK_ASC_UC_N, (duk_uint8_t) DUK_ASC_UC_F,
31988 (duk_uint8_t) DUK_ASC_UC_W, (duk_uint8_t) DUK_ASC_UC_R, (duk_uint8_t) DUK_ASC_UC_N,
31989 (duk_uint8_t) DUK_ASC_UC_E, (duk_uint8_t) DUK_ASC_UC_R, (duk_uint8_t) DUK_ASC_UC_R,
31990 (duk_uint8_t) DUK_ASC_UC_F, (duk_uint8_t) DUK_ASC_UC_T, (duk_uint8_t) DUK_ASC_UC_L
31991};
31992
31993/* Constructor */
31995 duk_hthread *thr = (duk_hthread *) ctx;
31996 duk_idx_t nargs;
31997
31998 /* Calling as a non-constructor is not meaningful. */
31999 if (!duk_is_constructor_call(ctx)) {
32000 return DUK_RET_TYPE_ERROR;
32001 }
32002
32003 nargs = duk_get_top(ctx);
32004 duk_set_top(ctx, 1);
32005
32006 duk_push_this(ctx);
32007
32008 /* [ name this ] */
32009
32010 if (nargs == 0) {
32011 /* Automatic defaulting of logger name from caller. This would
32012 * work poorly with tail calls, but constructor calls are currently
32013 * never tail calls, so tail calls are not an issue now.
32014 */
32015
32016 if (thr->callstack_top >= 2) {
32017 duk_activation *act_caller = thr->callstack + thr->callstack_top - 2;
32018 duk_hobject *func_caller;
32019
32020 func_caller = DUK_ACT_GET_FUNC(act_caller);
32021 if (func_caller) {
32022 /* Stripping the filename might be a good idea
32023 * ("/foo/bar/quux.js" -> logger name "quux"),
32024 * but now used verbatim.
32025 */
32026 duk_push_hobject(ctx, func_caller);
32028 duk_replace(ctx, 0);
32029 }
DUK_INTERNAL_DECL duk_ret_t duk_bi_logger_constructor(duk_context *ctx)
DUK_EXTERNAL void duk_replace(duk_context *ctx, duk_idx_t to_index)
#define DUK_ACT_GET_FUNC(act)
DUK_INTERNAL_DECL void duk_push_hobject(duk_context *ctx, duk_hobject *h)

◆ duk_bi_logger_prototype_fmt()

DUK_INTERNAL_DECL duk_ret_t duk_bi_logger_prototype_fmt ( duk_context * ctx)

Definition at line 32034 of file duktape-1.5.2/src-noline/duktape.c.

32036 {
32037 duk_dup(ctx, 0);
32039 } else {
32040 /* don't set 'n' at all, inherited value is used as name */
32041 }
32042
32043 duk_compact(ctx, 1);
32044
32045 return 0; /* keep default instance */
32046}
32047
32048/* Default function to format objects. Tries to use toLogString() but falls
32049 * back to toString(). Any errors are propagated out without catching.

◆ duk_bi_logger_prototype_log_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_logger_prototype_log_shared ( duk_context * ctx)

Definition at line 32082 of file duktape-1.5.2/src-noline/duktape.c.

32099 {
32100 duk_hthread *thr = (duk_hthread *) ctx;
32101 duk_double_t now;
32102 duk_small_int_t entry_lev = duk_get_current_magic(ctx);
32103 duk_small_int_t logger_lev;
32104 duk_int_t nargs;
32105 duk_int_t i;
32106 duk_size_t tot_len;
32107 const duk_uint8_t *arg_str;
32108 duk_size_t arg_len;
32109 duk_uint8_t *buf, *p;
32110 const duk_uint8_t *q;
32111 duk_uint8_t date_buf[DUK_BI_DATE_ISO8601_BUFSIZE];
32112 duk_size_t date_len;
32113 duk_small_int_t rc;
32114
32115 DUK_ASSERT(entry_lev >= 0 && entry_lev <= 5);
32116 DUK_UNREF(thr);
32117
32118 /* XXX: sanitize to printable (and maybe ASCII) */
32119 /* XXX: better multiline */
32120
32121 /*
32122 * Logger arguments are:
32123 *
32124 * magic: log level (0-5)
32125 * this: logger
32126 * stack: plain log args
32127 *
32128 * We want to minimize memory churn so a two-pass approach
32129 * is used: first pass formats arguments and computes final
32130 * string length, second pass copies strings either into a
32131 * pre-allocated and reused buffer (short messages) or into a
32132 * newly allocated fixed buffer. If the backend function plays
32133 * nice, it won't coerce the buffer to a string (and thus
32134 * intern it).
32135 */
32136
32137 nargs = duk_get_top(ctx);
32138
32139 /* [ arg1 ... argN this ] */
32140
32141 /*
32142 * Log level check
32143 */
32144
32145 duk_push_this(ctx);
32146
32148 logger_lev = (duk_small_int_t) duk_get_int(ctx, -1);
32149 if (entry_lev < logger_lev) {
32150 return 0;
32151 }
32152 /* log level could be popped but that's not necessary */
32153
32154 now = DUK_USE_DATE_GET_NOW(ctx);
32155 duk_bi_date_format_timeval(now, date_buf);
32156 date_len = DUK_STRLEN((const char *) date_buf);
32157
32159 duk_to_string(ctx, -1);
32160 DUK_ASSERT(duk_is_string(ctx, -1));
32161
32162 /* [ arg1 ... argN this loggerLevel loggerName ] */
32163
32164 /*
32165 * Pass 1
32166 */
32167
32168 /* Line format: <time> <entryLev> <loggerName>: <msg> */
32169
32170 tot_len = 0;
32171 tot_len += 3 + /* separators: space, space, colon */
32172 3 + /* level string */
32173 date_len + /* time */
32174 duk_get_length(ctx, -1); /* loggerName */
32175
32176 for (i = 0; i < nargs; i++) {
32177 /* When formatting an argument to a string, errors may happen from multiple
32178 * causes. In general we want to catch obvious errors like a toLogString()
32179 * throwing an error, but we don't currently try to catch every possible
32180 * error. In particular, internal errors (like out of memory or stack) are
32181 * not caught. Also, we expect Error toString() to not throw an error.
32182 */
32183 if (duk_is_object(ctx, i)) {
32184 /* duk_pcall_prop() may itself throw an error, but we're content
32185 * in catching the obvious errors (like toLogString() throwing an
32186 * error).
32187 */
32189 duk_dup(ctx, i);
32190 /* [ arg1 ... argN this loggerLevel loggerName 'fmt' arg ] */
32191 /* call: this.fmt(arg) */
32192 rc = duk_pcall_prop(ctx, -5 /*obj_index*/, 1 /*nargs*/);
32193 if (rc) {
32194 /* Keep the error as the result (coercing it might fail below,
32195 * but we don't catch that now).
32196 */
32197 ;
32198 }
32199 duk_replace(ctx, i);
32200 }
32201 (void) duk_to_lstring(ctx, i, &arg_len);
32202 tot_len++; /* sep (even before first one) */
32203 tot_len += arg_len;
32204 }
32205
32206 /*
32207 * Pass 2
32208 */
32209
32210 /* XXX: There used to be a shared log buffer here, but it was removed
32211 * when dynamic buffer spare was removed. The problem with using
32212 * bufwriter is that, without the spare, the buffer gets passed on
32213 * as an argument to the raw() call so it'd need to be resized
32214 * (reallocated) anyway. If raw() call convention is changed, this
32215 * could be made more efficient.
32216 */
32217
32218 buf = (duk_uint8_t *) duk_push_fixed_buffer(ctx, tot_len);
32219 DUK_ASSERT(buf != NULL);
32220 p = buf;
32221
32222 DUK_MEMCPY((void *) p, (const void *) date_buf, (size_t) date_len);
32223 p += date_len;
32224 *p++ = (duk_uint8_t) DUK_ASC_SPACE;
32225
32226 q = duk__log_level_strings + (entry_lev * 3);
32227 DUK_MEMCPY((void *) p, (const void *) q, (size_t) 3);
32228 p += 3;
32229
32230 *p++ = (duk_uint8_t) DUK_ASC_SPACE;
32231
32232 arg_str = (const duk_uint8_t *) duk_get_lstring(ctx, -2, &arg_len);
32233 DUK_MEMCPY((void *) p, (const void *) arg_str, (size_t) arg_len);
32234 p += arg_len;
32235
32236 *p++ = (duk_uint8_t) DUK_ASC_COLON;
32237
32238 for (i = 0; i < nargs; i++) {
32239 *p++ = (duk_uint8_t) DUK_ASC_SPACE;
32240
32241 arg_str = (const duk_uint8_t *) duk_get_lstring(ctx, i, &arg_len);
32242 DUK_ASSERT(arg_str != NULL);
32243 DUK_MEMCPY((void *) p, (const void *) arg_str, (size_t) arg_len);
32244 p += arg_len;
32245 }
32246 DUK_ASSERT(buf + tot_len == p);
32247
32248 /* [ arg1 ... argN this loggerLevel loggerName buffer ] */
32249
32250#if defined(DUK_USE_DEBUGGER_SUPPORT) && defined(DUK_USE_DEBUGGER_FWD_LOGGING)
32251 /* Do debugger forwarding before raw() because the raw() function
32252 * doesn't get the log level right now.
32253 */
32254 if (DUK_HEAP_IS_DEBUGGER_ATTACHED(thr->heap)) {
32255 const char *log_buf;
32256 duk_size_t sz_buf;
32257 log_buf = (const char *) duk_get_buffer(ctx, -1, &sz_buf);
32258 DUK_ASSERT(log_buf != NULL);
32259 duk_debug_write_notify(thr, DUK_DBG_CMD_LOG);
DUK_EXTERNAL duk_size_t duk_get_length(duk_context *ctx, duk_idx_t index)
#define DUK_BI_DATE_ISO8601_BUFSIZE
DUK_LOCAL const duk_uint8_t duk__log_level_strings[]
DUK_INTERNAL_DECL void duk_bi_date_format_timeval(duk_double_t timeval, duk_uint8_t *out_buf)
DUK_EXTERNAL duk_int_t duk_pcall_prop(duk_context *ctx, duk_idx_t obj_index, duk_idx_t nargs)

◆ duk_bi_logger_prototype_raw()

DUK_INTERNAL_DECL duk_ret_t duk_bi_logger_prototype_raw ( duk_context * ctx)

Definition at line 32058 of file duktape-1.5.2/src-noline/duktape.c.

32075 {

◆ duk_bi_math_object_max()

DUK_INTERNAL_DECL duk_ret_t duk_bi_math_object_max ( duk_context * ctx)

Definition at line 32565 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_math_object_min()

DUK_INTERNAL_DECL duk_ret_t duk_bi_math_object_min ( duk_context * ctx)

Definition at line 32569 of file duktape-1.5.2/src-noline/duktape.c.

32571 {

◆ duk_bi_math_object_onearg_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_math_object_onearg_shared ( duk_context * ctx)

Definition at line 32543 of file duktape-1.5.2/src-noline/duktape.c.

32550 {
32551#if defined(DUK_USE_AVOID_PLATFORM_FUNCPTRS)
32552 duk__atan2,
DUK_LOCAL double duk__atan2(double x, double y)

◆ duk_bi_math_object_random()

DUK_INTERNAL_DECL duk_ret_t duk_bi_math_object_random ( duk_context * ctx)

Definition at line 32573 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_math_object_twoarg_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_math_object_twoarg_shared ( duk_context * ctx)

Definition at line 32554 of file duktape-1.5.2/src-noline/duktape.c.

32560 {
32563
double(* duk__one_arg_func)(double)

◆ duk_bi_nodejs_buffer_byte_length()

DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_byte_length ( duk_context * ctx)

Definition at line 23623 of file duktape-1.5.2/src-noline/duktape.c.

23629 {
23630 DUK_UNREF(ctx);
23632}
23633#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
23634
23635/*
23636 * Node.js Buffer.byteLength()

◆ duk_bi_nodejs_buffer_concat()

DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_concat ( duk_context * ctx)

Definition at line 23649 of file duktape-1.5.2/src-noline/duktape.c.

23655 {
23656 DUK_UNREF(ctx);
23658}
23659#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
23660
23661/*
23662 * Node.js Buffer.concat()
23663 */
23664
23665#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
23667 duk_hthread *thr;
23668 duk_hobject *h_arg;
23669 duk_int_t total_length = 0;
23670 duk_hbufferobject *h_bufobj;
23671 duk_hbufferobject *h_bufres;
23672 duk_hbuffer *h_val;
23673 duk_uint_t i, n;
23674 duk_uint8_t *p;
23675 duk_size_t space_left;
23676 duk_size_t copy_size;
23677
23678 thr = (duk_hthread *) ctx;
23679 DUK_UNREF(thr);
23680
23681 /* Node.js accepts only actual Arrays. */
23682 h_arg = duk_require_hobject(ctx, 0);
23684 return DUK_RET_TYPE_ERROR;
23685 }
23686
23687 /* Compute result length and validate argument buffers. */
23688 n = (duk_uint_t) duk_get_length(ctx, 0);
23689 for (i = 0; i < n; i++) {
23690 /* Neutered checks not necessary here: neutered buffers have
23691 * zero 'length' so we'll effectively skip them.
23692 */
23693 DUK_ASSERT_TOP(ctx, 2); /* [ array totalLength ] */
23694 duk_get_prop_index(ctx, 0, (duk_uarridx_t) i); /* -> [ array totalLength buf ] */
23695 h_bufobj = duk__require_bufobj_value(ctx, 2);
23696 DUK_ASSERT(h_bufobj != NULL);
23697 total_length += h_bufobj->length;
23698 duk_pop(ctx);
23699 }
23700 if (n == 1) {
23701 /* For the case n==1 Node.js doesn't seem to type check
23702 * the sole member but we do it before returning it.
23703 * For this case only the original buffer object is
23704 * returned (not a copy).
23705 */
23706 duk_get_prop_index(ctx, 0, 0);
23707 return 1;
23708 }
23709
23710 /* User totalLength overrides a computed length, but we'll check
23711 * every copy in the copy loop. Note that duk_to_uint() can
23712 * technically have arbitrary side effects so we need to recheck
23713 * the buffers in the copy loop.
23714 */
23715 if (!duk_is_undefined(ctx, 1) && n > 0) {
23716 /* For n == 0, Node.js ignores totalLength argument and
23717 * returns a zero length buffer.
23718 */
23719 total_length = duk_to_int(ctx, 1);
23720 }
23721 if (total_length < 0) {
23722 return DUK_RET_RANGE_ERROR;
23723 }
23724
23725 h_bufres = duk_push_bufferobject_raw(ctx,
23730 DUK_ASSERT(h_bufres != NULL);
23731
23732 p = (duk_uint8_t *) duk_push_fixed_buffer(ctx, total_length);
23733 DUK_ASSERT(p != NULL);
23734 space_left = total_length;
23735
23736 for (i = 0; i < n; i++) {
23737 DUK_ASSERT_TOP(ctx, 4); /* [ array totalLength bufres buf ] */
23738
23739 duk_get_prop_index(ctx, 0, (duk_uarridx_t) i);
23740 h_bufobj = duk__require_bufobj_value(ctx, 4);
23741 DUK_ASSERT(h_bufobj != NULL);
23742
23743 copy_size = h_bufobj->length;
23744 if (copy_size > space_left) {
23745 copy_size = space_left;
23746 }
23747
23748 if (h_bufobj->buf != NULL &&
23750 DUK_MEMCPY((void *) p,
23751 (const void *) DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_bufobj),
23752 copy_size);
23753 } else {
23754 /* Just skip, leaving zeroes in the result. */
23755 ;
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_concat(duk_context *ctx)
#define DUK_HOBJECT_CLASS_BUFFER
#define DUK_BIDX_NODEJS_BUFFER_PROTOTYPE

◆ duk_bi_nodejs_buffer_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_constructor ( duk_context * ctx)

Definition at line 22052 of file duktape-1.5.2/src-noline/duktape.c.

22069 {
22070 /* Internal class is Object: Object.prototype.toString.call(new Buffer(0))
22071 * prints "[object Object]".
22072 */
22073 duk_int_t len;
22074 duk_int_t i;
22075 duk_hbuffer *h_buf;
22076 duk_hbufferobject *h_bufobj;
22077 duk_size_t buf_size;
22078
22079 switch (duk_get_type(ctx, 0)) {
22080 case DUK_TYPE_BUFFER: {
22081 /* Custom behavior: plain buffer is used as internal buffer
22082 * without making a copy (matches Duktape.Buffer).
22083 */
22084 duk_set_top(ctx, 1); /* -> [ buffer ] */
22085 break;
22086 }
22087 case DUK_TYPE_NUMBER: {
22088 len = duk_to_int_clamped(ctx, 0, 0, DUK_INT_MAX);
22089 (void) duk_push_fixed_buffer(ctx, (duk_size_t) len);
22090 break;
22091 }
22092 case DUK_TYPE_OBJECT: {
22093 duk_uint8_t *buf;
22094
22095 (void) duk_get_prop_string(ctx, 0, "length");
22096 len = duk_to_int_clamped(ctx, -1, 0, DUK_INT_MAX);
22097 duk_pop(ctx);
22098 buf = (duk_uint8_t *) duk_push_fixed_buffer(ctx, (duk_size_t) len);
22099 for (i = 0; i < len; i++) {
22100 /* XXX: fast path for array arguments? */
22101 duk_get_prop_index(ctx, 0, (duk_uarridx_t) i);
22102 buf[i] = (duk_uint8_t) (duk_to_uint32(ctx, -1) & 0xffU);
22103 duk_pop(ctx);
22104 }
22105 break;
22106 }
22107 case DUK_TYPE_STRING: {
22108 /* ignore encoding for now */
22109 duk_dup(ctx, 0);
22110 (void) duk_to_buffer(ctx, -1, &buf_size);
22111 break;
22112 }
22113 default:
22114 return DUK_RET_TYPE_ERROR;
22115 }
22116
22117 DUK_ASSERT(duk_is_buffer(ctx, -1));
22118 h_buf = duk_get_hbuffer(ctx, -1);
22119 DUK_ASSERT(h_buf != NULL);
22120
DUK_EXTERNAL duk_bool_t duk_get_prop_string(duk_context *ctx, duk_idx_t obj_index, const char *key)
#define duk_to_buffer(ctx, index, out_size)

◆ duk_bi_nodejs_buffer_copy()

DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_copy ( duk_context * ctx)

Definition at line 23012 of file duktape-1.5.2/src-noline/duktape.c.

23018 {
23019 DUK_UNREF(ctx);
23021}
23022#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
23023
23024/*
23025 * Node.js Buffer.prototype.copy()
23026 */
23027
23028#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
23030 duk_hthread *thr;
23031 duk_hbufferobject *h_this;
23032 duk_hbufferobject *h_bufarg;
23033 duk_int_t source_length;
23034 duk_int_t target_length;
23035 duk_int_t target_start, source_start, source_end;
23036 duk_uint_t target_ustart, source_ustart, source_uend;
23037 duk_uint_t copy_size = 0;
23038
23039 /* [ targetBuffer targetStart sourceStart sourceEnd ] */
23040
23041 thr = (duk_hthread *) ctx;
23042 DUK_UNREF(thr);
23043
23044 h_this = duk__require_bufobj_this(ctx);
23045 h_bufarg = duk__require_bufobj_value(ctx, 0);
23046 DUK_ASSERT(h_this != NULL);
23047 DUK_ASSERT(h_bufarg != NULL);
23048 source_length = (duk_int_t) h_this->length;
23049 target_length = (duk_int_t) h_bufarg->length;
23050
23051 target_start = duk_to_int(ctx, 1);
23052 source_start = duk_to_int(ctx, 2);
23053 if (duk_is_undefined(ctx, 3)) {
23054 source_end = source_length;
23055 } else {
23056 source_end = duk_to_int(ctx, 3);
23057 }
23058
23059 DUK_DDD(DUK_DDDPRINT("checking copy args: target_start=%ld, target_length=%ld, "
23060 "source_start=%ld, source_end=%ld, source_length=%ld",
23061 (long) target_start, (long) h_bufarg->length,
23062 (long) source_start, (long) source_end, (long) source_length));
23063
23064 /* This behavior mostly mimics Node.js now. */
23065
23066 if (source_start < 0 || source_end < 0 || target_start < 0) {
23067 /* Negative offsets cause a RangeError. */
23068 goto fail_bounds;
23069 }
23070 source_ustart = (duk_uint_t) source_start;
23071 source_uend = (duk_uint_t) source_end;
23072 target_ustart = (duk_uint_t) target_start;
23073 if (source_ustart >= source_uend || /* crossed offsets or zero size */
23074 source_ustart >= (duk_uint_t) source_length || /* source out-of-bounds (but positive) */
23075 target_ustart >= (duk_uint_t) target_length) { /* target out-of-bounds (but positive) */
23076 goto silent_ignore;
23077 }
23078 if (source_uend >= (duk_uint_t) source_length) {
23079 /* Source end clamped silently to available length. */
23080 source_uend = source_length;
23081 }
23082 copy_size = source_uend - source_ustart;
23083 if (target_ustart + copy_size > (duk_uint_t) target_length) {
23084 /* Clamp to target's end if too long.
23085 *
23086 * NOTE: there's no overflow possibility in the comparison;
23087 * both target_ustart and copy_size are >= 0 and based on
23088 * values in duk_int_t range. Adding them as duk_uint_t
23089 * values is then guaranteed not to overflow.
23090 */
23091 DUK_ASSERT(target_ustart + copy_size >= target_ustart); /* no overflow */
23092 DUK_ASSERT(target_ustart + copy_size >= copy_size); /* no overflow */
23093 copy_size = (duk_uint_t) target_length - target_ustart;
23094 }
23095
23096 DUK_DDD(DUK_DDDPRINT("making copy: target_ustart=%lu source_ustart=%lu copy_size=%lu",
23097 (unsigned long) target_ustart, (unsigned long) source_ustart,
23098 (unsigned long) copy_size));
23099
23100 DUK_ASSERT(copy_size >= 1);
23101 DUK_ASSERT(source_ustart <= (duk_uint_t) source_length);
23102 DUK_ASSERT(source_ustart + copy_size <= (duk_uint_t) source_length);
23103 DUK_ASSERT(target_ustart <= (duk_uint_t) target_length);
23104 DUK_ASSERT(target_ustart + copy_size <= (duk_uint_t) target_length);
23105
23106 /* Ensure copy is covered by underlying buffers. */
23107 DUK_ASSERT(h_bufarg->buf != NULL); /* length check */
23108 DUK_ASSERT(h_this->buf != NULL); /* length check */
23109 if (DUK_HBUFFEROBJECT_VALID_BYTEOFFSET_EXCL(h_bufarg, target_ustart + copy_size) &&
23110 DUK_HBUFFEROBJECT_VALID_BYTEOFFSET_EXCL(h_this, source_ustart + copy_size)) {
23111 /* Must use memmove() because copy area may overlap (source and target
23112 * buffer may be the same, or from different slices.
23113 */
23114 DUK_MEMMOVE((void *) (DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_bufarg) + target_ustart),
#define DUK_HBUFFEROBJECT_VALID_BYTEOFFSET_EXCL(h, off)
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_copy(duk_context *ctx)

◆ duk_bi_nodejs_buffer_fill()

DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_fill ( duk_context * ctx)

Definition at line 22884 of file duktape-1.5.2/src-noline/duktape.c.

22890 {
22891 DUK_UNREF(ctx);
22893}
22894#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
22895
22896/*
22897 * Node.js Buffer.prototype.fill()
22898 */
22899
22900#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
22902 duk_hthread *thr;
22903 duk_hbufferobject *h_this;
22904 const duk_uint8_t *fill_str_ptr;
22905 duk_size_t fill_str_len;
22906 duk_uint8_t fill_value;
22907 duk_int_t fill_offset;
22908 duk_int_t fill_end;
22909 duk_size_t fill_length;
22910 duk_uint8_t *p;
22911
22912 thr = (duk_hthread *) ctx;
22913 DUK_UNREF(thr);
22914
22915 h_this = duk__require_bufobj_this(ctx);
22916 DUK_ASSERT(h_this != NULL);
22917 if (h_this->buf == NULL) {
22918 return DUK_RET_TYPE_ERROR;
22919 }
22920
22921 /* [ value offset end ] */
22922
22923 if (duk_is_string(ctx, 0)) {
22924 fill_str_ptr = (const duk_uint8_t *) duk_get_lstring(ctx, 0, &fill_str_len);
22925 DUK_ASSERT(fill_str_ptr != NULL);
22926 } else {
22927 fill_value = (duk_uint8_t) duk_to_uint32(ctx, 0);
22928 fill_str_ptr = (const duk_uint8_t *) &fill_value;
22929 fill_str_len = 1;
22930 }
22931
22932 /* Fill offset handling is more lenient than in Node.js. */
22933
22934 duk__clamp_startend_nonegidx_noshift(ctx, h_this, 1 /*idx_start*/, 2 /*idx_end*/, &fill_offset, &fill_end);
22935
22936 DUK_DDD(DUK_DDDPRINT("fill: fill_value=%02x, fill_offset=%ld, fill_end=%ld, view length=%ld",
22937 (unsigned int) fill_value, (long) fill_offset, (long) fill_end, (long) h_this->length));
22938
22939 DUK_ASSERT(fill_end - fill_offset >= 0);
22940 DUK_ASSERT(h_this->buf != NULL);
22941
22942 p = (DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_this) + fill_offset);
22943 fill_length = (duk_size_t) (fill_end - fill_offset);
22944 if (fill_str_len == 1) {
22945 /* Handle single character fills as memset() even when
22946 * the fill data comes from a one-char argument.
22947 */
22948 DUK_MEMSET((void *) p, (int) fill_str_ptr[0], (size_t) fill_length);
DUK_LOCAL void duk__clamp_startend_nonegidx_noshift(duk_context *ctx, duk_hbufferobject *h_bufobj, duk_idx_t idx_start, duk_idx_t idx_end, duk_int_t *out_start_offset, duk_int_t *out_end_offset)
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_fill(duk_context *ctx)

◆ duk_bi_nodejs_buffer_is_buffer()

DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_is_buffer ( duk_context * ctx)

Definition at line 23582 of file duktape-1.5.2/src-noline/duktape.c.

23588 {
23589 DUK_UNREF(ctx);
23591}
23592#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
23593
23594/*
23595 * Node.js Buffer.isBuffer()
23596 */
23597
23598#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
23600 duk_hthread *thr;
23601 duk_tval *tv;
23602 duk_hobject *h;
23603 duk_hobject *h_proto;
23604 duk_bool_t ret = 0;
23605
23606 thr = (duk_hthread *) ctx;
23607
23608 DUK_ASSERT(duk_get_top(ctx) >= 1); /* nargs */
23609 tv = duk_get_tval(ctx, 0);
23610 DUK_ASSERT(tv != NULL);
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_is_buffer(duk_context *ctx)

◆ duk_bi_nodejs_buffer_is_encoding()

DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_is_encoding ( duk_context * ctx)

Definition at line 23560 of file duktape-1.5.2/src-noline/duktape.c.

23566 {
23567 DUK_UNREF(ctx);
23569}

◆ duk_bi_nodejs_buffer_tojson()

DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_tojson ( duk_context * ctx)

Definition at line 22773 of file duktape-1.5.2/src-noline/duktape.c.

22775 :
22776 return DUK_RET_TYPE_ERROR;
22777}
22778#else /* DUK_USE_BUFFEROBJECT_SUPPORT */
22780 DUK_UNREF(ctx);
22782}
22783#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
22784
22785/*
22786 * Node.js Buffer.prototype: toJSON()
22787 */
22788
22789#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
22791 duk_hthread *thr;
22792 duk_hbufferobject *h_this;
22793 duk_uint8_t *buf;
22794 duk_uint_t i;
22795
22796 thr = (duk_hthread *) ctx;
22797 DUK_UNREF(thr);
22798 h_this = duk__require_bufobj_this(ctx);
22799 DUK_ASSERT(h_this != NULL);
22800
22801 if (h_this->buf == NULL || !DUK_HBUFFEROBJECT_VALID_SLICE(h_this)) {
22802 /* Serialize uncovered backing buffer as a null; doesn't
22803 * really matter as long we're memory safe.
22804 */
22805 duk_push_null(ctx);
22806 return 1;
22807 }
22808
22809 duk_push_object(ctx);
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_tojson(duk_context *ctx)
DUK_EXTERNAL void duk_push_null(duk_context *ctx)

◆ duk_bi_nodejs_buffer_tostring()

DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_tostring ( duk_context * ctx)

Definition at line 22655 of file duktape-1.5.2/src-noline/duktape.c.

22661 {
22662 DUK_UNREF(ctx);
22664}
22665#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
22666
22667/*
22668 * Node.js Buffer: toString([encoding], [start], [end])
22669 */
22670
22671#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
22673 duk_hthread *thr;
22674 duk_hbufferobject *h_this;
22675 duk_int_t start_offset, end_offset;
22676 duk_uint8_t *buf_slice;
22677 duk_size_t slice_length;
22678
22679 thr = (duk_hthread *) ctx;
22680 DUK_UNREF(thr);
22681
22682 h_this = duk__get_bufobj_this(ctx);
22683 if (h_this == NULL) {
22684 /* XXX: happens e.g. when evaluating: String(Buffer.prototype). */
22685 duk_push_string(ctx, "[object Object]");
22686 return 1;
22687 }
22689
22690 /* ignore encoding for now */
22691
22692 duk__clamp_startend_nonegidx_noshift(ctx, h_this, 1 /*idx_start*/, 2 /*idx_end*/, &start_offset, &end_offset);
22693
22694 slice_length = (duk_size_t) (end_offset - start_offset);
22695 buf_slice = (duk_uint8_t *) duk_push_fixed_buffer(ctx, slice_length);
22696 DUK_ASSERT(buf_slice != NULL);
22697
22698 if (h_this->buf == NULL) {
22699 goto type_error;
DUK_LOCAL duk_hbufferobject * duk__get_bufobj_this(duk_context *ctx)

◆ duk_bi_nodejs_buffer_write()

DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_write ( duk_context * ctx)

Definition at line 22961 of file duktape-1.5.2/src-noline/duktape.c.

22967 {
22968 DUK_UNREF(ctx);
22970}
22971#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
22972
22973/*
22974 * Node.js Buffer.prototype.write(string, [offset], [length], [encoding])
22975 */
22976
22977#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
22979 duk_hthread *thr;
22980 duk_hbufferobject *h_this;
22981 duk_uint_t offset;
22982 duk_uint_t length;
22983 const duk_uint8_t *str_data;
22985
22986 thr = (duk_hthread *) ctx;
22987 DUK_UNREF(thr);
22988
22989 h_this = duk__require_bufobj_this(ctx);
22990 DUK_ASSERT(h_this != NULL);
22991
22992 /* Argument must be a string, e.g. a buffer is not allowed. */
22993 str_data = (const duk_uint8_t *) duk_require_lstring(ctx, 0, &str_len);
22994
22995 duk__resolve_offset_opt_length(ctx, h_this, 1, 2, &offset, &length, 0 /*throw_flag*/);
22996 DUK_ASSERT(offset <= h_this->length);
22997 DUK_ASSERT(offset + length <= h_this->length);
22998
22999 /* XXX: encoding is ignored now. */
DUK_INTERNAL_DECL duk_ret_t duk_bi_nodejs_buffer_write(duk_context *ctx)
DUK_EXTERNAL const char * duk_require_lstring(duk_context *ctx, duk_idx_t index, duk_size_t *out_len)
static int str_len(lua_State *L)

◆ duk_bi_number_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_number_constructor ( duk_context * ctx)

Definition at line 32642 of file duktape-1.5.2/src-noline/duktape.c.

32645 {
32646 DUK_DDD(DUK_DDDPRINT("unacceptable this value: %!T", (duk_tval *) duk_get_tval(ctx, -1)));
32647 DUK_ERROR_TYPE((duk_hthread *) ctx, "number expected");
32648 }
32650 DUK_ASSERT(duk_is_number(ctx, -1));
32651 DUK_DDD(DUK_DDDPRINT("number object: %!T, internal value: %!T",
32652 (duk_tval *) duk_get_tval(ctx, -2), (duk_tval *) duk_get_tval(ctx, -1)));
32653 duk_remove(ctx, -2);
32654
32655 done:
32656 return duk_get_number(ctx, -1);
32657}
32658
32660 duk_hthread *thr = (duk_hthread *) ctx;
32661 duk_idx_t nargs;
32662 duk_hobject *h_this;
32663
32664 DUK_UNREF(thr);
32665
32666 /*
32667 * The Number constructor uses ToNumber(arg) for number coercion
32668 * (coercing an undefined argument to NaN). However, if the
32669 * argument is not given at all, +0 must be used instead. To do
32670 * this, a vararg function is used.
32671 */
32672
32673 nargs = duk_get_top(ctx);
32674 if (nargs == 0) {
32675 duk_push_int(ctx, 0);
32676 }
32677 duk_to_number(ctx, 0);
32678 duk_set_top(ctx, 1);
32679 DUK_ASSERT_TOP(ctx, 1);
32680
32681 if (!duk_is_constructor_call(ctx)) {
32682 return 1;
32683 }
32684
32685 /*
32686 * E5 Section 15.7.2.1 requires that the constructed object
32687 * must have the original Number.prototype as its internal
32688 * prototype. However, since Number.prototype is non-writable
32689 * and non-configurable, this doesn't have to be enforced here:
32690 * The default object (bound to 'this') is OK, though we have
32691 * to change its class.
32692 *
32693 * Internal value set to ToNumber(arg) or +0; if no arg given,
32694 * ToNumber(undefined) = NaN, so special treatment is needed
#define DUK_ERROR_TYPE(thr, msg)
DUK_EXTERNAL void duk_remove(duk_context *ctx, duk_idx_t index)
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_constructor(duk_context *ctx)

◆ duk_bi_number_prototype_to_exponential()

DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_exponential ( duk_context * ctx)

Definition at line 32768 of file duktape-1.5.2/src-noline/duktape.c.

32779 :
32780 DUK_ASSERT_TOP(ctx, 2);
32781 duk_to_string(ctx, -1);
32782 return 1;
32783}
32784
32786 duk_bool_t frac_undefined;
32787 duk_small_int_t frac_digits;
32788 duk_double_t d;
32790 duk_small_uint_t n2s_flags;
32791
32793
32794 frac_undefined = duk_is_undefined(ctx, 0);
32795 duk_to_int(ctx, 0); /* for side effects */
32796
32798 if (c == DUK_FP_NAN || c == DUK_FP_INFINITE) {
32799 goto use_to_string;
32800 }
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_exponential(duk_context *ctx)
DUK_LOCAL duk_double_t duk__push_this_number_plain(duk_context *ctx)

◆ duk_bi_number_prototype_to_fixed()

DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_fixed ( duk_context * ctx)

Definition at line 32735 of file duktape-1.5.2/src-noline/duktape.c.

32739 {
32740 /* XXX: just use toString() for now; permitted although not recommended.
32741 * nargs==1, so radix is passed to toString().
32742 */
32744}
32745
32746/*
32747 * toFixed(), toExponential(), toPrecision()
32748 */
32749
32750/* XXX: shared helper for toFixed(), toExponential(), toPrecision()? */
32751
32753 duk_small_int_t frac_digits;
32754 duk_double_t d;
32756 duk_small_uint_t n2s_flags;
32757
32758 frac_digits = (duk_small_int_t) duk_to_int_check_range(ctx, 0, 0, 20);
32760
32762 if (c == DUK_FP_NAN || c == DUK_FP_INFINITE) {
32763 goto use_to_string;
32764 }
32765
32766 if (d >= 1.0e21 || d <= -1.0e21) {
DUK_INTERNAL_DECL duk_int_t duk_to_int_check_range(duk_context *ctx, duk_idx_t index, duk_int_t minval, duk_int_t maxval)
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_string(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_fixed(duk_context *ctx)

◆ duk_bi_number_prototype_to_locale_string()

DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_locale_string ( duk_context * ctx)

Definition at line 32722 of file duktape-1.5.2/src-noline/duktape.c.

32723 {
32724 radix = 10;
32725 } else {
32726 radix = (duk_small_int_t) duk_to_int_check_range(ctx, 0, 2, 36);
32727 }

◆ duk_bi_number_prototype_to_precision()

DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_precision ( duk_context * ctx)

Definition at line 32802 of file duktape-1.5.2/src-noline/duktape.c.

32806
32808 10 /*radix*/,
32809 frac_digits + 1 /*leading digit + fractions*/,
32810 n2s_flags /*flags*/);
32811 return 1;
32812
32813 use_to_string:
32814 DUK_ASSERT_TOP(ctx, 2);
32815 duk_to_string(ctx, -1);
32816 return 1;
32817}
32818
32820 /* The specification has quite awkward order of coercion and
32821 * checks for toPrecision(). The operations below are a bit
32822 * reordered, within constraints of observable side effects.
32823 */
32824
32825 duk_double_t d;
32826 duk_small_int_t prec;
32828 duk_small_uint_t n2s_flags;
32829
32830 DUK_ASSERT_TOP(ctx, 1);
32831
32833 if (duk_is_undefined(ctx, 0)) {
32834 goto use_to_string;
32835 }
32836 DUK_ASSERT_TOP(ctx, 2);
32837
32838 duk_to_int(ctx, 0); /* for side effects */
32839
32841 if (c == DUK_FP_NAN || c == DUK_FP_INFINITE) {
32842 goto use_to_string;
32843 }
32844
32845 prec = (duk_small_int_t) duk_to_int_check_range(ctx, 0, 1, 21);
32846
32847 n2s_flags = DUK_N2S_FLAG_FIXED_FORMAT |
#define DUK_N2S_FLAG_FIXED_FORMAT
DUK_INTERNAL_DECL void duk_numconv_stringify(duk_context *ctx, duk_small_int_t radix, duk_small_int_t digits, duk_small_uint_t flags)
DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_precision(duk_context *ctx)

◆ duk_bi_number_prototype_to_string()

DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_to_string ( duk_context * ctx)

Definition at line 32701 of file duktape-1.5.2/src-noline/duktape.c.

32713 {
32714 (void) duk__push_this_number_plain(ctx);
32715 return 1;
32716}
32717
32719 duk_small_int_t radix;
32720 duk_small_uint_t n2s_flags;

◆ duk_bi_number_prototype_value_of()

DUK_INTERNAL_DECL duk_ret_t duk_bi_number_prototype_value_of ( duk_context * ctx)

Definition at line 32696 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_object_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor ( duk_context * ctx)

Definition at line 32854 of file duktape-1.5.2/src-noline/duktape.c.

32856 :
32857 /* Used when precision is undefined; also used for NaN (-> "NaN"),
32858 * and +/- infinity (-> "Infinity", "-Infinity").
32859 */
32860
32861 DUK_ASSERT_TOP(ctx, 2);
32862 duk_to_string(ctx, -1);
32863 return 1;
32864}
32865/*
32866 * Object built-ins
32867 */
32868
32869/* include removed: duk_internal.h */
32870
32872 if (!duk_is_constructor_call(ctx) &&
32873 !duk_is_null_or_undefined(ctx, 0)) {
32874 duk_to_object(ctx, 0);
32875 return 1;
32876 }
32877
32878 if (duk_is_object(ctx, 0)) {
32879 return 1;
32880 }
32881
32882 /* Pointer and buffer primitive values are treated like other
32883 * primitives values which have a fully fledged object counterpart:
32884 * promote to an object value. Lightfuncs are coerced with
32885 * ToObject() even they could also be returned as is.
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor(duk_context *ctx)

◆ duk_bi_object_constructor_create()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_create ( duk_context * ctx)

Definition at line 33005 of file duktape-1.5.2/src-noline/duktape.c.

33008 :
33009 duk_set_top(ctx, 1);
33010 return ret_success;
33011
33012 fail_nonextensible:
33013 fail_loop:
33014 return DUK_RET_TYPE_ERROR;
33015}
33016
33018 /* XXX: no need for indirect call */
33020}
33021
33023 duk_tval *tv;
33025
33026 DUK_ASSERT_TOP(ctx, 2);
33027
33028 tv = duk_get_tval(ctx, 0);
33029 DUK_ASSERT(tv != NULL);
33030 if (DUK_TVAL_IS_NULL(tv)) {
33031 ;
33032 } else if (DUK_TVAL_IS_OBJECT(tv)) {
33034 DUK_ASSERT(proto != NULL);
33035 } else {
33036 return DUK_RET_TYPE_ERROR;
33037 }
33038
33042 proto);
33043
33044 if (!duk_is_undefined(ctx, 1)) {
const char * proto
Definition civetweb.c:18378
#define DUK_HOBJECT_CLASS_OBJECT
#define DUK_TVAL_IS_NULL(tv)
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_create(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_hobject_object_get_own_property_descriptor(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_get_own_property_descriptor(duk_context *ctx)

◆ duk_bi_object_constructor_define_properties()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_define_properties ( duk_context * ctx)

Definition at line 33116 of file duktape-1.5.2/src-noline/duktape.c.

33133 {
33134 duk_small_uint_t pass;
33135 duk_uint_t defprop_flags;
33136 duk_hobject *obj;
33137 duk_idx_t idx_value;
33138 duk_hobject *get;
33139 duk_hobject *set;
33140
33141 /* Lightfunc handling by ToObject() coercion. */
33142 obj = duk_require_hobject_or_lfunc_coerce(ctx, 0); /* target */
33143 DUK_ASSERT(obj != NULL);
33144
33145 duk_to_object(ctx, 1); /* properties object */
33146
33147 DUK_DDD(DUK_DDDPRINT("target=%!iT, properties=%!iT",
33148 (duk_tval *) duk_get_tval(ctx, 0),
33149 (duk_tval *) duk_get_tval(ctx, 1)));
33150
33151 /*
33152 * Two pass approach to processing the property descriptors.
33153 * On first pass validate and normalize all descriptors before
33154 * any changes are made to the target object. On second pass
33155 * make the actual modifications to the target object.
33156 *
33157 * Right now we'll just use the same normalize/validate helper
33158 * on both passes, ignoring its outputs on the first pass.
33159 */
33160
33161 for (pass = 0; pass < 2; pass++) {
33162 duk_set_top(ctx, 2); /* -> [ hobject props ] */
33163 duk_enum(ctx, 1, DUK_ENUM_OWN_PROPERTIES_ONLY /*enum_flags*/);
33164
33165 for (;;) {
33166 duk_hstring *key;
33167
33168 /* [ hobject props enum(props) ] */
33169
33170 duk_set_top(ctx, 3);
33171
33172 if (!duk_next(ctx, 2, 1 /*get_value*/)) {
33173 break;
33174 }
33175
33176 DUK_DDD(DUK_DDDPRINT("-> key=%!iT, desc=%!iT",
33177 (duk_tval *) duk_get_tval(ctx, -2),
33178 (duk_tval *) duk_get_tval(ctx, -1)));
33179
33180 /* [ hobject props enum(props) key desc ] */
33181
33183 4 /*idx_desc*/,
33184 &defprop_flags,
33185 &idx_value,
33186 &get,
33187 &set);
33188
33189 /* [ hobject props enum(props) key desc value? getter? setter? ] */
33190
33191 if (pass == 0) {
33192 continue;
33193 }
33194
33195 key = duk_get_hstring(ctx, 3);
33196 DUK_ASSERT(key != NULL);
33197
DUK_EXTERNAL void duk_enum(duk_context *ctx, duk_idx_t obj_index, duk_uint_t enum_flags)
DUK_EXTERNAL duk_bool_t duk_next(duk_context *ctx, duk_idx_t enum_index, duk_bool_t get_value)
DUK_INTERNAL_DECL void duk_hobject_prepare_property_descriptor(duk_context *ctx, duk_idx_t idx_in, duk_uint_t *out_defprop_flags, duk_idx_t *out_idx_value, duk_hobject **out_getter, duk_hobject **out_setter)
#define DUK_ENUM_OWN_PROPERTIES_ONLY

◆ duk_bi_object_constructor_define_property()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_define_property ( duk_context * ctx)

Definition at line 33046 of file duktape-1.5.2/src-noline/duktape.c.

33063 {
33064 duk_hobject *obj;
33065 duk_hstring *key;
33066 duk_hobject *get;
33067 duk_hobject *set;
33068 duk_idx_t idx_value;
33069 duk_uint_t defprop_flags;
33070
33071 DUK_ASSERT(ctx != NULL);
33072
33073 DUK_DDD(DUK_DDDPRINT("Object.defineProperty(): ctx=%p obj=%!T key=%!T desc=%!T",
33074 (void *) ctx,
33075 (duk_tval *) duk_get_tval(ctx, 0),
33076 (duk_tval *) duk_get_tval(ctx, 1),
33077 (duk_tval *) duk_get_tval(ctx, 2)));
33078
33079 /* [ obj key desc ] */
33080
33081 /* Lightfuncs are currently supported by coercing to a temporary
33082 * Function object; changes will be allowed (the coerced value is
33083 * extensible) but will be lost.
33084 */
33086 (void) duk_to_string(ctx, 1);
33087 key = duk_require_hstring(ctx, 1);
33088 (void) duk_require_hobject(ctx, 2);
33089
33090 DUK_ASSERT(obj != NULL);
33091 DUK_ASSERT(key != NULL);
33092 DUK_ASSERT(duk_get_hobject(ctx, 2) != NULL);
33093
33094 /*
33095 * Validate and convert argument property descriptor (an Ecmascript
33096 * object) into a set of defprop_flags and possibly property value,
33097 * getter, and/or setter values on the value stack.
33098 *
33099 * Lightfunc set/get values are coerced to full Functions.
33100 */
33101
33103 2 /*idx_desc*/,
33104 &defprop_flags,
33105 &idx_value,
33106 &get,
33107 &set);
33108
33109 /*
33110 * Use Object.defineProperty() helper for the actual operation.
33111 */
33112
33114 defprop_flags,
DUK_INTERNAL_DECL void duk_hobject_define_property_helper(duk_context *ctx, duk_uint_t defprop_flags, duk_hobject *obj, duk_hstring *key, duk_idx_t idx_value, duk_hobject *get, duk_hobject *set)

◆ duk_bi_object_constructor_get_own_property_descriptor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_get_own_property_descriptor ( duk_context * ctx)

Definition at line 33000 of file duktape-1.5.2/src-noline/duktape.c.

33001 {
33002 goto fail_loop;
33003 }

◆ duk_bi_object_constructor_is_extensible()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_is_extensible ( duk_context * ctx)

Definition at line 33258 of file duktape-1.5.2/src-noline/duktape.c.

33259 {
33260 duk_hobject *h;
33261 duk_bool_t is_frozen;
33262 duk_bool_t rc;
33263
33264 h = duk_require_hobject_or_lfunc(ctx, 0);
33265 if (!h) {
33266 duk_push_true(ctx); /* frozen and sealed */
33267 } else {
33268 is_frozen = duk_get_current_magic(ctx);
DUK_INTERNAL_DECL duk_hobject * duk_require_hobject_or_lfunc(duk_context *ctx, duk_idx_t index)

◆ duk_bi_object_constructor_is_sealed_frozen_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_is_sealed_frozen_shared ( duk_context * ctx)

Definition at line 33242 of file duktape-1.5.2/src-noline/duktape.c.

33243 {
33244 /* Lightfunc, always success. */
33245 return 1;
33246 }
33247 DUK_ASSERT(h != NULL);
33248
33250
33251 /* A non-extensible object cannot gain any more properties,
33252 * so this is a good time to compact.
33253 */
33255
33256 return 1;
DUK_INTERNAL_DECL void duk_hobject_compact_props(duk_hthread *thr, duk_hobject *obj)
#define DUK_HOBJECT_CLEAR_EXTENSIBLE(h)

◆ duk_bi_object_constructor_keys_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_keys_shared ( duk_context * ctx)

Definition at line 33273 of file duktape-1.5.2/src-noline/duktape.c.

33275 {
33276 duk_hobject *h;
33277
33278 h = duk_require_hobject_or_lfunc(ctx, 0);
33279 if (!h) {
33280 duk_push_false(ctx);
33281 } else {
33283 }
33284 return 1;
33285}
33286
33287/* Shared helper for Object.getOwnPropertyNames() and Object.keys().
33288 * Magic: 0=getOwnPropertyNames, 1=Object.keys.
33289 */
33291 duk_hthread *thr = (duk_hthread *) ctx;
33292 duk_hobject *obj;
33293#if defined(DUK_USE_ES6_PROXY)
33294 duk_hobject *h_proxy_target;
33295 duk_hobject *h_proxy_handler;
33296 duk_hobject *h_trap_result;
33297 duk_uarridx_t i, len, idx;
33298#endif
33299 duk_small_uint_t enum_flags;
33300
33301 DUK_ASSERT_TOP(ctx, 1);
33302 DUK_UNREF(thr);
33303
33305 DUK_ASSERT(obj != NULL);
33306 DUK_UNREF(obj);
33307
33308#if defined(DUK_USE_ES6_PROXY)
33310 obj,
33311 &h_proxy_target,
33312 &h_proxy_handler))) {
33313 goto skip_proxy;
33314 }
33315
33316 duk_push_hobject(ctx, h_proxy_handler);
33318 /* Careful with reachability here: don't pop 'obj' before pushing
33319 * proxy target.
33320 */
33321 DUK_DDD(DUK_DDDPRINT("no ownKeys trap, get keys of target instead"));
33322 duk_pop_2(ctx);
33323 duk_push_hobject(ctx, h_proxy_target);
33324 duk_replace(ctx, 0);
33325 DUK_ASSERT_TOP(ctx, 1);
33326 goto skip_proxy;
33327 }
33328
33329 /* [ obj handler trap ] */
33330 duk_insert(ctx, -2);
33331 duk_push_hobject(ctx, h_proxy_target); /* -> [ obj trap handler target ] */
33332 duk_call_method(ctx, 1 /*nargs*/); /* -> [ obj trap_result ] */
33333 h_trap_result = duk_require_hobject(ctx, -1);
33334 DUK_UNREF(h_trap_result);
33335
33336 len = (duk_uarridx_t) duk_get_length(ctx, -1);
33337 idx = 0;
33338 duk_push_array(ctx);
33339 for (i = 0; i < len; i++) {
33340 /* [ obj trap_result res_arr ] */
33341 if (duk_get_prop_index(ctx, -2, i) && duk_is_string(ctx, -1)) {
33342 /* XXX: for Object.keys() we should check enumerability of key */
33343 /* [ obj trap_result res_arr propname ] */
33344 duk_put_prop_index(ctx, -2, idx);
33345 idx++;
33346 } else {
33347 duk_pop(ctx);
33348 }
33349 }
33350
33351 /* XXX: missing trap result validation for non-configurable target keys
33352 * (must be present), for non-extensible target all target keys must be
33353 * present and no extra keys can be present.
33354 * http://www.ecma-international.org/ecma-262/6.0/#sec-proxy-object-internal-methods-and-internal-slots-ownpropertykeys
33355 */
33356
33357 /* XXX: for Object.keys() the [[OwnPropertyKeys]] result (trap result)
33358 * should be filtered so that only enumerable keys remain. Enumerability
33359 * should be checked with [[GetOwnProperty]] on the original object
33360 * (i.e., the proxy in this case). If the proxy has a getOwnPropertyDescriptor
33361 * trap, it should be triggered for every property. If the proxy doesn't have
33362 * the trap, enumerability should be checked against the target object instead.
33363 * We don't do any of this now, so Object.keys() and Object.getOwnPropertyNames()
33364 * return the same result now for proxy traps. We still do clean up the trap
33365 * result, so that Object.keys() and Object.getOwnPropertyNames() will return a
33366 * clean array of strings without gaps.
33367 */
33368 return 1;
33369
33370 skip_proxy:
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_keys_shared(duk_context *ctx)
#define DUK_HOBJECT_HAS_EXTENSIBLE(h)
DUK_INTERNAL_DECL duk_bool_t duk_hobject_proxy_check(duk_hthread *thr, duk_hobject *obj, duk_hobject **out_target, duk_hobject **out_handler)

◆ duk_bi_object_constructor_prevent_extensions()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_prevent_extensions ( duk_context * ctx)

Definition at line 33221 of file duktape-1.5.2/src-noline/duktape.c.

33222 {
33223 /* Lightfunc, always success. */
33224 return 1;
33225 }
33226
33227 is_freeze = (duk_bool_t) duk_get_current_magic(ctx);
33228 duk_hobject_object_seal_freeze_helper(thr, h, is_freeze);
33229
33230 /* Sealed and frozen objects cannot gain any more properties,
33231 * so this is a good time to compact them.
33232 */
33234
33235 return 1;
33236}
33237
33239 duk_hthread *thr = (duk_hthread *) ctx;
33240 duk_hobject *h;
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_prevent_extensions(duk_context *ctx)
DUK_INTERNAL_DECL void duk_hobject_object_seal_freeze_helper(duk_hthread *thr, duk_hobject *obj, duk_bool_t is_freeze)

◆ duk_bi_object_constructor_seal_freeze_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_constructor_seal_freeze_shared ( duk_context * ctx)

Definition at line 33199 of file duktape-1.5.2/src-noline/duktape.c.

33216 {
33217 duk_hthread *thr = (duk_hthread *) ctx;
33218 duk_hobject *h;
33219 duk_bool_t is_freeze;

◆ duk_bi_object_getprototype_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_getprototype_shared ( duk_context * ctx)

Definition at line 32892 of file duktape-1.5.2/src-noline/duktape.c.

32892 {
32893 duk_to_object(ctx, 0);
32894 return 1;
32895 }
32896
32901 return 1;
32902}
32903
32904/* Shared helper to implement Object.getPrototypeOf and the ES6
32905 * Object.prototype.__proto__ getter.
32906 *
32907 * http://www.ecma-international.org/ecma-262/6.0/index.html#sec-get-object.prototype.__proto__
32908 */
32910 duk_hthread *thr = (duk_hthread *) ctx;
32911 duk_hobject *h;
32913
32914 DUK_UNREF(thr);
32915
32916 /* magic: 0=getter call, 1=Object.getPrototypeOf */
32917 if (duk_get_current_magic(ctx) == 0) {
32919 duk_insert(ctx, 0);
32920 }
32921
32922 h = duk_require_hobject_or_lfunc(ctx, 0);
32923 /* h is NULL for lightfunc */
32924
32925 /* XXX: should the API call handle this directly, i.e. attempt
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_getprototype_shared(duk_context *ctx)

◆ duk_bi_object_prototype_has_own_property()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_has_own_property ( duk_context * ctx)

Definition at line 33418 of file duktape-1.5.2/src-noline/duktape.c.

33420 {

◆ duk_bi_object_prototype_is_prototype_of()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_is_prototype_of ( duk_context * ctx)

Definition at line 33395 of file duktape-1.5.2/src-noline/duktape.c.

33395 {
33396 DUK_ASSERT_TOP(ctx, 0);
33399 if (!duk_is_callable(ctx, 1)) {
33400 return DUK_RET_TYPE_ERROR;
33401 }
33402 duk_dup(ctx, 0); /* -> [ O toString O ] */
33403 duk_call_method(ctx, 0); /* XXX: call method tail call? */
33404 return 1;
33405}
33406
33409 return 1;
33410}
33411
33413 duk_hthread *thr = (duk_hthread *) ctx;
33414 duk_hobject *h_v;
33415 duk_hobject *h_obj;
33416
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_value_of(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_is_prototype_of(duk_context *ctx)

◆ duk_bi_object_prototype_property_is_enumerable()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_property_is_enumerable ( duk_context * ctx)

Definition at line 33422 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_object_prototype_to_locale_string()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_to_locale_string ( duk_context * ctx)

Definition at line 33378 of file duktape-1.5.2/src-noline/duktape.c.

33379 {
33380 /* Object.getOwnPropertyNames */
33381 enum_flags = DUK_ENUM_INCLUDE_NONENUMERABLE |
33384 }
33385
33386 return duk_hobject_get_enumerated_keys(ctx, enum_flags);
33387}
33388
DUK_INTERNAL_DECL duk_ret_t duk_hobject_get_enumerated_keys(duk_context *ctx, duk_small_uint_t enum_flags)
#define DUK_ENUM_NO_PROXY_BEHAVIOR
#define DUK_ENUM_INCLUDE_NONENUMERABLE

◆ duk_bi_object_prototype_to_string()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_to_string ( duk_context * ctx)

Definition at line 33372 of file duktape-1.5.2/src-noline/duktape.c.

33375 {
33376 /* Object.keys */

◆ duk_bi_object_prototype_value_of()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_value_of ( duk_context * ctx)

Definition at line 33390 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_object_setprototype_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_object_setprototype_shared ( duk_context * ctx)

Definition at line 32933 of file duktape-1.5.2/src-noline/duktape.c.

32933 {
32934 proto = DUK_HOBJECT_GET_PROTOTYPE(thr->heap, h);
32935 if (proto) {
32936 duk_push_hobject(ctx, proto);
32937 } else {
32938 duk_push_null(ctx);
32939 }
32940 }
32941 return 1;
32942}
32943
32944/* Shared helper to implement ES6 Object.setPrototypeOf and
32945 * Object.prototype.__proto__ setter.
32946 *
32947 * http://www.ecma-international.org/ecma-262/6.0/index.html#sec-get-object.prototype.__proto__
32948 * http://www.ecma-international.org/ecma-262/6.0/index.html#sec-object.setprototypeof
32949 */
32951 duk_hthread *thr = (duk_hthread *) ctx;
32952 duk_hobject *h_obj;
32953 duk_hobject *h_new_proto;
32954 duk_hobject *h_curr;
32955 duk_ret_t ret_success = 1; /* retval for success path */
32956
32957 /* Preliminaries for __proto__ and setPrototypeOf (E6 19.1.2.18 steps 1-4);
32958 * magic: 0=setter call, 1=Object.setPrototypeOf
32959 */
32960 if (duk_get_current_magic(ctx) == 0) {
32962 duk_insert(ctx, 0);
32964 return 0;
32965 }
32966
32967 /* __proto__ setter returns 'undefined' on success unlike the
32968 * setPrototypeOf() call which returns the target object.
32969 */
32970 ret_success = 0;
32971 } else {
32974 }
32975
32976 h_new_proto = duk_get_hobject(ctx, 1);
32977 /* h_new_proto may be NULL */
32978 if (duk_is_lightfunc(ctx, 0)) {
32979 if (h_new_proto == thr->builtins[DUK_BIDX_FUNCTION_PROTOTYPE]) {
32980 goto skip;
32981 }
32982 goto fail_nonextensible;
32983 }
32984 h_obj = duk_get_hobject(ctx, 0);
32985 if (!h_obj) {
32986 goto skip;
32987 }
32988 DUK_ASSERT(h_obj != NULL);
32989
32990 /* [[SetPrototypeOf]] standard behavior, E6 9.1.2 */
32991 /* TODO: implement Proxy object support here */
32992
32993 if (h_new_proto == DUK_HOBJECT_GET_PROTOTYPE(thr->heap, h_obj)) {
32994 goto skip;
32995 }
32996 if (!DUK_HOBJECT_HAS_EXTENSIBLE(h_obj)) {
32997 goto fail_nonextensible;
32998 }
DUK_EXTERNAL duk_bool_t duk_check_type_mask(duk_context *ctx, duk_idx_t index, duk_uint_t mask)
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_setprototype_shared(duk_context *ctx)
DUK_EXTERNAL duk_bool_t duk_is_lightfunc(duk_context *ctx, duk_idx_t index)
DUK_INTERNAL_DECL void duk_push_this_check_object_coercible(duk_context *ctx)
#define DUK_TYPE_MASK_OBJECT
#define duk_require_object_coercible(ctx, index)
#define duk_require_type_mask(ctx, index, mask)

◆ duk_bi_pointer_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_pointer_constructor ( duk_context * ctx)

Definition at line 33435 of file duktape-1.5.2/src-noline/duktape.c.

33435 {
33436 return duk_hobject_object_ownprop_helper(ctx, 0 /*required_desc_flags*/);
33437}
33438
33440 return duk_hobject_object_ownprop_helper(ctx, DUK_PROPDESC_FLAG_ENUMERABLE /*required_desc_flags*/);
33441}
33442/*
33443 * Pointer built-ins
33444 */
33445
33446/* include removed: duk_internal.h */
33447
33448/*
33449 * Constructor
33450 */
33451
33453 /* XXX: this behavior is quite useless now; it would be nice to be able
33454 * to create pointer values from e.g. numbers or strings. Numbers are
33455 * problematic on 64-bit platforms though. Hex encoded strings?
33456 */
33457 if (duk_get_top(ctx) == 0) {
33458 duk_push_pointer(ctx, NULL);
33459 } else {
33460 duk_to_pointer(ctx, 0);
33461 }
DUK_EXTERNAL void * duk_to_pointer(duk_context *ctx, duk_idx_t index)
DUK_INTERNAL_DECL duk_ret_t duk_bi_object_prototype_property_is_enumerable(duk_context *ctx)
DUK_INTERNAL_DECL duk_bool_t duk_hobject_object_ownprop_helper(duk_context *ctx, duk_small_uint_t required_desc_flags)
#define DUK_PROPDESC_FLAG_ENUMERABLE
DUK_INTERNAL_DECL duk_ret_t duk_bi_pointer_constructor(duk_context *ctx)

◆ duk_bi_pointer_prototype_tostring_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_pointer_prototype_tostring_shared ( duk_context * ctx)

Definition at line 33467 of file duktape-1.5.2/src-noline/duktape.c.

33484 {
33485 duk_tval *tv;
33486 duk_small_int_t to_string = duk_get_current_magic(ctx);
33487
33488 duk_push_this(ctx);
33489 tv = duk_require_tval(ctx, -1);
33490 DUK_ASSERT(tv != NULL);
33491
33492 if (DUK_TVAL_IS_POINTER(tv)) {
33493 /* nop */
33494 } else if (DUK_TVAL_IS_OBJECT(tv)) {
33496 DUK_ASSERT(h != NULL);
33497
33498 /* Must be a "pointer object", i.e. class "Pointer" */
#define DUK_TVAL_IS_POINTER(tv)
DUK_INTERNAL_DECL duk_tval * duk_require_tval(duk_context *ctx, duk_idx_t index)

◆ duk_bi_proxy_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_proxy_constructor ( duk_context * ctx)

Definition at line 33506 of file duktape-1.5.2/src-noline/duktape.c.

33508 {
33509 duk_to_string(ctx, -1);
33510 }
33511 return 1;
33512
33513 type_error:
33514 return DUK_RET_TYPE_ERROR;
33515}
33516/*
33517 * Proxy built-in (ES6)
33518 */
33519
33520/* include removed: duk_internal.h */
33521
33522#if defined(DUK_USE_ES6_PROXY)
33524 duk_hobject *h_target;
33525 duk_hobject *h_handler;
33526
33527 if (!duk_is_constructor_call(ctx)) {
33528 return DUK_RET_TYPE_ERROR;
33529 }
33530
33531 /* Reject a proxy object as the target because it would need
33532 * special handler in property lookups. (ES6 has no such restriction)
33533 */
33534 h_target = duk_require_hobject_or_lfunc_coerce(ctx, 0);
33535 DUK_ASSERT(h_target != NULL);
33536 if (DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ(h_target)) {
33537 return DUK_RET_TYPE_ERROR;
33538 }
33539
33540 /* Reject a proxy object as the handler because it would cause
33541 * potentially unbounded recursion. (ES6 has no such restriction)
33542 */
33543 h_handler = duk_require_hobject_or_lfunc_coerce(ctx, 1);
33544 DUK_ASSERT(h_handler != NULL);
33545 if (DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ(h_handler)) {
33546 return DUK_RET_TYPE_ERROR;
33547 }
33548
33549 /* XXX: the returned value is exotic in ES6, but we use a
33550 * simple object here with no prototype. Without a prototype,
33551 * [[DefaultValue]] coercion fails which is abit confusing.
33552 * No callable check/handling in the current Proxy subset.
33553 */
33558 NULL);
#define DUK_HOBJECT_HAS_EXOTIC_PROXYOBJ(h)
#define DUK_HOBJECT_FLAG_EXOTIC_PROXYOBJ
DUK_INTERNAL_DECL duk_ret_t duk_bi_proxy_constructor(duk_context *ctx)

◆ duk_bi_regexp_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_regexp_constructor ( duk_context * ctx)

Definition at line 33584 of file duktape-1.5.2/src-noline/duktape.c.

33590 {
33591 duk_hobject *h;
33592
33593 duk_push_this(ctx);
33595 DUK_ASSERT(h != NULL);
33596 DUK_UNREF(h);
33597 duk_insert(ctx, 0); /* prepend regexp to valstack 0 index */
33598}
33599
33600/* XXX: much to improve (code size) */
33602 duk_hthread *thr = (duk_hthread *) ctx;
33603 duk_hobject *h_pattern;
33604
33605 DUK_ASSERT_TOP(ctx, 2);
33606 h_pattern = duk_get_hobject(ctx, 0);
33607
33608 if (!duk_is_constructor_call(ctx) &&
33609 h_pattern != NULL &&
33611 duk_is_undefined(ctx, 1)) {
33612 /* Called as a function, pattern has [[Class]] "RegExp" and
33613 * flags is undefined -> return object as is.
33614 */
33615 duk_dup(ctx, 0);
33616 return 1;
33617 }
33618
33619 /* Else functionality is identical for function call and constructor
33620 * call.
33621 */
33622
33623 if (h_pattern != NULL &&
33625 if (duk_is_undefined(ctx, 1)) {
33626 duk_bool_t flag_g, flag_i, flag_m;
33631
33632 duk_push_sprintf(ctx, "%s%s%s",
33633 (const char *) (flag_g ? "g" : ""),
33634 (const char *) (flag_i ? "i" : ""),
33635 (const char *) (flag_m ? "m" : ""));
33636
33637 /* [ ... pattern flags ] */
33638 } else {
33639 return DUK_RET_TYPE_ERROR;
33640 }
33641 } else {
33642 if (duk_is_undefined(ctx, 0)) {
33643 duk_push_string(ctx, "");
33644 } else {
33645 duk_dup(ctx, 0);
33646 duk_to_string(ctx, -1);
33647 }
33648 if (duk_is_undefined(ctx, 1)) {
33649 duk_push_string(ctx, "");
33650 } else {
33651 duk_dup(ctx, 1);
33652 duk_to_string(ctx, -1);
33653 }
33654
33655 /* [ ... pattern flags ] */
#define DUK_HOBJECT_CLASS_REGEXP
DUK_INTERNAL_DECL duk_ret_t duk_bi_regexp_constructor(duk_context *ctx)
DUK_INTERNAL_DECL duk_hobject * duk_require_hobject_with_class(duk_context *ctx, duk_idx_t index, duk_small_uint_t classnum)
DUK_INTERNAL_DECL duk_bool_t duk_get_prop_stridx_boolean(duk_context *ctx, duk_idx_t obj_index, duk_small_int_t stridx, duk_bool_t *out_has_prop)
#define DUK_STRIDX_IGNORE_CASE

◆ duk_bi_regexp_prototype_exec()

DUK_INTERNAL_DECL duk_ret_t duk_bi_regexp_prototype_exec ( duk_context * ctx)

Definition at line 33657 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_regexp_prototype_test()

DUK_INTERNAL_DECL duk_ret_t duk_bi_regexp_prototype_test ( duk_context * ctx)

Definition at line 33669 of file duktape-1.5.2/src-noline/duktape.c.

33674 {
33676
33677 /* [ regexp input ] */
33678
33680
33681 /* [ result ] */
33682
DUK_INTERNAL_DECL void duk_regexp_match(duk_hthread *thr)
DUK_LOCAL void duk__get_this_regexp(duk_context *ctx)

◆ duk_bi_regexp_prototype_to_string()

DUK_INTERNAL_DECL duk_ret_t duk_bi_regexp_prototype_to_string ( duk_context * ctx)

Definition at line 33684 of file duktape-1.5.2/src-noline/duktape.c.

33686 {
33688
33689 /* [ regexp input ] */
33690
33691 /* result object is created and discarded; wasteful but saves code space */
33693
33694 /* [ result ] */
33695
33696 duk_push_boolean(ctx, (duk_is_null(ctx, -1) ? 0 : 1));
33697
33698 return 1;
33699}
33700
33702 duk_hstring *h_bc;
33703 duk_small_int_t re_flags;
33704
33705#if 0
33706 /* A little tricky string approach to provide the flags string.
33707 * This depends on the specific flag values in duk_regexp.h,
33708 * which needs to be asserted for. In practice this doesn't
33709 * produce more compact code than the easier approach in use.
33710 */
33711
33712 const char *flag_strings = "gim\0gi\0gm\0g\0";
33713 duk_uint8_t flag_offsets[8] = {
33714 (duk_uint8_t) 3, /* flags: "" */
33715 (duk_uint8_t) 10, /* flags: "g" */
33716 (duk_uint8_t) 5, /* flags: "i" */
33717 (duk_uint8_t) 4, /* flags: "gi" */
33718 (duk_uint8_t) 2, /* flags: "m" */
33719 (duk_uint8_t) 7, /* flags: "gm" */
33720 (duk_uint8_t) 1, /* flags: "im" */
33721 (duk_uint8_t) 0, /* flags: "gim" */
33722 };
33726#endif
33727
33729
33730 /* [ regexp ] */
33731
33734 h_bc = duk_get_hstring(ctx, -1);
33735 DUK_ASSERT(h_bc != NULL);
33738 DUK_ASSERT(DUK_HSTRING_GET_DATA(h_bc)[0] < 0x80);
33739 re_flags = (duk_small_int_t) DUK_HSTRING_GET_DATA(h_bc)[0];
33740
33741 /* [ regexp source bytecode ] */
33742
33743#if 1
33744 /* This is a cleaner approach and also produces smaller code than
33745 * the other alternative. Use duk_require_string() for format
33746 * safety (although the source property should always exist).
33747 */
33748 duk_push_sprintf(ctx, "/%s/%s%s%s",
33749 (const char *) duk_require_string(ctx, -2), /* require to be safe */
#define DUK_RE_FLAG_MULTILINE
#define DUK_HSTRING_GET_CHARLEN(x)
DUK_EXTERNAL duk_bool_t duk_is_null(duk_context *ctx, duk_idx_t index)
DUK_INTERNAL_DECL duk_ret_t duk_bi_regexp_prototype_to_string(duk_context *ctx)
#define DUK_RE_FLAG_IGNORE_CASE
#define DUK_STRIDX_INT_BYTECODE

◆ duk_bi_string_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_constructor ( duk_context * ctx)

Definition at line 33793 of file duktape-1.5.2/src-noline/duktape.c.

33810 {
33811 /* String constructor needs to distinguish between an argument not given at all
33812 * vs. given as 'undefined'. We're a vararg function to handle this properly.
33813 */
33814
33815 if (duk_get_top(ctx) == 0) {
33817 } else {
33818 duk_to_string(ctx, 0);
33819 }
33820 DUK_ASSERT(duk_is_string(ctx, 0));

◆ duk_bi_string_constructor_from_char_code()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_constructor_from_char_code ( duk_context * ctx)

Definition at line 33822 of file duktape-1.5.2/src-noline/duktape.c.

33823 {
33829
33830 /* String object internal value is immutable */
33831 duk_dup(ctx, 0);
33833 }
33834 /* Note: unbalanced stack on purpose */
33835
33836 return 1;
33837}
33838
33840 duk_hthread *thr = (duk_hthread *) ctx;
33841 duk_bufwriter_ctx bw_alloc;
33843 duk_idx_t i, n;
33845
33846 /* XXX: It would be nice to build the string directly but ToUint16()
33847 * coercion is needed so a generic helper would not be very
33848 * helpful (perhaps coerce the value stack first here and then
33849 * build a string from a duk_tval number sequence in one go?).
33850 */
33851
33852 n = duk_get_top(ctx);
33853
33854 bw = &bw_alloc;
33855 DUK_BW_INIT_PUSHBUF(thr, bw, n); /* initial estimate for ASCII only codepoints */
33856
33857 for (i = 0; i < n; i++) {
33858 /* XXX: could improve bufwriter handling to write multiple codepoints
33859 * with one ensure call but the relative benefit would be quite small.
33860 */
33861
33862#if defined(DUK_USE_NONSTD_STRING_FROMCHARCODE_32BIT)
33863 /* ToUint16() coercion is mandatory in the E5.1 specification, but
#define DUK_BIDX_STRING_PROTOTYPE
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_constructor_from_char_code(duk_context *ctx)
#define DUK_HOBJECT_FLAG_EXOTIC_STRINGOBJ
#define DUK_BW_INIT_PUSHBUF(thr, bw_ctx, sz)
#define DUK_HOBJECT_CLASS_STRING

◆ duk_bi_string_prototype_caseconv_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_caseconv_shared ( duk_context * ctx)

Definition at line 34074 of file duktape-1.5.2/src-noline/duktape.c.

34077 {
34078 end_pos = start_pos;
34079 }
34080
34081 DUK_ASSERT(end_pos >= start_pos);

◆ duk_bi_string_prototype_char_at()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_char_at ( duk_context * ctx)

Definition at line 33906 of file duktape-1.5.2/src-noline/duktape.c.

33909 {
33910 goto type_error;
33911 }
33912
33913 /* never here, but fall through */
33914
33915 type_error:

◆ duk_bi_string_prototype_char_code_at()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_char_code_at ( duk_context * ctx)

Definition at line 33917 of file duktape-1.5.2/src-noline/duktape.c.

33923 {
33924 duk_int_t pos;
33925
33926 /* XXX: faster implementation */
33927
33929 pos = duk_to_int(ctx, 0);
33930 duk_substring(ctx, -1, pos, pos + 1);
33931 return 1;
33932}
33933
33935 duk_hthread *thr = (duk_hthread *) ctx;
33936 duk_int_t pos;
33937 duk_hstring *h;
33938 duk_bool_t clamped;
33939
33940 /* XXX: faster implementation */
33941
33942 DUK_DDD(DUK_DDDPRINT("arg=%!T", (duk_tval *) duk_get_tval(ctx, 0)));
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_char_code_at(duk_context *ctx)
DUK_INTERNAL_DECL duk_hstring * duk_push_this_coercible_to_string(duk_context *ctx)
DUK_EXTERNAL void duk_substring(duk_context *ctx, duk_idx_t index, duk_size_t start_offset, duk_size_t end_offset)

◆ duk_bi_string_prototype_concat()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_concat ( duk_context * ctx)

Definition at line 35015 of file duktape-1.5.2/src-noline/duktape.c.

35019 {
35020 duk_push_null(ctx);
35021 }

◆ duk_bi_string_prototype_indexof_shared()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_indexof_shared ( duk_context * ctx)

Definition at line 34087 of file duktape-1.5.2/src-noline/duktape.c.

34091 {
34092 duk_hthread *thr = (duk_hthread *) ctx;
34093 duk_small_int_t uppercase = duk_get_current_magic(ctx);
34094
34097 return 1;
34098}
34099
34100/*
34101 * indexOf() and lastIndexOf()
34102 */
34103
34105 duk_hthread *thr = (duk_hthread *) ctx;
34106 duk_hstring *h_this;
34107 duk_hstring *h_search;
34108 duk_int_t clen_this;
34109 duk_int_t cpos;
34110 duk_int_t bpos;
34111 const duk_uint8_t *p_start, *p_end, *p;
34112 const duk_uint8_t *q_start;
34113 duk_int_t q_blen;
34114 duk_uint8_t firstbyte;
34115 duk_uint8_t t;
34116 duk_small_int_t is_lastindexof = duk_get_current_magic(ctx); /* 0=indexOf, 1=lastIndexOf */
34117
34119 DUK_ASSERT(h_this != NULL);
34120 clen_this = (duk_int_t) DUK_HSTRING_GET_CHARLEN(h_this);
34121
34122 h_search = duk_to_hstring(ctx, 0);
34123 DUK_ASSERT(h_search != NULL);
34124 q_start = DUK_HSTRING_GET_DATA(h_search);
34125 q_blen = (duk_int_t) DUK_HSTRING_GET_BYTELEN(h_search);
34126
34127 duk_to_number(ctx, 1);
34128 if (duk_is_nan(ctx, 1) && is_lastindexof) {
34129 /* indexOf: NaN should cause pos to be zero.
34130 * lastIndexOf: NaN should cause pos to be +Infinity
34131 * (and later be clamped to len).
34132 */
34133 cpos = clen_this;
34134 } else {
34135 cpos = duk_to_int_clamped(ctx, 1, 0, clen_this);
34136 }
34137
34138 /* Empty searchstring always matches; cpos must be clamped here.
34139 * (If q_blen were < 0 due to clamped coercion, it would also be
34140 * caught here.)
34141 */
34142 if (q_blen <= 0) {
34143 duk_push_int(ctx, cpos);
34144 return 1;
34145 }
34146 DUK_ASSERT(q_blen > 0);
34147
34148 bpos = (duk_int_t) duk_heap_strcache_offset_char2byte(thr, h_this, (duk_uint32_t) cpos);
34149
34150 p_start = DUK_HSTRING_GET_DATA(h_this);
34151 p_end = p_start + DUK_HSTRING_GET_BYTELEN(h_this);
34152 p = p_start + bpos;
34153
34154 /* This loop is optimized for size. For speed, there should be
34155 * two separate loops, and we should ensure that memcmp() can be
34156 * used without an extra "will searchstring fit" check. Doing
34157 * the preconditioning for 'p' and 'p_end' is easy but cpos
34158 * must be updated if 'p' is wound back (backward scanning).
34159 */
34160
34161 firstbyte = q_start[0]; /* leading byte of match string */
34162 while (p <= p_end && p >= p_start) {
34163 t = *p;
34164
34165 /* For Ecmascript strings, this check can only match for
34166 * initial UTF-8 bytes (not continuation bytes). For other
34167 * strings all bets are off.
34168 */
34169
34170 if ((t == firstbyte) && ((duk_size_t) (p_end - p) >= (duk_size_t) q_blen)) {
34171 DUK_ASSERT(q_blen > 0); /* no issues with memcmp() zero size, even if broken */
34172 if (DUK_MEMCMP((const void *) p, (const void *) q_start, (size_t) q_blen) == 0) {
34173 duk_push_int(ctx, cpos);
34174 return 1;
34175 }
34176 }
34177
34178 /* track cpos while scanning */
34179 if (is_lastindexof) {
34180 /* when going backwards, we decrement cpos 'early';
34181 * 'p' may point to a continuation byte of the char
34182 * at offset 'cpos', but that's OK because we'll
34183 * backtrack all the way to the initial byte.
DUK_INTERNAL_DECL duk_hstring * duk_to_hstring(duk_context *ctx, duk_idx_t index)
DUK_INTERNAL_DECL duk_uint_fast32_t duk_heap_strcache_offset_char2byte(duk_hthread *thr, duk_hstring *h, duk_uint_fast32_t char_offset)
DUK_EXTERNAL duk_bool_t duk_is_nan(duk_context *ctx, duk_idx_t index)
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_indexof_shared(duk_context *ctx)
DUK_INTERNAL_DECL void duk_unicode_case_convert_string(duk_hthread *thr, duk_bool_t uppercase)

◆ duk_bi_string_prototype_locale_compare()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_locale_compare ( duk_context * ctx)

Definition at line 35031 of file duktape-1.5.2/src-noline/duktape.c.

35032 {
35033 /* duk_concat() coerces arguments with ToString() in correct order */
35035 duk_insert(ctx, 0); /* this is relatively expensive */
35036 duk_concat(ctx, duk_get_top(ctx));
35037 return 1;
35038}
35039
35041 DUK_ASSERT_TOP(ctx, 0);
35043 duk_trim(ctx, 0);
35044 DUK_ASSERT_TOP(ctx, 1);
35045 return 1;
35046}
35047
35049 duk_hstring *h1;
35050 duk_hstring *h2;
35051 duk_size_t h1_len, h2_len, prefix_len;
35052 duk_small_int_t ret = 0;
35053 duk_small_int_t rc;
35054
35055 /* The current implementation of localeCompare() is simply a codepoint
35056 * by codepoint comparison, implemented with a simple string compare
35057 * because UTF-8 should preserve codepoint ordering (assuming valid
35058 * shortest UTF-8 encoding).
35059 *
35060 * The specification requires that the return value must be related
35061 * to the sort order: e.g. negative means that 'this' comes before
35062 * 'that' in sort order. We assume an ascending sort order.
35063 */
35064
35065 /* XXX: could share code with duk_js_ops.c, duk_js_compare_helper */
35066
35068 DUK_ASSERT(h1 != NULL);
35069
35070 h2 = duk_to_hstring(ctx, 0);
35071 DUK_ASSERT(h2 != NULL);
35072
35073 h1_len = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h1);
35074 h2_len = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h2);
35075 prefix_len = (h1_len <= h2_len ? h1_len : h2_len);
35076
35077 /* Zero size compare not an issue with DUK_MEMCMP. */
35078 rc = (duk_small_int_t) DUK_MEMCMP((const void *) DUK_HSTRING_GET_DATA(h1),
35079 (const void *) DUK_HSTRING_GET_DATA(h2),
35080 (size_t) prefix_len);
35081
35082 if (rc < 0) {
35083 ret = -1;
35084 goto done;
35085 } else if (rc > 0) {
35086 ret = 1;
35087 goto done;
DUK_EXTERNAL void duk_trim(duk_context *ctx, duk_idx_t index)
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_trim(duk_context *ctx)
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_locale_compare(duk_context *ctx)

◆ duk_bi_string_prototype_match()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_match ( duk_context * ctx)

Definition at line 34937 of file duktape-1.5.2/src-noline/duktape.c.

34937 {
34938 duk_push_int(ctx, -1);
34939 return 1;
34940 }
34941
34943 DUK_ASSERT(duk_is_number(ctx, -1));
34944 return 1;
34945}
34946#else /* DUK_USE_REGEXP_SUPPORT */
34948 DUK_UNREF(ctx);
34950}
34951#endif /* DUK_USE_REGEXP_SUPPORT */
34952
34953#ifdef DUK_USE_REGEXP_SUPPORT
34955 duk_hthread *thr = (duk_hthread *) ctx;
34956 duk_bool_t global;
34957 duk_int_t prev_last_index;
34958 duk_int_t this_index;
34959 duk_int_t arr_idx;
34960
34961 DUK_ASSERT_TOP(ctx, 1);
34963 duk__to_regexp_helper(ctx, 0 /*index*/, 0 /*force_new*/);
34965 DUK_ASSERT_TOP(ctx, 2);
34966
34967 /* stack[0] = regexp
34968 * stack[1] = string
34969 */
34970
34971 if (!global) {
34972 duk_regexp_match(thr); /* -> [ res_obj ] */
34973 return 1; /* return 'res_obj' */
34974 }
34975
34976 /* Global case is more complex. */
34977
34978 /* [ regexp string ] */
34979
34980 duk_push_int(ctx, 0);
34982 duk_push_array(ctx);
34983
34984 /* [ regexp string res_arr ] */
34985
34986 prev_last_index = 0;
34987 arr_idx = 0;
34988
34989 for (;;) {
34990 DUK_ASSERT_TOP(ctx, 3);
34991
34992 duk_dup(ctx, 0);
34993 duk_dup(ctx, 1);
34994 duk_regexp_match(thr); /* -> [ ... regexp string ] -> [ ... res_obj ] */
34995
34996 if (!duk_is_object(ctx, -1)) {
34997 duk_pop(ctx);
34998 break;
34999 }
35000
35002 DUK_ASSERT(duk_is_number(ctx, -1));
35003 this_index = duk_get_int(ctx, -1);
35004 duk_pop(ctx);
35005
35006 if (this_index == prev_last_index) {
35007 this_index++;
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_search(duk_context *ctx)
DUK_LOCAL void duk__to_regexp_helper(duk_context *ctx, duk_idx_t index, duk_bool_t force_new)
#define DUK_STRIDX_LAST_INDEX
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_match(duk_context *ctx)

◆ duk_bi_string_prototype_replace()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_replace ( duk_context * ctx)

Definition at line 34200 of file duktape-1.5.2/src-noline/duktape.c.

34217 {
34218 duk_hthread *thr = (duk_hthread *) ctx;
34219 duk_hstring *h_input;
34220 duk_hstring *h_match;
34221 duk_hstring *h_search;
34222 duk_hobject *h_re;
34223 duk_bufwriter_ctx bw_alloc;
34225#ifdef DUK_USE_REGEXP_SUPPORT
34226 duk_bool_t is_regexp;
34227 duk_bool_t is_global;
34228#endif
34229 duk_bool_t is_repl_func;
34230 duk_uint32_t match_start_coff, match_start_boff;
34231#ifdef DUK_USE_REGEXP_SUPPORT
34232 duk_int_t match_caps;
34233#endif
34234 duk_uint32_t prev_match_end_boff;
34235 const duk_uint8_t *r_start, *r_end, *r; /* repl string scan */
34236 duk_size_t tmp_sz;
34237
34238 DUK_ASSERT_TOP(ctx, 2);
34239 h_input = duk_push_this_coercible_to_string(ctx);
34240 DUK_ASSERT(h_input != NULL);
34241
34242 bw = &bw_alloc;
34243 DUK_BW_INIT_PUSHBUF(thr, bw, DUK_HSTRING_GET_BYTELEN(h_input)); /* input size is good output starting point */
34244
34245 DUK_ASSERT_TOP(ctx, 4);
34246
34247 /* stack[0] = search value
34248 * stack[1] = replace value
34249 * stack[2] = input string
34250 * stack[3] = result buffer
34251 */
34252
34254 if (h_re) {
34255#ifdef DUK_USE_REGEXP_SUPPORT
34256 is_regexp = 1;
34258
34259 if (is_global) {
34260 /* start match from beginning */
34261 duk_push_int(ctx, 0);
34263 }
34264#else /* DUK_USE_REGEXP_SUPPORT */
34266#endif /* DUK_USE_REGEXP_SUPPORT */
34267 } else {
34268 duk_to_string(ctx, 0);
34269#ifdef DUK_USE_REGEXP_SUPPORT
34270 is_regexp = 0;
34271 is_global = 0;
34272#endif
34273 }
34274
34275 if (duk_is_function(ctx, 1)) {
34276 is_repl_func = 1;
34277 r_start = NULL;
34278 r_end = NULL;
34279 } else {
34280 duk_hstring *h_repl;
34281
34282 is_repl_func = 0;
34283 h_repl = duk_to_hstring(ctx, 1);
34284 DUK_ASSERT(h_repl != NULL);
34285 r_start = DUK_HSTRING_GET_DATA(h_repl);
34286 r_end = r_start + DUK_HSTRING_GET_BYTELEN(h_repl);
34287 }
34288
34289 prev_match_end_boff = 0;
34290
34291 for (;;) {
34292 /*
34293 * If matching with a regexp:
34294 * - non-global RegExp: lastIndex not touched on a match, zeroed
34295 * on a non-match
34296 * - global RegExp: on match, lastIndex will be updated by regexp
34297 * executor to point to next char after the matching part (so that
34298 * characters in the matching part are not matched again)
34299 *
34300 * If matching with a string:
34301 * - always non-global match, find first occurrence
34302 *
34303 * We need:
34304 * - The character offset of start-of-match for the replacer function
34305 * - The byte offsets for start-of-match and end-of-match to implement
34306 * the replacement values $&, $`, and $', and to copy non-matching
34307 * input string portions (including header and trailer) verbatim.
34308 *
34309 * NOTE: the E5.1 specification is a bit vague how the RegExp should
34310 * behave in the replacement process; e.g. is matching done first for
34311 * all matches (in the global RegExp case) before any replacer calls
34312 * are made? See: test-bi-string-proto-replace.js for discussion.
34313 */
34314
34315 DUK_ASSERT_TOP(ctx, 4);
34316
34317#ifdef DUK_USE_REGEXP_SUPPORT
34318 if (is_regexp) {
34319 duk_dup(ctx, 0);
34320 duk_dup(ctx, 2);
34321 duk_regexp_match(thr); /* [ ... regexp input ] -> [ res_obj ] */
34322 if (!duk_is_object(ctx, -1)) {
34323 duk_pop(ctx);
34324 break;
34325 }
34326
34328 DUK_ASSERT(duk_is_number(ctx, -1));
34329 match_start_coff = duk_get_int(ctx, -1);
34330 duk_pop(ctx);
34331
34332 duk_get_prop_index(ctx, -1, 0);
34333 DUK_ASSERT(duk_is_string(ctx, -1));
34334 h_match = duk_get_hstring(ctx, -1);
34335 DUK_ASSERT(h_match != NULL);
34336 duk_pop(ctx); /* h_match is borrowed, remains reachable through match_obj */
34337
34338 if (DUK_HSTRING_GET_BYTELEN(h_match) == 0) {
34339 /* This should be equivalent to match() algorithm step 8.f.iii.2:
34340 * detect an empty match and allow it, but don't allow it twice.
34341 */
34342 duk_uint32_t last_index;
34343
34345 last_index = (duk_uint32_t) duk_get_uint(ctx, -1);
34346 DUK_DDD(DUK_DDDPRINT("empty match, bump lastIndex: %ld -> %ld",
34347 (long) last_index, (long) (last_index + 1)));
34348 duk_pop(ctx);
34349 duk_push_int(ctx, last_index + 1);
34351 }
34352
34353 DUK_ASSERT(duk_get_length(ctx, -1) <= DUK_INT_MAX); /* string limits */
34354 match_caps = (duk_int_t) duk_get_length(ctx, -1);
34355 } else {
34356#else /* DUK_USE_REGEXP_SUPPORT */
34357 { /* unconditionally */
34358#endif /* DUK_USE_REGEXP_SUPPORT */
34359 const duk_uint8_t *p_start, *p_end, *p; /* input string scan */
34360 const duk_uint8_t *q_start; /* match string */
34361 duk_size_t q_blen;
34362
34363#ifdef DUK_USE_REGEXP_SUPPORT
34364 DUK_ASSERT(!is_global); /* single match always */
34365#endif
34366
34367 p_start = DUK_HSTRING_GET_DATA(h_input);
34368 p_end = p_start + DUK_HSTRING_GET_BYTELEN(h_input);
34369 p = p_start;
34370
34371 h_search = duk_get_hstring(ctx, 0);
34372 DUK_ASSERT(h_search != NULL);
34373 q_start = DUK_HSTRING_GET_DATA(h_search);
34374 q_blen = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h_search);
34375
34376 p_end -= q_blen; /* ensure full memcmp() fits in while */
34377
34378 match_start_coff = 0;
34379
34380 while (p <= p_end) {
34381 DUK_ASSERT(p + q_blen <= DUK_HSTRING_GET_DATA(h_input) + DUK_HSTRING_GET_BYTELEN(h_input));
34382 if (DUK_MEMCMP((const void *) p, (const void *) q_start, (size_t) q_blen) == 0) {
34383 duk_dup(ctx, 0);
34384 h_match = duk_get_hstring(ctx, -1);
34385 DUK_ASSERT(h_match != NULL);
34386#ifdef DUK_USE_REGEXP_SUPPORT
34387 match_caps = 0;
34388#endif
34389 goto found;
34390 }
34391
34392 /* track utf-8 non-continuation bytes */
34393 if ((p[0] & 0xc0) != 0x80) {
34394 match_start_coff++;
34395 }
34396 p++;
34397 }
34398
34399 /* not found */
34400 break;
34401 }
34402 found:
34403
34404 /* stack[0] = search value
34405 * stack[1] = replace value
34406 * stack[2] = input string
34407 * stack[3] = result buffer
34408 * stack[4] = regexp match OR match string
34409 */
34410
34411 match_start_boff = duk_heap_strcache_offset_char2byte(thr, h_input, match_start_coff);
34412
34413 tmp_sz = (duk_size_t) (match_start_boff - prev_match_end_boff);
34414 DUK_BW_WRITE_ENSURE_BYTES(thr, bw, DUK_HSTRING_GET_DATA(h_input) + prev_match_end_boff, tmp_sz);
34415
34416 prev_match_end_boff = match_start_boff + DUK_HSTRING_GET_BYTELEN(h_match);
34417
34418 if (is_repl_func) {
34419 duk_idx_t idx_args;
34420 duk_hstring *h_repl;
34421
34422 /* regexp res_obj is at index 4 */
34423
34424 duk_dup(ctx, 1);
34425 idx_args = duk_get_top(ctx);
34426
34427#ifdef DUK_USE_REGEXP_SUPPORT
34428 if (is_regexp) {
34429 duk_int_t idx;
34430 duk_require_stack(ctx, match_caps + 2);
34431 for (idx = 0; idx < match_caps; idx++) {
34432 /* match followed by capture(s) */
34433 duk_get_prop_index(ctx, 4, idx);
34434 }
34435 } else {
34436#else /* DUK_USE_REGEXP_SUPPORT */
34437 { /* unconditionally */
34438#endif /* DUK_USE_REGEXP_SUPPORT */
34439 /* match == search string, by definition */
34440 duk_dup(ctx, 0);
34441 }
34442 duk_push_int(ctx, match_start_coff);
34443 duk_dup(ctx, 2);
34444
34445 /* [ ... replacer match [captures] match_char_offset input ] */
34446
34447 duk_call(ctx, duk_get_top(ctx) - idx_args);
34448 h_repl = duk_to_hstring(ctx, -1); /* -> [ ... repl_value ] */
34449 DUK_ASSERT(h_repl != NULL);
34450
34451 DUK_BW_WRITE_ENSURE_HSTRING(thr, bw, h_repl);
34452
34453 duk_pop(ctx); /* repl_value */
34454 } else {
34455 r = r_start;
34456
34457 while (r < r_end) {
34458 duk_int_t ch1;
34459 duk_int_t ch2;
34460#ifdef DUK_USE_REGEXP_SUPPORT
34461 duk_int_t ch3;
34462#endif
34464
34465 ch1 = *r++;
34466 if (ch1 != DUK_ASC_DOLLAR) {
34467 goto repl_write;
34468 }
34469 left = r_end - r;
34470
34471 if (left <= 0) {
34472 goto repl_write;
34473 }
34474
34475 ch2 = r[0];
34476 switch ((int) ch2) {
34477 case DUK_ASC_DOLLAR: {
34478 ch1 = (1 << 8) + DUK_ASC_DOLLAR;
34479 goto repl_write;
34480 }
34481 case DUK_ASC_AMP: {
34482 DUK_BW_WRITE_ENSURE_HSTRING(thr, bw, h_match);
34483 r++;
34484 continue;
34485 }
34486 case DUK_ASC_GRAVE: {
34487 tmp_sz = (duk_size_t) match_start_boff;
34488 DUK_BW_WRITE_ENSURE_BYTES(thr, bw, DUK_HSTRING_GET_DATA(h_input), tmp_sz);
34489 r++;
34490 continue;
34491 }
34492 case DUK_ASC_SINGLEQUOTE: {
34493 duk_uint32_t match_end_boff;
34494
34495 /* Use match charlen instead of bytelen, just in case the input and
34496 * match codepoint encodings would have different lengths.
34497 */
34498 match_end_boff = duk_heap_strcache_offset_char2byte(thr,
34499 h_input,
34500 match_start_coff + DUK_HSTRING_GET_CHARLEN(h_match));
34501
34502 tmp_sz = (duk_size_t) (DUK_HSTRING_GET_BYTELEN(h_input) - match_end_boff);
34503 DUK_BW_WRITE_ENSURE_BYTES(thr, bw, DUK_HSTRING_GET_DATA(h_input) + match_end_boff, tmp_sz);
34504 r++;
34505 continue;
34506 }
34507 default: {
34508#ifdef DUK_USE_REGEXP_SUPPORT
34509 duk_int_t capnum, captmp, capadv;
34510 /* XXX: optional check, match_caps is zero if no regexp,
34511 * so dollar will be interpreted literally anyway.
34512 */
34513
34514 if (!is_regexp) {
34515 goto repl_write;
34516 }
34517
34518 if (!(ch2 >= DUK_ASC_0 && ch2 <= DUK_ASC_9)) {
34519 goto repl_write;
34520 }
34521 capnum = ch2 - DUK_ASC_0;
34522 capadv = 1;
34523
34524 if (left >= 2) {
34525 ch3 = r[1];
34526 if (ch3 >= DUK_ASC_0 && ch3 <= DUK_ASC_9) {
34527 captmp = capnum * 10 + (ch3 - DUK_ASC_0);
34528 if (captmp < match_caps) {
34529 capnum = captmp;
34530 capadv = 2;
34531 }
34532 }
34533 }
34534
34535 if (capnum > 0 && capnum < match_caps) {
34536 DUK_ASSERT(is_regexp != 0); /* match_caps == 0 without regexps */
34537
34538 /* regexp res_obj is at offset 4 */
34539 duk_get_prop_index(ctx, 4, (duk_uarridx_t) capnum);
34540 if (duk_is_string(ctx, -1)) {
34541 duk_hstring *h_tmp_str;
34542
34543 h_tmp_str = duk_get_hstring(ctx, -1);
34544 DUK_ASSERT(h_tmp_str != NULL);
34545
34546 DUK_BW_WRITE_ENSURE_HSTRING(thr, bw, h_tmp_str);
34547 } else {
34548 /* undefined -> skip (replaced with empty) */
34549 }
34550 duk_pop(ctx);
34551 r += capadv;
34552 continue;
34553 } else {
34554 goto repl_write;
34555 }
34556#else /* DUK_USE_REGEXP_SUPPORT */
34557 goto repl_write; /* unconditionally */
34558#endif /* DUK_USE_REGEXP_SUPPORT */
34559 } /* default case */
34560 } /* switch (ch2) */
34561
34562 repl_write:
34563 /* ch1 = (r_increment << 8) + byte */
34564
34565 DUK_BW_WRITE_ENSURE_U8(thr, bw, (duk_uint8_t) (ch1 & 0xff));
34566 r += ch1 >> 8;
34567 } /* while repl */
34568 } /* if (is_repl_func) */
34569
34570 duk_pop(ctx); /* pop regexp res_obj or match string */
34571
34572#ifdef DUK_USE_REGEXP_SUPPORT
#define DUK_BW_WRITE_ENSURE_U8(thr, bw_ctx, val)
DUK_EXTERNAL duk_bool_t duk_is_function(duk_context *ctx, duk_idx_t index)
#define DUK_BW_WRITE_ENSURE_HSTRING(thr, bw_ctx, val)
DUK_EXTERNAL duk_uint_t duk_get_uint(duk_context *ctx, duk_idx_t index)
DUK_EXTERNAL void duk_call(duk_context *ctx, duk_idx_t nargs)
#define DUK_BW_WRITE_ENSURE_BYTES(thr, bw_ctx, valptr, valsz)
lu_byte left

◆ duk_bi_string_prototype_search()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_search ( duk_context * ctx)

Definition at line 34891 of file duktape-1.5.2/src-noline/duktape.c.

34894 {
34895 goto do_new;
34896 }
34897 return;
34898
34899 do_new:
34901 duk_dup(ctx, index);
34902 duk_new(ctx, 1); /* [ ... RegExp val ] -> [ ... res ] */
34903 duk_replace(ctx, index);
34904}
34905#endif /* DUK_USE_REGEXP_SUPPORT */
34906
34907#ifdef DUK_USE_REGEXP_SUPPORT
34909 duk_hthread *thr = (duk_hthread *) ctx;
34910
34911 /* Easiest way to implement the search required by the specification
34912 * is to do a RegExp test() with lastIndex forced to zero. To avoid
34913 * side effects on the argument, "clone" the RegExp if a RegExp was
34914 * given as input.
34915 *
34916 * The global flag of the RegExp should be ignored; setting lastIndex
34917 * to zero (which happens when "cloning" the RegExp) should have an
34918 * equivalent effect.
34919 */
34920
34921 DUK_ASSERT_TOP(ctx, 1);
34922 (void) duk_push_this_coercible_to_string(ctx); /* at index 1 */
34923 duk__to_regexp_helper(ctx, 0 /*index*/, 1 /*force_new*/);
34924
34925 /* stack[0] = regexp
34926 * stack[1] = string
34927 */
34928
DUK_EXTERNAL void duk_new(duk_context *ctx, duk_idx_t nargs)
#define DUK_BIDX_REGEXP_CONSTRUCTOR

◆ duk_bi_string_prototype_slice()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_slice ( duk_context * ctx)

Definition at line 34034 of file duktape-1.5.2/src-noline/duktape.c.

34045 {
34046 DUK_UNREF(ctx);
34048}
34049#endif /* DUK_USE_SECTION_B */
34050
34052 duk_hstring *h;
34053 duk_int_t start_pos, end_pos;
34054 duk_int_t len;
34055
34057 DUK_ASSERT(h != NULL);
34059
34060 /* [ start end str ] */
34061
34062 start_pos = duk_to_int_clamped(ctx, 0, -len, len);
34063 if (start_pos < 0) {
34064 start_pos = len + start_pos;
34065 }
34066 if (duk_is_undefined(ctx, 1)) {
34067 end_pos = len;
34068 } else {
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_slice(duk_context *ctx)

◆ duk_bi_string_prototype_split()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_split ( duk_context * ctx)

Definition at line 34582 of file duktape-1.5.2/src-noline/duktape.c.

34599 {
34600 duk_hthread *thr = (duk_hthread *) ctx;
34601 duk_hstring *h_input;
34602 duk_hstring *h_sep;
34603 duk_uint32_t limit;
34604 duk_uint32_t arr_idx;
34605#ifdef DUK_USE_REGEXP_SUPPORT
34606 duk_bool_t is_regexp;
34607#endif
34608 duk_bool_t matched; /* set to 1 if any match exists (needed for empty input special case) */
34609 duk_uint32_t prev_match_end_coff, prev_match_end_boff;
34610 duk_uint32_t match_start_boff, match_start_coff;
34611 duk_uint32_t match_end_boff, match_end_coff;
34612
34613 DUK_UNREF(thr);
34614
34615 h_input = duk_push_this_coercible_to_string(ctx);
34616 DUK_ASSERT(h_input != NULL);
34617
34618 duk_push_array(ctx);
34619
34620 if (duk_is_undefined(ctx, 1)) {
34621 limit = 0xffffffffUL;
34622 } else {
34623 limit = duk_to_uint32(ctx, 1);
34624 }
34625
34626 if (limit == 0) {
34627 return 1;
34628 }
34629
34630 /* If the separator is a RegExp, make a "clone" of it. The specification
34631 * algorithm calls [[Match]] directly for specific indices; we emulate this
34632 * by tweaking lastIndex and using a "force global" variant of duk_regexp_match()
34633 * which will use global-style matching even when the RegExp itself is non-global.
34634 */
34635
34636 if (duk_is_undefined(ctx, 0)) {
34637 /* The spec algorithm first does "R = ToString(separator)" before checking
34638 * whether separator is undefined. Since this is side effect free, we can
34639 * skip the ToString() here.
34640 */
34641 duk_dup(ctx, 2);
34642 duk_put_prop_index(ctx, 3, 0);
34643 return 1;
34645#ifdef DUK_USE_REGEXP_SUPPORT
34647 duk_dup(ctx, 0);
34648 duk_new(ctx, 1); /* [ ... RegExp val ] -> [ ... res ] */
34649 duk_replace(ctx, 0);
34650 /* lastIndex is initialized to zero by new RegExp() */
34651 is_regexp = 1;
34652#else
34654#endif
34655 } else {
34656 duk_to_string(ctx, 0);
34657#ifdef DUK_USE_REGEXP_SUPPORT
34658 is_regexp = 0;
34659#endif
34660 }
34661
34662 /* stack[0] = separator (string or regexp)
34663 * stack[1] = limit
34664 * stack[2] = input string
34665 * stack[3] = result array
34666 */
34667
34668 prev_match_end_boff = 0;
34669 prev_match_end_coff = 0;
34670 arr_idx = 0;
34671 matched = 0;
34672
34673 for (;;) {
34674 /*
34675 * The specification uses RegExp [[Match]] to attempt match at specific
34676 * offsets. We don't have such a primitive, so we use an actual RegExp
34677 * and tweak lastIndex. Since the RegExp may be non-global, we use a
34678 * special variant which forces global-like behavior for matching.
34679 */
34680
34681 DUK_ASSERT_TOP(ctx, 4);
34682
34683#ifdef DUK_USE_REGEXP_SUPPORT
34684 if (is_regexp) {
34685 duk_dup(ctx, 0);
34686 duk_dup(ctx, 2);
34687 duk_regexp_match_force_global(thr); /* [ ... regexp input ] -> [ res_obj ] */
34688 if (!duk_is_object(ctx, -1)) {
34689 duk_pop(ctx);
34690 break;
34691 }
34692 matched = 1;
34693
34695 DUK_ASSERT(duk_is_number(ctx, -1));
34696 match_start_coff = duk_get_int(ctx, -1);
34697 match_start_boff = duk_heap_strcache_offset_char2byte(thr, h_input, match_start_coff);
34698 duk_pop(ctx);
34699
34700 if (match_start_coff == DUK_HSTRING_GET_CHARLEN(h_input)) {
34701 /* don't allow an empty match at the end of the string */
34702 duk_pop(ctx);
34703 break;
34704 }
34705
34707 DUK_ASSERT(duk_is_number(ctx, -1));
34708 match_end_coff = duk_get_int(ctx, -1);
34709 match_end_boff = duk_heap_strcache_offset_char2byte(thr, h_input, match_end_coff);
34710 duk_pop(ctx);
34711
34712 /* empty match -> bump and continue */
34713 if (prev_match_end_boff == match_end_boff) {
34714 duk_push_int(ctx, match_end_coff + 1);
34716 duk_pop(ctx);
34717 continue;
34718 }
34719 } else {
34720#else /* DUK_USE_REGEXP_SUPPORT */
34721 { /* unconditionally */
34722#endif /* DUK_USE_REGEXP_SUPPORT */
34723 const duk_uint8_t *p_start, *p_end, *p; /* input string scan */
34724 const duk_uint8_t *q_start; /* match string */
34725 duk_size_t q_blen, q_clen;
34726
34727 p_start = DUK_HSTRING_GET_DATA(h_input);
34728 p_end = p_start + DUK_HSTRING_GET_BYTELEN(h_input);
34729 p = p_start + prev_match_end_boff;
34730
34731 h_sep = duk_get_hstring(ctx, 0);
34732 DUK_ASSERT(h_sep != NULL);
34733 q_start = DUK_HSTRING_GET_DATA(h_sep);
34734 q_blen = (duk_size_t) DUK_HSTRING_GET_BYTELEN(h_sep);
34735 q_clen = (duk_size_t) DUK_HSTRING_GET_CHARLEN(h_sep);
34736
34737 p_end -= q_blen; /* ensure full memcmp() fits in while */
34738
34739 match_start_coff = prev_match_end_coff;
34740
34741 if (q_blen == 0) {
34742 /* Handle empty separator case: it will always match, and always
34743 * triggers the check in step 13.c.iii initially. Note that we
34744 * must skip to either end of string or start of first codepoint,
34745 * skipping over any continuation bytes!
34746 *
34747 * Don't allow an empty string to match at the end of the input.
34748 */
34749
34750 matched = 1; /* empty separator can always match */
34751
34752 match_start_coff++;
34753 p++;
34754 while (p < p_end) {
34755 if ((p[0] & 0xc0) != 0x80) {
34756 goto found;
34757 }
34758 p++;
34759 }
34760 goto not_found;
34761 }
34762
34763 DUK_ASSERT(q_blen > 0 && q_clen > 0);
34764 while (p <= p_end) {
34765 DUK_ASSERT(p + q_blen <= DUK_HSTRING_GET_DATA(h_input) + DUK_HSTRING_GET_BYTELEN(h_input));
34766 DUK_ASSERT(q_blen > 0); /* no issues with empty memcmp() */
34767 if (DUK_MEMCMP((const void *) p, (const void *) q_start, (size_t) q_blen) == 0) {
34768 /* never an empty match, so step 13.c.iii can't be triggered */
34769 goto found;
34770 }
34771
34772 /* track utf-8 non-continuation bytes */
34773 if ((p[0] & 0xc0) != 0x80) {
34774 match_start_coff++;
34775 }
34776 p++;
34777 }
34778
34779 not_found:
34780 /* not found */
34781 break;
34782
34783 found:
34784 matched = 1;
34785 match_start_boff = (duk_uint32_t) (p - p_start);
34786 match_end_coff = (duk_uint32_t) (match_start_coff + q_clen); /* constrained by string length */
34787 match_end_boff = (duk_uint32_t) (match_start_boff + q_blen); /* ditto */
34788
34789 /* empty match (may happen with empty separator) -> bump and continue */
34790 if (prev_match_end_boff == match_end_boff) {
34791 prev_match_end_boff++;
34792 prev_match_end_coff++;
34793 continue;
34794 }
34795 } /* if (is_regexp) */
34796
34797 /* stack[0] = separator (string or regexp)
34798 * stack[1] = limit
34799 * stack[2] = input string
34800 * stack[3] = result array
34801 * stack[4] = regexp res_obj (if is_regexp)
34802 */
34803
34804 DUK_DDD(DUK_DDDPRINT("split; match_start b=%ld,c=%ld, match_end b=%ld,c=%ld, prev_end b=%ld,c=%ld",
34805 (long) match_start_boff, (long) match_start_coff,
34806 (long) match_end_boff, (long) match_end_coff,
34807 (long) prev_match_end_boff, (long) prev_match_end_coff));
34808
34809 duk_push_lstring(ctx,
34810 (const char *) (DUK_HSTRING_GET_DATA(h_input) + prev_match_end_boff),
34811 (duk_size_t) (match_start_boff - prev_match_end_boff));
34812 duk_put_prop_index(ctx, 3, arr_idx);
34813 arr_idx++;
34814 if (arr_idx >= limit) {
34815 goto hit_limit;
34816 }
34817
34818#ifdef DUK_USE_REGEXP_SUPPORT
34819 if (is_regexp) {
34820 duk_size_t i, len;
34821
34822 len = duk_get_length(ctx, 4);
34823 for (i = 1; i < len; i++) {
34824 DUK_ASSERT(i <= DUK_UARRIDX_MAX); /* cannot have >4G captures */
34825 duk_get_prop_index(ctx, 4, (duk_uarridx_t) i);
34826 duk_put_prop_index(ctx, 3, arr_idx);
34827 arr_idx++;
34828 if (arr_idx >= limit) {
34829 goto hit_limit;
34830 }
34831 }
34832
34833 duk_pop(ctx);
34834 /* lastIndex already set up for next match */
34835 } else {
34836#else /* DUK_USE_REGEXP_SUPPORT */
34837 { /* unconditionally */
34838#endif /* DUK_USE_REGEXP_SUPPORT */
34839 /* no action */
34840 }
34841
34842 prev_match_end_boff = match_end_boff;
34843 prev_match_end_coff = match_end_coff;
34844 continue;
34845 } /* for */
34846
34847 /* Combined step 11 (empty string special case) and 14-15. */
34848
34849 DUK_DDD(DUK_DDDPRINT("split trailer; prev_end b=%ld,c=%ld",
34850 (long) prev_match_end_boff, (long) prev_match_end_coff));
34851
34852 if (DUK_HSTRING_GET_CHARLEN(h_input) > 0 || !matched) {
34853 /* Add trailer if:
34854 * a) non-empty input
34855 * b) empty input and no (zero size) match found (step 11)
34856 */
34857
34858 duk_push_lstring(ctx,
DUK_EXTERNAL const char * duk_push_lstring(duk_context *ctx, const char *str, duk_size_t len)
DUK_INTERNAL_DECL void duk_regexp_match_force_global(duk_hthread *thr)

◆ duk_bi_string_prototype_substr()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_substr ( duk_context * ctx)

Definition at line 33985 of file duktape-1.5.2/src-noline/duktape.c.

33989 {
33990 duk_int_t tmp = start_pos;
33991 start_pos = end_pos;
33992 end_pos = tmp;
33993 }
33994
33995 DUK_ASSERT(end_pos >= start_pos);
33996
33997 duk_substring(ctx, -1, (duk_size_t) start_pos, (duk_size_t) end_pos);
33998 return 1;
33999}
34000
34001#ifdef DUK_USE_SECTION_B
34003 duk_hstring *h;
34004 duk_int_t start_pos, end_pos;
34005 duk_int_t len;
34006
34007 /* Unlike non-obsolete String calls, substr() algorithm in E5.1
34008 * specification will happily coerce undefined and null to strings
34009 * ("undefined" and "null").
34010 */
34011 duk_push_this(ctx);
34012 h = duk_to_hstring(ctx, -1);
34013 DUK_ASSERT(h != NULL);
34015
34016 /* [ start length str ] */
34017
34018 /* The implementation for computing of start_pos and end_pos differs
34019 * from the standard algorithm, but is intended to result in the exactly
34020 * same behavior. This is not always obvious.
34021 */
34022
34023 /* combines steps 2 and 5; -len ensures max() not needed for step 5 */
34024 start_pos = duk_to_int_clamped(ctx, 0, -len, len);
34025 if (start_pos < 0) {
34026 start_pos = len + start_pos;
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_substr(duk_context *ctx)

◆ duk_bi_string_prototype_substring()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_substring ( duk_context * ctx)

Definition at line 33952 of file duktape-1.5.2/src-noline/duktape.c.

33952 {
33954 return 1;
33955 }
33956
33957 duk_push_u32(ctx, (duk_uint32_t) duk_hstring_char_code_at_raw(thr, h, pos));
33958 return 1;
33959}
33960
33961/*
33962 * substring(), substr(), slice()
33963 */
33964
33965/* XXX: any chance of merging these three similar but still slightly
33966 * different algorithms so that footprint would be reduced?
33967 */
33968
33970 duk_hstring *h;
33971 duk_int_t start_pos, end_pos;
33972 duk_int_t len;
33973
33975 DUK_ASSERT(h != NULL);
33977
33978 /* [ start end str ] */
33979
33980 start_pos = duk_to_int_clamped(ctx, 0, 0, len);
33981 if (duk_is_undefined(ctx, 1)) {
33982 end_pos = len;
DUK_INTERNAL_DECL duk_ucodepoint_t duk_hstring_char_code_at_raw(duk_hthread *thr, duk_hstring *h, duk_uint_t pos)
DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_substring(duk_context *ctx)

◆ duk_bi_string_prototype_to_string()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_to_string ( duk_context * ctx)

Definition at line 33869 of file duktape-1.5.2/src-noline/duktape.c.

33886 {
33887 duk_tval *tv;
33888
33889 duk_push_this(ctx);
33890 tv = duk_require_tval(ctx, -1);
33891 DUK_ASSERT(tv != NULL);
33892
33893 if (DUK_TVAL_IS_STRING(tv)) {
33894 /* return as is */
33895 return 1;
33896 } else if (DUK_TVAL_IS_OBJECT(tv)) {
33898 DUK_ASSERT(h != NULL);
33899
33900 /* Must be a "string object", i.e. class "String" */
#define DUK_TVAL_IS_STRING(tv)

◆ duk_bi_string_prototype_trim()

DUK_INTERNAL_DECL duk_ret_t duk_bi_string_prototype_trim ( duk_context * ctx)

Definition at line 35023 of file duktape-1.5.2/src-noline/duktape.c.

35026 {
35027 DUK_UNREF(ctx);
35029}

◆ duk_bi_thread_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_thread_constructor ( duk_context * ctx)

Definition at line 35098 of file duktape-1.5.2/src-noline/duktape.c.

35101 :
35102 duk_push_int(ctx, (duk_int_t) ret);
35103 return 1;
35104}
35105/*
35106 * Thread builtins
35107 */
35108
35109/* include removed: duk_internal.h */
35110
35111/*
35112 * Constructor
35113 */
35114
35116 duk_hthread *new_thr;
35117 duk_hobject *func;
35118
35119 /* XXX: need a duk_require_func_or_lfunc_coerce() */
35120 if (!duk_is_callable(ctx, 0)) {
DUK_INTERNAL_DECL duk_ret_t duk_bi_thread_constructor(duk_context *ctx)

◆ duk_bi_thread_current()

DUK_INTERNAL_DECL duk_ret_t duk_bi_thread_current ( duk_context * ctx)

Definition at line 35389 of file duktape-1.5.2/src-noline/duktape.c.

◆ duk_bi_thread_resume()

DUK_INTERNAL_DECL duk_ret_t duk_bi_thread_resume ( duk_context * ctx)

Definition at line 35137 of file duktape-1.5.2/src-noline/duktape.c.

35154 {
35155 duk_hthread *thr = (duk_hthread *) ctx;
35156 duk_hthread *thr_resume;
35157 duk_tval *tv;
35158 duk_hobject *func;
35159 duk_hobject *caller_func;
35160 duk_small_int_t is_error;
35161
35162 DUK_DDD(DUK_DDDPRINT("Duktape.Thread.resume(): thread=%!T, value=%!T, is_error=%!T",
35163 (duk_tval *) duk_get_tval(ctx, 0),
35164 (duk_tval *) duk_get_tval(ctx, 1),
35165 (duk_tval *) duk_get_tval(ctx, 2)));
35166
35168 DUK_ASSERT(thr->heap->curr_thread == thr);
35169
35170 thr_resume = duk_require_hthread(ctx, 0);
35171 is_error = (duk_small_int_t) duk_to_boolean(ctx, 2);
35172 duk_set_top(ctx, 2);
35173
35174 /* [ thread value ] */
35175
35176 /*
35177 * Thread state and calling context checks
35178 */
35179
35180 if (thr->callstack_top < 2) {
35181 DUK_DD(DUK_DDPRINT("resume state invalid: callstack should contain at least 2 entries (caller and Duktape.Thread.resume)"));
35182 goto state_error;
35183 }
35184 DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack + thr->callstack_top - 1) != NULL); /* us */
35186 DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack + thr->callstack_top - 2) != NULL); /* caller */
35187
35188 caller_func = DUK_ACT_GET_FUNC(thr->callstack + thr->callstack_top - 2);
35189 if (!DUK_HOBJECT_IS_COMPILEDFUNCTION(caller_func)) {
35190 DUK_DD(DUK_DDPRINT("resume state invalid: caller must be Ecmascript code"));
35191 goto state_error;
35192 }
35193
35194 /* Note: there is no requirement that: 'thr->callstack_preventcount == 1'
35195 * like for yield.
35196 */
35197
35198 if (thr_resume->state != DUK_HTHREAD_STATE_INACTIVE &&
35199 thr_resume->state != DUK_HTHREAD_STATE_YIELDED) {
35200 DUK_DD(DUK_DDPRINT("resume state invalid: target thread must be INACTIVE or YIELDED"));
35201 goto state_error;
35202 }
35203
35205 thr_resume->state == DUK_HTHREAD_STATE_YIELDED);
35206
35207 /* Further state-dependent pre-checks */
35208
35209 if (thr_resume->state == DUK_HTHREAD_STATE_YIELDED) {
35210 /* no pre-checks now, assume a previous yield() has left things in
35211 * tip-top shape (longjmp handler will assert for these).
35212 */
35213 } else {
35215
35216 if ((thr_resume->callstack_top != 0) ||
35217 (thr_resume->valstack_top - thr_resume->valstack != 1)) {
35218 goto state_invalid_initial;
35219 }
35220 tv = &thr_resume->valstack_top[-1];
35221 DUK_ASSERT(tv >= thr_resume->valstack && tv < thr_resume->valstack_top);
35222 if (!DUK_TVAL_IS_OBJECT(tv)) {
35223 goto state_invalid_initial;
35224 }
35225 func = DUK_TVAL_GET_OBJECT(tv);
35226 DUK_ASSERT(func != NULL);
35228 /* Note: cannot be a bound function either right now,
35229 * this would be easy to relax though.
35230 */
35231 goto state_invalid_initial;
35232 }
35233
35234 }
35235
35236 /*
35237 * The error object has been augmented with a traceback and other
35238 * info from its creation point -- usually another thread. The
35239 * error handler is called here right before throwing, but it also
35240 * runs in the resumer's thread. It might be nice to get a traceback
35241 * from the resumee but this is not the case now.
35242 */
35243
35244#if defined(DUK_USE_AUGMENT_ERROR_THROW)
35245 if (is_error) {
35246 DUK_ASSERT_TOP(ctx, 2); /* value (error) is at stack top */
35247 duk_err_augment_error_throw(thr); /* in resumer's context */
35248 }
35249#endif
35250
35251#ifdef DUK_USE_DEBUG
35252 if (is_error) {
35253 DUK_DDD(DUK_DDDPRINT("RESUME ERROR: thread=%!T, value=%!T",
35254 (duk_tval *) duk_get_tval(ctx, 0),
35255 (duk_tval *) duk_get_tval(ctx, 1)));
35256 } else if (thr_resume->state == DUK_HTHREAD_STATE_YIELDED) {
35257 DUK_DDD(DUK_DDDPRINT("RESUME NORMAL: thread=%!T, value=%!T",
35258 (duk_tval *) duk_get_tval(ctx, 0),
35259 (duk_tval *) duk_get_tval(ctx, 1)));
35260 } else {
35261 DUK_DDD(DUK_DDDPRINT("RESUME INITIAL: thread=%!T, value=%!T",
35262 (duk_tval *) duk_get_tval(ctx, 0),
35263 (duk_tval *) duk_get_tval(ctx, 1)));
35264 }
35265#endif
35266
35268
35269 /* lj value2: thread */
35271 DUK_TVAL_SET_TVAL_UPDREF(thr, &thr->heap->lj.value2, &thr->valstack_bottom[0]); /* side effects */
35272
35273 /* lj value1: value */
35274 DUK_ASSERT(thr->valstack_bottom + 1 < thr->valstack_top);
DUK_INTERNAL_DECL duk_hthread * duk_require_hthread(duk_context *ctx, duk_idx_t index)
#define DUK_HTHREAD_STATE_INACTIVE
#define DUK_TVAL_SET_TVAL_UPDREF
#define DUK_HTHREAD_STATE_RUNNING
DUK_INTERNAL_DECL void duk_err_augment_error_throw(duk_hthread *thr)
#define DUK_HTHREAD_STATE_YIELDED

◆ duk_bi_thread_yield()

DUK_INTERNAL_DECL duk_ret_t duk_bi_thread_yield ( duk_context * ctx)

Definition at line 35291 of file duktape-1.5.2/src-noline/duktape.c.

35308 {
35309 duk_hthread *thr = (duk_hthread *) ctx;
35310 duk_hobject *caller_func;
35311 duk_small_int_t is_error;
35312
35313 DUK_DDD(DUK_DDDPRINT("Duktape.Thread.yield(): value=%!T, is_error=%!T",
35314 (duk_tval *) duk_get_tval(ctx, 0),
35315 (duk_tval *) duk_get_tval(ctx, 1)));
35316
35318 DUK_ASSERT(thr->heap->curr_thread == thr);
35319
35320 is_error = (duk_small_int_t) duk_to_boolean(ctx, 1);
35321 duk_set_top(ctx, 1);
35322
35323 /* [ value ] */
35324
35325 /*
35326 * Thread state and calling context checks
35327 */
35328
35329 if (!thr->resumer) {
35330 DUK_DD(DUK_DDPRINT("yield state invalid: current thread must have a resumer"));
35331 goto state_error;
35332 }
35334
35335 if (thr->callstack_top < 2) {
35336 DUK_DD(DUK_DDPRINT("yield state invalid: callstack should contain at least 2 entries (caller and Duktape.Thread.yield)"));
35337 goto state_error;
35338 }
35339 DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack + thr->callstack_top - 1) != NULL); /* us */
35341 DUK_ASSERT(DUK_ACT_GET_FUNC(thr->callstack + thr->callstack_top - 2) != NULL); /* caller */
35342
35343 caller_func = DUK_ACT_GET_FUNC(thr->callstack + thr->callstack_top - 2);
35344 if (!DUK_HOBJECT_IS_COMPILEDFUNCTION(caller_func)) {
35345 DUK_DD(DUK_DDPRINT("yield state invalid: caller must be Ecmascript code"));
35346 goto state_error;
35347 }
35348
35349 DUK_ASSERT(thr->callstack_preventcount >= 1); /* should never be zero, because we (Duktape.Thread.yield) are on the stack */
35350 if (thr->callstack_preventcount != 1) {
35351 /* Note: the only yield-preventing call is Duktape.Thread.yield(), hence check for 1, not 0 */
35352 DUK_DD(DUK_DDPRINT("yield state invalid: there must be no yield-preventing calls in current thread callstack (preventcount is %ld)",
35353 (long) thr->callstack_preventcount));
35354 goto state_error;
35355 }
35356
35357 /*
35358 * The error object has been augmented with a traceback and other
35359 * info from its creation point -- usually the current thread.
35360 * The error handler, however, is called right before throwing
35361 * and runs in the yielder's thread.
35362 */
35363
35364#if defined(DUK_USE_AUGMENT_ERROR_THROW)
35365 if (is_error) {
35366 DUK_ASSERT_TOP(ctx, 1); /* value (error) is at stack top */
35367 duk_err_augment_error_throw(thr); /* in yielder's context */
35368 }
35369#endif
35370
35371#ifdef DUK_USE_DEBUG
35372 if (is_error) {
35373 DUK_DDD(DUK_DDDPRINT("YIELD ERROR: value=%!T",
35374 (duk_tval *) duk_get_tval(ctx, 0)));
35375 } else {
35376 DUK_DDD(DUK_DDDPRINT("YIELD NORMAL: value=%!T",
35377 (duk_tval *) duk_get_tval(ctx, 0)));
35378 }
35379#endif
35380
35381 /*
35382 * Process yield
35383 *
35384 * After longjmp(), processing continues in bytecode executor longjmp
35385 * handler, which will e.g. update thr->resumer to NULL.
35386 */
35387
#define DUK_HTHREAD_STATE_RESUMED

◆ duk_bi_type_error_thrower()

DUK_INTERNAL_DECL duk_ret_t duk_bi_type_error_thrower ( duk_context * ctx)

Definition at line 35399 of file duktape-1.5.2/src-noline/duktape.c.

35401 :
35402 DUK_ERROR_TYPE(thr, "invalid state");

◆ duk_bi_typedarray_constructor()

DUK_INTERNAL_DECL duk_ret_t duk_bi_typedarray_constructor ( duk_context * ctx)

Definition at line 22204 of file duktape-1.5.2/src-noline/duktape.c.

22204 :
22205 return DUK_RET_RANGE_ERROR;
22206}
22207#else /* DUK_USE_BUFFEROBJECT_SUPPORT */
22209 DUK_UNREF(ctx);
22211}
22212#endif /* DUK_USE_BUFFEROBJECT_SUPPORT */
22213
22214
22215/* Format of magic, bits:
22216 * 0...1: elem size shift (0-3)
22217 * 2...5: elem type (DUK_HBUFFEROBJECT_ELEM_xxx)
22218 */
22219
22220#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
22222 duk_hthread *thr;
22223 duk_tval *tv;
22224 duk_hobject *h_obj;
22225 duk_hbufferobject *h_bufobj = NULL;
22226 duk_hbufferobject *h_bufarr = NULL;
22227 duk_hbufferobject *h_bufarg = NULL;
22228 duk_hbuffer *h_val;
22229 duk_small_uint_t magic;
22230 duk_small_uint_t shift;
22231 duk_small_uint_t elem_type;
22232 duk_small_uint_t elem_size;
22233 duk_small_uint_t class_num;
22234 duk_small_uint_t proto_bidx;
22235 duk_uint_t align_mask;
22236 duk_uint_t elem_length;
22237 duk_int_t elem_length_signed;
22238 duk_uint_t byte_length;
22239 duk_small_uint_t copy_mode;
22240
22241 thr = (duk_hthread *) ctx;
22242 DUK_UNREF(thr);
22243
22244 /* XXX: function flag to make this automatic? */
22245 if (!duk_is_constructor_call(ctx)) {
22246 return DUK_RET_TYPE_ERROR;
22247 }
22248
22249 /* We could fit built-in index into magic but that'd make the magic
22250 * number dependent on built-in numbering (genbuiltins.py doesn't
22251 * handle that yet). So map both class and prototype from the
22252 * element type.
22253 */
22254 magic = duk_get_current_magic(ctx);
22255 shift = magic & 0x03; /* bits 0...1: shift */
22256 elem_type = (magic >> 2) & 0x0f; /* bits 2...5: type */
22257 elem_size = 1 << shift;
22258 align_mask = elem_size - 1;
22259 DUK_ASSERT(elem_type < sizeof(duk__buffer_proto_from_elemtype) / sizeof(duk_uint8_t));
22260 proto_bidx = duk__buffer_proto_from_elemtype[elem_type];
22261 DUK_ASSERT(proto_bidx < DUK_NUM_BUILTINS);
22262 DUK_ASSERT(elem_type < sizeof(duk__buffer_class_from_elemtype) / sizeof(duk_uint8_t));
22263 class_num = duk__buffer_class_from_elemtype[elem_type];
22264
22265 DUK_DD(DUK_DDPRINT("typedarray constructor, magic=%d, shift=%d, elem_type=%d, "
22266 "elem_size=%d, proto_bidx=%d, class_num=%d",
22267 (int) magic, (int) shift, (int) elem_type, (int) elem_size,
22268 (int) proto_bidx, (int) class_num));
22269
22270 /* Argument variants. When the argument is an ArrayBuffer a view to
22271 * the same buffer is created; otherwise a new ArrayBuffer is always
22272 * created.
22273 */
22274
22275 tv = duk_get_tval(ctx, 0);
22276 DUK_ASSERT(tv != NULL); /* arg count */
22277 if (DUK_TVAL_IS_OBJECT(tv)) {
22278 h_obj = DUK_TVAL_GET_OBJECT(tv);
22279 DUK_ASSERT(h_obj != NULL);
22280
22282 /* ArrayBuffer: unlike any other argument variant, create
22283 * a view into the existing buffer.
22284 */
22285
22286 duk_int_t byte_offset_signed;
22287 duk_uint_t byte_offset;
22288
22289 h_bufarg = (duk_hbufferobject *) h_obj;
22290
22291 byte_offset_signed = duk_to_int(ctx, 1);
22292 if (byte_offset_signed < 0) {
22293 goto fail_arguments;
22294 }
22295 byte_offset = (duk_uint_t) byte_offset_signed;
22296 if (byte_offset > h_bufarg->length ||
22297 (byte_offset & align_mask) != 0) {
22298 /* Must be >= 0 and multiple of element size. */
22299 goto fail_arguments;
22300 }
22301 if (duk_is_undefined(ctx, 2)) {
22302 DUK_ASSERT(h_bufarg->length >= byte_offset);
22303 byte_length = h_bufarg->length - byte_offset;
22304 if ((byte_length & align_mask) != 0) {
22305 /* Must be element size multiple from
22306 * start offset to end of buffer.
22307 */
22308 goto fail_arguments;
22309 }
22310 elem_length = (byte_length >> shift);
22311 } else {
22312 elem_length_signed = duk_to_int(ctx, 2);
22313 if (elem_length_signed < 0) {
22314 goto fail_arguments;
22315 }
22316 elem_length = (duk_uint_t) elem_length_signed;
22317 byte_length = elem_length << shift;
22318 if ((byte_length >> shift) != elem_length) {
22319 /* Byte length would overflow. */
22320 /* XXX: easier check with less code? */
22321 goto fail_arguments;
22322 }
22323 DUK_ASSERT(h_bufarg->length >= byte_offset);
22324 if (byte_length > h_bufarg->length - byte_offset) {
22325 /* Not enough data. */
22326 goto fail_arguments;
22327 }
22328 }
22329 DUK_UNREF(elem_length);
22330 DUK_ASSERT_DISABLE(byte_offset >= 0);
22331 DUK_ASSERT(byte_offset <= h_bufarg->length);
22332 DUK_ASSERT_DISABLE(byte_length >= 0);
22333 DUK_ASSERT(byte_offset + byte_length <= h_bufarg->length);
22334 DUK_ASSERT((elem_length << shift) == byte_length);
22335
22336 h_bufobj = duk_push_bufferobject_raw(ctx,
22339 DUK_HOBJECT_CLASS_AS_FLAGS(class_num),
22340 proto_bidx);
22341 h_val = h_bufarg->buf;
22342 if (h_val == NULL) {
22343 return DUK_RET_TYPE_ERROR;
22344 }
22345 h_bufobj->buf = h_val;
22346 DUK_HBUFFER_INCREF(thr, h_val);
22347 h_bufobj->offset = h_bufarg->offset + byte_offset;
22348 h_bufobj->length = byte_length;
22349 h_bufobj->shift = (duk_uint8_t) shift;
22350 h_bufobj->elem_type = (duk_uint8_t) elem_type;
22351 h_bufobj->is_view = 1;
22353
22354 /* Set .buffer to the argument ArrayBuffer. */
22355 duk_dup(ctx, 0);
22357 duk_compact(ctx, -1);
22358 return 1;
22359 } else if (DUK_HOBJECT_IS_BUFFEROBJECT(h_obj)) {
22360 /* TypedArray (or other non-ArrayBuffer duk_hbufferobject).
22361 * Conceptually same behavior as for an Array-like argument,
22362 * with a few fast paths.
22363 */
22364
22365 h_bufarg = (duk_hbufferobject *) h_obj;
22367 elem_length_signed = (duk_int_t) (h_bufarg->length >> h_bufarg->shift);
22368 if (h_bufarg->buf == NULL) {
22369 return DUK_RET_TYPE_ERROR;
22370 }
22371
22372 /* Select copy mode. Must take into account element
22373 * compatibility and validity of the underlying source
22374 * buffer.
22375 */
22376
22377 DUK_DDD(DUK_DDDPRINT("selecting copy mode for bufobj arg, "
22378 "src byte_length=%ld, src shift=%d, "
22379 "src/dst elem_length=%ld; "
22380 "dst shift=%d -> dst byte_length=%ld",
22381 (long) h_bufarg->length, (int) h_bufarg->shift,
22382 (long) elem_length_signed, (int) shift,
22383 (long) (elem_length_signed << shift)));
22384
22385 copy_mode = 2; /* default is explicit index read/write copy */
22386 DUK_ASSERT(elem_type < sizeof(duk__buffer_elemtype_copy_compatible) / sizeof(duk_uint16_t));
22387 if (DUK_HBUFFEROBJECT_VALID_SLICE(h_bufarg)) {
22388 if ((duk__buffer_elemtype_copy_compatible[elem_type] & (1 << h_bufarg->elem_type)) != 0) {
22389 DUK_DDD(DUK_DDDPRINT("source/target are copy compatible, memcpy"));
22390 DUK_ASSERT(shift == h_bufarg->shift); /* byte sizes will match */
22391 copy_mode = 0;
22392 } else {
22393 DUK_DDD(DUK_DDDPRINT("source/target not copy compatible but valid, fast copy"));
22394 copy_mode = 1;
22395 }
22396 }
22397 } else {
22398 /* Array or Array-like */
22399 elem_length_signed = (duk_int_t) duk_get_length(ctx, 0);
22400 copy_mode = 2;
22401 }
22402 } else if (DUK_TVAL_IS_BUFFER(tv)) {
22403 /* Accept plain buffer values like array initializers
22404 * (new in Duktape 1.4.0).
22405 */
22406 duk_hbuffer *h_srcbuf;
22407 h_srcbuf = DUK_TVAL_GET_BUFFER(tv);
22408 elem_length_signed = (duk_int_t) DUK_HBUFFER_GET_SIZE(h_srcbuf);
22409 copy_mode = 2; /* XXX: could add fast path for u8 compatible views */
22410 } else {
22411 /* Non-object argument is simply int coerced, matches
22412 * V8 behavior (except for "null", which we coerce to
22413 * 0 but V8 TypeErrors).
22414 */
22415 elem_length_signed = duk_to_int(ctx, 0);
22416 copy_mode = 3;
22417 }
22418 if (elem_length_signed < 0) {
22419 goto fail_arguments;
22420 }
22421 elem_length = (duk_uint_t) elem_length_signed;
22422 byte_length = (duk_uint_t) (elem_length << shift);
22423 if ((byte_length >> shift) != elem_length) {
22424 /* Byte length would overflow. */
22425 /* XXX: easier check with less code? */
22426 goto fail_arguments;
22427 }
22428
22429 DUK_DDD(DUK_DDDPRINT("elem_length=%ld, byte_length=%ld",
22430 (long) elem_length, (long) byte_length));
22431
22432 /* ArrayBuffer argument is handled specially above; the rest of the
22433 * argument variants are handled by shared code below.
22434 */
22435
22436 /* Push a new ArrayBuffer (becomes view .buffer) */
22437 h_bufarr = duk__push_arraybuffer_with_length(ctx, byte_length);
22438 DUK_ASSERT(h_bufarr != NULL);
22439 h_val = h_bufarr->buf;
22440 DUK_ASSERT(h_val != NULL);
22441
22442 /* Push the resulting view object and attach the ArrayBuffer. */
22443 h_bufobj = duk_push_bufferobject_raw(ctx,
22446 DUK_HOBJECT_CLASS_AS_FLAGS(class_num),
22447 proto_bidx);
22448
22449 h_bufobj->buf = h_val;
22450 DUK_HBUFFER_INCREF(thr, h_val);
22451 DUK_ASSERT(h_bufobj->offset == 0);
22452 h_bufobj->length = byte_length;
22453 h_bufobj->shift = (duk_uint8_t) shift;
22454 h_bufobj->elem_type = (duk_uint8_t) elem_type;
22455 h_bufobj->is_view = 1;
22457
22458 /* Set .buffer */
22459 duk_dup(ctx, -2);
22461 duk_compact(ctx, -1);
22462
22463 /* Copy values, the copy method depends on the arguments.
22464 *
22465 * Copy mode decision may depend on the validity of the underlying
22466 * buffer of the source argument; there must be no harmful side effects
22467 * from there to here for copy_mode to still be valid.
22468 */
22469 DUK_DDD(DUK_DDDPRINT("copy mode: %d", (int) copy_mode));
22470 switch (copy_mode) {
22471 case 0: {
22472 /* Use byte copy. */
22473
22474 duk_uint8_t *p_src;
22475 duk_uint8_t *p_dst;
22476
22477 DUK_ASSERT(h_bufobj != NULL);
22478 DUK_ASSERT(h_bufobj->buf != NULL);
22480 DUK_ASSERT(h_bufarg != NULL);
22481 DUK_ASSERT(h_bufarg->buf != NULL);
22483
22484 p_dst = DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_bufobj);
22485 p_src = DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_bufarg);
22486
22487 DUK_DDD(DUK_DDDPRINT("using memcpy: p_src=%p, p_dst=%p, byte_length=%ld",
22488 (void *) p_src, (void *) p_dst, (long) byte_length));
22489
22490 DUK_MEMCPY((void *) p_dst, (const void *) p_src, (size_t) byte_length);
22491 break;
22492 }
22493 case 1: {
22494 /* Copy values through direct validated reads and writes. */
22495
22496 duk_small_uint_t src_elem_size;
22497 duk_small_uint_t dst_elem_size;
22498 duk_uint8_t *p_src;
22499 duk_uint8_t *p_src_end;
22500 duk_uint8_t *p_dst;
22501
22502 DUK_ASSERT(h_bufobj != NULL);
22503 DUK_ASSERT(h_bufobj->buf != NULL);
22505 DUK_ASSERT(h_bufarg != NULL);
22506 DUK_ASSERT(h_bufarg->buf != NULL);
22508
22509 src_elem_size = 1 << h_bufarg->shift;
22510 dst_elem_size = elem_size;
22511
22512 p_src = DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_bufarg);
22513 p_dst = DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_bufobj);
22514 p_src_end = p_src + h_bufarg->length;
22515
22516 DUK_DDD(DUK_DDDPRINT("using fast copy: p_src=%p, p_src_end=%p, p_dst=%p, "
22517 "src_elem_size=%d, dst_elem_size=%d",
22518 (void *) p_src, (void *) p_src_end, (void *) p_dst,
22519 (int) src_elem_size, (int) dst_elem_size));
22520
22521 while (p_src != p_src_end) {
22522 DUK_DDD(DUK_DDDPRINT("fast path per element copy loop: "
22523 "p_src=%p, p_src_end=%p, p_dst=%p",
22524 (void *) p_src, (void *) p_src_end, (void *) p_dst));
22525 /* A validated read() is always a number, so it's write coercion
22526 * is always side effect free an won't invalidate pointers etc.
22527 */
22528 duk_hbufferobject_push_validated_read(ctx, h_bufarg, p_src, src_elem_size);
22529 duk_hbufferobject_validated_write(ctx, h_bufobj, p_dst, dst_elem_size);
22530 duk_pop(ctx);
22531 p_src += src_elem_size;
22532 p_dst += dst_elem_size;
22533 }
22534 break;
22535 }
22536 case 2: {
22537 /* Copy values by index reads and writes. Let virtual
22538 * property handling take care of coercion.
22539 */
22540 duk_uint_t i;
22541
22542 DUK_DDD(DUK_DDDPRINT("using slow copy"));
22543
22544 for (i = 0; i < elem_length; i++) {
22545 duk_get_prop_index(ctx, 0, (duk_uarridx_t) i);
22546 duk_put_prop_index(ctx, -2, (duk_uarridx_t) i);
22547 }
22548 break;
22549 }
22550 default:
22551 case 3: {
22552 /* No copy, leave zero bytes in the buffer. There's no
22553 * ambiguity with Float32/Float64 because zero bytes also
22554 * represent 0.0.
22555 */
22556#if !defined(DUK_USE_ZERO_BUFFER_DATA)
DUK_INTERNAL_DECL void duk_hbufferobject_push_validated_read(duk_context *ctx, duk_hbufferobject *h_bufobj, duk_uint8_t *p, duk_small_uint_t elem_size)
DUK_INTERNAL_DECL void duk_hbufferobject_validated_write(duk_context *ctx, duk_hbufferobject *h_bufobj, duk_uint8_t *p, duk_small_uint_t elem_size)
DUK_LOCAL duk_hbufferobject * duk__push_arraybuffer_with_length(duk_context *ctx, duk_uint_t len)
static const duk_uint8_t duk__buffer_class_from_elemtype[9]
#define DUK_ASSERT_DISABLE(x)
static const duk_uint8_t duk__buffer_proto_from_elemtype[9]
static duk_uint16_t duk__buffer_elemtype_copy_compatible[9]
#define DUK_HOBJECT_CLASS_ARRAYBUFFER

◆ duk_bi_typedarray_set()

DUK_INTERNAL_DECL duk_ret_t duk_bi_typedarray_set ( duk_context * ctx)

Definition at line 23159 of file duktape-1.5.2/src-noline/duktape.c.

23162 :
23163 *
23164 * - Source and target separate buffers or non-overlapping.
23165 *
23166 * - Source and target have a compatible type so that a plain byte copy
23167 * is possible. Note that while e.g. uint8 and int8 are compatible
23168 * (coercion one way or another doesn't change the byte representation),
23169 * e.g. int8 and uint8clamped are NOT compatible when writing int8
23170 * values into uint8clamped typedarray (-1 would clamp to 0 for instance).
23171 *
23172 * See test-bi-typedarray-proto-set.js.
23173 */
23174
23175#if defined(DUK_USE_BUFFEROBJECT_SUPPORT)
23176DUK_INTERNAL duk_ret_t duk_bi_typedarray_set(duk_context *ctx) {
23177 duk_hthread *thr;
23178 duk_hbufferobject *h_this;
23179 duk_hobject *h_obj;
23180 duk_uarridx_t i, n;
23181 duk_int_t offset_signed;
23182 duk_uint_t offset_elems;
23183 duk_uint_t offset_bytes;
23184
23185 thr = (duk_hthread *) ctx;
23186 DUK_UNREF(thr);
23187
23188 h_this = duk__require_bufobj_this(ctx);
23189 DUK_ASSERT(h_this != NULL);
23190 DUK_ASSERT_HBUFFEROBJECT_VALID(h_this);
23191
23192 if (h_this->buf == NULL) {
23193 DUK_DDD(DUK_DDDPRINT("source neutered, skip copy"));
23194 return 0;
23195 }
23196
23197 h_obj = duk_require_hobject(ctx, 0);
23198 DUK_ASSERT(h_obj != NULL);
23199
23200 /* XXX: V8 throws a TypeError for negative values. Would it
23201 * be more useful to interpret negative offsets here from the
23202 * end of the buffer too?
23203 */
23204 offset_signed = duk_to_int(ctx, 1);
23205 if (offset_signed < 0) {
23206 return DUK_RET_TYPE_ERROR;
23207 }
23208 offset_elems = (duk_uint_t) offset_signed;
23209 offset_bytes = offset_elems << h_this->shift;
23210 if ((offset_bytes >> h_this->shift) != offset_elems) {
23211 /* Byte length would overflow. */
23212 /* XXX: easier check with less code? */
23213 return DUK_RET_RANGE_ERROR;
23214 }
23215 if (offset_bytes > h_this->length) {
23216 /* Equality may be OK but >length not. Checking
23217 * this explicitly avoids some overflow cases
23218 * below.
23219 */
23220 return DUK_RET_RANGE_ERROR;
23221 }
23222 DUK_ASSERT(offset_bytes <= h_this->length);
23223
23224 /* Fast path: source is a TypedArray (or any bufferobject). */
23225
23226 if (DUK_HOBJECT_IS_BUFFEROBJECT(h_obj)) {
23227 duk_hbufferobject *h_bufarg;
23228 duk_uint16_t comp_mask;
23229 duk_small_int_t no_overlap = 0;
23230 duk_uint_t src_length;
23231 duk_uint_t dst_length;
23232 duk_uint_t dst_length_elems;
23233 duk_uint8_t *p_src_base;
23234 duk_uint8_t *p_src_end;
23235 duk_uint8_t *p_src;
23236 duk_uint8_t *p_dst_base;
23237 duk_uint8_t *p_dst;
23238 duk_small_uint_t src_elem_size;
23239 duk_small_uint_t dst_elem_size;
23240
23241 h_bufarg = (duk_hbufferobject *) h_obj;
23242 DUK_ASSERT_HBUFFEROBJECT_VALID(h_bufarg);
23243
23244 if (h_bufarg->buf == NULL) {
23245 DUK_DDD(DUK_DDDPRINT("target neutered, skip copy"));
23246 return 0;
23247 }
23248
23249 /* Nominal size check. */
23250 src_length = h_bufarg->length; /* bytes in source */
23251 dst_length_elems = (src_length >> h_bufarg->shift); /* elems in source and dest */
23252 dst_length = dst_length_elems << h_this->shift; /* bytes in dest */
23253 if ((dst_length >> h_this->shift) != dst_length_elems) {
23254 /* Byte length would overflow. */
23255 /* XXX: easier check with less code? */
23256 return DUK_RET_RANGE_ERROR;
23257 }
23258 DUK_DDD(DUK_DDDPRINT("nominal size check: src_length=%ld, dst_length=%ld",
23259 (long) src_length, (long) dst_length));
23260 DUK_ASSERT(offset_bytes <= h_this->length);
23261 if (dst_length > h_this->length - offset_bytes) {
23262 /* Overflow not an issue because subtraction is used on the right
23263 * side and guaranteed to be >= 0.
23264 */
23265 DUK_DDD(DUK_DDDPRINT("copy exceeds target buffer nominal length"));
23266 return DUK_RET_RANGE_ERROR;
23267 }
23268 if (!DUK_HBUFFEROBJECT_VALID_BYTEOFFSET_EXCL(h_this, offset_bytes + dst_length)) {
23269 DUK_DDD(DUK_DDDPRINT("copy not covered by underlying target buffer, ignore"));
23270 return 0;
23271 }
23272
23273 p_src_base = DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_bufarg);
23274 p_dst_base = DUK_HBUFFEROBJECT_GET_SLICE_BASE(thr->heap, h_this) + offset_bytes;
23275
23276 /* Check actual underlying buffers for validity and that they
23277 * cover the copy. No side effects are allowed after the check
23278 * so that the validity status doesn't change.
23279 */
23280 if (!DUK_HBUFFEROBJECT_VALID_SLICE(h_this) ||
23281 !DUK_HBUFFEROBJECT_VALID_SLICE(h_bufarg)) {
23282 /* The condition could be more narrow and check for the
23283 * copy area only, but there's no need for fine grained
23284 * behavior when the underlying buffer is misconfigured.
23285 */
23286 DUK_DDD(DUK_DDDPRINT("source and/or target not covered by underlying buffer, skip copy"));
23287 return 0;
23288 }
23289
23290 /* We want to do a straight memory copy if possible: this is
23291 * an important operation because .set() is the TypedArray
23292 * way to copy chunks of memory. However, because set()
23293 * conceptually works in terms of elements, not all views are
23294 * compatible with direct byte copying.
23295 *
23296 * If we do manage a direct copy, the "overlap issue" handled
23297 * below can just be solved using memmove() because the source
23298 * and destination element sizes are necessarily equal.
23299 */
23300
23301 DUK_ASSERT(h_this->elem_type < sizeof(duk__buffer_elemtype_copy_compatible) / sizeof(duk_uint16_t));
23302 comp_mask = duk__buffer_elemtype_copy_compatible[h_this->elem_type];
23303 if (comp_mask & (1 << h_bufarg->elem_type)) {
23304 DUK_ASSERT(src_length == dst_length);
23305
23306 DUK_DDD(DUK_DDDPRINT("fast path: able to use memmove() because views are compatible"));
23307 DUK_MEMMOVE((void *) p_dst_base, (const void *) p_src_base, (size_t) dst_length);
23308 return 0;
23309 }
23310 DUK_DDD(DUK_DDDPRINT("fast path: views are not compatible with a byte copy, copy by item"));
23311
23312 /* We want to avoid making a copy to process set() but that's
23313 * not always possible: the source and the target may overlap
23314 * and because element sizes are different, the overlap cannot
23315 * always be handled with a memmove() or choosing the copy
23316 * direction in a certain way. For example, if source type is
23317 * uint8 and target type is uint32, the target area may exceed
23318 * the source area from both ends!
23319 *
23320 * Note that because external buffers may point to the same
23321 * memory areas, we must ultimately make this check using
23322 * pointers.
23323 *
23324 * NOTE: careful with side effects: any side effect may cause
23325 * a buffer resize (or external buffer pointer/length update)!
23326 */
23327
23328 DUK_DDD(DUK_DDDPRINT("overlap check: p_src_base=%p, src_length=%ld, "
23329 "p_dst_base=%p, dst_length=%ld",
23330 (void *) p_src_base, (long) src_length,
23331 (void *) p_dst_base, (long) dst_length));
23332
23333 if (p_src_base >= p_dst_base + dst_length || /* source starts after dest ends */
23334 p_src_base + src_length <= p_dst_base) { /* source ends before dest starts */
23335 no_overlap = 1;
23336 }
23337
23338 if (!no_overlap) {
23339 /* There's overlap: the desired end result is that
23340 * conceptually a copy is made to avoid "trampling"
23341 * of source data by destination writes. We make
23342 * an actual temporary copy to handle this case.
23343 */
23344 duk_uint8_t *p_src_copy;
23345
23346 DUK_DDD(DUK_DDDPRINT("there is overlap, make a copy of the source"));
23347 p_src_copy = (duk_uint8_t *) duk_push_fixed_buffer(ctx, src_length);
23348 DUK_ASSERT(p_src_copy != NULL);
23349 DUK_MEMCPY((void *) p_src_copy, (const void *) p_src_base, (size_t) src_length);
23350
23351 p_src_base = p_src_copy; /* use p_src_base from now on */
23352 }
23353 /* Value stack intentionally mixed size here. */
23354
23355 DUK_DDD(DUK_DDDPRINT("after overlap check: p_src_base=%p, src_length=%ld, "
23356 "p_dst_base=%p, dst_length=%ld, valstack top=%ld",
23357 (void *) p_src_base, (long) src_length,
23358 (void *) p_dst_base, (long) dst_length,
23359 (long) duk_get_top(ctx)));
23360
23361 /* Ready to make the copy. We must proceed element by element
23362 * and must avoid any side effects that might cause the buffer
23363 * validity check above to become invalid.
23364 *
23365 * Although we work through the value stack here, only plain
23366 * numbers are handled which should be side effect safe.
23367 */
23368
23369 src_elem_size = 1 << h_bufarg->shift;
23370 dst_elem_size = 1 << h_this->shift;
23371 p_src = p_src_base;
23372 p_dst = p_dst_base;
23373 p_src_end = p_src_base + src_length;
23374
23375 while (p_src != p_src_end) {
23376 DUK_DDD(DUK_DDDPRINT("fast path per element copy loop: "
23377 "p_src=%p, p_src_end=%p, p_dst=%p",
23378 (void *) p_src, (void *) p_src_end, (void *) p_dst));
23379 /* A validated read() is always a number, so it's write coercion
23380 * is always side effect free an won't invalidate pointers etc.
23381 */
23382 duk_hbufferobject_push_validated_read(ctx, h_bufarg, p_src, src_elem_size);
23383 duk_hbufferobject_validated_write(ctx, h_this, p_dst, dst_elem_size);
23384 duk_pop(ctx);
23385 p_src += src_elem_size;
23386 p_dst += dst_elem_size;
23387 }
23388
23389 return 0;
23390 } else {
23391 /* Slow path: quite slow, but we save space by using the property code
23392 * to write coerce target values. We don't need to worry about overlap
23393 * here because the source is not a TypedArray.
23394 *
23395 * We could use the bufferobject write coercion helper but since the
23396 * property read may have arbitrary side effects, full validity checks
23397 * would be needed for every element anyway.
23398 */
23399
23400 n = (duk_uarridx_t) duk_get_length(ctx, 0);
23401 DUK_ASSERT(offset_bytes <= h_this->length);
23402 if ((n << h_this->shift) > h_this->length - offset_bytes) {
23403 /* Overflow not an issue because subtraction is used on the right
23404 * side and guaranteed to be >= 0.
23405 */
23406 DUK_DDD(DUK_DDDPRINT("copy exceeds target buffer nominal length"));
23407 return DUK_RET_RANGE_ERROR;
23408 }
23409
23410 /* There's no need to check for buffer validity status for the

Variable Documentation

◆ duk_bi_native_functions

DUK_INTERNAL_DECL const duk_c_function duk_bi_native_functions[149]

Definition at line 753 of file duktape-1.5.2/src-separate/duk_builtins.h.

◆ duk_strings_data

DUK_INTERNAL_DECL const duk_uint8_t duk_strings_data[1049]

Definition at line 594 of file duktape-1.5.2/src-separate/duk_builtins.h.