https://git.reactos.org/?p=reactos.git;a=commitdiff;h=8dba275bd6f1e61a8d2c4…
commit 8dba275bd6f1e61a8d2c4f68529db60cb532bf41
Author: Amine Khaldi <amine.khaldi(a)reactos.org>
AuthorDate: Sat Mar 17 13:11:29 2018 +0100
Commit: Amine Khaldi <amine.khaldi(a)reactos.org>
CommitDate: Sat Mar 17 13:11:29 2018 +0100
[JSCRIPT] Sync with Wine Staging 3.3. CORE-14434
---
dll/win32/jscript/CMakeLists.txt | 4 +-
dll/win32/jscript/activex.c | 9 +-
dll/win32/jscript/array.c | 107 ++++++++-
dll/win32/jscript/bool.c | 6 +
dll/win32/jscript/cc_parser.tab.c | 144 ++++++-----
dll/win32/jscript/cc_parser.tab.h | 82 +++++++
dll/win32/jscript/cc_parser.y | 6 +
dll/win32/jscript/compile.c | 33 ++-
dll/win32/jscript/date.c | 45 +++-
dll/win32/jscript/decode.c | 4 +
dll/win32/jscript/dispex.c | 20 +-
dll/win32/jscript/engine.c | 54 +++--
dll/win32/jscript/engine.h | 3 +-
dll/win32/jscript/error.c | 9 +
dll/win32/jscript/function.c | 7 +
dll/win32/jscript/global.c | 10 +
dll/win32/jscript/jscript.c | 16 +-
dll/win32/jscript/jscript.h | 81 +++----
dll/win32/jscript/jscript_main.c | 18 +-
dll/win32/jscript/json.c | 28 ++-
dll/win32/jscript/jsregexp.c | 7 +
dll/win32/jscript/jsstr.c | 4 +
dll/win32/jscript/jsutils.c | 10 +
dll/win32/jscript/jsval.h | 2 +-
dll/win32/jscript/lex.c | 14 ++
dll/win32/jscript/math.c | 11 +-
dll/win32/jscript/number.c | 7 +
dll/win32/jscript/object.c | 6 +
dll/win32/jscript/parser.tab.c | 490 +++++++++++++++++++-------------------
dll/win32/jscript/parser.tab.h | 8 +-
dll/win32/jscript/parser.y | 6 +
dll/win32/jscript/precomp.h | 24 ++
dll/win32/jscript/regexp.c | 7 +
dll/win32/jscript/resource.h | 2 +
dll/win32/jscript/rsrc.rc | 2 -
dll/win32/jscript/string.c | 8 +
dll/win32/jscript/vbarray.c | 4 +
media/doc/README.WINE | 2 +-
38 files changed, 853 insertions(+), 447 deletions(-)
diff --git a/dll/win32/jscript/CMakeLists.txt b/dll/win32/jscript/CMakeLists.txt
index 01dc2daa5b..5551ee74a1 100644
--- a/dll/win32/jscript/CMakeLists.txt
+++ b/dll/win32/jscript/CMakeLists.txt
@@ -33,7 +33,7 @@ list(APPEND SOURCE
regexp.c
string.c
vbarray.c
- jscript.h)
+ precomp.h)
list(APPEND jscript_rc_deps
${CMAKE_CURRENT_SOURCE_DIR}/jscript.rgs
@@ -54,5 +54,5 @@ add_dependencies(jscript jscript_idlheader stdole2)
set_module_type(jscript win32dll)
target_link_libraries(jscript uuid wine)
add_importlibs(jscript user32 ole32 oleaut32 advapi32 msvcrt kernel32 ntdll)
-add_pch(jscript jscript.h SOURCE)
+add_pch(jscript precomp.h SOURCE)
add_cd_file(TARGET jscript DESTINATION reactos/system32 FOR all)
diff --git a/dll/win32/jscript/activex.c b/dll/win32/jscript/activex.c
index 0bdf80e976..c7d9a66911 100644
--- a/dll/win32/jscript/activex.c
+++ b/dll/win32/jscript/activex.c
@@ -16,9 +16,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
#include "jscript.h"
+#include "objsafe.h"
+#include "mshtmhst.h"
+
+#include "wine/debug.h"
-#include <mshtmhst.h>
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
/* Defined as extern in urlmon.idl, but not exported by uuid.lib */
const GUID GUID_CUSTOM_CONFIRMOBJECTSAFETY =
diff --git a/dll/win32/jscript/array.c b/dll/win32/jscript/array.c
index 4fb70a3b76..fcccdd61f3 100644
--- a/dll/win32/jscript/array.c
+++ b/dll/win32/jscript/array.c
@@ -16,8 +16,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
+#include <math.h>
+#include <assert.h>
+
#include "jscript.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
typedef struct {
jsdisp_t dispex;
@@ -37,6 +47,7 @@ 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 default_separatorW[] = {',',0};
@@ -377,9 +388,10 @@ static HRESULT Array_pop(script_ctx_t *ctx, vdisp_t *vthis, WORD
flags, unsigned
hres = jsdisp_get_idx(jsthis, length, &val);
if(SUCCEEDED(hres))
hres = jsdisp_delete_idx(jsthis, length);
- else if(hres == DISP_E_UNKNOWNNAME)
+ else if(hres == DISP_E_UNKNOWNNAME) {
val = jsval_undefined();
- else
+ hres = S_OK;
+ }else
return hres;
if(SUCCEEDED(hres))
@@ -938,6 +950,61 @@ static HRESULT Array_toLocaleString(script_ctx_t *ctx, vdisp_t
*vthis, WORD flag
return E_NOTIMPL;
}
+static HRESULT Array_indexOf(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned
argc, jsval_t *argv,
+ jsval_t *r)
+{
+ jsdisp_t *jsthis;
+ unsigned length, i, from = 0;
+ jsval_t search, value;
+ BOOL eq;
+ HRESULT hres;
+
+ TRACE("\n");
+
+ hres = get_length(ctx, vthis, &jsthis, &length);
+ if(FAILED(hres))
+ return hres;
+ if(!length) {
+ if(r) *r = jsval_number(-1);
+ return S_OK;
+ }
+
+ search = argc ? argv[0] : jsval_undefined();
+
+ if(argc > 1) {
+ double from_arg;
+
+ hres = to_integer(ctx, argv[1], &from_arg);
+ if(FAILED(hres))
+ return hres;
+
+ if(from_arg >= 0)
+ from = min(from_arg, length);
+ else
+ from = max(from_arg + length, 0);
+ }
+
+ for(i = from; i < length; i++) {
+ hres = jsdisp_get_idx(jsthis, i, &value);
+ if(hres == DISP_E_UNKNOWNNAME)
+ continue;
+ if(FAILED(hres))
+ return hres;
+
+ hres = jsval_strict_equal(value, search, &eq);
+ jsval_release(value);
+ if(FAILED(hres))
+ return hres;
+ if(eq) {
+ if(r) *r = jsval_number(i);
+ return S_OK;
+ }
+ }
+
+ if(r) *r = jsval_number(-1);
+ return S_OK;
+}
+
/* ECMA-262 3rd Edition 15.4.4.13 */
static HRESULT Array_unshift(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned
argc, jsval_t *argv,
jsval_t *r)
@@ -1036,6 +1103,7 @@ static void Array_on_put(jsdisp_t *dispex, const WCHAR *name)
static const builtin_prop_t Array_props[] = {
{concatW, Array_concat, PROPF_METHOD|1},
+ {indexOfW, Array_indexOf, PROPF_ES5|PROPF_METHOD|1},
{joinW, Array_join, PROPF_METHOD|1},
{lengthW, NULL,0, Array_get_length,
Array_set_length},
{popW, Array_pop, PROPF_METHOD},
@@ -1072,6 +1140,24 @@ static const builtin_info_t ArrayInst_info = {
Array_on_put
};
+/* ECMA-262 5.1 Edition 15.4.3.2 */
+static HRESULT ArrayConstr_isArray(script_ctx_t *ctx, vdisp_t *vthis, WORD flags,
unsigned argc, jsval_t *argv, jsval_t *r)
+{
+ jsdisp_t *obj;
+
+ TRACE("\n");
+
+ if(!argc || !is_object_instance(argv[0])) {
+ if(r) *r = jsval_bool(FALSE);
+ return S_OK;
+ }
+
+ obj = iface_to_jsdisp(get_object(argv[0]));
+ if(r) *r = jsval_bool(obj && is_class(obj, JSCLASS_ARRAY));
+ if(obj) jsdisp_release(obj);
+ return S_OK;
+}
+
static HRESULT ArrayConstr_value(script_ctx_t *ctx, vdisp_t *vthis, WORD flags, unsigned
argc, jsval_t *argv,
jsval_t *r)
{
@@ -1146,6 +1232,21 @@ static HRESULT alloc_array(script_ctx_t *ctx, jsdisp_t
*object_prototype, ArrayI
return S_OK;
}
+static const WCHAR isArrayW[] =
{'i','s','A','r','r','a','y',0};
+
+static const builtin_prop_t ArrayConstr_props[] = {
+ {isArrayW, ArrayConstr_isArray, PROPF_ES5|PROPF_METHOD|1}
+};
+
+static const builtin_info_t ArrayConstr_info = {
+ JSCLASS_FUNCTION,
+ DEFAULT_FUNCTION_VALUE,
+ sizeof(ArrayConstr_props)/sizeof(*ArrayConstr_props),
+ ArrayConstr_props,
+ NULL,
+ NULL
+};
+
HRESULT create_array_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdisp_t
**ret)
{
ArrayInstance *array;
@@ -1157,7 +1258,7 @@ HRESULT create_array_constr(script_ctx_t *ctx, jsdisp_t
*object_prototype, jsdis
if(FAILED(hres))
return hres;
- hres = create_builtin_constructor(ctx, ArrayConstr_value, ArrayW, NULL,
PROPF_CONSTR|1, &array->dispex, ret);
+ hres = create_builtin_constructor(ctx, ArrayConstr_value, ArrayW,
&ArrayConstr_info, PROPF_CONSTR|1, &array->dispex, ret);
jsdisp_release(&array->dispex);
return hres;
diff --git a/dll/win32/jscript/bool.c b/dll/win32/jscript/bool.c
index f7e8df2fce..75c98c2403 100644
--- a/dll/win32/jscript/bool.c
+++ b/dll/win32/jscript/bool.c
@@ -17,8 +17,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <assert.h>
+
#include "jscript.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
typedef struct {
jsdisp_t dispex;
diff --git a/dll/win32/jscript/cc_parser.tab.c b/dll/win32/jscript/cc_parser.tab.c
index 264d0719b7..2e46c11953 100644
--- a/dll/win32/jscript/cc_parser.tab.c
+++ b/dll/win32/jscript/cc_parser.tab.c
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.0. */
/* Bison implementation for Yacc-like parsers in C
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.2"
+#define YYBISON_VERSION "3.0"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -70,15 +70,23 @@
/* Copy the first part of user declarations. */
#line 19 "cc_parser.y" /* yacc.c:339 */
+
#include "jscript.h"
+#include "engine.h"
+#include "parser.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
#line 84 "cc_parser.tab.c" /* yacc.c:339 */
-# ifndef YY_NULLPTR
+# ifndef YY_NULL
# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
+# define YY_NULL nullptr
# else
-# define YY_NULLPTR 0
+# define YY_NULL 0
# endif
# endif
@@ -90,7 +98,10 @@
# define YYERROR_VERBOSE 0
#endif
-
+/* In a future release of Bison, this section will be replaced
+ by #include "cc_parser.tab.h". */
+#ifndef YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED
+# define YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -128,7 +139,7 @@ union YYSTYPE
ccval_t ccval;
-#line 140 "cc_parser.tab.c" /* yacc.c:355 */
+#line 143 "cc_parser.tab.c" /* yacc.c:355 */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
@@ -138,7 +149,7 @@ union YYSTYPE
int cc_parser_parse (parser_ctx_t *ctx);
-
+#endif /* !YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED */
/* Copy the second part of user declarations. */
#line 47 "cc_parser.y" /* yacc.c:358 */
@@ -235,7 +246,7 @@ static int cc_parser_lex(void *lval, parser_ctx_t *ctx)
}
-#line 247 "cc_parser.tab.c" /* yacc.c:358 */
+#line 250 "cc_parser.tab.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -292,30 +303,11 @@ typedef short int yytype_int16;
# endif
#endif
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__ \
- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))
\
- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
-# else
-# define YY_ATTRIBUTE(Spec) /* empty */
-# endif
-#endif
-
-#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
-#endif
-
-#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-# define _Noreturn __declspec (noreturn)
-# else
-# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later. */
+# if (! defined __GNUC__ || __GNUC__ < 2 \
+ || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
+# define __attribute__(Spec) /* empty */
# endif
#endif
@@ -553,7 +545,7 @@ static const char *const yytname[] =
"CCBitwiseORExpression", "CCBitwiseXORExpression",
"CCBitwiseANDExpression", "CCEqualityExpression",
"CCRelationalExpression", "CCShiftExpression",
"CCAdditiveExpression",
- "CCMultiplicativeExpression", YY_NULLPTR
+ "CCMultiplicativeExpression", YY_NULL
};
#endif
@@ -955,11 +947,11 @@ static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
- const char *yyformat = YY_NULLPTR;
+ const char *yyformat = YY_NULL;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
@@ -1016,7 +1008,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
yyarg[yycount++] = yytname[yyx];
{
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
@@ -1355,233 +1347,233 @@ yyreduce:
case 2:
#line 146 "cc_parser.y" /* yacc.c:1646 */
{ ctx->ccval = (yyvsp[0].ccval); YYACCEPT; }
-#line 1367 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1351 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 3:
#line 149 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1373 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1357 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 4:
#line 150 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[-1].ccval); }
-#line 1379 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1363 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 5:
#line 151 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_bool(!get_ccbool((yyvsp[0].ccval))); }
-#line 1385 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1369 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 6:
#line 152 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'~' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1391 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1375 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 7:
#line 153 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'+' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1397 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1381 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 8:
#line 154 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'-' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1403 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1387 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 9:
#line 157 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1409 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1393 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 10:
#line 159 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'||' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1415 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1399 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 11:
#line 162 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1421 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1405 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 12:
#line 164 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'&&' expression not implemented\n"); ctx->hres
= E_NOTIMPL; YYABORT; }
-#line 1427 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1411 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 13:
#line 167 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1433 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1417 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 14:
#line 169 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'|' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1439 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1423 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 15:
#line 172 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1445 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1429 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 16:
#line 174 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'^' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1451 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1435 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 17:
#line 177 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1457 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1441 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 18:
#line 179 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'&' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1463 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1447 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 19:
#line 182 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1469 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1453 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 20:
#line 184 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) ==
get_ccnum((yyvsp[0].ccval))); }
-#line 1475 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1459 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 21:
#line 186 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) !=
get_ccnum((yyvsp[0].ccval))); }
-#line 1481 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1465 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 22:
#line 188 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'===' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1487 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1471 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 23:
#line 190 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'!==' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1493 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1477 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 24:
#line 193 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1499 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1483 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 25:
#line 195 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) <
get_ccnum((yyvsp[0].ccval))); }
-#line 1505 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1489 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 26:
#line 197 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) <=
get_ccnum((yyvsp[0].ccval))); }
-#line 1511 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1495 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 27:
#line 199 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) >
get_ccnum((yyvsp[0].ccval))); }
-#line 1517 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1501 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 28:
#line 201 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_bool(get_ccnum((yyvsp[-2].ccval)) >=
get_ccnum((yyvsp[0].ccval))); }
-#line 1523 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1507 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 29:
#line 204 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1529 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1513 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 30:
#line 206 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'<<' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1535 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1519 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 31:
#line 208 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'>>' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1541 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1525 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 32:
#line 210 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'>>>' expression not implemented\n");
ctx->hres = E_NOTIMPL; YYABORT; }
-#line 1547 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1531 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 33:
#line 213 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1553 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1537 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 34:
#line 215 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) +
get_ccnum((yyvsp[0].ccval))); }
-#line 1559 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1543 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 35:
#line 217 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) -
get_ccnum((yyvsp[0].ccval))); }
-#line 1565 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1549 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 36:
#line 220 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = (yyvsp[0].ccval); }
-#line 1571 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1555 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 37:
#line 222 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) *
get_ccnum((yyvsp[0].ccval))); }
-#line 1577 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1561 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 38:
#line 224 "cc_parser.y" /* yacc.c:1646 */
{ (yyval.ccval) = ccval_num(get_ccnum((yyvsp[-2].ccval)) /
get_ccnum((yyvsp[0].ccval))); }
-#line 1583 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1567 "cc_parser.tab.c" /* yacc.c:1646 */
break;
case 39:
#line 226 "cc_parser.y" /* yacc.c:1646 */
{ FIXME("'%%' expression not implemented\n"); ctx->hres =
E_NOTIMPL; YYABORT; }
-#line 1589 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1573 "cc_parser.tab.c" /* yacc.c:1646 */
break;
-#line 1593 "cc_parser.tab.c" /* yacc.c:1646 */
+#line 1577 "cc_parser.tab.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
diff --git a/dll/win32/jscript/cc_parser.tab.h b/dll/win32/jscript/cc_parser.tab.h
new file mode 100644
index 0000000000..275e13edfa
--- /dev/null
+++ b/dll/win32/jscript/cc_parser.tab.h
@@ -0,0 +1,82 @@
+/* A Bison parser, made by GNU Bison 3.0. */
+
+/* Bison interface for Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+#ifndef YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED
+# define YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int cc_parser_debug;
+#endif
+
+/* Token type. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ enum yytokentype
+ {
+ tEQ = 258,
+ tEQEQ = 259,
+ tNEQ = 260,
+ tNEQEQ = 261,
+ tLSHIFT = 262,
+ tRSHIFT = 263,
+ tRRSHIFT = 264,
+ tOR = 265,
+ tAND = 266,
+ tLEQ = 267,
+ tGEQ = 268,
+ tCCValue = 269
+ };
+#endif
+
+/* Value type. */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
+{
+#line 36 "cc_parser.y" /* yacc.c:1909 */
+
+ ccval_t ccval;
+
+#line 73 "cc_parser.tab.h" /* yacc.c:1909 */
+};
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+
+
+int cc_parser_parse (parser_ctx_t *ctx);
+
+#endif /* !YY_CC_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_CC_PARSER_TAB_H_INCLUDED */
diff --git a/dll/win32/jscript/cc_parser.y b/dll/win32/jscript/cc_parser.y
index d06ba7c703..18c1cb1c38 100644
--- a/dll/win32/jscript/cc_parser.y
+++ b/dll/win32/jscript/cc_parser.y
@@ -19,6 +19,12 @@
%{
#include "jscript.h"
+#include "engine.h"
+#include "parser.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
%}
diff --git a/dll/win32/jscript/compile.c b/dll/win32/jscript/compile.c
index b9dff8fe30..6e6be9135f 100644
--- a/dll/win32/jscript/compile.c
+++ b/dll/win32/jscript/compile.c
@@ -16,10 +16,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <math.h>
+#include <assert.h>
+
#include "jscript.h"
+#include "engine.h"
+#include "parser.h"
-#include <wine/rbtree.h>
+#include "wine/rbtree.h"
+#include "wine/debug.h"
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
WINE_DECLARE_DEBUG_CHANNEL(jscript_disas);
typedef struct _statement_ctx_t {
@@ -854,29 +861,29 @@ static HRESULT literal_as_bstr(compiler_ctx_t *ctx, literal_t
*literal, BSTR *st
static HRESULT compile_array_literal(compiler_ctx_t *ctx, array_literal_expression_t
*expr)
{
- unsigned i, elem_cnt = expr->length;
+ unsigned length = 0;
array_element_t *iter;
+ unsigned array_instr;
HRESULT hres;
- for(iter = expr->element_list; iter; iter = iter->next) {
- elem_cnt += iter->elision+1;
+ array_instr = push_instr(ctx, OP_carray);
- for(i=0; i < iter->elision; i++) {
- if(!push_instr(ctx, OP_undefined))
- return E_OUTOFMEMORY;
- }
+ for(iter = expr->element_list; iter; iter = iter->next) {
+ length += iter->elision;
hres = compile_expression(ctx, iter->expr, TRUE);
if(FAILED(hres))
return hres;
- }
- for(i=0; i < expr->length; i++) {
- if(!push_instr(ctx, OP_undefined))
- return E_OUTOFMEMORY;
+ hres = push_instr_uint(ctx, OP_carray_set, length);
+ if(FAILED(hres))
+ return hres;
+
+ length++;
}
- return push_instr_uint(ctx, OP_carray, elem_cnt);
+ instr_ptr(ctx, array_instr)->u.arg[0].uint = length + expr->length;
+ return S_OK;
}
static HRESULT compile_object_literal(compiler_ctx_t *ctx, property_value_expression_t
*expr)
diff --git a/dll/win32/jscript/date.c b/dll/win32/jscript/date.c
index fb81dd4606..f784d51afb 100644
--- a/dll/win32/jscript/date.c
+++ b/dll/win32/jscript/date.c
@@ -17,8 +17,19 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
+#include <limits.h>
+#include <math.h>
+#include <assert.h>
+
#include "jscript.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
/* 1601 to 1970 is 369 years plus 89 leap days */
#define TIME_EPOCH ((ULONGLONG)(369 * 365 + 89) * 86400 * 1000)
@@ -81,6 +92,7 @@ static const WCHAR getYearW[] =
{'g','e','t','Y','e','a','r',0};
static const WCHAR setYearW[] =
{'s','e','t','Y','e','a','r',0};
static const WCHAR UTCW[] = {'U','T','C',0};
+static const WCHAR nowW[] = {'n','o','w',0};
static const WCHAR parseW[] =
{'p','a','r','s','e',0};
static inline DateInstance *date_from_jsdisp(jsdisp_t *jsdisp)
@@ -441,6 +453,17 @@ static inline DOUBLE time_clip(DOUBLE time)
return floor(time);
}
+static double date_now(void)
+{
+ FILETIME ftime;
+ LONGLONG time;
+
+ GetSystemTimeAsFileTime(&ftime);
+ time = ((LONGLONG)ftime.dwHighDateTime << 32) + ftime.dwLowDateTime;
+
+ return time/10000 - TIME_EPOCH;
+}
+
static SYSTEMTIME create_systemtime(DOUBLE time)
{
SYSTEMTIME st;
@@ -2350,6 +2373,15 @@ static HRESULT DateConstr_UTC(script_ctx_t *ctx, vdisp_t *jsthis,
WORD flags, un
return hres;
}
+/* ECMA-262 5.1 Edition 15.9.4.4 */
+static HRESULT DateConstr_now(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned
argc, jsval_t *argv, jsval_t *r)
+{
+ TRACE("\n");
+
+ if(r) *r = jsval_number(date_now());
+ return S_OK;
+}
+
static HRESULT DateConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned
argc, jsval_t *argv,
jsval_t *r)
{
@@ -2362,19 +2394,11 @@ static HRESULT DateConstr_value(script_ctx_t *ctx, vdisp_t
*jsthis, WORD flags,
case DISPATCH_CONSTRUCT:
switch(argc) {
/* ECMA-262 3rd Edition 15.9.3.3 */
- case 0: {
- FILETIME time;
- LONGLONG lltime;
-
- GetSystemTimeAsFileTime(&time);
- lltime = ((LONGLONG)time.dwHighDateTime<<32)
- + time.dwLowDateTime;
-
- hres = create_date(ctx, NULL, lltime/10000-TIME_EPOCH, &date);
+ case 0:
+ hres = create_date(ctx, NULL, date_now(), &date);
if(FAILED(hres))
return hres;
break;
- }
/* ECMA-262 3rd Edition 15.9.3.2 */
case 1: {
@@ -2443,6 +2467,7 @@ static HRESULT DateConstr_value(script_ctx_t *ctx, vdisp_t *jsthis,
WORD flags,
static const builtin_prop_t DateConstr_props[] = {
{UTCW, DateConstr_UTC, PROPF_METHOD},
+ {nowW, DateConstr_now, PROPF_HTML|PROPF_METHOD},
{parseW, DateConstr_parse, PROPF_METHOD}
};
diff --git a/dll/win32/jscript/decode.c b/dll/win32/jscript/decode.c
index 1799b91864..d402d7c961 100644
--- a/dll/win32/jscript/decode.c
+++ b/dll/win32/jscript/decode.c
@@ -18,6 +18,10 @@
#include "jscript.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
/*
* This file implements algorithm for decoding scripts encoded by
* screnc.exe. The 'secret' algorithm that's well documented here:
diff --git a/dll/win32/jscript/dispex.c b/dll/win32/jscript/dispex.c
index 8bc03d1662..ffb351e2ac 100644
--- a/dll/win32/jscript/dispex.c
+++ b/dll/win32/jscript/dispex.c
@@ -16,8 +16,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <assert.h>
+
#include "jscript.h"
+#include "wine/unicode.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
#define FDEX_VERSION_MASK 0xf0000000
#define GOLDEN_RATIO 0x9E3779B9U
@@ -83,8 +90,19 @@ static const builtin_prop_t *find_builtin_prop(jsdisp_t *This, const
WCHAR *name
i = (min+max)/2;
r = strcmpW(name, This->builtin_info->props[i].name);
- if(!r)
+ if(!r) {
+ /* Skip prop if it's available only in higher compatibility mode. */
+ unsigned version = (This->builtin_info->props[i].flags &
PROPF_VERSION_MASK)
+ >> PROPF_VERSION_SHIFT;
+ if(version && version > This->ctx->version)
+ return NULL;
+
+ /* Skip prop if it's available only in HTML mode and we're not
running in HTML mode. */
+ if((This->builtin_info->props[i].flags & PROPF_HTML) &&
!This->ctx->html_mode)
+ return NULL;
+
return This->builtin_info->props + i;
+ }
if(r < 0)
max = i-1;
diff --git a/dll/win32/jscript/engine.c b/dll/win32/jscript/engine.c
index 16fe6aaeae..d41afa5c3b 100644
--- a/dll/win32/jscript/engine.c
+++ b/dll/win32/jscript/engine.c
@@ -16,7 +16,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
+#include <math.h>
+#include <assert.h>
+
#include "jscript.h"
+#include "engine.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
static const WCHAR booleanW[] =
{'b','o','o','l','e','a','n',0};
static const WCHAR functionW[] =
{'f','u','n','c','t','i','o','n',0};
@@ -514,7 +525,7 @@ static HRESULT disp_cmp(IDispatch *disp1, IDispatch *disp2, BOOL
*ret)
}
/* ECMA-262 3rd Edition 11.9.6 */
-static HRESULT equal2_values(jsval_t lval, jsval_t rval, BOOL *ret)
+HRESULT jsval_strict_equal(jsval_t lval, jsval_t rval, BOOL *ret)
{
jsval_type_t type = jsval_type(lval);
@@ -843,7 +854,7 @@ static HRESULT interp_case(script_ctx_t *ctx)
TRACE("\n");
v = stack_pop(ctx);
- hres = equal2_values(stack_top(ctx), v, &b);
+ hres = jsval_strict_equal(stack_top(ctx), v, &b);
jsval_release(v);
if(FAILED(hres))
return hres;
@@ -1290,7 +1301,7 @@ static HRESULT interp_local(script_ctx_t *ctx)
jsval_t copy;
HRESULT hres;
- TRACE("%d\n", arg);
+ TRACE("%d: %s\n", arg, debugstr_w(local_name(frame, arg)));
if(!frame->base_scope || !frame->base_scope->frame)
return identifier_value(ctx, local_name(frame, arg));
@@ -1393,8 +1404,6 @@ static HRESULT interp_carray(script_ctx_t *ctx)
{
const unsigned arg = get_op_uint(ctx, 0);
jsdisp_t *array;
- jsval_t val;
- unsigned i;
HRESULT hres;
TRACE("%u\n", arg);
@@ -1403,20 +1412,27 @@ static HRESULT interp_carray(script_ctx_t *ctx)
if(FAILED(hres))
return hres;
- i = arg;
- while(i--) {
- val = stack_pop(ctx);
- hres = jsdisp_propput_idx(array, i, val);
- jsval_release(val);
- if(FAILED(hres)) {
- jsdisp_release(array);
- return hres;
- }
- }
-
return stack_push(ctx, jsval_obj(array));
}
+static HRESULT interp_carray_set(script_ctx_t *ctx)
+{
+ const unsigned index = get_op_uint(ctx, 0);
+ jsval_t value, array;
+ HRESULT hres;
+
+ value = stack_pop(ctx);
+
+ TRACE("[%u] = %s\n", index, debugstr_jsval(value));
+
+ array = stack_top(ctx);
+ assert(is_object_instance(array));
+
+ hres = jsdisp_propput_idx(iface_to_jsdisp(get_object(array)), index, value);
+ jsval_release(value);
+ return hres;
+}
+
/* ECMA-262 3rd Edition 11.1.5 */
static HRESULT interp_new_obj(script_ctx_t *ctx)
{
@@ -2092,7 +2108,7 @@ static HRESULT interp_preinc(script_ctx_t *ctx)
static HRESULT equal_values(script_ctx_t *ctx, jsval_t lval, jsval_t rval, BOOL *ret)
{
if(jsval_type(lval) == jsval_type(rval) || (is_number(lval) &&
is_number(rval)))
- return equal2_values(lval, rval, ret);
+ return jsval_strict_equal(lval, rval, ret);
/* FIXME: NULL disps should be handled in more general way */
if(is_object_instance(lval) && !get_object(lval))
@@ -2222,7 +2238,7 @@ static HRESULT interp_eq2(script_ctx_t *ctx)
TRACE("%s === %s\n", debugstr_jsval(l), debugstr_jsval(r));
- hres = equal2_values(r, l, &b);
+ hres = jsval_strict_equal(r, l, &b);
jsval_release(l);
jsval_release(r);
if(FAILED(hres))
@@ -2243,7 +2259,7 @@ static HRESULT interp_neq2(script_ctx_t *ctx)
r = stack_pop(ctx);
l = stack_pop(ctx);
- hres = equal2_values(r, l, &b);
+ hres = jsval_strict_equal(r, l, &b);
jsval_release(l);
jsval_release(r);
if(FAILED(hres))
diff --git a/dll/win32/jscript/engine.h b/dll/win32/jscript/engine.h
index ce4c326730..6d40e30905 100644
--- a/dll/win32/jscript/engine.h
+++ b/dll/win32/jscript/engine.h
@@ -23,12 +23,13 @@
X(and, 1, 0,0) \
X(array, 1, 0,0) \
X(assign, 1, 0,0) \
- X(assign_call,1, ARG_UINT, 0) \
+ X(assign_call,1, ARG_UINT, 0) \
X(bool, 1, ARG_INT, 0) \
X(bneg, 1, 0,0) \
X(call, 1, ARG_UINT, ARG_UINT) \
X(call_member,1, ARG_UINT, ARG_UINT) \
X(carray, 1, ARG_UINT, 0) \
+ X(carray_set, 1, ARG_UINT, 0) \
X(case, 0, ARG_ADDR, 0) \
X(cnd_nz, 0, ARG_ADDR, 0) \
X(cnd_z, 0, ARG_ADDR, 0) \
diff --git a/dll/win32/jscript/error.c b/dll/win32/jscript/error.c
index 835f06e77d..b855b8798b 100644
--- a/dll/win32/jscript/error.c
+++ b/dll/win32/jscript/error.c
@@ -16,8 +16,17 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
+#include <math.h>
+
#include "jscript.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
static const WCHAR descriptionW[] =
{'d','e','s','c','r','i','p','t','i','o','n',0};
static const WCHAR messageW[] =
{'m','e','s','s','a','g','e',0};
static const WCHAR nameW[] = {'n','a','m','e',0};
diff --git a/dll/win32/jscript/function.c b/dll/win32/jscript/function.c
index c1456c24c9..8480a3bf1a 100644
--- a/dll/win32/jscript/function.c
+++ b/dll/win32/jscript/function.c
@@ -16,7 +16,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <assert.h>
+
#include "jscript.h"
+#include "engine.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
typedef struct {
jsdisp_t dispex;
diff --git a/dll/win32/jscript/global.c b/dll/win32/jscript/global.c
index 4ac33b3cd0..6cd5ee9f6a 100644
--- a/dll/win32/jscript/global.c
+++ b/dll/win32/jscript/global.c
@@ -16,8 +16,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
+#include <math.h>
+#include <limits.h>
+
#include "jscript.h"
+#include "engine.h"
+
+#include "wine/debug.h"
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
static const WCHAR NaNW[] = {'N','a','N',0};
static const WCHAR InfinityW[] =
{'I','n','f','i','n','i','t','y',0};
diff --git a/dll/win32/jscript/jscript.c b/dll/win32/jscript/jscript.c
index 9e8b3cb29c..15d81d2c53 100644
--- a/dll/win32/jscript/jscript.c
+++ b/dll/win32/jscript/jscript.c
@@ -16,7 +16,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <assert.h>
+
#include "jscript.h"
+#include "engine.h"
+#include "objsafe.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
#ifdef _WIN64
@@ -47,6 +55,7 @@ typedef struct {
LONG thread_id;
LCID lcid;
DWORD version;
+ BOOL html_mode;
BOOL is_encode;
IActiveScriptSite *site;
@@ -704,6 +713,7 @@ static HRESULT WINAPI JScriptParse_InitNew(IActiveScriptParse *iface)
ctx->active_script = &This->IActiveScript_iface;
ctx->safeopt = This->safeopt;
ctx->version = This->version;
+ ctx->html_mode = This->html_mode;
ctx->ei.val = jsval_undefined();
heap_pool_init(&ctx->tmp_heap);
@@ -912,12 +922,14 @@ static HRESULT WINAPI
JScriptProperty_SetProperty(IActiveScriptProperty *iface,
switch(dwProperty) {
case SCRIPTPROP_INVOKEVERSIONING:
- if(V_VT(pvarValue) != VT_I4 || V_I4(pvarValue) < 0 || V_I4(pvarValue) > 15)
{
+ if(V_VT(pvarValue) != VT_I4 || V_I4(pvarValue) < 0
+ || (V_I4(pvarValue) > 15 && !(V_I4(pvarValue) &
SCRIPTLANGUAGEVERSION_HTML))) {
WARN("invalid value %s\n", debugstr_variant(pvarValue));
return E_INVALIDARG;
}
- This->version = V_I4(pvarValue);
+ This->version = V_I4(pvarValue) & 0x1ff;
+ This->html_mode = (V_I4(pvarValue) & SCRIPTLANGUAGEVERSION_HTML) != 0;
break;
default:
FIXME("Unimplemented property %x\n", dwProperty);
diff --git a/dll/win32/jscript/jscript.h b/dll/win32/jscript/jscript.h
index 1a5101917b..6f06062a8b 100644
--- a/dll/win32/jscript/jscript.h
+++ b/dll/win32/jscript/jscript.h
@@ -16,36 +16,37 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#ifndef _WINE_JSCRIPT_H
-#define _WINE_JSCRIPT_H
+#pragma once
-#include <wine/config.h>
-#include <wine/port.h>
-
-#include <assert.h>
#include <stdarg.h>
-
-#define WIN32_NO_STATUS
-#define _INC_WINDOWS
-#define COM_NO_WINDOWS_H
+#include <stdio.h>
#define COBJMACROS
-#include <windef.h>
-#include <winbase.h>
-#include <objbase.h>
-#include <oleauto.h>
-#include <dispex.h>
-#include <activscp.h>
-#include <objsafe.h>
+#include "windef.h"
+#include "winbase.h"
+#include "winuser.h"
+#include "ole2.h"
+#include "dispex.h"
+#include "activscp.h"
-#include <wine/debug.h>
-#include <wine/list.h>
-#include <wine/unicode.h>
+#include "resource.h"
-WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+#include "wine/unicode.h"
+#include "wine/heap.h"
+#include "wine/list.h"
-#include "resource.h"
+/*
+ * This is Wine jscript extension for ES5 compatible mode. Native IE9+ implements
+ * a separated JavaScript enging in side MSHTML. We implement its features here
+ * and enable it when HTML flag is specified in SCRIPTPROP_INVOKEVERSIONING property.
+ */
+#define SCRIPTLANGUAGEVERSION_HTML 0x400
+
+/*
+ * This is Wine jscript extension for ES5 compatible mode. Allowed only in HTML mode.
+ */
+#define SCRIPTLANGUAGEVERSION_ES5 0x102
typedef struct _jsval_t jsval_t;
typedef struct _jsstr_t jsstr_t;
@@ -68,26 +69,6 @@ void heap_pool_clear(heap_pool_t*) DECLSPEC_HIDDEN;
void heap_pool_free(heap_pool_t*) DECLSPEC_HIDDEN;
heap_pool_t *heap_pool_mark(heap_pool_t*) DECLSPEC_HIDDEN;
-static inline void* __WINE_ALLOC_SIZE(1) heap_alloc(size_t size)
-{
- return HeapAlloc(GetProcessHeap(), 0, size);
-}
-
-static inline void* __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t size)
-{
- return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size);
-}
-
-static inline void* __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t size)
-{
- return HeapReAlloc(GetProcessHeap(), 0, mem, size);
-}
-
-static inline BOOL heap_free(void *mem)
-{
- return HeapFree(GetProcessHeap(), 0, mem);
-}
-
static inline LPWSTR heap_strdupW(LPCWSTR str)
{
LPWSTR ret = NULL;
@@ -115,6 +96,11 @@ extern HINSTANCE jscript_hinstance DECLSPEC_HIDDEN;
#define PROPF_CONST 0x0800
#define PROPF_DONTDELETE 0x1000
+#define PROPF_VERSION_MASK 0x01ff0000
+#define PROPF_VERSION_SHIFT 16
+#define PROPF_HTML (SCRIPTLANGUAGEVERSION_HTML << PROPF_VERSION_SHIFT)
+#define PROPF_ES5 ((SCRIPTLANGUAGEVERSION_HTML|SCRIPTLANGUAGEVERSION_ES5)
<< PROPF_VERSION_SHIFT)
+
/*
* This is our internal dispatch flag informing calee that it's called directly from
interpreter.
* If calee is executed as interpreted function, we may let already running interpreter
to take
@@ -357,6 +343,8 @@ HRESULT to_string(script_ctx_t*,jsval_t,jsstr_t**) DECLSPEC_HIDDEN;
HRESULT to_flat_string(script_ctx_t*,jsval_t,jsstr_t**,const WCHAR**) DECLSPEC_HIDDEN;
HRESULT to_object(script_ctx_t*,jsval_t,IDispatch**) DECLSPEC_HIDDEN;
+HRESULT jsval_strict_equal(jsval_t,jsval_t,BOOL*) DECLSPEC_HIDDEN;
+
HRESULT variant_change_type(script_ctx_t*,VARIANT*,VARIANT*,VARTYPE) DECLSPEC_HIDDEN;
HRESULT decode_source(WCHAR*) DECLSPEC_HIDDEN;
@@ -412,6 +400,7 @@ struct _script_ctx_t {
IInternetHostSecurityManager *secmgr;
DWORD safeopt;
DWORD version;
+ BOOL html_mode;
LCID lcid;
cc_ctx_t *cc;
JSCaller *jscaller;
@@ -516,7 +505,7 @@ static inline BOOL is_int32(double d)
static inline DWORD make_grfdex(script_ctx_t *ctx, DWORD flags)
{
- return (ctx->version << 28) | flags;
+ return ((ctx->version & 0xff) << 28) | flags;
}
#define FACILITY_JSCRIPT 10
@@ -585,9 +574,3 @@ static inline void unlock_module(void)
{
InterlockedDecrement(&module_ref);
}
-
-#include "engine.h"
-#include "parser.h"
-#include "regexp.h"
-
-#endif /* _WINE_JSCRIPT_H */
diff --git a/dll/win32/jscript/jscript_main.c b/dll/win32/jscript/jscript_main.c
index 03f1f56465..9f9f4121f7 100644
--- a/dll/win32/jscript/jscript_main.c
+++ b/dll/win32/jscript/jscript_main.c
@@ -16,14 +16,26 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "initguid.h"
+
#include "jscript.h"
-#include <rpcproxy.h>
-#include <initguid.h>
-#include <jscript_classes.h>
+#include "winreg.h"
+#include "advpub.h"
+#include "activaut.h"
+#include "objsafe.h"
+#include "mshtmhst.h"
+#include "rpcproxy.h"
+#include "jscript_classes.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
LONG module_ref = 0;
+DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
+
HINSTANCE jscript_hinstance;
static HRESULT WINAPI ClassFactory_QueryInterface(IClassFactory *iface, REFIID riid, void
**ppv)
diff --git a/dll/win32/jscript/json.c b/dll/win32/jscript/json.c
index fd1e471eee..fc23b54c0d 100644
--- a/dll/win32/jscript/json.c
+++ b/dll/win32/jscript/json.c
@@ -16,7 +16,16 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <math.h>
+#include <assert.h>
+
#include "jscript.h"
+#include "parser.h"
+
+#include "wine/debug.h"
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
static const WCHAR parseW[] =
{'p','a','r','s','e',0};
static const WCHAR stringifyW[] =
{'s','t','r','i','n','g','i','f','y',0};
@@ -536,15 +545,18 @@ static HRESULT stringify_array(stringify_ctx_t *ctx, jsdisp_t *obj)
}
hres = jsdisp_get_idx(obj, i, &val);
- if(FAILED(hres))
- return hres;
-
- hres = stringify(ctx, val);
- if(FAILED(hres))
+ if(SUCCEEDED(hres)) {
+ hres = stringify(ctx, val);
+ if(FAILED(hres))
+ return hres;
+ if(hres == S_FALSE && !append_string(ctx, nullW))
+ return E_OUTOFMEMORY;
+ }else if(hres == DISP_E_UNKNOWNNAME) {
+ if(!append_string(ctx, nullW))
+ return E_OUTOFMEMORY;
+ }else {
return hres;
-
- if(hres == S_FALSE && !append_string(ctx, nullW))
- return E_OUTOFMEMORY;
+ }
}
if((length && *ctx->gap && !append_char(ctx, '\n')) ||
!append_char(ctx, ']'))
diff --git a/dll/win32/jscript/jsregexp.c b/dll/win32/jscript/jsregexp.c
index 6615005404..5798635cb8 100644
--- a/dll/win32/jscript/jsregexp.c
+++ b/dll/win32/jscript/jsregexp.c
@@ -16,7 +16,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <math.h>
+
#include "jscript.h"
+#include "regexp.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
typedef struct {
jsdisp_t dispex;
diff --git a/dll/win32/jscript/jsstr.c b/dll/win32/jscript/jsstr.c
index 6eb7dea34a..6a39c4c3dc 100644
--- a/dll/win32/jscript/jsstr.c
+++ b/dll/win32/jscript/jsstr.c
@@ -16,8 +16,12 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <assert.h>
+
#include "jscript.h"
+#include "wine/debug.h"
+
/*
* This is the length of a string that is considered to be long enough to be
* worth the rope to avoid copy.
diff --git a/dll/win32/jscript/jsutils.c b/dll/win32/jscript/jsutils.c
index fb691afe8d..4556ec45a3 100644
--- a/dll/win32/jscript/jsutils.c
+++ b/dll/win32/jscript/jsutils.c
@@ -16,8 +16,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
+#include <math.h>
+#include <assert.h>
+
#include "jscript.h"
+#include "engine.h"
+
+#include "wine/debug.h"
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
WINE_DECLARE_DEBUG_CHANNEL(heap);
const char *debugstr_jsval(const jsval_t v)
diff --git a/dll/win32/jscript/jsval.h b/dll/win32/jscript/jsval.h
index 1121425373..963f59f6a0 100644
--- a/dll/win32/jscript/jsval.h
+++ b/dll/win32/jscript/jsval.h
@@ -246,4 +246,4 @@ HRESULT jsval_to_variant(jsval_t,VARIANT*) DECLSPEC_HIDDEN;
void jsval_release(jsval_t) DECLSPEC_HIDDEN;
HRESULT jsval_copy(jsval_t,jsval_t*) DECLSPEC_HIDDEN;
-#endif /* JSVAL_H */
+#endif
diff --git a/dll/win32/jscript/lex.c b/dll/win32/jscript/lex.c
index 2471aaa40d..352395865f 100644
--- a/dll/win32/jscript/lex.c
+++ b/dll/win32/jscript/lex.c
@@ -16,10 +16,24 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
+#include <limits.h>
+
#include "jscript.h"
+#include "activscp.h"
+#include "objsafe.h"
+#include "engine.h"
+#include "parser.h"
#include "parser.tab.h"
+#include "wine/debug.h"
+#include "wine/unicode.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
static const WCHAR breakW[] =
{'b','r','e','a','k',0};
static const WCHAR caseW[] = {'c','a','s','e',0};
static const WCHAR catchW[] =
{'c','a','t','c','h',0};
diff --git a/dll/win32/jscript/math.c b/dll/win32/jscript/math.c
index 77c2062380..ef906f5439 100644
--- a/dll/win32/jscript/math.c
+++ b/dll/win32/jscript/math.c
@@ -17,9 +17,18 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
+#include <math.h>
+#include <limits.h>
+
#include "jscript.h"
+#include "ntsecapi.h"
+
+#include "wine/debug.h"
-#include <ntsecapi.h>
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
static const WCHAR EW[] = {'E',0};
static const WCHAR LOG2EW[] =
{'L','O','G','2','E',0};
diff --git a/dll/win32/jscript/number.c b/dll/win32/jscript/number.c
index 94ec171785..94c8cc4e07 100644
--- a/dll/win32/jscript/number.c
+++ b/dll/win32/jscript/number.c
@@ -16,8 +16,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <math.h>
+#include <assert.h>
+
#include "jscript.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
typedef struct {
jsdisp_t dispex;
diff --git a/dll/win32/jscript/object.c b/dll/win32/jscript/object.c
index 9a02618d5d..de09060e8a 100644
--- a/dll/win32/jscript/object.c
+++ b/dll/win32/jscript/object.c
@@ -16,8 +16,14 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include <assert.h>
+
#include "jscript.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
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 valueOfW[] =
{'v','a','l','u','e','O','f',0};
diff --git a/dll/win32/jscript/parser.tab.c b/dll/win32/jscript/parser.tab.c
index 798cd1df55..d72f750ba0 100644
--- a/dll/win32/jscript/parser.tab.c
+++ b/dll/win32/jscript/parser.tab.c
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.0. */
/* Bison implementation for Yacc-like parsers in C
@@ -44,7 +44,7 @@
#define YYBISON 1
/* Bison version. */
-#define YYBISON_VERSION "3.0.2"
+#define YYBISON_VERSION "3.0"
/* Skeleton name. */
#define YYSKELETON_NAME "yacc.c"
@@ -72,6 +72,12 @@
#include "jscript.h"
+#include "engine.h"
+#include "parser.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
static int parser_error(parser_ctx_t*,const char*);
static void set_error(parser_ctx_t*,UINT);
@@ -185,11 +191,11 @@ static source_elements_t
*source_elements_add_statement(source_elements_t*,state
#line 193 "parser.tab.c" /* yacc.c:339 */
-# ifndef YY_NULLPTR
+# ifndef YY_NULL
# if defined __cplusplus && 201103L <= __cplusplus
-# define YY_NULLPTR nullptr
+# define YY_NULL nullptr
# else
-# define YY_NULLPTR 0
+# define YY_NULL 0
# endif
# endif
@@ -201,7 +207,10 @@ static source_elements_t
*source_elements_add_statement(source_elements_t*,state
# define YYERROR_VERBOSE 0
#endif
-
+/* In a future release of Bison, this section will be replaced
+ by #include "parser.tab.h". */
+#ifndef YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED
+# define YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -289,7 +298,7 @@ union YYSTYPE
struct _variable_list_t *variable_list;
variable_declaration_t *variable_declaration;
-#line 299 "parser.tab.c" /* yacc.c:355 */
+#line 302 "parser.tab.c" /* yacc.c:355 */
};
# define YYSTYPE_IS_TRIVIAL 1
# define YYSTYPE_IS_DECLARED 1
@@ -299,11 +308,11 @@ union YYSTYPE
int parser_parse (parser_ctx_t *ctx);
-
+#endif /* !YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED */
/* Copy the second part of user declarations. */
-#line 313 "parser.tab.c" /* yacc.c:358 */
+#line 316 "parser.tab.c" /* yacc.c:358 */
#ifdef short
# undef short
@@ -360,30 +369,11 @@ typedef short int yytype_int16;
# endif
#endif
-#ifndef YY_ATTRIBUTE
-# if (defined __GNUC__ \
- && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__)))
\
- || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
-# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
-# else
-# define YY_ATTRIBUTE(Spec) /* empty */
-# endif
-#endif
-
-#ifndef YY_ATTRIBUTE_PURE
-# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
-#endif
-
-#ifndef YY_ATTRIBUTE_UNUSED
-# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
-#endif
-
-#if !defined _Noreturn \
- && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
-# if defined _MSC_VER && 1200 <= _MSC_VER
-# define _Noreturn __declspec (noreturn)
-# else
-# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+#ifndef __attribute__
+/* This feature is available in gcc versions 2.5 and later. */
+# if (! defined __GNUC__ || __GNUC__ < 2 \
+ || (__GNUC__ == 2 && __GNUC_MINOR__ < 5))
+# define __attribute__(Spec) /* empty */
# endif
#endif
@@ -673,7 +663,7 @@ static const char *const yytname[] =
"ArrayLiteral", "ElementList", "Elision",
"Elision_opt", "ObjectLiteral",
"PropertyNameAndValueList", "PropertyName",
"Identifier_opt", "Literal",
"BooleanLiteral", "semicolon_opt", "left_bracket",
"right_bracket",
- "semicolon", YY_NULLPTR
+ "semicolon", YY_NULL
};
#endif
@@ -1433,11 +1423,11 @@ static int
yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
yytype_int16 *yyssp, int yytoken)
{
- YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]);
YYSIZE_T yysize = yysize0;
enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
/* Internationalized format string. */
- const char *yyformat = YY_NULLPTR;
+ const char *yyformat = YY_NULL;
/* Arguments of yyformat. */
char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
/* Number of reported tokens (one for the "unexpected", one per
@@ -1494,7 +1484,7 @@ yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
}
yyarg[yycount++] = yytname[yyx];
{
- YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]);
if (! (yysize <= yysize1
&& yysize1 <= YYSTACK_ALLOC_MAXIMUM))
return 2;
@@ -1833,1279 +1823,1279 @@ yyreduce:
case 2:
#line 253 "parser.y" /* yacc.c:1646 */
{ program_parsed(ctx, (yyvsp[-2].source_elements)); }
-#line 1843 "parser.tab.c" /* yacc.c:1646 */
+#line 1827 "parser.tab.c" /* yacc.c:1646 */
break;
case 3:
#line 256 "parser.y" /* yacc.c:1646 */
{}
-#line 1849 "parser.tab.c" /* yacc.c:1646 */
+#line 1833 "parser.tab.c" /* yacc.c:1646 */
break;
case 4:
#line 257 "parser.y" /* yacc.c:1646 */
{}
-#line 1855 "parser.tab.c" /* yacc.c:1646 */
+#line 1839 "parser.tab.c" /* yacc.c:1646 */
break;
case 5:
#line 261 "parser.y" /* yacc.c:1646 */
{ (yyval.source_elements) = new_source_elements(ctx); }
-#line 1861 "parser.tab.c" /* yacc.c:1646 */
+#line 1845 "parser.tab.c" /* yacc.c:1646 */
break;
case 6:
#line 263 "parser.y" /* yacc.c:1646 */
{ (yyval.source_elements) =
source_elements_add_statement((yyvsp[-1].source_elements), (yyvsp[0].statement)); }
-#line 1867 "parser.tab.c" /* yacc.c:1646 */
+#line 1851 "parser.tab.c" /* yacc.c:1646 */
break;
case 7:
#line 268 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_function_expression(ctx, NULL, (yyvsp[-4].parameter_list),
(yyvsp[-1].source_elements), NULL, (yyvsp[-6].srcptr),
(yyvsp[0].srcptr)-(yyvsp[-6].srcptr)+1); }
-#line 1873 "parser.tab.c" /* yacc.c:1646 */
+#line 1857 "parser.tab.c" /* yacc.c:1646 */
break;
case 8:
#line 270 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_function_expression(ctx, (yyvsp[-6].identifier),
(yyvsp[-4].parameter_list), (yyvsp[-1].source_elements), NULL, (yyvsp[-7].srcptr),
(yyvsp[0].srcptr)-(yyvsp[-7].srcptr)+1); }
-#line 1879 "parser.tab.c" /* yacc.c:1646 */
+#line 1863 "parser.tab.c" /* yacc.c:1646 */
break;
case 9:
#line 272 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_function_expression(ctx, (yyvsp[-6].identifier),
(yyvsp[-4].parameter_list), (yyvsp[-1].source_elements), (yyvsp[-8].identifier),
(yyvsp[-9].srcptr), (yyvsp[0].srcptr)-(yyvsp[-9].srcptr)+1); }
-#line 1885 "parser.tab.c" /* yacc.c:1646 */
+#line 1869 "parser.tab.c" /* yacc.c:1646 */
break;
case 10:
#line 275 "parser.y" /* yacc.c:1646 */
{ (yyval.srcptr) = (yyvsp[0].srcptr); }
-#line 1891 "parser.tab.c" /* yacc.c:1646 */
+#line 1875 "parser.tab.c" /* yacc.c:1646 */
break;
case 11:
#line 279 "parser.y" /* yacc.c:1646 */
{ (yyval.source_elements) = (yyvsp[0].source_elements); }
-#line 1897 "parser.tab.c" /* yacc.c:1646 */
+#line 1881 "parser.tab.c" /* yacc.c:1646 */
break;
case 12:
#line 283 "parser.y" /* yacc.c:1646 */
{ (yyval.parameter_list) = new_parameter_list(ctx, (yyvsp[0].identifier)); }
-#line 1903 "parser.tab.c" /* yacc.c:1646 */
+#line 1887 "parser.tab.c" /* yacc.c:1646 */
break;
case 13:
#line 285 "parser.y" /* yacc.c:1646 */
{ (yyval.parameter_list) = parameter_list_add(ctx, (yyvsp[-2].parameter_list),
(yyvsp[0].identifier)); }
-#line 1909 "parser.tab.c" /* yacc.c:1646 */
+#line 1893 "parser.tab.c" /* yacc.c:1646 */
break;
case 14:
#line 289 "parser.y" /* yacc.c:1646 */
{ (yyval.parameter_list) = NULL; }
-#line 1915 "parser.tab.c" /* yacc.c:1646 */
+#line 1899 "parser.tab.c" /* yacc.c:1646 */
break;
case 15:
#line 290 "parser.y" /* yacc.c:1646 */
{ (yyval.parameter_list) = (yyvsp[0].parameter_list); }
-#line 1921 "parser.tab.c" /* yacc.c:1646 */
+#line 1905 "parser.tab.c" /* yacc.c:1646 */
break;
case 16:
#line 294 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1927 "parser.tab.c" /* yacc.c:1646 */
+#line 1911 "parser.tab.c" /* yacc.c:1646 */
break;
case 17:
#line 295 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1933 "parser.tab.c" /* yacc.c:1646 */
+#line 1917 "parser.tab.c" /* yacc.c:1646 */
break;
case 18:
#line 296 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1939 "parser.tab.c" /* yacc.c:1646 */
+#line 1923 "parser.tab.c" /* yacc.c:1646 */
break;
case 19:
#line 297 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_expression_statement(ctx, (yyvsp[0].expr)); }
-#line 1945 "parser.tab.c" /* yacc.c:1646 */
+#line 1929 "parser.tab.c" /* yacc.c:1646 */
break;
case 20:
#line 298 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1951 "parser.tab.c" /* yacc.c:1646 */
+#line 1935 "parser.tab.c" /* yacc.c:1646 */
break;
case 21:
#line 299 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1957 "parser.tab.c" /* yacc.c:1646 */
+#line 1941 "parser.tab.c" /* yacc.c:1646 */
break;
case 22:
#line 300 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1963 "parser.tab.c" /* yacc.c:1646 */
+#line 1947 "parser.tab.c" /* yacc.c:1646 */
break;
case 23:
#line 301 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1969 "parser.tab.c" /* yacc.c:1646 */
+#line 1953 "parser.tab.c" /* yacc.c:1646 */
break;
case 24:
#line 302 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1975 "parser.tab.c" /* yacc.c:1646 */
+#line 1959 "parser.tab.c" /* yacc.c:1646 */
break;
case 25:
#line 303 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1981 "parser.tab.c" /* yacc.c:1646 */
+#line 1965 "parser.tab.c" /* yacc.c:1646 */
break;
case 26:
#line 304 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1987 "parser.tab.c" /* yacc.c:1646 */
+#line 1971 "parser.tab.c" /* yacc.c:1646 */
break;
case 27:
#line 305 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1993 "parser.tab.c" /* yacc.c:1646 */
+#line 1977 "parser.tab.c" /* yacc.c:1646 */
break;
case 28:
#line 306 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 1999 "parser.tab.c" /* yacc.c:1646 */
+#line 1983 "parser.tab.c" /* yacc.c:1646 */
break;
case 29:
#line 307 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 2005 "parser.tab.c" /* yacc.c:1646 */
+#line 1989 "parser.tab.c" /* yacc.c:1646 */
break;
case 30:
#line 308 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 2011 "parser.tab.c" /* yacc.c:1646 */
+#line 1995 "parser.tab.c" /* yacc.c:1646 */
break;
case 31:
#line 312 "parser.y" /* yacc.c:1646 */
{ (yyval.statement_list) = new_statement_list(ctx, (yyvsp[0].statement)); }
-#line 2017 "parser.tab.c" /* yacc.c:1646 */
+#line 2001 "parser.tab.c" /* yacc.c:1646 */
break;
case 32:
#line 314 "parser.y" /* yacc.c:1646 */
{ (yyval.statement_list) = statement_list_add((yyvsp[-1].statement_list),
(yyvsp[0].statement)); }
-#line 2023 "parser.tab.c" /* yacc.c:1646 */
+#line 2007 "parser.tab.c" /* yacc.c:1646 */
break;
case 33:
#line 318 "parser.y" /* yacc.c:1646 */
{ (yyval.statement_list) = NULL; }
-#line 2029 "parser.tab.c" /* yacc.c:1646 */
+#line 2013 "parser.tab.c" /* yacc.c:1646 */
break;
case 34:
#line 319 "parser.y" /* yacc.c:1646 */
{ (yyval.statement_list) = (yyvsp[0].statement_list); }
-#line 2035 "parser.tab.c" /* yacc.c:1646 */
+#line 2019 "parser.tab.c" /* yacc.c:1646 */
break;
case 35:
#line 323 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_block_statement(ctx, (yyvsp[-1].statement_list)); }
-#line 2041 "parser.tab.c" /* yacc.c:1646 */
+#line 2025 "parser.tab.c" /* yacc.c:1646 */
break;
case 36:
#line 324 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_block_statement(ctx, NULL); }
-#line 2047 "parser.tab.c" /* yacc.c:1646 */
+#line 2031 "parser.tab.c" /* yacc.c:1646 */
break;
case 37:
#line 329 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_var_statement(ctx, (yyvsp[-1].variable_list)); }
-#line 2053 "parser.tab.c" /* yacc.c:1646 */
+#line 2037 "parser.tab.c" /* yacc.c:1646 */
break;
case 38:
#line 333 "parser.y" /* yacc.c:1646 */
{ (yyval.variable_list) = new_variable_list(ctx, (yyvsp[0].variable_declaration)); }
-#line 2059 "parser.tab.c" /* yacc.c:1646 */
+#line 2043 "parser.tab.c" /* yacc.c:1646 */
break;
case 39:
#line 335 "parser.y" /* yacc.c:1646 */
{ (yyval.variable_list) = variable_list_add(ctx, (yyvsp[-2].variable_list),
(yyvsp[0].variable_declaration)); }
-#line 2065 "parser.tab.c" /* yacc.c:1646 */
+#line 2049 "parser.tab.c" /* yacc.c:1646 */
break;
case 40:
#line 340 "parser.y" /* yacc.c:1646 */
{ (yyval.variable_list) = new_variable_list(ctx, (yyvsp[0].variable_declaration)); }
-#line 2071 "parser.tab.c" /* yacc.c:1646 */
+#line 2055 "parser.tab.c" /* yacc.c:1646 */
break;
case 41:
#line 342 "parser.y" /* yacc.c:1646 */
{ (yyval.variable_list) = variable_list_add(ctx, (yyvsp[-2].variable_list),
(yyvsp[0].variable_declaration)); }
-#line 2077 "parser.tab.c" /* yacc.c:1646 */
+#line 2061 "parser.tab.c" /* yacc.c:1646 */
break;
case 42:
#line 347 "parser.y" /* yacc.c:1646 */
{ (yyval.variable_declaration) = new_variable_declaration(ctx,
(yyvsp[-1].identifier), (yyvsp[0].expr)); }
-#line 2083 "parser.tab.c" /* yacc.c:1646 */
+#line 2067 "parser.tab.c" /* yacc.c:1646 */
break;
case 43:
#line 352 "parser.y" /* yacc.c:1646 */
{ (yyval.variable_declaration) = new_variable_declaration(ctx,
(yyvsp[-1].identifier), (yyvsp[0].expr)); }
-#line 2089 "parser.tab.c" /* yacc.c:1646 */
+#line 2073 "parser.tab.c" /* yacc.c:1646 */
break;
case 44:
#line 356 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = NULL; }
-#line 2095 "parser.tab.c" /* yacc.c:1646 */
+#line 2079 "parser.tab.c" /* yacc.c:1646 */
break;
case 45:
#line 357 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2101 "parser.tab.c" /* yacc.c:1646 */
+#line 2085 "parser.tab.c" /* yacc.c:1646 */
break;
case 46:
#line 362 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2107 "parser.tab.c" /* yacc.c:1646 */
+#line 2091 "parser.tab.c" /* yacc.c:1646 */
break;
case 47:
#line 366 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = NULL; }
-#line 2113 "parser.tab.c" /* yacc.c:1646 */
+#line 2097 "parser.tab.c" /* yacc.c:1646 */
break;
case 48:
#line 367 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2119 "parser.tab.c" /* yacc.c:1646 */
+#line 2103 "parser.tab.c" /* yacc.c:1646 */
break;
case 49:
#line 372 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2125 "parser.tab.c" /* yacc.c:1646 */
+#line 2109 "parser.tab.c" /* yacc.c:1646 */
break;
case 50:
#line 376 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_statement(ctx, STAT_EMPTY, 0); }
-#line 2131 "parser.tab.c" /* yacc.c:1646 */
+#line 2115 "parser.tab.c" /* yacc.c:1646 */
break;
case 51:
#line 381 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_expression_statement(ctx, (yyvsp[-1].expr)); }
-#line 2137 "parser.tab.c" /* yacc.c:1646 */
+#line 2121 "parser.tab.c" /* yacc.c:1646 */
break;
case 52:
#line 386 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_if_statement(ctx, (yyvsp[-4].expr), (yyvsp[-2].statement),
(yyvsp[0].statement)); }
-#line 2143 "parser.tab.c" /* yacc.c:1646 */
+#line 2127 "parser.tab.c" /* yacc.c:1646 */
break;
case 53:
#line 388 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_if_statement(ctx, (yyvsp[-2].expr), (yyvsp[0].statement),
NULL); }
-#line 2149 "parser.tab.c" /* yacc.c:1646 */
+#line 2133 "parser.tab.c" /* yacc.c:1646 */
break;
case 54:
#line 393 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_while_statement(ctx, TRUE, (yyvsp[-2].expr),
(yyvsp[-5].statement)); }
-#line 2155 "parser.tab.c" /* yacc.c:1646 */
+#line 2139 "parser.tab.c" /* yacc.c:1646 */
break;
case 55:
#line 395 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_while_statement(ctx, FALSE, (yyvsp[-2].expr),
(yyvsp[0].statement)); }
-#line 2161 "parser.tab.c" /* yacc.c:1646 */
+#line 2145 "parser.tab.c" /* yacc.c:1646 */
break;
case 56:
#line 397 "parser.y" /* yacc.c:1646 */
{ if(!explicit_error(ctx, (yyvsp[0].expr), ';')) YYABORT; }
-#line 2167 "parser.tab.c" /* yacc.c:1646 */
+#line 2151 "parser.tab.c" /* yacc.c:1646 */
break;
case 57:
#line 399 "parser.y" /* yacc.c:1646 */
{ if(!explicit_error(ctx, (yyvsp[0].expr), ';')) YYABORT; }
-#line 2173 "parser.tab.c" /* yacc.c:1646 */
+#line 2157 "parser.tab.c" /* yacc.c:1646 */
break;
case 58:
#line 401 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_for_statement(ctx, NULL, (yyvsp[-8].expr),
(yyvsp[-5].expr), (yyvsp[-2].expr), (yyvsp[0].statement)); }
-#line 2179 "parser.tab.c" /* yacc.c:1646 */
+#line 2163 "parser.tab.c" /* yacc.c:1646 */
break;
case 59:
#line 403 "parser.y" /* yacc.c:1646 */
{ if(!explicit_error(ctx, (yyvsp[0].variable_list), ';')) YYABORT; }
-#line 2185 "parser.tab.c" /* yacc.c:1646 */
+#line 2169 "parser.tab.c" /* yacc.c:1646 */
break;
case 60:
#line 405 "parser.y" /* yacc.c:1646 */
{ if(!explicit_error(ctx, (yyvsp[0].expr), ';')) YYABORT; }
-#line 2191 "parser.tab.c" /* yacc.c:1646 */
+#line 2175 "parser.tab.c" /* yacc.c:1646 */
break;
case 61:
#line 407 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_for_statement(ctx, (yyvsp[-8].variable_list), NULL,
(yyvsp[-5].expr), (yyvsp[-2].expr), (yyvsp[0].statement)); }
-#line 2197 "parser.tab.c" /* yacc.c:1646 */
+#line 2181 "parser.tab.c" /* yacc.c:1646 */
break;
case 62:
#line 409 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_forin_statement(ctx, NULL, (yyvsp[-4].expr),
(yyvsp[-2].expr), (yyvsp[0].statement)); }
-#line 2203 "parser.tab.c" /* yacc.c:1646 */
+#line 2187 "parser.tab.c" /* yacc.c:1646 */
break;
case 63:
#line 411 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_forin_statement(ctx, (yyvsp[-4].variable_declaration),
NULL, (yyvsp[-2].expr), (yyvsp[0].statement)); }
-#line 2209 "parser.tab.c" /* yacc.c:1646 */
+#line 2193 "parser.tab.c" /* yacc.c:1646 */
break;
case 64:
#line 416 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_continue_statement(ctx, (yyvsp[-1].identifier)); }
-#line 2215 "parser.tab.c" /* yacc.c:1646 */
+#line 2199 "parser.tab.c" /* yacc.c:1646 */
break;
case 65:
#line 421 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_break_statement(ctx, (yyvsp[-1].identifier)); }
-#line 2221 "parser.tab.c" /* yacc.c:1646 */
+#line 2205 "parser.tab.c" /* yacc.c:1646 */
break;
case 66:
#line 426 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_return_statement(ctx, (yyvsp[-1].expr)); }
-#line 2227 "parser.tab.c" /* yacc.c:1646 */
+#line 2211 "parser.tab.c" /* yacc.c:1646 */
break;
case 67:
#line 431 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_with_statement(ctx, (yyvsp[-2].expr),
(yyvsp[0].statement)); }
-#line 2233 "parser.tab.c" /* yacc.c:1646 */
+#line 2217 "parser.tab.c" /* yacc.c:1646 */
break;
case 68:
#line 436 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_labelled_statement(ctx, (yyvsp[-2].identifier),
(yyvsp[0].statement)); }
-#line 2239 "parser.tab.c" /* yacc.c:1646 */
+#line 2223 "parser.tab.c" /* yacc.c:1646 */
break;
case 69:
#line 441 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_switch_statement(ctx, (yyvsp[-2].expr),
(yyvsp[0].case_clausule)); }
-#line 2245 "parser.tab.c" /* yacc.c:1646 */
+#line 2229 "parser.tab.c" /* yacc.c:1646 */
break;
case 70:
#line 446 "parser.y" /* yacc.c:1646 */
{ (yyval.case_clausule) = new_case_block(ctx, (yyvsp[-1].case_list), NULL, NULL); }
-#line 2251 "parser.tab.c" /* yacc.c:1646 */
+#line 2235 "parser.tab.c" /* yacc.c:1646 */
break;
case 71:
#line 448 "parser.y" /* yacc.c:1646 */
{ (yyval.case_clausule) = new_case_block(ctx, (yyvsp[-3].case_list),
(yyvsp[-2].case_clausule), (yyvsp[-1].case_list)); }
-#line 2257 "parser.tab.c" /* yacc.c:1646 */
+#line 2241 "parser.tab.c" /* yacc.c:1646 */
break;
case 72:
#line 452 "parser.y" /* yacc.c:1646 */
{ (yyval.case_list) = NULL; }
-#line 2263 "parser.tab.c" /* yacc.c:1646 */
+#line 2247 "parser.tab.c" /* yacc.c:1646 */
break;
case 73:
#line 453 "parser.y" /* yacc.c:1646 */
{ (yyval.case_list) = (yyvsp[0].case_list); }
-#line 2269 "parser.tab.c" /* yacc.c:1646 */
+#line 2253 "parser.tab.c" /* yacc.c:1646 */
break;
case 74:
#line 457 "parser.y" /* yacc.c:1646 */
{ (yyval.case_list) = new_case_list(ctx, (yyvsp[0].case_clausule)); }
-#line 2275 "parser.tab.c" /* yacc.c:1646 */
+#line 2259 "parser.tab.c" /* yacc.c:1646 */
break;
case 75:
#line 459 "parser.y" /* yacc.c:1646 */
{ (yyval.case_list) = case_list_add(ctx, (yyvsp[-1].case_list),
(yyvsp[0].case_clausule)); }
-#line 2281 "parser.tab.c" /* yacc.c:1646 */
+#line 2265 "parser.tab.c" /* yacc.c:1646 */
break;
case 76:
#line 464 "parser.y" /* yacc.c:1646 */
{ (yyval.case_clausule) = new_case_clausule(ctx, (yyvsp[-2].expr),
(yyvsp[0].statement_list)); }
-#line 2287 "parser.tab.c" /* yacc.c:1646 */
+#line 2271 "parser.tab.c" /* yacc.c:1646 */
break;
case 77:
#line 469 "parser.y" /* yacc.c:1646 */
{ (yyval.case_clausule) = new_case_clausule(ctx, NULL, (yyvsp[0].statement_list)); }
-#line 2293 "parser.tab.c" /* yacc.c:1646 */
+#line 2277 "parser.tab.c" /* yacc.c:1646 */
break;
case 78:
#line 474 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_throw_statement(ctx, (yyvsp[-1].expr)); }
-#line 2299 "parser.tab.c" /* yacc.c:1646 */
+#line 2283 "parser.tab.c" /* yacc.c:1646 */
break;
case 79:
#line 478 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_try_statement(ctx, (yyvsp[-1].statement),
(yyvsp[0].catch_block), NULL); }
-#line 2305 "parser.tab.c" /* yacc.c:1646 */
+#line 2289 "parser.tab.c" /* yacc.c:1646 */
break;
case 80:
#line 479 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_try_statement(ctx, (yyvsp[-1].statement), NULL,
(yyvsp[0].statement)); }
-#line 2311 "parser.tab.c" /* yacc.c:1646 */
+#line 2295 "parser.tab.c" /* yacc.c:1646 */
break;
case 81:
#line 481 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = new_try_statement(ctx, (yyvsp[-2].statement),
(yyvsp[-1].catch_block), (yyvsp[0].statement)); }
-#line 2317 "parser.tab.c" /* yacc.c:1646 */
+#line 2301 "parser.tab.c" /* yacc.c:1646 */
break;
case 82:
#line 486 "parser.y" /* yacc.c:1646 */
{ (yyval.catch_block) = new_catch_block(ctx, (yyvsp[-2].identifier),
(yyvsp[0].statement)); }
-#line 2323 "parser.tab.c" /* yacc.c:1646 */
+#line 2307 "parser.tab.c" /* yacc.c:1646 */
break;
case 83:
#line 490 "parser.y" /* yacc.c:1646 */
{ (yyval.statement) = (yyvsp[0].statement); }
-#line 2329 "parser.tab.c" /* yacc.c:1646 */
+#line 2313 "parser.tab.c" /* yacc.c:1646 */
break;
case 84:
#line 494 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = NULL; }
-#line 2335 "parser.tab.c" /* yacc.c:1646 */
+#line 2319 "parser.tab.c" /* yacc.c:1646 */
break;
case 85:
#line 495 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2341 "parser.tab.c" /* yacc.c:1646 */
+#line 2325 "parser.tab.c" /* yacc.c:1646 */
break;
case 86:
#line 498 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2347 "parser.tab.c" /* yacc.c:1646 */
+#line 2331 "parser.tab.c" /* yacc.c:1646 */
break;
case 87:
#line 499 "parser.y" /* yacc.c:1646 */
{ set_error(ctx, JS_E_SYNTAX); YYABORT; }
-#line 2353 "parser.tab.c" /* yacc.c:1646 */
+#line 2337 "parser.tab.c" /* yacc.c:1646 */
break;
case 88:
#line 503 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2359 "parser.tab.c" /* yacc.c:1646 */
+#line 2343 "parser.tab.c" /* yacc.c:1646 */
break;
case 89:
#line 505 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_COMMA, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2365 "parser.tab.c" /* yacc.c:1646 */
+#line 2349 "parser.tab.c" /* yacc.c:1646 */
break;
case 90:
#line 509 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = NULL; }
-#line 2371 "parser.tab.c" /* yacc.c:1646 */
+#line 2355 "parser.tab.c" /* yacc.c:1646 */
break;
case 91:
#line 510 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2377 "parser.tab.c" /* yacc.c:1646 */
+#line 2361 "parser.tab.c" /* yacc.c:1646 */
break;
case 92:
#line 515 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2383 "parser.tab.c" /* yacc.c:1646 */
+#line 2367 "parser.tab.c" /* yacc.c:1646 */
break;
case 93:
#line 517 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_COMMA, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2389 "parser.tab.c" /* yacc.c:1646 */
+#line 2373 "parser.tab.c" /* yacc.c:1646 */
break;
case 94:
#line 520 "parser.y" /* yacc.c:1646 */
{ (yyval.ival) = (yyvsp[0].ival); }
-#line 2395 "parser.tab.c" /* yacc.c:1646 */
+#line 2379 "parser.tab.c" /* yacc.c:1646 */
break;
case 95:
#line 521 "parser.y" /* yacc.c:1646 */
{ (yyval.ival) = EXPR_ASSIGNDIV; }
-#line 2401 "parser.tab.c" /* yacc.c:1646 */
+#line 2385 "parser.tab.c" /* yacc.c:1646 */
break;
case 96:
#line 525 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2407 "parser.tab.c" /* yacc.c:1646 */
+#line 2391 "parser.tab.c" /* yacc.c:1646 */
break;
case 97:
#line 527 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_ASSIGN, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2413 "parser.tab.c" /* yacc.c:1646 */
+#line 2397 "parser.tab.c" /* yacc.c:1646 */
break;
case 98:
#line 529 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2419 "parser.tab.c" /* yacc.c:1646 */
+#line 2403 "parser.tab.c" /* yacc.c:1646 */
break;
case 99:
#line 534 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2425 "parser.tab.c" /* yacc.c:1646 */
+#line 2409 "parser.tab.c" /* yacc.c:1646 */
break;
case 100:
#line 536 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_ASSIGN, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2431 "parser.tab.c" /* yacc.c:1646 */
+#line 2415 "parser.tab.c" /* yacc.c:1646 */
break;
case 101:
#line 538 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2437 "parser.tab.c" /* yacc.c:1646 */
+#line 2421 "parser.tab.c" /* yacc.c:1646 */
break;
case 102:
#line 542 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2443 "parser.tab.c" /* yacc.c:1646 */
+#line 2427 "parser.tab.c" /* yacc.c:1646 */
break;
case 103:
#line 544 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_conditional_expression(ctx, (yyvsp[-4].expr), (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2449 "parser.tab.c" /* yacc.c:1646 */
+#line 2433 "parser.tab.c" /* yacc.c:1646 */
break;
case 104:
#line 549 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2455 "parser.tab.c" /* yacc.c:1646 */
+#line 2439 "parser.tab.c" /* yacc.c:1646 */
break;
case 105:
#line 551 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_conditional_expression(ctx, (yyvsp[-4].expr), (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2461 "parser.tab.c" /* yacc.c:1646 */
+#line 2445 "parser.tab.c" /* yacc.c:1646 */
break;
case 106:
#line 555 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2467 "parser.tab.c" /* yacc.c:1646 */
+#line 2451 "parser.tab.c" /* yacc.c:1646 */
break;
case 107:
#line 557 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_OR, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2473 "parser.tab.c" /* yacc.c:1646 */
+#line 2457 "parser.tab.c" /* yacc.c:1646 */
break;
case 108:
#line 562 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2479 "parser.tab.c" /* yacc.c:1646 */
+#line 2463 "parser.tab.c" /* yacc.c:1646 */
break;
case 109:
#line 564 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_OR, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2485 "parser.tab.c" /* yacc.c:1646 */
+#line 2469 "parser.tab.c" /* yacc.c:1646 */
break;
case 110:
#line 568 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2491 "parser.tab.c" /* yacc.c:1646 */
+#line 2475 "parser.tab.c" /* yacc.c:1646 */
break;
case 111:
#line 570 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_AND, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2497 "parser.tab.c" /* yacc.c:1646 */
+#line 2481 "parser.tab.c" /* yacc.c:1646 */
break;
case 112:
#line 575 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2503 "parser.tab.c" /* yacc.c:1646 */
+#line 2487 "parser.tab.c" /* yacc.c:1646 */
break;
case 113:
#line 577 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_AND, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2509 "parser.tab.c" /* yacc.c:1646 */
+#line 2493 "parser.tab.c" /* yacc.c:1646 */
break;
case 114:
#line 581 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2515 "parser.tab.c" /* yacc.c:1646 */
+#line 2499 "parser.tab.c" /* yacc.c:1646 */
break;
case 115:
#line 583 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_BOR, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2521 "parser.tab.c" /* yacc.c:1646 */
+#line 2505 "parser.tab.c" /* yacc.c:1646 */
break;
case 116:
#line 588 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2527 "parser.tab.c" /* yacc.c:1646 */
+#line 2511 "parser.tab.c" /* yacc.c:1646 */
break;
case 117:
#line 590 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_BOR, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2533 "parser.tab.c" /* yacc.c:1646 */
+#line 2517 "parser.tab.c" /* yacc.c:1646 */
break;
case 118:
#line 594 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2539 "parser.tab.c" /* yacc.c:1646 */
+#line 2523 "parser.tab.c" /* yacc.c:1646 */
break;
case 119:
#line 596 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_BXOR, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2545 "parser.tab.c" /* yacc.c:1646 */
+#line 2529 "parser.tab.c" /* yacc.c:1646 */
break;
case 120:
#line 601 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2551 "parser.tab.c" /* yacc.c:1646 */
+#line 2535 "parser.tab.c" /* yacc.c:1646 */
break;
case 121:
#line 603 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_BXOR, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2557 "parser.tab.c" /* yacc.c:1646 */
+#line 2541 "parser.tab.c" /* yacc.c:1646 */
break;
case 122:
#line 607 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2563 "parser.tab.c" /* yacc.c:1646 */
+#line 2547 "parser.tab.c" /* yacc.c:1646 */
break;
case 123:
#line 609 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_BAND, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2569 "parser.tab.c" /* yacc.c:1646 */
+#line 2553 "parser.tab.c" /* yacc.c:1646 */
break;
case 124:
#line 614 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2575 "parser.tab.c" /* yacc.c:1646 */
+#line 2559 "parser.tab.c" /* yacc.c:1646 */
break;
case 125:
#line 616 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_BAND, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2581 "parser.tab.c" /* yacc.c:1646 */
+#line 2565 "parser.tab.c" /* yacc.c:1646 */
break;
case 126:
#line 620 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2587 "parser.tab.c" /* yacc.c:1646 */
+#line 2571 "parser.tab.c" /* yacc.c:1646 */
break;
case 127:
#line 622 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2593 "parser.tab.c" /* yacc.c:1646 */
+#line 2577 "parser.tab.c" /* yacc.c:1646 */
break;
case 128:
#line 626 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2599 "parser.tab.c" /* yacc.c:1646 */
+#line 2583 "parser.tab.c" /* yacc.c:1646 */
break;
case 129:
#line 628 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2605 "parser.tab.c" /* yacc.c:1646 */
+#line 2589 "parser.tab.c" /* yacc.c:1646 */
break;
case 130:
#line 632 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2611 "parser.tab.c" /* yacc.c:1646 */
+#line 2595 "parser.tab.c" /* yacc.c:1646 */
break;
case 131:
#line 634 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2617 "parser.tab.c" /* yacc.c:1646 */
+#line 2601 "parser.tab.c" /* yacc.c:1646 */
break;
case 132:
#line 636 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_INSTANCEOF, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2623 "parser.tab.c" /* yacc.c:1646 */
+#line 2607 "parser.tab.c" /* yacc.c:1646 */
break;
case 133:
#line 638 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_IN, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2629 "parser.tab.c" /* yacc.c:1646 */
+#line 2613 "parser.tab.c" /* yacc.c:1646 */
break;
case 134:
#line 642 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2635 "parser.tab.c" /* yacc.c:1646 */
+#line 2619 "parser.tab.c" /* yacc.c:1646 */
break;
case 135:
#line 644 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2641 "parser.tab.c" /* yacc.c:1646 */
+#line 2625 "parser.tab.c" /* yacc.c:1646 */
break;
case 136:
#line 646 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_INSTANCEOF, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2647 "parser.tab.c" /* yacc.c:1646 */
+#line 2631 "parser.tab.c" /* yacc.c:1646 */
break;
case 137:
#line 650 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2653 "parser.tab.c" /* yacc.c:1646 */
+#line 2637 "parser.tab.c" /* yacc.c:1646 */
break;
case 138:
#line 652 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2659 "parser.tab.c" /* yacc.c:1646 */
+#line 2643 "parser.tab.c" /* yacc.c:1646 */
break;
case 139:
#line 657 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2665 "parser.tab.c" /* yacc.c:1646 */
+#line 2649 "parser.tab.c" /* yacc.c:1646 */
break;
case 140:
#line 659 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_ADD, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2671 "parser.tab.c" /* yacc.c:1646 */
+#line 2655 "parser.tab.c" /* yacc.c:1646 */
break;
case 141:
#line 661 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_SUB, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2677 "parser.tab.c" /* yacc.c:1646 */
+#line 2661 "parser.tab.c" /* yacc.c:1646 */
break;
case 142:
#line 665 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2683 "parser.tab.c" /* yacc.c:1646 */
+#line 2667 "parser.tab.c" /* yacc.c:1646 */
break;
case 143:
#line 667 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_MUL, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2689 "parser.tab.c" /* yacc.c:1646 */
+#line 2673 "parser.tab.c" /* yacc.c:1646 */
break;
case 144:
#line 669 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_DIV, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2695 "parser.tab.c" /* yacc.c:1646 */
+#line 2679 "parser.tab.c" /* yacc.c:1646 */
break;
case 145:
#line 671 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_MOD, (yyvsp[-2].expr),
(yyvsp[0].expr)); }
-#line 2701 "parser.tab.c" /* yacc.c:1646 */
+#line 2685 "parser.tab.c" /* yacc.c:1646 */
break;
case 146:
#line 675 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2707 "parser.tab.c" /* yacc.c:1646 */
+#line 2691 "parser.tab.c" /* yacc.c:1646 */
break;
case 147:
#line 677 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_DELETE, (yyvsp[0].expr)); }
-#line 2713 "parser.tab.c" /* yacc.c:1646 */
+#line 2697 "parser.tab.c" /* yacc.c:1646 */
break;
case 148:
#line 678 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_VOID, (yyvsp[0].expr)); }
-#line 2719 "parser.tab.c" /* yacc.c:1646 */
+#line 2703 "parser.tab.c" /* yacc.c:1646 */
break;
case 149:
#line 680 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_TYPEOF, (yyvsp[0].expr)); }
-#line 2725 "parser.tab.c" /* yacc.c:1646 */
+#line 2709 "parser.tab.c" /* yacc.c:1646 */
break;
case 150:
#line 681 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_PREINC, (yyvsp[0].expr)); }
-#line 2731 "parser.tab.c" /* yacc.c:1646 */
+#line 2715 "parser.tab.c" /* yacc.c:1646 */
break;
case 151:
#line 682 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_PREDEC, (yyvsp[0].expr)); }
-#line 2737 "parser.tab.c" /* yacc.c:1646 */
+#line 2721 "parser.tab.c" /* yacc.c:1646 */
break;
case 152:
#line 683 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_PLUS, (yyvsp[0].expr)); }
-#line 2743 "parser.tab.c" /* yacc.c:1646 */
+#line 2727 "parser.tab.c" /* yacc.c:1646 */
break;
case 153:
#line 684 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_MINUS, (yyvsp[0].expr)); }
-#line 2749 "parser.tab.c" /* yacc.c:1646 */
+#line 2733 "parser.tab.c" /* yacc.c:1646 */
break;
case 154:
#line 685 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_BITNEG, (yyvsp[0].expr)); }
-#line 2755 "parser.tab.c" /* yacc.c:1646 */
+#line 2739 "parser.tab.c" /* yacc.c:1646 */
break;
case 155:
#line 686 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_LOGNEG, (yyvsp[0].expr)); }
-#line 2761 "parser.tab.c" /* yacc.c:1646 */
+#line 2745 "parser.tab.c" /* yacc.c:1646 */
break;
case 156:
#line 691 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2767 "parser.tab.c" /* yacc.c:1646 */
+#line 2751 "parser.tab.c" /* yacc.c:1646 */
break;
case 157:
#line 693 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_POSTINC, (yyvsp[-1].expr)); }
-#line 2773 "parser.tab.c" /* yacc.c:1646 */
+#line 2757 "parser.tab.c" /* yacc.c:1646 */
break;
case 158:
#line 695 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_unary_expression(ctx, EXPR_POSTDEC, (yyvsp[-1].expr)); }
-#line 2779 "parser.tab.c" /* yacc.c:1646 */
+#line 2763 "parser.tab.c" /* yacc.c:1646 */
break;
case 159:
#line 700 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2785 "parser.tab.c" /* yacc.c:1646 */
+#line 2769 "parser.tab.c" /* yacc.c:1646 */
break;
case 160:
#line 701 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2791 "parser.tab.c" /* yacc.c:1646 */
+#line 2775 "parser.tab.c" /* yacc.c:1646 */
break;
case 161:
#line 705 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2797 "parser.tab.c" /* yacc.c:1646 */
+#line 2781 "parser.tab.c" /* yacc.c:1646 */
break;
case 162:
#line 706 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_new_expression(ctx, (yyvsp[0].expr), NULL); }
-#line 2803 "parser.tab.c" /* yacc.c:1646 */
+#line 2787 "parser.tab.c" /* yacc.c:1646 */
break;
case 163:
#line 710 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2809 "parser.tab.c" /* yacc.c:1646 */
+#line 2793 "parser.tab.c" /* yacc.c:1646 */
break;
case 164:
#line 711 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2815 "parser.tab.c" /* yacc.c:1646 */
+#line 2799 "parser.tab.c" /* yacc.c:1646 */
break;
case 165:
#line 713 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_ARRAY, (yyvsp[-3].expr),
(yyvsp[-1].expr)); }
-#line 2821 "parser.tab.c" /* yacc.c:1646 */
+#line 2805 "parser.tab.c" /* yacc.c:1646 */
break;
case 166:
#line 715 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_member_expression(ctx, (yyvsp[-2].expr), (yyvsp[0].identifier));
}
-#line 2827 "parser.tab.c" /* yacc.c:1646 */
+#line 2811 "parser.tab.c" /* yacc.c:1646 */
break;
case 167:
#line 717 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_new_expression(ctx, (yyvsp[-1].expr), (yyvsp[0].argument_list));
}
-#line 2833 "parser.tab.c" /* yacc.c:1646 */
+#line 2817 "parser.tab.c" /* yacc.c:1646 */
break;
case 168:
#line 722 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_call_expression(ctx, (yyvsp[-1].expr),
(yyvsp[0].argument_list)); }
-#line 2839 "parser.tab.c" /* yacc.c:1646 */
+#line 2823 "parser.tab.c" /* yacc.c:1646 */
break;
case 169:
#line 724 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_call_expression(ctx, (yyvsp[-1].expr),
(yyvsp[0].argument_list)); }
-#line 2845 "parser.tab.c" /* yacc.c:1646 */
+#line 2829 "parser.tab.c" /* yacc.c:1646 */
break;
case 170:
#line 726 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_binary_expression(ctx, EXPR_ARRAY, (yyvsp[-3].expr),
(yyvsp[-1].expr)); }
-#line 2851 "parser.tab.c" /* yacc.c:1646 */
+#line 2835 "parser.tab.c" /* yacc.c:1646 */
break;
case 171:
#line 728 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_member_expression(ctx, (yyvsp[-2].expr), (yyvsp[0].identifier));
}
-#line 2857 "parser.tab.c" /* yacc.c:1646 */
+#line 2841 "parser.tab.c" /* yacc.c:1646 */
break;
case 172:
#line 732 "parser.y" /* yacc.c:1646 */
{ (yyval.argument_list) = NULL; }
-#line 2863 "parser.tab.c" /* yacc.c:1646 */
+#line 2847 "parser.tab.c" /* yacc.c:1646 */
break;
case 173:
#line 733 "parser.y" /* yacc.c:1646 */
{ (yyval.argument_list) = (yyvsp[-1].argument_list); }
-#line 2869 "parser.tab.c" /* yacc.c:1646 */
+#line 2853 "parser.tab.c" /* yacc.c:1646 */
break;
case 174:
#line 737 "parser.y" /* yacc.c:1646 */
{ (yyval.argument_list) = new_argument_list(ctx, (yyvsp[0].expr)); }
-#line 2875 "parser.tab.c" /* yacc.c:1646 */
+#line 2859 "parser.tab.c" /* yacc.c:1646 */
break;
case 175:
#line 739 "parser.y" /* yacc.c:1646 */
{ (yyval.argument_list) = argument_list_add(ctx, (yyvsp[-2].argument_list),
(yyvsp[0].expr)); }
-#line 2881 "parser.tab.c" /* yacc.c:1646 */
+#line 2865 "parser.tab.c" /* yacc.c:1646 */
break;
case 176:
#line 743 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_expression(ctx, EXPR_THIS, 0); }
-#line 2887 "parser.tab.c" /* yacc.c:1646 */
+#line 2871 "parser.tab.c" /* yacc.c:1646 */
break;
case 177:
#line 744 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_identifier_expression(ctx, (yyvsp[0].identifier)); }
-#line 2893 "parser.tab.c" /* yacc.c:1646 */
+#line 2877 "parser.tab.c" /* yacc.c:1646 */
break;
case 178:
#line 745 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_literal_expression(ctx, (yyvsp[0].literal)); }
-#line 2899 "parser.tab.c" /* yacc.c:1646 */
+#line 2883 "parser.tab.c" /* yacc.c:1646 */
break;
case 179:
#line 746 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2905 "parser.tab.c" /* yacc.c:1646 */
+#line 2889 "parser.tab.c" /* yacc.c:1646 */
break;
case 180:
#line 747 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[0].expr); }
-#line 2911 "parser.tab.c" /* yacc.c:1646 */
+#line 2895 "parser.tab.c" /* yacc.c:1646 */
break;
case 181:
#line 748 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = (yyvsp[-1].expr); }
-#line 2917 "parser.tab.c" /* yacc.c:1646 */
+#line 2901 "parser.tab.c" /* yacc.c:1646 */
break;
case 182:
#line 752 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_array_literal_expression(ctx, NULL, 0); }
-#line 2923 "parser.tab.c" /* yacc.c:1646 */
+#line 2907 "parser.tab.c" /* yacc.c:1646 */
break;
case 183:
#line 753 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_array_literal_expression(ctx, NULL, (yyvsp[-1].ival)+1); }
-#line 2929 "parser.tab.c" /* yacc.c:1646 */
+#line 2913 "parser.tab.c" /* yacc.c:1646 */
break;
case 184:
#line 754 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_array_literal_expression(ctx, (yyvsp[-1].element_list), 0); }
-#line 2935 "parser.tab.c" /* yacc.c:1646 */
+#line 2919 "parser.tab.c" /* yacc.c:1646 */
break;
case 185:
#line 756 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_array_literal_expression(ctx, (yyvsp[-3].element_list),
(yyvsp[-1].ival)+1); }
-#line 2941 "parser.tab.c" /* yacc.c:1646 */
+#line 2925 "parser.tab.c" /* yacc.c:1646 */
break;
case 186:
#line 761 "parser.y" /* yacc.c:1646 */
{ (yyval.element_list) = new_element_list(ctx, (yyvsp[-1].ival), (yyvsp[0].expr)); }
-#line 2947 "parser.tab.c" /* yacc.c:1646 */
+#line 2931 "parser.tab.c" /* yacc.c:1646 */
break;
case 187:
#line 763 "parser.y" /* yacc.c:1646 */
{ (yyval.element_list) = element_list_add(ctx, (yyvsp[-3].element_list),
(yyvsp[-1].ival), (yyvsp[0].expr)); }
-#line 2953 "parser.tab.c" /* yacc.c:1646 */
+#line 2937 "parser.tab.c" /* yacc.c:1646 */
break;
case 188:
#line 767 "parser.y" /* yacc.c:1646 */
{ (yyval.ival) = 1; }
-#line 2959 "parser.tab.c" /* yacc.c:1646 */
+#line 2943 "parser.tab.c" /* yacc.c:1646 */
break;
case 189:
#line 768 "parser.y" /* yacc.c:1646 */
{ (yyval.ival) = (yyvsp[-1].ival) + 1; }
-#line 2965 "parser.tab.c" /* yacc.c:1646 */
+#line 2949 "parser.tab.c" /* yacc.c:1646 */
break;
case 190:
#line 772 "parser.y" /* yacc.c:1646 */
{ (yyval.ival) = 0; }
-#line 2971 "parser.tab.c" /* yacc.c:1646 */
+#line 2955 "parser.tab.c" /* yacc.c:1646 */
break;
case 191:
#line 773 "parser.y" /* yacc.c:1646 */
{ (yyval.ival) = (yyvsp[0].ival); }
-#line 2977 "parser.tab.c" /* yacc.c:1646 */
+#line 2961 "parser.tab.c" /* yacc.c:1646 */
break;
case 192:
#line 777 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_prop_and_value_expression(ctx, NULL); }
-#line 2983 "parser.tab.c" /* yacc.c:1646 */
+#line 2967 "parser.tab.c" /* yacc.c:1646 */
break;
case 193:
#line 779 "parser.y" /* yacc.c:1646 */
{ (yyval.expr) = new_prop_and_value_expression(ctx, (yyvsp[-1].property_list)); }
-#line 2989 "parser.tab.c" /* yacc.c:1646 */
+#line 2973 "parser.tab.c" /* yacc.c:1646 */
break;
case 194:
#line 784 "parser.y" /* yacc.c:1646 */
{ (yyval.property_list) = new_property_list(ctx, (yyvsp[-2].literal),
(yyvsp[0].expr)); }
-#line 2995 "parser.tab.c" /* yacc.c:1646 */
+#line 2979 "parser.tab.c" /* yacc.c:1646 */
break;
case 195:
#line 786 "parser.y" /* yacc.c:1646 */
{ (yyval.property_list) = property_list_add(ctx, (yyvsp[-4].property_list),
(yyvsp[-2].literal), (yyvsp[0].expr)); }
-#line 3001 "parser.tab.c" /* yacc.c:1646 */
+#line 2985 "parser.tab.c" /* yacc.c:1646 */
break;
case 196:
#line 790 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = new_string_literal(ctx, (yyvsp[0].identifier)); }
-#line 3007 "parser.tab.c" /* yacc.c:1646 */
+#line 2991 "parser.tab.c" /* yacc.c:1646 */
break;
case 197:
#line 791 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = new_string_literal(ctx, (yyvsp[0].wstr)); }
-#line 3013 "parser.tab.c" /* yacc.c:1646 */
+#line 2997 "parser.tab.c" /* yacc.c:1646 */
break;
case 198:
#line 792 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = (yyvsp[0].literal); }
-#line 3019 "parser.tab.c" /* yacc.c:1646 */
+#line 3003 "parser.tab.c" /* yacc.c:1646 */
break;
case 199:
#line 796 "parser.y" /* yacc.c:1646 */
{ (yyval.identifier) = NULL; }
-#line 3025 "parser.tab.c" /* yacc.c:1646 */
+#line 3009 "parser.tab.c" /* yacc.c:1646 */
break;
case 200:
#line 797 "parser.y" /* yacc.c:1646 */
{ (yyval.identifier) = (yyvsp[0].identifier); }
-#line 3031 "parser.tab.c" /* yacc.c:1646 */
+#line 3015 "parser.tab.c" /* yacc.c:1646 */
break;
case 201:
#line 801 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = new_null_literal(ctx); }
-#line 3037 "parser.tab.c" /* yacc.c:1646 */
+#line 3021 "parser.tab.c" /* yacc.c:1646 */
break;
case 202:
#line 802 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = (yyvsp[0].literal); }
-#line 3043 "parser.tab.c" /* yacc.c:1646 */
+#line 3027 "parser.tab.c" /* yacc.c:1646 */
break;
case 203:
#line 803 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = (yyvsp[0].literal); }
-#line 3049 "parser.tab.c" /* yacc.c:1646 */
+#line 3033 "parser.tab.c" /* yacc.c:1646 */
break;
case 204:
#line 804 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = new_string_literal(ctx, (yyvsp[0].wstr)); }
-#line 3055 "parser.tab.c" /* yacc.c:1646 */
+#line 3039 "parser.tab.c" /* yacc.c:1646 */
break;
case 205:
#line 805 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = parse_regexp(ctx);
if(!(yyval.literal)) YYABORT; }
-#line 3062 "parser.tab.c" /* yacc.c:1646 */
+#line 3046 "parser.tab.c" /* yacc.c:1646 */
break;
case 206:
#line 807 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = parse_regexp(ctx);
if(!(yyval.literal)) YYABORT; }
-#line 3069 "parser.tab.c" /* yacc.c:1646 */
+#line 3053 "parser.tab.c" /* yacc.c:1646 */
break;
case 207:
#line 812 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = new_boolean_literal(ctx, VARIANT_TRUE); }
-#line 3075 "parser.tab.c" /* yacc.c:1646 */
+#line 3059 "parser.tab.c" /* yacc.c:1646 */
break;
case 208:
#line 813 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = new_boolean_literal(ctx, VARIANT_FALSE); }
-#line 3081 "parser.tab.c" /* yacc.c:1646 */
+#line 3065 "parser.tab.c" /* yacc.c:1646 */
break;
case 209:
#line 814 "parser.y" /* yacc.c:1646 */
{ (yyval.literal) = (yyvsp[0].literal); }
-#line 3087 "parser.tab.c" /* yacc.c:1646 */
+#line 3071 "parser.tab.c" /* yacc.c:1646 */
break;
case 211:
#line 818 "parser.y" /* yacc.c:1646 */
{ if(!allow_auto_semicolon(ctx)) {YYABORT;} }
-#line 3093 "parser.tab.c" /* yacc.c:1646 */
+#line 3077 "parser.tab.c" /* yacc.c:1646 */
break;
case 213:
#line 822 "parser.y" /* yacc.c:1646 */
{ set_error(ctx, JS_E_MISSING_LBRACKET); YYABORT; }
-#line 3099 "parser.tab.c" /* yacc.c:1646 */
+#line 3083 "parser.tab.c" /* yacc.c:1646 */
break;
case 215:
#line 826 "parser.y" /* yacc.c:1646 */
{ set_error(ctx, JS_E_MISSING_RBRACKET); YYABORT; }
-#line 3105 "parser.tab.c" /* yacc.c:1646 */
+#line 3089 "parser.tab.c" /* yacc.c:1646 */
break;
case 217:
#line 830 "parser.y" /* yacc.c:1646 */
{ set_error(ctx, JS_E_MISSING_SEMICOLON); YYABORT; }
-#line 3111 "parser.tab.c" /* yacc.c:1646 */
+#line 3095 "parser.tab.c" /* yacc.c:1646 */
break;
-#line 3115 "parser.tab.c" /* yacc.c:1646 */
+#line 3099 "parser.tab.c" /* yacc.c:1646 */
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
diff --git a/dll/win32/jscript/parser.tab.h b/dll/win32/jscript/parser.tab.h
index 0233eaf9e4..096db230a2 100644
--- a/dll/win32/jscript/parser.tab.h
+++ b/dll/win32/jscript/parser.tab.h
@@ -1,4 +1,4 @@
-/* A Bison parser, made by GNU Bison 3.0.2. */
+/* A Bison parser, made by GNU Bison 3.0. */
/* Bison interface for Yacc-like parsers in C
@@ -30,8 +30,8 @@
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
-#ifndef YY_PARSER_PARSER_TAB_H_INCLUDED
-# define YY_PARSER_PARSER_TAB_H_INCLUDED
+#ifndef YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED
+# define YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED
/* Debug traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
@@ -129,4 +129,4 @@ union YYSTYPE
int parser_parse (parser_ctx_t *ctx);
-#endif /* !YY_PARSER_PARSER_TAB_H_INCLUDED */
+#endif /* !YY_PARSER_E_REACTOSSYNC_GCC_DLL_WIN32_JSCRIPT_PARSER_TAB_H_INCLUDED */
diff --git a/dll/win32/jscript/parser.y b/dll/win32/jscript/parser.y
index b97e7fd5e0..59e67575fc 100644
--- a/dll/win32/jscript/parser.y
+++ b/dll/win32/jscript/parser.y
@@ -19,6 +19,12 @@
%{
#include "jscript.h"
+#include "engine.h"
+#include "parser.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
static int parser_error(parser_ctx_t*,const char*);
static void set_error(parser_ctx_t*,UINT);
diff --git a/dll/win32/jscript/precomp.h b/dll/win32/jscript/precomp.h
new file mode 100644
index 0000000000..abd64f187f
--- /dev/null
+++ b/dll/win32/jscript/precomp.h
@@ -0,0 +1,24 @@
+
+#ifndef _JSCRIPT_PRECOMP_H
+#define _JSCRIPT_PRECOMP_H
+
+#include <wine/config.h>
+#include <wine/port.h>
+
+#include <assert.h>
+
+#define WIN32_NO_STATUS
+#define _INC_WINDOWS
+#define COM_NO_WINDOWS_H
+
+#include "jscript.h"
+
+#include <objsafe.h>
+
+#include <wine/debug.h>
+
+#include "engine.h"
+#include "parser.h"
+#include "regexp.h"
+
+#endif /* !_JSCRIPT_PRECOMP_H */
diff --git a/dll/win32/jscript/regexp.c b/dll/win32/jscript/regexp.c
index 6152ea0f65..cca7cc556c 100644
--- a/dll/win32/jscript/regexp.c
+++ b/dll/win32/jscript/regexp.c
@@ -31,7 +31,14 @@
* the Initial Developer. All Rights Reserved.
*/
+#include <assert.h>
+
#include "jscript.h"
+#include "regexp.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
/* FIXME: Better error handling */
#define ReportRegExpError(a,b,c)
diff --git a/dll/win32/jscript/resource.h b/dll/win32/jscript/resource.h
index f5184bd483..bb78ec19f0 100644
--- a/dll/win32/jscript/resource.h
+++ b/dll/win32/jscript/resource.h
@@ -18,6 +18,8 @@
#pragma once
+#include <windef.h>
+
#define JSCRIPT_MAJOR_VERSION 5
#define JSCRIPT_MINOR_VERSION 8
#define JSCRIPT_BUILD_VERSION 16475
diff --git a/dll/win32/jscript/rsrc.rc b/dll/win32/jscript/rsrc.rc
index ea0bdb992f..f843d1e94a 100644
--- a/dll/win32/jscript/rsrc.rc
+++ b/dll/win32/jscript/rsrc.rc
@@ -16,8 +16,6 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
-#include <windef.h>
-
#include "resource.h"
/* @makedep: jscript.rgs */
diff --git a/dll/win32/jscript/string.c b/dll/win32/jscript/string.c
index 5d636e6d4c..ad978f245c 100644
--- a/dll/win32/jscript/string.c
+++ b/dll/win32/jscript/string.c
@@ -16,7 +16,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
+#include "config.h"
+#include "wine/port.h"
+
#include "jscript.h"
+#include "regexp.h"
+
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
typedef struct {
jsdisp_t dispex;
diff --git a/dll/win32/jscript/vbarray.c b/dll/win32/jscript/vbarray.c
index 3f38b582ff..23122282e7 100644
--- a/dll/win32/jscript/vbarray.c
+++ b/dll/win32/jscript/vbarray.c
@@ -18,6 +18,10 @@
#include "jscript.h"
+#include "wine/debug.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(jscript);
+
typedef struct {
jsdisp_t dispex;
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 93a5a04a6b..bd747fa90b 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -85,7 +85,7 @@ reactos/dll/win32/inseng # Synced to WineStaging-3.3
reactos/dll/win32/iphlpapi # Out of sync
reactos/dll/win32/itircl # Synced to WineStaging-3.3
reactos/dll/win32/itss # Synced to WineStaging-3.3
-reactos/dll/win32/jscript # Synced to Wine-3.0
+reactos/dll/win32/jscript # Synced to WineStaging-3.3
reactos/dll/win32/jsproxy # Synced to WineStaging-2.16
reactos/dll/win32/loadperf # Synced to WineStaging-2.9
reactos/dll/win32/lz32 # Synced to WineStaging-2.9