21 #include <wine/port.h> 41 static const WCHAR RangeErrorW[] = {
'R',
'a',
'n',
'g',
'e',
'E',
'r',
'r',
'o',
'r',0};
42 static const WCHAR ReferenceErrorW[] = {
'R',
'e',
'f',
'e',
'r',
'e',
'n',
'c',
'e',
'E',
'r',
'r',
'o',
'r',0};
43 static const WCHAR SyntaxErrorW[] = {
'S',
'y',
'n',
't',
'a',
'x',
'E',
'r',
'r',
'o',
'r',0};
51 static const WCHAR RegExpErrorW[] = {
'R',
'e',
'g',
'E',
'x',
'p',
'E',
'r',
'r',
'o',
'r',0};
52 static const WCHAR ActiveXObjectW[] = {
'A',
'c',
't',
'i',
'v',
'e',
'X',
'O',
'b',
'j',
'e',
'c',
't',0};
54 static const WCHAR EnumeratorW[] = {
'E',
'n',
'u',
'm',
'e',
'r',
'a',
't',
'o',
'r',0};
60 static const WCHAR parseFloatW[] = {
'p',
'a',
'r',
's',
'e',
'F',
'l',
'o',
'a',
't',0};
63 static const WCHAR ScriptEngineW[] = {
'S',
'c',
'r',
'i',
'p',
't',
'E',
'n',
'g',
'i',
'n',
'e',0};
65 {
'S',
'c',
'r',
'i',
'p',
't',
'E',
'n',
'g',
'i',
'n',
'e',
'M',
'a',
'j',
'o',
'r',
'V',
'e',
'r',
's',
'i',
'o',
'n',0};
67 {
'S',
'c',
'r',
'i',
'p',
't',
'E',
'n',
'g',
'i',
'n',
'e',
'M',
'i',
'n',
'o',
'r',
'V',
'e',
'r',
's',
'i',
'o',
'n',0};
69 {
'S',
'c',
'r',
'i',
'p',
't',
'E',
'n',
'g',
'i',
'n',
'e',
'B',
'u',
'i',
'l',
'd',
'V',
'e',
'r',
's',
'i',
'o',
'n',0};
70 static const WCHAR CollectGarbageW[] = {
'C',
'o',
'l',
'l',
'e',
'c',
't',
'G',
'a',
'r',
'b',
'a',
'g',
'e',0};
75 static const WCHAR encodeURIComponentW[] = {
'e',
'n',
'c',
'o',
'd',
'e',
'U',
'R',
'I',
'C',
'o',
'm',
'p',
'o',
'n',
'e',
'n',
't',0};
76 static const WCHAR decodeURIComponentW[] = {
'd',
'e',
'c',
'o',
'd',
'e',
'U',
'R',
'I',
'C',
'o',
'm',
'p',
'o',
'n',
'e',
'n',
't',0};
81 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
82 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
83 0,2,0,0,1,0,1,2,2,2,2,1,1,2,2,1,
84 2,2,2,2,2,2,2,2,2,2,1,1,0,1,0,1,
85 1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
86 2,2,2,2,2,2,2,2,2,2,2,0,0,0,0,2,
87 0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,
88 2,2,2,2,2,2,2,2,2,2,2,0,0,0,2,0,
107 return ((
c >=
'A' &&
c <=
'Z') || (
c >=
'a' &&
c <=
'z') || (
c >=
'0' &&
c <=
'9') ||
108 c ==
'@' ||
c ==
'*' ||
c ==
'_' ||
c ==
'+' ||
c ==
'-' ||
c ==
'.' ||
c ==
'/');
275 if(
'0' <=
c &&
c <=
'9')
277 if(
'a' <=
c &&
c <=
'z')
279 if(
'A' <=
c &&
c <=
'Z')
305 if(radix && (radix < 2 || radix > 36)) {
306 WARN(
"radix %d out of range\n", radix);
332 if(
ptr[1] ==
'x' ||
ptr[1] ==
'X') {
343 }
else if(radix == 16 && *
ptr ==
'0' && (
ptr[1] ==
'x' ||
ptr[1] ==
'X')) {
391 else if(*
str ==
'-') {
400 hlp =
d*10 + *(
str++) -
'0';
419 hlp =
d*10 + *(
str++) -
'0';
429 if(*
str && !ret_nan && (*
str==
'e' || *
str==
'E')) {
435 else if(*
str ==
'-') {
552 static const WCHAR JScriptW[] = {
'J',
'S',
'c',
'r',
'i',
'p',
't',0};
848 unsigned char mask = 0x80;
851 FIXME(
"Throw URIError: Invalid hex sequence\n");
857 while(octets[0] &
mask) {
862 FIXME(
"Throw URIError: Invalid initial UTF character\n");
868 FIXME(
"Throw URIError: Incomplete UTF sequence\n");
873 FIXME(
"Throw URIError: Invalid hex sequence\n");
883 FIXME(
"Throw URIError: Invalid UTF sequence\n");
904 unsigned char mask = 0x80;
908 while(octets[0] &
mask) {
1108 jsdisp_t *math, *object_prototype, *constr;
1136 if(
ctx->version >= 2) {
static const WCHAR decodeURIW[]
static size_t double int int int * sign
static const WCHAR DateW[]
static const WCHAR NumberW[]
static jsstr_t * jsstr_alloc(const WCHAR *str)
static const WCHAR RangeErrorW[]
static const WCHAR _GetObjectW[]
static const WCHAR * jsstr_flatten(jsstr_t *str)
HRESULT create_object_constr(script_ctx_t *, jsdisp_t *, jsdisp_t **) DECLSPEC_HIDDEN
static const WCHAR ScriptEngineW[]
static const WCHAR EvalErrorW[]
#define MB_ERR_INVALID_CHARS
static const WCHAR escapeW[]
#define WideCharToMultiByte
static const WCHAR encodeURIW[]
jsstr_t * jsstr_undefined(void)
static HRESULT JSGlobal_parseInt(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
GLdouble GLdouble GLdouble r
static const WCHAR ObjectW[]
HRESULT jsdisp_define_data_property(jsdisp_t *obj, const WCHAR *name, unsigned flags, jsval_t value)
static const WCHAR undefinedW[]
HRESULT create_number_constr(script_ctx_t *, jsdisp_t *, jsdisp_t **) DECLSPEC_HIDDEN
static const WCHAR BooleanW[]
static const WCHAR ScriptEngineMinorVersionW[]
static const WCHAR isNaNW[]
HRESULT JSGlobal_eval(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static BOOL is_string(parse_buffer *buf)
static BOOL is_uri_reserved(WCHAR c)
static const WCHAR unescapeW[]
static void jsstr_release(jsstr_t *str)
HRESULT create_bool_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret)
#define JSCRIPT_MAJOR_VERSION
#define EXEC_RETURN_TO_INTERP
static HRESULT JSGlobal_ScriptEngineBuildVersion(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
#define JSCRIPT_BUILD_VERSION
HRESULT throw_uri_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
static HRESULT JSGlobal_encodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static HRESULT JSGlobal_ScriptEngineMinorVersion(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static const WCHAR ScriptEngineBuildVersionW[]
static const WCHAR CollectGarbageW[]
static HRESULT JSGlobal_parseFloat(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
GLenum GLuint GLenum GLsizei const GLchar * buf
static const WCHAR ScriptEngineMajorVersionW[]
HRESULT to_number(script_ctx_t *, jsval_t, double *) DECLSPEC_HIDDEN
static HRESULT JSGlobal_unescape(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static HRESULT JSGlobal_decodeURIComponent(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
float pow(float __x, int __y)
HRESULT jsval_copy(jsval_t v, jsval_t *r)
static jsstr_t * get_string(jsval_t v)
static const WCHAR isFiniteW[]
HRESULT create_math(script_ctx_t *, jsdisp_t **) DECLSPEC_HIDDEN
static const WCHAR EnumeratorW[]
static BOOL is_ecma_nonblank(const WCHAR c)
HRESULT create_json(script_ctx_t *, jsdisp_t **) DECLSPEC_HIDDEN
static HRESULT JSGlobal_CollectGarbage(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
HRESULT create_vbarray_constr(script_ctx_t *, jsdisp_t *, jsdisp_t **) DECLSPEC_HIDDEN
HRESULT throw_syntax_error(script_ctx_t *ctx, HRESULT error, const WCHAR *str)
#define JS_E_INVALID_URI_CHAR
HRESULT create_enumerator_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret)
HRESULT to_int32(script_ctx_t *, jsval_t, INT *) DECLSPEC_HIDDEN
static const WCHAR ErrorW[]
HRESULT compile_script(script_ctx_t *ctx, const WCHAR *code, const WCHAR *args, const WCHAR *delimiter, BOOL from_eval, BOOL use_decode, bytecode_t **ret)
static HRESULT JSGlobal_ScriptEngineMajorVersion(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
HRESULT create_object_prototype(script_ctx_t *, jsdisp_t **) DECLSPEC_HIDDEN
static jsval_t jsval_string(jsstr_t *str)
static const WCHAR NaNW[]
static const WCHAR evalW[]
HRESULT init_error_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
static const WCHAR TypeErrorW[]
static const builtin_info_t JSGlobal_info
HRESULT exec_source(script_ctx_t *ctx, DWORD flags, bytecode_t *bytecode, function_code_t *function, scope_chain_t *scope, IDispatch *this_obj, jsdisp_t *function_instance, jsdisp_t *variable_obj, unsigned argc, jsval_t *argv, jsval_t *r)
const char * debugstr_jsstr(jsstr_t *str)
static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype)
static INT char_to_int(WCHAR c)
static const WCHAR ActiveXObjectW[]
static const WCHAR SyntaxErrorW[]
static HRESULT JSGlobal_escape(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
HRESULT init_global(script_ctx_t *ctx)
static const WCHAR ArrayW[]
static HRESULT JSGlobal_isFinite(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
#define SCRIPTLANGUAGEVERSION_ES5
static const WCHAR URIErrorW[]
WINE_DEFAULT_DEBUG_CHANNEL(jscript)
static const WCHAR parseFloatW[]
static const WCHAR ReferenceErrorW[]
static const WCHAR VBArrayW[]
static HRESULT JSGlobal_encodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static const builtin_prop_t JSGlobal_props[]
static const WCHAR StringW[]
HRESULT create_regexp_constr(script_ctx_t *, jsdisp_t *, jsdisp_t **) DECLSPEC_HIDDEN
BOOL is_finite(double) DECLSPEC_HIDDEN
static HRESULT JSGlobal_isNaN(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
HRESULT init_function_constr(script_ctx_t *ctx, jsdisp_t *object_prototype)
static jsval_t jsval_undefined(void)
static const WCHAR JSONW[]
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
#define JSCRIPT_MINOR_VERSION
static HRESULT JSGlobal_decodeURI(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static WCHAR int_to_char(int i)
static HRESULT JSGlobal_GetObject(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
HRESULT create_date_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret)
#define DISPATCH_JSCRIPT_CALLEREXECSSOURCE
static const WCHAR FunctionW[]
HRESULT create_string_constr(script_ctx_t *, jsdisp_t *, jsdisp_t **) DECLSPEC_HIDDEN
HRESULT create_dispex(script_ctx_t *ctx, const builtin_info_t *builtin_info, jsdisp_t *prototype, jsdisp_t **dispex)
static const WCHAR MathW[]
static void jsdisp_release(jsdisp_t *jsdisp)
static const WCHAR InfinityW[]
#define JS_E_INVALID_URI_CODING
#define MultiByteToWideChar
static jsval_t jsval_obj(jsdisp_t *obj)
HRESULT create_activex_constr(script_ctx_t *ctx, jsdisp_t **ret)
jsstr_t * jsstr_alloc_buf(unsigned len, WCHAR **buf)
void release_bytecode(bytecode_t *code)
static jsval_t jsval_bool(BOOL b)
static BOOL is_uri_unescaped(WCHAR c)
HRESULT create_array_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t **ret)
static const WCHAR encodeURIComponentW[]
static int hex_to_int(const WCHAR wch)
static HRESULT JSGlobal_ScriptEngine(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r)
static const WCHAR RegExpW[]
static int uri_char_table[]
HRESULT to_flat_string(script_ctx_t *, jsval_t, jsstr_t **, const WCHAR **) DECLSPEC_HIDDEN
static const WCHAR decodeURIComponentW[]
static const WCHAR RegExpErrorW[]
static jsval_t jsval_number(double n)
const char * debugstr_jsval(const jsval_t) DECLSPEC_HIDDEN
static const WCHAR parseIntW[]