ReactOS  0.4.14-dev-599-g2d4d3f5
array.c File Reference
#include <math.h>
#include <assert.h>
#include "jscript.h"
#include "wine/debug.h"
Include dependency graph for array.c:

Go to the source code of this file.

Classes

struct  ArrayInstance
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (jscript)
 
static ArrayInstancearray_from_jsdisp (jsdisp_t *jsdisp)
 
static ArrayInstancearray_from_vdisp (vdisp_t *vdisp)
 
static ArrayInstancearray_this (vdisp_t *jsthis)
 
unsigned array_get_length (jsdisp_t *array)
 
static HRESULT get_length (script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
 
static HRESULT set_length (jsdisp_t *obj, DWORD length)
 
static WCHARidx_to_str (DWORD idx, WCHAR *ptr)
 
static HRESULT Array_get_length (script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r)
 
static HRESULT Array_set_length (script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
 
static HRESULT concat_array (jsdisp_t *array, ArrayInstance *obj, DWORD *len)
 
static HRESULT concat_obj (jsdisp_t *array, IDispatch *obj, DWORD *len)
 
static HRESULT Array_concat (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT array_join (script_ctx_t *ctx, jsdisp_t *array, DWORD length, const WCHAR *sep, unsigned seplen, jsval_t *r)
 
static HRESULT Array_join (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_pop (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_push (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_reverse (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_shift (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_slice (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT sort_cmp (script_ctx_t *ctx, jsdisp_t *cmp_func, jsval_t v1, jsval_t v2, INT *cmp)
 
static HRESULT Array_sort (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_splice (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_toString (script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_toLocaleString (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_forEach (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_indexOf (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_map (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_unshift (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT Array_get_value (script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r)
 
static void Array_destructor (jsdisp_t *dispex)
 
static void Array_on_put (jsdisp_t *dispex, const WCHAR *name)
 
static HRESULT ArrayConstr_isArray (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT ArrayConstr_value (script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
 
static HRESULT alloc_array (script_ctx_t *ctx, jsdisp_t *object_prototype, ArrayInstance **ret)
 
HRESULT create_array_constr (script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret)
 
HRESULT create_array (script_ctx_t *ctx, DWORD length, jsdisp_t **ret)
 

Variables

static const WCHAR lengthW [] = {'l','e','n','g','t','h',0}
 
static const WCHAR concatW [] = {'c','o','n','c','a','t',0}
 
static const WCHAR forEachW [] = {'f','o','r','E','a','c','h',0}
 
static const WCHAR joinW [] = {'j','o','i','n',0}
 
static const WCHAR popW [] = {'p','o','p',0}
 
static const WCHAR pushW [] = {'p','u','s','h',0}
 
static const WCHAR reverseW [] = {'r','e','v','e','r','s','e',0}
 
static const WCHAR shiftW [] = {'s','h','i','f','t',0}
 
static const WCHAR sliceW [] = {'s','l','i','c','e',0}
 
static const WCHAR sortW [] = {'s','o','r','t',0}
 
static const WCHAR spliceW [] = {'s','p','l','i','c','e',0}
 
static const WCHAR toStringW [] = {'t','o','S','t','r','i','n','g',0}
 
static const WCHAR toLocaleStringW [] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}
 
static const WCHAR unshiftW [] = {'u','n','s','h','i','f','t',0}
 
static const WCHAR indexOfW [] = {'i','n','d','e','x','O','f',0}
 
static const WCHAR mapW [] = {'m','a','p',0}
 
static const WCHAR default_separatorW [] = {',',0}
 
static const builtin_prop_t Array_props []
 
static const builtin_info_t Array_info
 
static const builtin_prop_t ArrayInst_props []
 
static const builtin_info_t ArrayInst_info
 
static const WCHAR isArrayW [] = {'i','s','A','r','r','a','y',0}
 
static const builtin_prop_t ArrayConstr_props []
 
static const builtin_info_t ArrayConstr_info
 

Function Documentation

◆ alloc_array()

static HRESULT alloc_array ( script_ctx_t ctx,
jsdisp_t object_prototype,
ArrayInstance **  ret 
)
static

Definition at line 1326 of file array.c.

1327 {
1329  HRESULT hres;
1330 
1331  array = heap_alloc_zero(sizeof(ArrayInstance));
1332  if(!array)
1333  return E_OUTOFMEMORY;
1334 
1335  if(object_prototype)
1336  hres = init_dispex(&array->dispex, ctx, &Array_info, object_prototype);
1337  else
1339 
1340  if(FAILED(hres)) {
1341  heap_free(array);
1342  return hres;
1343  }
1344 
1345  *ret = array;
1346  return S_OK;
1347 }
jsdisp_t * array_constr
Definition: jscript.h:443
static const builtin_info_t ArrayInst_info
Definition: array.c:1248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static const builtin_info_t Array_info
Definition: array.c:1235
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
int ret
#define S_OK
Definition: intsafe.h:59
HRESULT init_dispex(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype)
Definition: dispex.c:919
HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *constr)
Definition: dispex.c:1030
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by create_array(), and create_array_constr().

◆ Array_concat()

static HRESULT Array_concat ( script_ctx_t ctx,
vdisp_t jsthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 209 of file array.c.

211 {
212  jsdisp_t *ret;
213  DWORD len = 0;
214  HRESULT hres;
215 
216  TRACE("\n");
217 
218  hres = create_array(ctx, 0, &ret);
219  if(FAILED(hres))
220  return hres;
221 
222  hres = concat_obj(ret, jsthis->u.disp, &len);
223  if(SUCCEEDED(hres)) {
224  DWORD i;
225 
226  for(i=0; i < argc; i++) {
229  else
231  if(FAILED(hres))
232  break;
233  }
234  }
235 
236  if(FAILED(hres))
237  return hres;
238 
239  if(r)
240  *r = jsval_obj(ret);
241  else
243  return S_OK;
244 }
static int argc
Definition: ServiceArgs.c:12
static IDispatch * get_object(jsval_t v)
Definition: jsval.h:219
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define argv
Definition: mplay32.c:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static BOOL is_object_instance(jsval_t v)
Definition: jsval.h:166
union vdisp_t::@425 u
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
IDispatch * disp
Definition: jscript.h:142
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
GLenum GLsizei len
Definition: glext.h:6722
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
#define S_OK
Definition: intsafe.h:59
HRESULT create_array(script_ctx_t *ctx, DWORD length, jsdisp_t **ret)
Definition: array.c:1381
static void jsdisp_release(jsdisp_t *jsdisp)
Definition: jscript.h:268
static jsval_t jsval_obj(jsdisp_t *obj)
Definition: jsval.h:125
static HRESULT concat_obj(jsdisp_t *array, IDispatch *obj, DWORD *len)
Definition: array.c:191
#define SUCCEEDED(hr)
Definition: intsafe.h:57

◆ Array_destructor()

static void Array_destructor ( jsdisp_t dispex)
static

Definition at line 1190 of file array.c.

1191 {
1192  heap_free(dispex);
1193 }
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ Array_forEach()

static HRESULT Array_forEach ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 957 of file array.c.

959 {
960  jsval_t value, args[3], res;
961  jsdisp_t *jsthis;
962  unsigned length, i;
963  HRESULT hres;
964 
965  TRACE("\n");
966 
967  hres = get_length(ctx, vthis, &jsthis, &length);
968  if(FAILED(hres))
969  return hres;
970 
971  /* Fixme check IsCallable */
972  if(!argc || !is_object_instance(argv[0]) || !get_object(argv[0])) {
973  FIXME("Invalid arg %s\n", debugstr_jsval(argc ? argv[0] : jsval_undefined()));
974  return E_INVALIDARG;
975  }
976 
977  if(argc > 1 && !is_undefined(argv[1])) {
978  FIXME("Unsupported context this %s\n", debugstr_jsval(argv[1]));
979  return E_NOTIMPL;
980  }
981 
982  for(i = 0; i < length; i++) {
983  hres = jsdisp_get_idx(jsthis, i, &value);
984  if(hres == DISP_E_UNKNOWNNAME)
985  continue;
986  if(FAILED(hres))
987  return hres;
988 
989  args[0] = value;
990  args[1] = jsval_number(i);
991  args[2] = jsval_obj(jsthis);
994  if(FAILED(hres))
995  return hres;
997  }
998 
999  if(r) *r = jsval_undefined();
1000  return S_OK;
1001 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static int argc
Definition: ServiceArgs.c:12
void jsval_release(jsval_t val)
Definition: jsutils.c:191
static IDispatch * get_object(jsval_t v)
Definition: jsval.h:219
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static BOOL is_undefined(jsval_t v)
Definition: jsval.h:171
#define argv
Definition: mplay32.c:18
Definition: match.c:390
#define DISPATCH_METHOD
Definition: oleauto.h:1006
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_object_instance(jsval_t v)
Definition: jsval.h:166
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
GLsizei const GLfloat * value
Definition: glext.h:6069
static jsval_t jsval_undefined(void)
Definition: jsval.h:137
#define S_OK
Definition: intsafe.h:59
#define ARRAY_SIZE(a)
Definition: main.h:24
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425
#define E_NOTIMPL
Definition: ddrawi.h:99
static jsval_t jsval_obj(jsdisp_t *obj)
Definition: jsval.h:125
HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, IDispatch *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: dispex.c:1228
GLuint res
Definition: glext.h:9613
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79
static jsval_t jsval_number(double n)
Definition: jsval.h:144
const char * debugstr_jsval(const jsval_t) DECLSPEC_HIDDEN
Definition: jsutils.c:35

◆ array_from_jsdisp()

static ArrayInstance* array_from_jsdisp ( jsdisp_t jsdisp)
inlinestatic

Definition at line 58 of file array.c.

59 {
60  return CONTAINING_RECORD(jsdisp, ArrayInstance, dispex);
61 }
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560

Referenced by array_from_vdisp(), Array_get_length(), array_get_length(), Array_get_value(), Array_on_put(), Array_set_length(), concat_obj(), and set_length().

◆ array_from_vdisp()

static ArrayInstance* array_from_vdisp ( vdisp_t vdisp)
inlinestatic

Definition at line 63 of file array.c.

64 {
65  return array_from_jsdisp(vdisp->u.jsdisp);
66 }
jsdisp_t * jsdisp
Definition: jscript.h:144
union vdisp_t::@425 u
static ArrayInstance * array_from_jsdisp(jsdisp_t *jsdisp)
Definition: array.c:58

Referenced by array_this().

◆ array_get_length()

unsigned array_get_length ( jsdisp_t array)

Definition at line 73 of file array.c.

74 {
77 }
#define assert(x)
Definition: debug.h:53
static BOOL is_class(jsdisp_t *jsdisp, jsclass_t class)
Definition: jscript.h:504
static ArrayInstance * array_from_jsdisp(jsdisp_t *jsdisp)
Definition: array.c:58
DWORD length
Definition: array.c:36

Referenced by stringify_array().

◆ Array_get_length()

static HRESULT Array_get_length ( script_ctx_t ctx,
jsdisp_t jsthis,
jsval_t r 
)
static

Definition at line 133 of file array.c.

134 {
135  TRACE("%p\n", jsthis);
136 
137  *r = jsval_number(array_from_jsdisp(jsthis)->length);
138  return S_OK;
139 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define TRACE(s)
Definition: solgame.cpp:4
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
static ArrayInstance * array_from_jsdisp(jsdisp_t *jsdisp)
Definition: array.c:58
#define S_OK
Definition: intsafe.h:59
static jsval_t jsval_number(double n)
Definition: jsval.h:144

◆ Array_get_value()

static HRESULT Array_get_value ( script_ctx_t ctx,
jsdisp_t jsthis,
jsval_t r 
)
static

Definition at line 1180 of file array.c.

1181 {
1183 
1184  TRACE("\n");
1185 
1186  return array_join(ctx, &array->dispex, array->length, default_separatorW,
1188 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR default_separatorW[]
Definition: array.c:56
static HRESULT array_join(script_ctx_t *ctx, jsdisp_t *array, DWORD length, const WCHAR *sep, unsigned seplen, jsval_t *r)
Definition: array.c:246
#define lstrlenW
Definition: compat.h:415
#define TRACE(s)
Definition: solgame.cpp:4
static ArrayInstance * array_from_jsdisp(jsdisp_t *jsdisp)
Definition: array.c:58

◆ Array_indexOf()

static HRESULT Array_indexOf ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 1003 of file array.c.

1005 {
1006  jsdisp_t *jsthis;
1007  unsigned length, i, from = 0;
1008  jsval_t search, value;
1009  BOOL eq;
1010  HRESULT hres;
1011 
1012  TRACE("\n");
1013 
1014  hres = get_length(ctx, vthis, &jsthis, &length);
1015  if(FAILED(hres))
1016  return hres;
1017  if(!length) {
1018  if(r) *r = jsval_number(-1);
1019  return S_OK;
1020  }
1021 
1022  search = argc ? argv[0] : jsval_undefined();
1023 
1024  if(argc > 1) {
1025  double from_arg;
1026 
1027  hres = to_integer(ctx, argv[1], &from_arg);
1028  if(FAILED(hres))
1029  return hres;
1030 
1031  if(from_arg >= 0)
1032  from = min(from_arg, length);
1033  else
1034  from = max(from_arg + length, 0);
1035  }
1036 
1037  for(i = from; i < length; i++) {
1038  hres = jsdisp_get_idx(jsthis, i, &value);
1039  if(hres == DISP_E_UNKNOWNNAME)
1040  continue;
1041  if(FAILED(hres))
1042  return hres;
1043 
1046  if(FAILED(hres))
1047  return hres;
1048  if(eq) {
1049  if(r) *r = jsval_number(i);
1050  return S_OK;
1051  }
1052  }
1053 
1054  if(r) *r = jsval_number(-1);
1055  return S_OK;
1056 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static short search(int val, const short *table, int size)
Definition: msg711.c:255
static int argc
Definition: ServiceArgs.c:12
void jsval_release(jsval_t val)
Definition: jsutils.c:191
#define max(a, b)
Definition: svc.c:63
HRESULT to_integer(script_ctx_t *, jsval_t, double *) DECLSPEC_HIDDEN
Definition: jsutils.c:648
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define argv
Definition: mplay32.c:18
#define eq(received, expected, label, type)
Definition: locale.c:144
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int BOOL
Definition: ntddk_ex.h:94
HRESULT jsval_strict_equal(jsval_t lval, jsval_t rval, BOOL *ret)
Definition: engine.c:531
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
GLsizei const GLfloat * value
Definition: glext.h:6069
static jsval_t jsval_undefined(void)
Definition: jsval.h:137
#define S_OK
Definition: intsafe.h:59
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425
#define min(a, b)
Definition: monoChain.cc:55
CardRegion * from
Definition: spigame.cpp:19
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79
static jsval_t jsval_number(double n)
Definition: jsval.h:144

◆ array_join()

static HRESULT array_join ( script_ctx_t ctx,
jsdisp_t array,
DWORD  length,
const WCHAR sep,
unsigned  seplen,
jsval_t r 
)
static

Definition at line 246 of file array.c.

248 {
249  jsstr_t **str_tab, *ret = NULL;
250  jsval_t val;
251  DWORD i;
252  HRESULT hres = E_FAIL;
253 
254  if(!length) {
255  if(r)
256  *r = jsval_string(jsstr_empty());
257  return S_OK;
258  }
259 
260  str_tab = heap_alloc_zero(length * sizeof(*str_tab));
261  if(!str_tab)
262  return E_OUTOFMEMORY;
263 
264  for(i=0; i < length; i++) {
265  hres = jsdisp_get_idx(array, i, &val);
266  if(hres == DISP_E_UNKNOWNNAME) {
267  hres = S_OK;
268  continue;
269  } else if(FAILED(hres))
270  break;
271 
272  if(!is_undefined(val) && !is_null(val)) {
273  hres = to_string(ctx, val, str_tab+i);
275  if(FAILED(hres))
276  break;
277  }
278  }
279 
280  if(SUCCEEDED(hres)) {
281  DWORD len = 0;
282 
283  if(str_tab[0])
284  len = jsstr_length(str_tab[0]);
285  for(i=1; i < length; i++) {
286  len += seplen;
287  if(str_tab[i])
288  len += jsstr_length(str_tab[i]);
289  if(len > JSSTR_MAX_LENGTH) {
291  break;
292  }
293  }
294 
295  if(SUCCEEDED(hres)) {
296  WCHAR *ptr = NULL;
297 
298  ret = jsstr_alloc_buf(len, &ptr);
299  if(ret) {
300  if(str_tab[0])
301  ptr += jsstr_flush(str_tab[0], ptr);
302 
303  for(i=1; i < length; i++) {
304  if(seplen) {
305  memcpy(ptr, sep, seplen*sizeof(WCHAR));
306  ptr += seplen;
307  }
308 
309  if(str_tab[i])
310  ptr += jsstr_flush(str_tab[i], ptr);
311  }
312  }else {
314  }
315  }
316  }
317 
318  for(i=0; i < length; i++) {
319  if(str_tab[i])
320  jsstr_release(str_tab[i]);
321  }
322  heap_free(str_tab);
323  if(FAILED(hres))
324  return hres;
325 
326  TRACE("= %s\n", debugstr_jsstr(ret));
327 
328  if(r)
329  *r = jsval_string(ret);
330  else
332  return S_OK;
333 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
void jsval_release(jsval_t val)
Definition: jsutils.c:191
Definition: jsstr.h:39
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static BOOL is_undefined(jsval_t v)
Definition: jsval.h:171
static unsigned jsstr_flush(jsstr_t *str, WCHAR *buf)
Definition: jsstr.h:148
#define JSSTR_MAX_LENGTH
Definition: jsstr.h:45
static unsigned jsstr_length(jsstr_t *str)
Definition: jsstr.h:58
static void jsstr_release(jsstr_t *str)
Definition: jsstr.h:110
#define E_FAIL
Definition: ddrawi.h:102
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static PVOID ptr
Definition: dispmode.c:27
static HRESULT to_string(VARIANT *src, BSTR *dst)
Definition: host.c:48
jsstr_t * jsstr_empty(void)
Definition: jsstr.c:288
smooth NULL
Definition: ftsmooth.c:416
static jsval_t jsval_string(jsstr_t *str)
Definition: jsval.h:109
GLuint GLfloat * val
Definition: glext.h:7180
#define TRACE(s)
Definition: solgame.cpp:4
const char * debugstr_jsstr(jsstr_t *str)
Definition: jsstr.c:37
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned long DWORD
Definition: ntddk_ex.h:95
static BOOL is_null(jsval_t v)
Definition: jsval.h:176
int ret
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425
jsstr_t * jsstr_alloc_buf(unsigned len, WCHAR **buf)
Definition: jsstr.c:69
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

Referenced by Array_get_value(), Array_join(), and Array_toString().

◆ Array_join()

static HRESULT Array_join ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 336 of file array.c.

338 {
339  jsdisp_t *jsthis;
340  DWORD length;
341  HRESULT hres;
342 
343  TRACE("\n");
344 
345  hres = get_length(ctx, vthis, &jsthis, &length);
346  if(FAILED(hres))
347  return hres;
348 
349  if(argc) {
350  const WCHAR *sep;
351  jsstr_t *sep_str;
352 
353  hres = to_flat_string(ctx, argv[0], &sep_str, &sep);
354  if(FAILED(hres))
355  return hres;
356 
357  hres = array_join(ctx, jsthis, length, sep, jsstr_length(sep_str), r);
358 
359  jsstr_release(sep_str);
360  }else {
362  }
363 
364  return hres;
365 }
static int argc
Definition: ServiceArgs.c:12
Definition: jsstr.h:39
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static const WCHAR default_separatorW[]
Definition: array.c:56
static HRESULT array_join(script_ctx_t *ctx, jsdisp_t *array, DWORD length, const WCHAR *sep, unsigned seplen, jsval_t *r)
Definition: array.c:246
static unsigned jsstr_length(jsstr_t *str)
Definition: jsstr.h:58
static void jsstr_release(jsstr_t *str)
Definition: jsstr.h:110
#define argv
Definition: mplay32.c:18
#define lstrlenW
Definition: compat.h:415
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT to_flat_string(script_ctx_t *, jsval_t, jsstr_t **, const WCHAR **) DECLSPEC_HIDDEN
Definition: jsutils.c:798
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79

◆ Array_map()

static HRESULT Array_map ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 1058 of file array.c.

1059 {
1060  IDispatch *context_this = NULL, *callback;
1061  jsval_t callback_args[3], mapped_value;
1062  jsdisp_t *jsthis, *array;
1063  DWORD length, k;
1064  HRESULT hres;
1065 
1066  TRACE("\n");
1067 
1068  hres = get_length(ctx, vthis, &jsthis, &length);
1069  if(FAILED(hres)) {
1070  FIXME("Could not get length\n");
1071  return hres;
1072  }
1073 
1074  /* Fixme check IsCallable */
1075  if(!argc || !is_object_instance(argv[0]) || !get_object(argv[0])) {
1076  FIXME("Invalid arg %s\n", debugstr_jsval(argc ? argv[0] : jsval_undefined()));
1077  return E_INVALIDARG;
1078  }
1079  callback = get_object(argv[0]);
1080 
1081  if(argc > 1) {
1082  if(is_object_instance(argv[1]) && get_object(argv[1])) {
1083  context_this = get_object(argv[1]);
1084  }else if(!is_undefined(argv[1])) {
1085  FIXME("Unsupported context this %s\n", debugstr_jsval(argv[1]));
1086  return E_NOTIMPL;
1087  }
1088  }
1089 
1090  hres = create_array(ctx, length, &array);
1091  if(FAILED(hres))
1092  return hres;
1093 
1094  for(k = 0; k < length; k++) {
1095  hres = jsdisp_get_idx(jsthis, k, &callback_args[0]);
1096  if(hres == DISP_E_UNKNOWNNAME)
1097  continue;
1098  if(FAILED(hres))
1099  break;
1100 
1101  callback_args[1] = jsval_number(k);
1102  callback_args[2] = jsval_obj(jsthis);
1103  hres = disp_call_value(ctx, callback, context_this, DISPATCH_METHOD, 3, callback_args, &mapped_value);
1104  jsval_release(callback_args[0]);
1105  if(FAILED(hres))
1106  break;
1107 
1108  hres = jsdisp_propput_idx(array, k, mapped_value);
1109  if(FAILED(hres))
1110  break;
1111  }
1112 
1113  if(SUCCEEDED(hres) && r)
1114  *r = jsval_obj(array);
1115  else
1117  return hres;
1118 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static int argc
Definition: ServiceArgs.c:12
void jsval_release(jsval_t val)
Definition: jsutils.c:191
static IDispatch * get_object(jsval_t v)
Definition: jsval.h:219
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
static BOOL is_undefined(jsval_t v)
Definition: jsval.h:171
#define argv
Definition: mplay32.c:18
#define DISPATCH_METHOD
Definition: oleauto.h:1006
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_object_instance(jsval_t v)
Definition: jsval.h:166
MmuTrapHandler callback[0x30]
Definition: mmuobject.c:44
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
static jsval_t jsval_undefined(void)
Definition: jsval.h:137
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT create_array(script_ctx_t *ctx, DWORD length, jsdisp_t **ret)
Definition: array.c:1381
static void jsdisp_release(jsdisp_t *jsdisp)
Definition: jscript.h:268
static jsval_t jsval_obj(jsdisp_t *obj)
Definition: jsval.h:125
HRESULT disp_call_value(script_ctx_t *ctx, IDispatch *disp, IDispatch *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: dispex.c:1228
int k
Definition: mpi.c:3369
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320
static jsval_t jsval_number(double n)
Definition: jsval.h:144
const char * debugstr_jsval(const jsval_t) DECLSPEC_HIDDEN
Definition: jsutils.c:35

◆ Array_on_put()

static void Array_on_put ( jsdisp_t dispex,
const WCHAR name 
)
static

Definition at line 1195 of file array.c.

1196 {
1198  const WCHAR *ptr = name;
1199  DWORD id = 0;
1200 
1201  if(!iswdigit(*ptr))
1202  return;
1203 
1204  while(*ptr && iswdigit(*ptr)) {
1205  id = id*10 + (*ptr-'0');
1206  ptr++;
1207  }
1208 
1209  if(*ptr)
1210  return;
1211 
1212  if(id >= array->length)
1213  array->length = id+1;
1214 }
#define iswdigit(_c)
Definition: ctype.h:667
static PVOID ptr
Definition: dispmode.c:27
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
static ArrayInstance * array_from_jsdisp(jsdisp_t *jsdisp)
Definition: array.c:58
GLuint const GLchar * name
Definition: glext.h:6031

◆ Array_pop()

static HRESULT Array_pop ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 367 of file array.c.

369 {
370  jsdisp_t *jsthis;
371  jsval_t val;
372  DWORD length;
373  HRESULT hres;
374 
375  TRACE("\n");
376 
377  hres = get_length(ctx, vthis, &jsthis, &length);
378  if(FAILED(hres))
379  return hres;
380 
381  if(!length) {
382  hres = set_length(jsthis, 0);
383  if(FAILED(hres))
384  return hres;
385 
386  if(r)
387  *r = jsval_undefined();
388  return S_OK;
389  }
390 
391  length--;
392  hres = jsdisp_get_idx(jsthis, length, &val);
393  if(SUCCEEDED(hres))
394  hres = jsdisp_delete_idx(jsthis, length);
395  else if(hres == DISP_E_UNKNOWNNAME) {
396  val = jsval_undefined();
397  hres = S_OK;
398  }else
399  return hres;
400 
401  if(SUCCEEDED(hres))
402  hres = set_length(jsthis, length);
403 
404  if(FAILED(hres)) {
406  return hres;
407  }
408 
409  if(r)
410  *r = val;
411  else
413  return hres;
414 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
void jsval_release(jsval_t val)
Definition: jsutils.c:191
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLfloat * val
Definition: glext.h:7180
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx)
Definition: dispex.c:1494
unsigned long DWORD
Definition: ntddk_ex.h:95
static jsval_t jsval_undefined(void)
Definition: jsval.h:137
#define S_OK
Definition: intsafe.h:59
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425
static HRESULT set_length(jsdisp_t *obj, DWORD length)
Definition: array.c:108
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79

◆ Array_push()

static HRESULT Array_push ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 417 of file array.c.

419 {
420  jsdisp_t *jsthis;
421  DWORD length = 0;
422  unsigned i;
423  HRESULT hres;
424 
425  TRACE("\n");
426 
427  hres = get_length(ctx, vthis, &jsthis, &length);
428  if(FAILED(hres))
429  return hres;
430 
431  for(i=0; i < argc; i++) {
432  hres = jsdisp_propput_idx(jsthis, length+i, argv[i]);
433  if(FAILED(hres))
434  return hres;
435  }
436 
437  hres = set_length(jsthis, length+argc);
438  if(FAILED(hres))
439  return hres;
440 
441  if(r)
443  return S_OK;
444 }
static int argc
Definition: ServiceArgs.c:12
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define argv
Definition: mplay32.c:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
#define S_OK
Definition: intsafe.h:59
static HRESULT set_length(jsdisp_t *obj, DWORD length)
Definition: array.c:108
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79
static jsval_t jsval_number(double n)
Definition: jsval.h:144

◆ Array_reverse()

static HRESULT Array_reverse ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 446 of file array.c.

448 {
449  jsdisp_t *jsthis;
450  DWORD length, k, l;
451  jsval_t v1, v2;
452  HRESULT hres1, hres2;
453 
454  TRACE("\n");
455 
456  hres1 = get_length(ctx, vthis, &jsthis, &length);
457  if(FAILED(hres1))
458  return hres1;
459 
460  for(k=0; k<length/2; k++) {
461  l = length-k-1;
462 
463  hres1 = jsdisp_get_idx(jsthis, k, &v1);
464  if(FAILED(hres1) && hres1!=DISP_E_UNKNOWNNAME)
465  return hres1;
466 
467  hres2 = jsdisp_get_idx(jsthis, l, &v2);
468  if(FAILED(hres2) && hres2!=DISP_E_UNKNOWNNAME) {
469  jsval_release(v1);
470  return hres2;
471  }
472 
473  if(hres1 == DISP_E_UNKNOWNNAME)
474  hres1 = jsdisp_delete_idx(jsthis, l);
475  else
476  hres1 = jsdisp_propput_idx(jsthis, l, v1);
477 
478  if(FAILED(hres1)) {
479  jsval_release(v1);
480  jsval_release(v2);
481  return hres1;
482  }
483 
484  if(hres2 == DISP_E_UNKNOWNNAME)
485  hres2 = jsdisp_delete_idx(jsthis, k);
486  else
487  hres2 = jsdisp_propput_idx(jsthis, k, v2);
488 
489  if(FAILED(hres2)) {
490  jsval_release(v2);
491  return hres2;
492  }
493  }
494 
495  if(r)
496  *r = jsval_obj(jsdisp_addref(jsthis));
497  return S_OK;
498 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
void jsval_release(jsval_t val)
Definition: jsutils.c:191
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
r l[0]
Definition: byte_order.h:167
#define TRACE(s)
Definition: solgame.cpp:4
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx)
Definition: dispex.c:1494
unsigned long DWORD
Definition: ntddk_ex.h:95
static jsdisp_t * jsdisp_addref(jsdisp_t *jsdisp)
Definition: jscript.h:262
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
#define S_OK
Definition: intsafe.h:59
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425
static jsval_t jsval_obj(jsdisp_t *obj)
Definition: jsval.h:125
GLfloat GLfloat v1
Definition: glext.h:6062
int k
Definition: mpi.c:3369
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79

◆ Array_set_length()

static HRESULT Array_set_length ( script_ctx_t ctx,
jsdisp_t jsthis,
jsval_t  value 
)
static

Definition at line 141 of file array.c.

142 {
144  DOUBLE len = -1;
145  DWORD i;
146  HRESULT hres;
147 
148  TRACE("%p %d\n", This, This->length);
149 
150  hres = to_number(ctx, value, &len);
151  if(FAILED(hres))
152  return hres;
153 
154  len = floor(len);
155  if(len!=(DWORD)len)
157 
158  for(i=len; i < This->length; i++) {
159  hres = jsdisp_delete_idx(&This->dispex, i);
160  if(FAILED(hres))
161  return hres;
162  }
163 
164  This->length = len;
165  return S_OK;
166 }
HRESULT throw_range_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
Definition: error.c:420
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
HRESULT to_number(script_ctx_t *, jsval_t, double *) DECLSPEC_HIDDEN
Definition: jsutils.c:609
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx)
Definition: dispex.c:1494
unsigned long DWORD
Definition: ntddk_ex.h:95
static ArrayInstance * array_from_jsdisp(jsdisp_t *jsdisp)
Definition: array.c:58
GLenum GLsizei len
Definition: glext.h:6722
#define S_OK
Definition: intsafe.h:59
#define JS_E_INVALID_LENGTH
Definition: jscript.h:568
double DOUBLE
Definition: typedefs.h:68
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)

◆ Array_shift()

static HRESULT Array_shift ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 501 of file array.c.

503 {
504  jsdisp_t *jsthis;
505  DWORD length = 0, i;
506  jsval_t v, ret;
507  HRESULT hres;
508 
509  TRACE("\n");
510 
511  hres = get_length(ctx, vthis, &jsthis, &length);
512  if(FAILED(hres))
513  return hres;
514 
515  if(!length) {
516  hres = set_length(jsthis, 0);
517  if(FAILED(hres))
518  return hres;
519 
520  if(r)
521  *r = jsval_undefined();
522  return S_OK;
523  }
524 
525  hres = jsdisp_get_idx(jsthis, 0, &ret);
526  if(hres == DISP_E_UNKNOWNNAME) {
527  ret = jsval_undefined();
528  hres = S_OK;
529  }
530 
531  for(i=1; SUCCEEDED(hres) && i<length; i++) {
532  hres = jsdisp_get_idx(jsthis, i, &v);
533  if(hres == DISP_E_UNKNOWNNAME)
534  hres = jsdisp_delete_idx(jsthis, i-1);
535  else if(SUCCEEDED(hres))
536  hres = jsdisp_propput_idx(jsthis, i-1, v);
537  }
538 
539  if(SUCCEEDED(hres)) {
540  hres = jsdisp_delete_idx(jsthis, length-1);
541  if(SUCCEEDED(hres))
542  hres = set_length(jsthis, length-1);
543  }
544 
545  if(FAILED(hres))
546  return hres;
547 
548  if(r)
549  *r = ret;
550  else
552  return hres;
553 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
void jsval_release(jsval_t val)
Definition: jsutils.c:191
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx)
Definition: dispex.c:1494
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
static jsval_t jsval_undefined(void)
Definition: jsval.h:137
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425
static HRESULT set_length(jsdisp_t *obj, DWORD length)
Definition: array.c:108
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79

◆ Array_slice()

static HRESULT Array_slice ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 556 of file array.c.

557 {
558  jsdisp_t *arr, *jsthis;
559  DOUBLE range;
560  DWORD length, start, end, idx;
561  HRESULT hres;
562 
563  TRACE("\n");
564 
565  hres = get_length(ctx, vthis, &jsthis, &length);
566  if(FAILED(hres))
567  return hres;
568 
569  if(argc) {
570  hres = to_number(ctx, argv[0], &range);
571  if(FAILED(hres))
572  return hres;
573 
574  range = floor(range);
575  if(-range>length || isnan(range)) start = 0;
576  else if(range < 0) start = range+length;
577  else if(range <= length) start = range;
578  else start = length;
579  }
580  else start = 0;
581 
582  if(argc > 1) {
583  hres = to_number(ctx, argv[1], &range);
584  if(FAILED(hres))
585  return hres;
586 
587  range = floor(range);
588  if(-range>length) end = 0;
589  else if(range < 0) end = range+length;
590  else if(range <= length) end = range;
591  else end = length;
592  }
593  else end = length;
594 
595  hres = create_array(ctx, (end>start)?end-start:0, &arr);
596  if(FAILED(hres))
597  return hres;
598 
599  for(idx=start; idx<end; idx++) {
600  jsval_t v;
601 
602  hres = jsdisp_get_idx(jsthis, idx, &v);
603  if(hres == DISP_E_UNKNOWNNAME)
604  continue;
605 
606  if(SUCCEEDED(hres)) {
607  hres = jsdisp_propput_idx(arr, idx-start, v);
608  jsval_release(v);
609  }
610 
611  if(FAILED(hres)) {
612  jsdisp_release(arr);
613  return hres;
614  }
615  }
616 
617  if(r)
618  *r = jsval_obj(arr);
619  else
620  jsdisp_release(arr);
621 
622  return S_OK;
623 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static int argc
Definition: ServiceArgs.c:12
void jsval_release(jsval_t val)
Definition: jsutils.c:191
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLuint GLuint end
Definition: gl.h:1545
#define argv
Definition: mplay32.c:18
HRESULT to_number(script_ctx_t *, jsval_t, double *) DECLSPEC_HIDDEN
Definition: jsutils.c:609
unsigned int idx
Definition: utils.c:41
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLint * range
Definition: glext.h:7539
int isnan(double x)
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
#define S_OK
Definition: intsafe.h:59
const GLdouble * v
Definition: gl.h:2040
GLuint start
Definition: gl.h:1545
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425
HRESULT create_array(script_ctx_t *ctx, DWORD length, jsdisp_t **ret)
Definition: array.c:1381
static void jsdisp_release(jsdisp_t *jsdisp)
Definition: jscript.h:268
static jsval_t jsval_obj(jsdisp_t *obj)
Definition: jsval.h:125
double DOUBLE
Definition: typedefs.h:68
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79

◆ Array_sort()

static HRESULT Array_sort ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 680 of file array.c.

682 {
683  jsdisp_t *jsthis, *cmp_func = NULL;
684  jsval_t *vtab, **sorttab = NULL;
685  DWORD length;
686  DWORD i;
687  HRESULT hres = S_OK;
688 
689  TRACE("\n");
690 
691  hres = get_length(ctx, vthis, &jsthis, &length);
692  if(FAILED(hres))
693  return hres;
694 
695  if(argc > 1) {
696  WARN("invalid arg_cnt %d\n", argc);
697  return E_FAIL;
698  }
699 
700  if(argc == 1) {
701  if(!is_object_instance(argv[0])) {
702  WARN("arg is not dispatch\n");
703  return E_FAIL;
704  }
705 
708  WARN("cmp_func is not a function\n");
709  if(cmp_func)
711  return E_FAIL;
712  }
713  }
714 
715  if(!length) {
716  if(cmp_func)
718  if(r)
719  *r = jsval_obj(jsdisp_addref(jsthis));
720  return S_OK;
721  }
722 
723  vtab = heap_alloc_zero(length * sizeof(*vtab));
724  if(vtab) {
725  for(i=0; i<length; i++) {
726  hres = jsdisp_get_idx(jsthis, i, vtab+i);
727  if(hres == DISP_E_UNKNOWNNAME) {
728  vtab[i] = jsval_undefined();
729  hres = S_OK;
730  } else if(FAILED(hres)) {
731  WARN("Could not get elem %d: %08x\n", i, hres);
732  break;
733  }
734  }
735  }else {
737  }
738 
739  if(SUCCEEDED(hres)) {
740  sorttab = heap_alloc(length*2*sizeof(*sorttab));
741  if(!sorttab)
743  }
744 
745  /* merge-sort */
746  if(SUCCEEDED(hres)) {
747  jsval_t *tmpv, **tmpbuf;
748  INT cmp;
749 
750  tmpbuf = sorttab + length;
751  for(i=0; i < length; i++)
752  sorttab[i] = vtab+i;
753 
754  for(i=0; i < length/2; i++) {
755  hres = sort_cmp(ctx, cmp_func, *sorttab[2*i+1], *sorttab[2*i], &cmp);
756  if(FAILED(hres))
757  break;
758 
759  if(cmp < 0) {
760  tmpv = sorttab[2*i];
761  sorttab[2*i] = sorttab[2*i+1];
762  sorttab[2*i+1] = tmpv;
763  }
764  }
765 
766  if(SUCCEEDED(hres)) {
767  DWORD k, a, b, bend;
768 
769  for(k=2; k < length; k *= 2) {
770  for(i=0; i+k < length; i += 2*k) {
771  a = b = 0;
772  if(i+2*k <= length)
773  bend = k;
774  else
775  bend = length - (i+k);
776 
777  memcpy(tmpbuf, sorttab+i, k*sizeof(jsval_t*));
778 
779  while(a < k && b < bend) {
780  hres = sort_cmp(ctx, cmp_func, *tmpbuf[a], *sorttab[i+k+b], &cmp);
781  if(FAILED(hres))
782  break;
783 
784  if(cmp < 0) {
785  sorttab[i+a+b] = tmpbuf[a];
786  a++;
787  }else {
788  sorttab[i+a+b] = sorttab[i+k+b];
789  b++;
790  }
791  }
792 
793  if(FAILED(hres))
794  break;
795 
796  if(a < k)
797  memcpy(sorttab+i+a+b, tmpbuf+a, (k-a)*sizeof(jsval_t*));
798  }
799 
800  if(FAILED(hres))
801  break;
802  }
803  }
804 
805  for(i=0; SUCCEEDED(hres) && i < length; i++)
806  hres = jsdisp_propput_idx(jsthis, i, *sorttab[i]);
807  }
808 
809  if(vtab) {
810  for(i=0; i < length; i++)
811  jsval_release(vtab[i]);
812  heap_free(vtab);
813  }
814  heap_free(sorttab);
815  if(cmp_func)
817 
818  if(FAILED(hres))
819  return hres;
820 
821  if(r)
822  *r = jsval_obj(jsdisp_addref(jsthis));
823  return S_OK;
824 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static int argc
Definition: ServiceArgs.c:12
void jsval_release(jsval_t val)
Definition: jsutils.c:191
static IDispatch * get_object(jsval_t v)
Definition: jsval.h:219
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define WARN(fmt,...)
Definition: debug.h:111
#define cmp(status, error)
Definition: error.c:114
#define argv
Definition: mplay32.c:18
#define E_FAIL
Definition: ddrawi.h:102
int32_t INT
Definition: typedefs.h:56
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
static BOOL is_class(jsdisp_t *jsdisp, jsclass_t class)
Definition: jscript.h:504
#define a
Definition: ke_i.h:78
smooth NULL
Definition: ftsmooth.c:416
static BOOL is_object_instance(jsval_t v)
Definition: jsval.h:166
#define b
Definition: ke_i.h:79
int(* cmp_func)(const void *ptr1, const void *ptr2)
Definition: btrfs.c:36
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned long DWORD
Definition: ntddk_ex.h:95
static jsdisp_t * jsdisp_addref(jsdisp_t *jsdisp)
Definition: jscript.h:262
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static HRESULT sort_cmp(script_ctx_t *ctx, jsdisp_t *cmp_func, jsval_t v1, jsval_t v2, INT *cmp)
Definition: array.c:625
jsdisp_t * iface_to_jsdisp(IDispatch *iface)
Definition: dispex.c:1060
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
static jsval_t jsval_undefined(void)
Definition: jsval.h:137
#define S_OK
Definition: intsafe.h:59
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425
static void jsdisp_release(jsdisp_t *jsdisp)
Definition: jscript.h:268
static jsval_t jsval_obj(jsdisp_t *obj)
Definition: jsval.h:125
GLboolean GLboolean GLboolean GLboolean a
Definition: glext.h:6204
int k
Definition: mpi.c:3369
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79
static BOOL heap_free(void *mem)
Definition: appwiz.h:75

◆ Array_splice()

static HRESULT Array_splice ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 827 of file array.c.

829 {
830  DWORD length, start=0, delete_cnt=0, i, add_args = 0;
831  jsdisp_t *ret_array = NULL, *jsthis;
832  jsval_t val;
833  double d;
834  int n;
835  HRESULT hres = S_OK;
836 
837  TRACE("\n");
838 
839  hres = get_length(ctx, vthis, &jsthis, &length);
840  if(FAILED(hres))
841  return hres;
842 
843  if(argc) {
844  hres = to_integer(ctx, argv[0], &d);
845  if(FAILED(hres))
846  return hres;
847 
848  if(is_int32(d)) {
849  if((n = d) >= 0)
850  start = min(n, length);
851  else
852  start = -n > length ? 0 : length + n;
853  }else {
854  start = d < 0.0 ? 0 : length;
855  }
856  }
857 
858  if(argc >= 2) {
859  hres = to_integer(ctx, argv[1], &d);
860  if(FAILED(hres))
861  return hres;
862 
863  if(is_int32(d)) {
864  if((n = d) > 0)
865  delete_cnt = min(n, length-start);
866  }else if(d > 0.0) {
867  delete_cnt = length-start;
868  }
869 
870  add_args = argc-2;
871  }
872 
873  if(r) {
874  hres = create_array(ctx, 0, &ret_array);
875  if(FAILED(hres))
876  return hres;
877 
878  for(i=0; SUCCEEDED(hres) && i < delete_cnt; i++) {
879  hres = jsdisp_get_idx(jsthis, start+i, &val);
880  if(hres == DISP_E_UNKNOWNNAME) {
881  hres = S_OK;
882  }else if(SUCCEEDED(hres)) {
883  hres = jsdisp_propput_idx(ret_array, i, val);
885  }
886  }
887 
888  if(SUCCEEDED(hres))
889  hres = jsdisp_propput_name(ret_array, lengthW, jsval_number(delete_cnt));
890  }
891 
892  if(add_args < delete_cnt) {
893  for(i = start; SUCCEEDED(hres) && i < length-delete_cnt; i++) {
894  hres = jsdisp_get_idx(jsthis, i+delete_cnt, &val);
895  if(hres == DISP_E_UNKNOWNNAME) {
896  hres = jsdisp_delete_idx(jsthis, i+add_args);
897  }else if(SUCCEEDED(hres)) {
898  hres = jsdisp_propput_idx(jsthis, i+add_args, val);
900  }
901  }
902 
903  for(i=length; SUCCEEDED(hres) && i != length-delete_cnt+add_args; i--)
904  hres = jsdisp_delete_idx(jsthis, i-1);
905  }else if(add_args > delete_cnt) {
906  for(i=length-delete_cnt; SUCCEEDED(hres) && i != start; i--) {
907  hres = jsdisp_get_idx(jsthis, i+delete_cnt-1, &val);
908  if(hres == DISP_E_UNKNOWNNAME) {
909  hres = jsdisp_delete_idx(jsthis, i+add_args-1);
910  }else if(SUCCEEDED(hres)) {
911  hres = jsdisp_propput_idx(jsthis, i+add_args-1, val);
913  }
914  }
915  }
916 
917  for(i=0; SUCCEEDED(hres) && i < add_args; i++)
918  hres = jsdisp_propput_idx(jsthis, start+i, argv[i+2]);
919 
920  if(SUCCEEDED(hres))
921  hres = jsdisp_propput_name(jsthis, lengthW, jsval_number(length-delete_cnt+add_args));
922 
923  if(FAILED(hres)) {
924  if(ret_array)
925  jsdisp_release(ret_array);
926  return hres;
927  }
928 
929  if(r)
930  *r = jsval_obj(ret_array);
931  return S_OK;
932 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static int argc
Definition: ServiceArgs.c:12
void jsval_release(jsval_t val)
Definition: jsutils.c:191
static const WCHAR lengthW[]
Definition: array.c:39
HRESULT to_integer(script_ctx_t *, jsval_t, double *) DECLSPEC_HIDDEN
Definition: jsutils.c:648
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble n
Definition: glext.h:7729
#define argv
Definition: mplay32.c:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
GLuint GLfloat * val
Definition: glext.h:7180
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
#define d
Definition: ke_i.h:81
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
HRESULT jsdisp_delete_idx(jsdisp_t *obj, DWORD idx)
Definition: dispex.c:1494
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
#define S_OK
Definition: intsafe.h:59
GLuint start
Definition: gl.h:1545
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425
HRESULT create_array(script_ctx_t *ctx, DWORD length, jsdisp_t **ret)
Definition: array.c:1381
#define min(a, b)
Definition: monoChain.cc:55
static void jsdisp_release(jsdisp_t *jsdisp)
Definition: jscript.h:268
static jsval_t jsval_obj(jsdisp_t *obj)
Definition: jsval.h:125
HRESULT jsdisp_propput_name(jsdisp_t *obj, const WCHAR *name, jsval_t val)
Definition: dispex.c:1344
static BOOL is_int32(double d)
Definition: jscript.h:514
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79
static jsval_t jsval_number(double n)
Definition: jsval.h:144

◆ array_this()

static ArrayInstance* array_this ( vdisp_t jsthis)
inlinestatic

Definition at line 68 of file array.c.

69 {
70  return is_vclass(jsthis, JSCLASS_ARRAY) ? array_from_vdisp(jsthis) : NULL;
71 }
smooth NULL
Definition: ftsmooth.c:416
static ArrayInstance * array_from_vdisp(vdisp_t *vdisp)
Definition: array.c:63
static BOOL is_vclass(vdisp_t *vdisp, jsclass_t class)
Definition: jscript.h:509

Referenced by Array_toString(), and get_length().

◆ Array_toLocaleString()

static HRESULT Array_toLocaleString ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 950 of file array.c.

952 {
953  FIXME("\n");
954  return E_NOTIMPL;
955 }
#define FIXME(fmt,...)
Definition: debug.h:110
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ Array_toString()

static HRESULT Array_toString ( script_ctx_t ctx,
vdisp_t jsthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 935 of file array.c.

937 {
939 
940  TRACE("\n");
941 
942  array = array_this(jsthis);
943  if(!array)
945 
946  return array_join(ctx, &array->dispex, array->length, default_separatorW,
948 }
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define JS_E_ARRAY_EXPECTED
Definition: jscript.h:569
static const WCHAR default_separatorW[]
Definition: array.c:56
static HRESULT array_join(script_ctx_t *ctx, jsdisp_t *array, DWORD length, const WCHAR *sep, unsigned seplen, jsval_t *r)
Definition: array.c:246
#define lstrlenW
Definition: compat.h:415
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
static ArrayInstance * array_this(vdisp_t *jsthis)
Definition: array.c:68
HRESULT throw_type_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
Definition: error.c:440
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320

◆ Array_unshift()

static HRESULT Array_unshift ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 1121 of file array.c.

1123 {
1124  jsdisp_t *jsthis;
1125  WCHAR buf[14], *buf_end, *str;
1126  DWORD i, length;
1127  jsval_t val;
1128  DISPID id;
1129  HRESULT hres;
1130 
1131  TRACE("\n");
1132 
1133  hres = get_length(ctx, vthis, &jsthis, &length);
1134  if(FAILED(hres))
1135  return hres;
1136 
1137  if(argc) {
1138  buf_end = buf + ARRAY_SIZE(buf)-1;
1139  *buf_end-- = 0;
1140  i = length;
1141 
1142  while(i--) {
1143  str = idx_to_str(i, buf_end);
1144 
1145  hres = jsdisp_get_id(jsthis, str, 0, &id);
1146  if(SUCCEEDED(hres)) {
1147  hres = jsdisp_propget(jsthis, id, &val);
1148  if(FAILED(hres))
1149  return hres;
1150 
1151  hres = jsdisp_propput_idx(jsthis, i+argc, val);
1152  jsval_release(val);
1153  }else if(hres == DISP_E_UNKNOWNNAME) {
1154  hres = IDispatchEx_DeleteMemberByDispID(vthis->u.dispex, id);
1155  }
1156  }
1157 
1158  if(FAILED(hres))
1159  return hres;
1160  }
1161 
1162  for(i=0; i<argc; i++) {
1163  hres = jsdisp_propput_idx(jsthis, i, argv[i]);
1164  if(FAILED(hres))
1165  return hres;
1166  }
1167 
1168  if(argc) {
1169  length += argc;
1170  hres = set_length(jsthis, length);
1171  if(FAILED(hres))
1172  return hres;
1173  }
1174 
1175  if(r)
1176  *r = ctx->version < 2 ? jsval_undefined() : jsval_number(length);
1177  return S_OK;
1178 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
static int argc
Definition: ServiceArgs.c:12
void jsval_release(jsval_t val)
Definition: jsutils.c:191
HRESULT jsdisp_propget(jsdisp_t *jsdisp, DISPID id, jsval_t *val)
Definition: dispex.c:1447
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define argv
Definition: mplay32.c:18
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
const WCHAR * str
DWORD version
Definition: jscript.h:420
union vdisp_t::@425 u
GLuint GLfloat * val
Definition: glext.h:7180
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
IDispatchEx * dispex
Definition: jscript.h:143
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
unsigned long DWORD
Definition: ntddk_ex.h:95
static WCHAR * idx_to_str(DWORD idx, WCHAR *ptr)
Definition: array.c:118
HRESULT jsdisp_get_id(jsdisp_t *jsdisp, const WCHAR *name, DWORD flags, DISPID *id)
Definition: dispex.c:1067
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
static jsval_t jsval_undefined(void)
Definition: jsval.h:137
#define S_OK
Definition: intsafe.h:59
static VARIANTARG static DISPID
Definition: ordinal.c:49
#define ARRAY_SIZE(a)
Definition: main.h:24
static HRESULT set_length(jsdisp_t *obj, DWORD length)
Definition: array.c:108
GLenum GLuint id
Definition: glext.h:5579
#define SUCCEEDED(hr)
Definition: intsafe.h:57
static HRESULT get_length(script_ctx_t *ctx, vdisp_t *vdisp, jsdisp_t **jsthis, DWORD *ret)
Definition: array.c:79
static jsval_t jsval_number(double n)
Definition: jsval.h:144

◆ ArrayConstr_isArray()

static HRESULT ArrayConstr_isArray ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 1258 of file array.c.

1259 {
1260  jsdisp_t *obj;
1261 
1262  TRACE("\n");
1263 
1264  if(!argc || !is_object_instance(argv[0])) {
1265  if(r) *r = jsval_bool(FALSE);
1266  return S_OK;
1267  }
1268 
1270  if(r) *r = jsval_bool(obj && is_class(obj, JSCLASS_ARRAY));
1271  if(obj) jsdisp_release(obj);
1272  return S_OK;
1273 }
static int argc
Definition: ServiceArgs.c:12
static IDispatch * get_object(jsval_t v)
Definition: jsval.h:219
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
#define argv
Definition: mplay32.c:18
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
static BOOL is_class(jsdisp_t *jsdisp, jsclass_t class)
Definition: jscript.h:504
static BOOL is_object_instance(jsval_t v)
Definition: jsval.h:166
#define TRACE(s)
Definition: solgame.cpp:4
jsdisp_t * iface_to_jsdisp(IDispatch *iface)
Definition: dispex.c:1060
#define S_OK
Definition: intsafe.h:59
static void jsdisp_release(jsdisp_t *jsdisp)
Definition: jscript.h:268
static jsval_t jsval_bool(BOOL b)
Definition: jsval.h:101

◆ ArrayConstr_value()

static HRESULT ArrayConstr_value ( script_ctx_t ctx,
vdisp_t vthis,
WORD  flags,
unsigned  argc,
jsval_t argv,
jsval_t r 
)
static

Definition at line 1275 of file array.c.

1277 {
1278  jsdisp_t *obj;
1279  DWORD i;
1280  HRESULT hres;
1281 
1282  TRACE("\n");
1283 
1284  switch(flags) {
1285  case DISPATCH_METHOD:
1286  case DISPATCH_CONSTRUCT: {
1287  if(argc == 1 && is_number(argv[0])) {
1288  double n = get_number(argv[0]);
1289 
1290  if(n < 0 || !is_int32(n))
1292 
1293  hres = create_array(ctx, n, &obj);
1294  if(FAILED(hres))
1295  return hres;
1296 
1297  *r = jsval_obj(obj);
1298  return S_OK;
1299  }
1300 
1301  hres = create_array(ctx, argc, &obj);
1302  if(FAILED(hres))
1303  return hres;
1304 
1305  for(i=0; i < argc; i++) {
1307  if(FAILED(hres))
1308  break;
1309  }
1310  if(FAILED(hres)) {
1312  return hres;
1313  }
1314 
1315  *r = jsval_obj(obj);
1316  break;
1317  }
1318  default:
1319  FIXME("unimplemented flags: %x\n", flags);
1320  return E_NOTIMPL;
1321  }
1322 
1323  return S_OK;
1324 }
static int argc
Definition: ServiceArgs.c:12
HRESULT throw_range_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
Definition: error.c:420
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLdouble n
Definition: glext.h:7729
#define argv
Definition: mplay32.c:18
static BOOL is_number(jsval_t v)
Definition: jsval.h:191
#define DISPATCH_METHOD
Definition: oleauto.h:1006
GLsizei GLsizei GLuint * obj
Definition: glext.h:6042
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLbitfield flags
Definition: glext.h:7161
static double get_number(jsval_t v)
Definition: jsval.h:224
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
#define S_OK
Definition: intsafe.h:59
#define E_NOTIMPL
Definition: ddrawi.h:99
HRESULT create_array(script_ctx_t *ctx, DWORD length, jsdisp_t **ret)
Definition: array.c:1381
static void jsdisp_release(jsdisp_t *jsdisp)
Definition: jscript.h:268
static jsval_t jsval_obj(jsdisp_t *obj)
Definition: jsval.h:125
#define JS_E_INVALID_LENGTH
Definition: jscript.h:568
static BOOL is_int32(double d)
Definition: jscript.h:514

Referenced by create_array_constr().

◆ concat_array()

static HRESULT concat_array ( jsdisp_t array,
ArrayInstance obj,
DWORD len 
)
static

Definition at line 168 of file array.c.

169 {
170  jsval_t val;
171  DWORD i;
172  HRESULT hres;
173 
174  for(i=0; i < obj->length; i++) {
175  hres = jsdisp_get_idx(&obj->dispex, i, &val);
176  if(hres == DISP_E_UNKNOWNNAME)
177  continue;
178  if(FAILED(hres))
179  return hres;
180 
183  if(FAILED(hres))
184  return hres;
185  }
186 
187  *len += obj->length;
188  return S_OK;
189 }
Definition: jsval.h:54
#define DISP_E_UNKNOWNNAME
Definition: winerror.h:2515
void jsval_release(jsval_t val)
Definition: jsutils.c:191
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLuint GLfloat * val
Definition: glext.h:7180
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
unsigned long DWORD
Definition: ntddk_ex.h:95
GLenum GLsizei len
Definition: glext.h:6722
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
#define S_OK
Definition: intsafe.h:59
HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r)
Definition: dispex.c:1425

Referenced by concat_obj().

◆ concat_obj()

static HRESULT concat_obj ( jsdisp_t array,
IDispatch obj,
DWORD len 
)
static

Definition at line 191 of file array.c.

192 {
193  jsdisp_t *jsobj;
194  HRESULT hres;
195 
196  jsobj = iface_to_jsdisp(obj);
197  if(jsobj) {
198  if(is_class(jsobj, JSCLASS_ARRAY)) {
200  jsdisp_release(jsobj);
201  return hres;
202  }
203  jsdisp_release(jsobj);
204  }
205 
206  return jsdisp_propput_idx(array, (*len)++, jsval_disp(obj));
207 }
static BOOL is_class(jsdisp_t *jsdisp, jsclass_t class)
Definition: jscript.h:504
static jsval_t jsval_disp(IDispatch *obj)
Definition: jsval.h:117
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
static ArrayInstance * array_from_jsdisp(jsdisp_t *jsdisp)
Definition: array.c:58
GLenum GLsizei len
Definition: glext.h:6722
jsdisp_t * iface_to_jsdisp(IDispatch *iface)
Definition: dispex.c:1060
HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val)
Definition: dispex.c:1349
static HRESULT concat_array(jsdisp_t *array, ArrayInstance *obj, DWORD *len)
Definition: array.c:168
static void jsdisp_release(jsdisp_t *jsdisp)
Definition: jscript.h:268

Referenced by Array_concat().

◆ create_array()

HRESULT create_array ( script_ctx_t ctx,
DWORD  length,
jsdisp_t **  ret 
)

Definition at line 1381 of file array.c.

1382 {
1384  HRESULT hres;
1385 
1386  hres = alloc_array(ctx, NULL, &array);
1387  if(FAILED(hres))
1388  return hres;
1389 
1390  array->length = length;
1391 
1392  *ret = &array->dispex;
1393  return S_OK;
1394 }
smooth NULL
Definition: ftsmooth.c:416
HRESULT hres
Definition: protocol.c:465
LONG HRESULT
Definition: typedefs.h:77
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
int ret
static HRESULT alloc_array(script_ctx_t *ctx, jsdisp_t *object_prototype, ArrayInstance **ret)
Definition: array.c:1326
#define S_OK
Definition: intsafe.h:59
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320

Referenced by Array_concat(), Array_map(), Array_slice(), Array_splice(), ArrayConstr_value(), create_match_array(), interp_carray(), parse_json_value(), regexp_string_match(), String_split(), and VBArray_toArray().

◆ create_array_constr()

HRESULT create_array_constr ( script_ctx_t ctx,
jsdisp_t object_prototype,
jsdisp_t **  ret 
)

Definition at line 1364 of file array.c.

1365 {
1367  HRESULT hres;
1368 
1369  static const WCHAR ArrayW[] = {'A','r','r','a','y',0};
1370 
1371  hres = alloc_array(ctx, object_prototype, &array);
1372  if(FAILED(hres))
1373  return hres;
1374 
1376 
1377  jsdisp_release(&array->dispex);
1378  return hres;
1379 }
#define PROPF_CONSTR
Definition: jscript.h:98
HRESULT create_builtin_constructor(script_ctx_t *ctx, builtin_invoke_t value_proc, const WCHAR *name, const builtin_info_t *builtin_info, DWORD flags, jsdisp_t *prototype, jsdisp_t **ret)
Definition: function.c:686
static const builtin_info_t ArrayConstr_info
Definition: array.c:1355
HRESULT hres
Definition: protocol.c:465
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
static HRESULT ArrayConstr_value(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:1275
static const WCHAR ArrayW[]
Definition: global.c:36
int ret
static HRESULT alloc_array(script_ctx_t *ctx, jsdisp_t *object_prototype, ArrayInstance **ret)
Definition: array.c:1326
static void jsdisp_release(jsdisp_t *jsdisp)
Definition: jscript.h:268
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320

Referenced by init_constructors().

◆ get_length()

static HRESULT get_length ( script_ctx_t ctx,
vdisp_t vdisp,
jsdisp_t **  jsthis,
DWORD ret 
)
static

Definition at line 79 of file array.c.

80 {
82  jsval_t val;
83  HRESULT hres;
84 
85  array = array_this(vdisp);
86  if(array) {
87  *jsthis = &array->dispex;
88  *ret = array->length;
89  return S_OK;
90  }
91 
92  if(!is_jsdisp(vdisp))
94 
96  if(FAILED(hres))
97  return hres;
98 
99  hres = to_uint32(ctx, val, ret);
101  if(FAILED(hres))
102  return hres;
103 
104  *jsthis = vdisp->u.jsdisp;
105  return S_OK;
106 }
HRESULT to_uint32(script_ctx_t *, jsval_t, UINT32 *) DECLSPEC_HIDDEN
Definition: jsutils.c:686
Definition: jsval.h:54
void jsval_release(jsval_t val)
Definition: jsutils.c:191
static const WCHAR lengthW[]
Definition: array.c:39
smooth NULL
Definition: ftsmooth.c:416
jsdisp_t * jsdisp
Definition: jscript.h:144
union vdisp_t::@425 u
GLuint GLfloat * val
Definition: glext.h:7180
HRESULT hres
Definition: protocol.c:465
HRESULT jsdisp_propget_name(jsdisp_t *obj, const WCHAR *name, jsval_t *val)
Definition: dispex.c:1408
LONG HRESULT
Definition: typedefs.h:77
static ArrayInstance * array_this(vdisp_t *jsthis)
Definition: array.c:68
int ret
#define S_OK
Definition: intsafe.h:59
#define JS_E_JSCRIPT_EXPECTED
Definition: jscript.h:561
HRESULT throw_type_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
Definition: error.c:440
static BOOL is_jsdisp(vdisp_t *vdisp)
Definition: jscript.h:157
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum GLint const GLfloat GLenum GLint const GLushort GLint GLint GLsizei GLsizei GLenum GLsizei GLsizei GLenum GLenum const GLvoid GLenum GLdouble GLenum GLint GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLenum GLfloat GLenum GLfloat GLenum GLushort const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLenum GLint GLenum GLint GLenum GLint GLuint GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble const GLfloat GLenum const GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLdouble GLint GLint GLsizei GLsizei GLenum GLuint GLenum array
Definition: glfuncs.h:320

Referenced by Array_forEach(), Array_indexOf(), Array_join(), Array_map(), Array_pop(), Array_push(), Array_reverse(), Array_shift(), Array_slice(), Array_sort(), Array_splice(), and Array_unshift().

◆ idx_to_str()

static WCHAR* idx_to_str ( DWORD  idx,
WCHAR ptr 
)
static

Definition at line 118 of file array.c.

119 {
120  if(!idx) {
121  *ptr = '0';
122  return ptr;
123  }
124 
125  while(idx) {
126  *ptr-- = '0' + (idx%10);
127  idx /= 10;
128  }
129 
130  return ptr+1;
131 }
static PVOID ptr
Definition: dispmode.c:27
unsigned int idx
Definition: utils.c:41

Referenced by Array_unshift().

◆ set_length()

static HRESULT set_length ( jsdisp_t obj,
DWORD  length 
)
static

Definition at line 108 of file array.c.

109 {
110  if(is_class(obj, JSCLASS_ARRAY)) {
112  return S_OK;
113  }
114 
116 }
static const WCHAR lengthW[]
Definition: array.c:39
static BOOL is_class(jsdisp_t *jsdisp, jsclass_t class)
Definition: jscript.h:504
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
static ArrayInstance * array_from_jsdisp(jsdisp_t *jsdisp)
Definition: array.c:58
DWORD length
Definition: array.c:36
#define S_OK
Definition: intsafe.h:59
HRESULT jsdisp_propput_name(jsdisp_t *obj, const WCHAR *name, jsval_t val)
Definition: dispex.c:1344
static jsval_t jsval_number(double n)
Definition: jsval.h:144

Referenced by Array_pop(), Array_push(), Array_shift(), and Array_unshift().

◆ sort_cmp()

static HRESULT sort_cmp ( script_ctx_t ctx,
jsdisp_t cmp_func,
jsval_t  v1,
jsval_t  v2,
INT cmp 
)
static

Definition at line 625 of file array.c.

626 {
627  HRESULT hres;
628 
629  if(cmp_func) {
630  jsval_t args[2];
631  jsval_t res;
632  double n;
633 
634  args[0] = v1;
635  args[1] = v2;
636 
638  if(FAILED(hres))
639  return hres;
640 
641  hres = to_number(ctx, res, &n);
643  if(FAILED(hres))
644  return hres;
645 
646  if(n == 0)
647  *cmp = 0;
648  *cmp = n > 0.0 ? 1 : -1;
649  }else if(is_undefined(v1)) {
650  *cmp = is_undefined(v2) ? 0 : 1;
651  }else if(is_undefined(v2)) {
652  *cmp = -1;
653  }else if(is_number(v1) && is_number(v2)) {
654  double d = get_number(v1)-get_number(v2);
655  if(d > 0.0)
656  *cmp = 1;
657  else
658  *cmp = d < -0.0 ? -1 : 0;
659  }else {
660  jsstr_t *x, *y;
661 
662  hres = to_string(ctx, v1, &x);
663  if(FAILED(hres))
664  return hres;
665 
666  hres = to_string(ctx, v2, &y);
667  if(SUCCEEDED(hres)) {
668  *cmp = jsstr_cmp(x, y);
669  jsstr_release(y);
670  }
671  jsstr_release(x);
672  if(FAILED(hres))
673  return hres;
674  }
675 
676  return S_OK;
677 }
Definition: jsval.h:54
void jsval_release(jsval_t val)
Definition: jsutils.c:191
Definition: jsstr.h:39
GLdouble n
Definition: glext.h:7729
static BOOL is_undefined(jsval_t v)
Definition: jsval.h:171
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
static void jsstr_release(jsstr_t *str)
Definition: jsstr.h:110
#define cmp(status, error)
Definition: error.c:114
static BOOL is_number(jsval_t v)
Definition: jsval.h:191
Definition: match.c:390
#define DISPATCH_METHOD
Definition: oleauto.h:1006
int jsstr_cmp(jsstr_t *str1, jsstr_t *str2)
Definition: jsstr.c:189
HRESULT to_number(script_ctx_t *, jsval_t, double *) DECLSPEC_HIDDEN
Definition: jsutils.c:609
static HRESULT to_string(VARIANT *src, BSTR *dst)
Definition: host.c:48
smooth NULL
Definition: ftsmooth.c:416
int(* cmp_func)(const void *ptr1, const void *ptr2)
Definition: btrfs.c:36
HRESULT jsdisp_call_value(jsdisp_t *jsfunc, IDispatch *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: dispex.c:1089
HRESULT hres
Definition: protocol.c:465
#define d
Definition: ke_i.h:81
LONG HRESULT
Definition: typedefs.h:77
static double get_number(jsval_t v)
Definition: jsval.h:224
GLfloat GLfloat GLfloat v2
Definition: glext.h:6063
#define S_OK
Definition: intsafe.h:59
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLuint res
Definition: glext.h:9613
GLfloat GLfloat v1
Definition: glext.h:6062
#define SUCCEEDED(hr)
Definition: intsafe.h:57

Referenced by Array_sort().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( jscript  )

Variable Documentation

◆ Array_info

const builtin_info_t Array_info
static
Initial value:
= {
}
static void Array_on_put(jsdisp_t *dispex, const WCHAR *name)
Definition: array.c:1195
static HRESULT Array_get_value(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r)
Definition: array.c:1180
smooth NULL
Definition: ftsmooth.c:416
static void Array_destructor(jsdisp_t *dispex)
Definition: array.c:1190
#define ARRAY_SIZE(a)
Definition: main.h:24
static const builtin_prop_t Array_props[]
Definition: array.c:1216

Definition at line 1235 of file array.c.

Referenced by alloc_array().

◆ Array_props

const builtin_prop_t Array_props[]
static
Initial value:
= {
}
#define PROPF_ES5
Definition: jscript.h:108
static HRESULT Array_toLocaleString(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:950
static const WCHAR lengthW[]
Definition: array.c:39
static HRESULT Array_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:935
static HRESULT Array_reverse(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:446
static HRESULT Array_set_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
Definition: array.c:141
static const WCHAR sliceW[]
Definition: array.c:47
static const WCHAR toStringW[]
Definition: array.c:50
static HRESULT Array_join(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:336
static HRESULT Array_shift(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:501
static const WCHAR mapW[]
Definition: array.c:54
static const WCHAR popW[]
Definition: array.c:43
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR shiftW[]
Definition: array.c:46
static HRESULT Array_pop(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:367
static const WCHAR unshiftW[]
Definition: array.c:52
static HRESULT Array_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r)
Definition: array.c:133
static HRESULT Array_splice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:827
static HRESULT Array_push(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:417
static HRESULT Array_slice(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:556
static const WCHAR reverseW[]
Definition: array.c:45
static HRESULT Array_sort(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:680
static const WCHAR sortW[]
Definition: array.c:48
static const WCHAR joinW[]
Definition: array.c:42
static HRESULT Array_map(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:1058
static HRESULT Array_unshift(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:1121
static const WCHAR forEachW[]
Definition: array.c:41
#define PROPF_METHOD
Definition: jscript.h:97
static const WCHAR toLocaleStringW[]
Definition: array.c:51
static const WCHAR pushW[]
Definition: array.c:44
static HRESULT Array_forEach(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:957
static const WCHAR spliceW[]
Definition: array.c:49
static HRESULT Array_concat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:209
static const WCHAR concatW[]
Definition: array.c:40
static HRESULT Array_indexOf(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:1003
static const WCHAR indexOfW[]
Definition: array.c:53

Definition at line 1216 of file array.c.

◆ ArrayConstr_info

const builtin_info_t ArrayConstr_info
static
Initial value:
= {
}
smooth NULL
Definition: ftsmooth.c:416
#define DEFAULT_FUNCTION_VALUE
Definition: jscript.h:315
static const builtin_prop_t ArrayConstr_props[]
Definition: array.c:1351
#define ARRAY_SIZE(a)
Definition: main.h:24

Definition at line 1355 of file array.c.

Referenced by create_array_constr().

◆ ArrayConstr_props

const builtin_prop_t ArrayConstr_props[]
static
Initial value:
= {
}
#define PROPF_ES5
Definition: jscript.h:108
static HRESULT ArrayConstr_isArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
Definition: array.c:1258
static const WCHAR isArrayW[]
Definition: array.c:1349
#define PROPF_METHOD
Definition: jscript.h:97

Definition at line 1351 of file array.c.

◆ ArrayInst_info

const builtin_info_t ArrayInst_info
static
Initial value:
= {
}
static void Array_on_put(jsdisp_t *dispex, const WCHAR *name)
Definition: array.c:1195
static HRESULT Array_get_value(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r)
Definition: array.c:1180
static const builtin_prop_t ArrayInst_props[]
Definition: array.c:1244
smooth NULL
Definition: ftsmooth.c:416
static void Array_destructor(jsdisp_t *dispex)
Definition: array.c:1190
#define ARRAY_SIZE(a)
Definition: main.h:24

Definition at line 1248 of file array.c.

Referenced by alloc_array().

◆ ArrayInst_props

const builtin_prop_t ArrayInst_props[]
static
Initial value:
= {
}
static const WCHAR lengthW[]
Definition: array.c:39
static HRESULT Array_set_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value)
Definition: array.c:141
smooth NULL
Definition: ftsmooth.c:416
static HRESULT Array_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r)
Definition: array.c:133

Definition at line 1244 of file array.c.

◆ concatW

const WCHAR concatW[] = {'c','o','n','c','a','t',0}
static

Definition at line 40 of file array.c.

◆ default_separatorW

const WCHAR default_separatorW[] = {',',0}
static

Definition at line 56 of file array.c.

Referenced by Array_get_value(), Array_join(), and Array_toString().

◆ forEachW

const WCHAR forEachW[] = {'f','o','r','E','a','c','h',0}
static

Definition at line 41 of file array.c.

◆ indexOfW

const WCHAR indexOfW[] = {'i','n','d','e','x','O','f',0}
static

Definition at line 53 of file array.c.

◆ isArrayW

const WCHAR isArrayW[] = {'i','s','A','r','r','a','y',0}
static

Definition at line 1349 of file array.c.

◆ joinW

const WCHAR joinW[] = {'j','o','i','n',0}
static

Definition at line 42 of file array.c.

◆ lengthW

const WCHAR lengthW[] = {'l','e','n','g','t','h',0}
static

Definition at line 39 of file array.c.

Referenced by Array_splice(), get_length(), read_bitmap_patterns(), and set_length().

◆ mapW

const WCHAR mapW[] = {'m','a','p',0}
static

Definition at line 54 of file array.c.

◆ popW

const WCHAR popW[] = {'p','o','p',0}
static

Definition at line 43 of file array.c.

◆ pushW

const WCHAR pushW[] = {'p','u','s','h',0}
static

Definition at line 44 of file array.c.

◆ reverseW

const WCHAR reverseW[] = {'r','e','v','e','r','s','e',0}
static

Definition at line 45 of file array.c.

◆ shiftW

const WCHAR shiftW[] = {'s','h','i','f','t',0}
static

Definition at line 46 of file array.c.

◆ sliceW

const WCHAR sliceW[] = {'s','l','i','c','e',0}
static

Definition at line 47 of file array.c.

◆ sortW

const WCHAR sortW[] = {'s','o','r','t',0}
static

Definition at line 48 of file array.c.

◆ spliceW

const WCHAR spliceW[] = {'s','p','l','i','c','e',0}
static

Definition at line 49 of file array.c.

◆ toLocaleStringW

const WCHAR toLocaleStringW[] = {'t','o','L','o','c','a','l','e','S','t','r','i','n','g',0}
static

Definition at line 51 of file array.c.

◆ toStringW

const WCHAR toStringW[] = {'t','o','S','t','r','i','n','g',0}
static

Definition at line 50 of file array.c.

Referenced by to_primitive().

◆ unshiftW

const WCHAR unshiftW[] = {'u','n','s','h','i','f','t',0}
static

Definition at line 52 of file array.c.