ReactOS.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
List overview
Download
Ros-diffs
June 2018
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
ros-diffs@reactos.org
26 participants
174 discussions
Start a n
N
ew thread
01/01: [PSDK] Update msctf.idl. CORE-14656
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=217390ae60c6c5c5e14a6…
commit 217390ae60c6c5c5e14a6dcd8e629f4b99d861b8 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Jun 4 03:40:17 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Jun 4 03:40:17 2018 +0100 [PSDK] Update msctf.idl. CORE-14656 --- sdk/include/psdk/msctf.idl | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/sdk/include/psdk/msctf.idl b/sdk/include/psdk/msctf.idl index 0b96faa02c..01e944cf5d 100644 --- a/sdk/include/psdk/msctf.idl +++ b/sdk/include/psdk/msctf.idl @@ -1119,6 +1119,23 @@ interface ITfKeyEventSink : IUnknown [out] BOOL *pfEaten); } +[ + object, + local, + uuid(1cd4c13b-1c36-4191-a70a-7f3e611f367d), + pointer_default(unique) +] +interface ITfKeyTraceEventSink : IUnknown +{ + HRESULT OnKeyTraceDown( + [in] WPARAM wParam, + [in] LPARAM lParam); + + HRESULT OnKeyTraceUp( + [in] WPARAM wParam, + [in] LPARAM lParam); +} + [ object, local,
6 years, 6 months
1
0
0
0
01/01: [JSCRIPT_WINETEST] Sync with Wine Staging 3.9. CORE-14656
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6b881f65022e958a8b66d…
commit 6b881f65022e958a8b66d6929df6d8bd963fb768 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Jun 4 03:39:17 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Jun 4 03:39:17 2018 +0100 [JSCRIPT_WINETEST] Sync with Wine Staging 3.9. CORE-14656 --- modules/rostests/winetests/jscript/api.js | 10 ++++++++++ modules/rostests/winetests/jscript/lang.js | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/modules/rostests/winetests/jscript/api.js b/modules/rostests/winetests/jscript/api.js index 4207f5a769..f9178a9713 100644 --- a/modules/rostests/winetests/jscript/api.js +++ b/modules/rostests/winetests/jscript/api.js @@ -408,6 +408,12 @@ ok(str.toString() === "", "str.toString() = " + str.toString()); var str = new String("test", "abc"); ok(str.toString() === "test", "str.toString() = " + str.toString()); +str = new String("test"); +ok(str.length === 4, "str.length = " + str.length); +str.length = 3; +str.length = 5; +ok(str.length === 4, "str.length = " + str.length); + var strObj = new Object(); strObj.toString = function() { return "abcd" }; strObj.substr = String.prototype.substr; @@ -1810,6 +1816,7 @@ ok(isNaN(tmp), "Math.tan(-Infinity) is not NaN"); return; var stringify_tests = [ + [[], undefined], [[true], "true"], [[false], "false"], [[null], "null"], @@ -1836,6 +1843,9 @@ ok(isNaN(tmp), "Math.tan(-Infinity) is not NaN"); "["+i+"] stringify(" + stringify_tests[i][0] + ") returned " + s + " expected " + stringify_tests[i][1]); } + s = JSON.stringify(); + ok(s === undefined, "stringify() returned " + s + " expected undefined"); + s = JSON.stringify(testObj); ok(s === undefined || s === "undefined" /* broken on some old versions */, "stringify(testObj) returned " + s + " expected undfined"); diff --git a/modules/rostests/winetests/jscript/lang.js b/modules/rostests/winetests/jscript/lang.js index ef4c3165b1..e6ff4dd059 100644 --- a/modules/rostests/winetests/jscript/lang.js +++ b/modules/rostests/winetests/jscript/lang.js @@ -48,6 +48,9 @@ tmp = 07777777777777777777777; ok(typeof(tmp) === "number" && tmp > 0xffffffff, "tmp = " + tmp); tmp = 07777777779777777777777; ok(typeof(tmp) === "number" && tmp > 0xffffffff, "tmp = " + tmp); +ok(0xffffffff === 4294967295, "0xffffffff = " + 0xffffffff); +tmp = 0x10000000000000000000000000000000000000000000000000000000000000000; +ok(tmp === Math.pow(2, 256), "0x1000...00 != 2^256"); ok(1 !== 2, "1 !== 2 is false"); ok(null !== undefined, "null !== undefined is false"); @@ -632,6 +635,12 @@ tmp = 10; ok((tmp |= 0x10) === 26, "tmp(10) |= 0x10 !== 26"); ok(getVT(tmp) === "VT_I4", "getVT(tmp |= 10) = " + getVT(tmp)); +tmp = (123 * Math.pow(2,32) + 2) | 0; +ok(tmp === 2, "123*2^32+2 | 0 = " + tmp); + +tmp = (-123 * Math.pow(2,32) + 2) | 0; +ok(tmp === 2, "123*2^32+2 | 0 = " + tmp); + tmp = 3 & 5; ok(tmp === 1, "3 & 5 !== 1"); ok(getVT(tmp) === "VT_I4", "getVT(3|5) = " + getVT(tmp));
6 years, 6 months
1
0
0
0
01/01: [JSCRIPT] Sync with Wine Staging 3.9. CORE-14656
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=3f071cc5272c4d1061912…
commit 3f071cc5272c4d10619122051805b864562647d9 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Jun 4 03:38:45 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Jun 4 03:38:45 2018 +0100 [JSCRIPT] Sync with Wine Staging 3.9. CORE-14656 --- dll/win32/jscript/date.c | 48 + dll/win32/jscript/dispex.c | 310 +++++-- dll/win32/jscript/error.c | 13 +- dll/win32/jscript/function.c | 40 +- dll/win32/jscript/global.c | 65 +- dll/win32/jscript/jscript.h | 35 +- dll/win32/jscript/json.c | 6 + dll/win32/jscript/jsregexp.c | 40 +- dll/win32/jscript/jsutils.c | 9 +- dll/win32/jscript/lex.c | 10 +- dll/win32/jscript/math.c | 3 +- dll/win32/jscript/object.c | 308 ++++++- dll/win32/jscript/parser.tab.c | 1927 +++++++++++++++++++++++----------------- dll/win32/jscript/parser.tab.h | 54 +- dll/win32/jscript/parser.y | 58 +- dll/win32/jscript/resource.h | 6 + dll/win32/jscript/string.c | 47 +- media/doc/README.WINE | 2 +- 18 files changed, 1925 insertions(+), 1056 deletions(-) diff --git a/dll/win32/jscript/date.c b/dll/win32/jscript/date.c index f784d51afb..28ad23d644 100644 --- a/dll/win32/jscript/date.c +++ b/dll/win32/jscript/date.c @@ -49,6 +49,7 @@ typedef struct { 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}; +static const WCHAR toISOStringW[] = {'t','o','I','S','O','S','t','r','i','n','g',0}; static const WCHAR toUTCStringW[] = {'t','o','U','T','C','S','t','r','i','n','g',0}; static const WCHAR toGMTStringW[] = {'t','o','G','M','T','S','t','r','i','n','g',0}; static const WCHAR toDateStringW[] = {'t','o','D','a','t','e','S','t','r','i','n','g',0}; @@ -632,6 +633,52 @@ static HRESULT Date_toLocaleString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flag return S_OK; } +static HRESULT Date_toISOString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, + jsval_t *r) +{ + DateInstance *date; + WCHAR buf[64], *p = buf; + double year; + + static const WCHAR short_year_formatW[] = {'%','0','4','d',0}; + static const WCHAR long_year_formatW[] = {'%','0','6','d',0}; + static const WCHAR formatW[] = {'-','%','0','2','d','-','%','0','2','d', + 'T','%','0','2','d',':','%','0','2','d',':','%','0','2','d','.','%','0','3','d','Z',0}; + + TRACE("\n"); + + if(!(date = date_this(jsthis))) + return throw_type_error(ctx, JS_E_DATE_EXPECTED, NULL); + + year = year_from_time(date->time); + if(isnan(year) || year > 999999 || year < -999999) { + FIXME("year %lf should throw an exception\n", year); + return E_FAIL; + } + + if(year < 0) { + *p++ = '-'; + p += sprintfW(p, long_year_formatW, -(int)year); + }else if(year > 9999) { + *p++ = '+'; + p += sprintfW(p, long_year_formatW, (int)year); + }else { + p += sprintfW(p, short_year_formatW, (int)year); + } + + sprintfW(p, formatW, (int)month_from_time(date->time) + 1, (int)date_from_time(date->time), + (int)hour_from_time(date->time), (int)min_from_time(date->time), + (int)sec_from_time(date->time), (int)ms_from_time(date->time)); + + if(r) { + jsstr_t *ret; + if(!(ret = jsstr_alloc(buf))) + return E_OUTOFMEMORY; + *r = jsval_string(ret); + } + return S_OK; +} + static HRESULT Date_valueOf(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { @@ -1923,6 +1970,7 @@ static const builtin_prop_t Date_props[] = { {setYearW, Date_setYear, PROPF_METHOD|1}, {toDateStringW, Date_toDateString, PROPF_METHOD}, {toGMTStringW, Date_toGMTString, PROPF_METHOD}, + {toISOStringW, Date_toISOString, PROPF_METHOD|PROPF_ES5}, {toLocaleDateStringW, Date_toLocaleDateString, PROPF_METHOD}, {toLocaleStringW, Date_toLocaleString, PROPF_METHOD}, {toLocaleTimeStringW, Date_toLocaleTimeString, PROPF_METHOD}, diff --git a/dll/win32/jscript/dispex.c b/dll/win32/jscript/dispex.c index ffb351e2ac..9b47368cf8 100644 --- a/dll/win32/jscript/dispex.c +++ b/dll/win32/jscript/dispex.c @@ -32,6 +32,7 @@ typedef enum { PROP_JSVAL, PROP_BUILTIN, PROP_PROTREF, + PROP_ACCESSOR, PROP_DELETED, PROP_IDX } prop_type_t; @@ -47,6 +48,10 @@ struct _dispex_prop_t { const builtin_prop_t *p; DWORD ref; unsigned idx; + struct { + jsdisp_t *getter; + jsdisp_t *setter; + } accessor; } u; int bucket_head; @@ -216,7 +221,13 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, builtin = find_builtin_prop(This, name); if(builtin) { - prop = alloc_prop(This, name, PROP_BUILTIN, builtin->flags); + unsigned flags = builtin->flags; + if(flags & PROPF_METHOD) + flags |= PROPF_WRITABLE | PROPF_CONFIGURABLE; + else if(builtin->setter) + flags |= PROPF_WRITABLE; + flags &= PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE; + prop = alloc_prop(This, name, PROP_BUILTIN, flags); if(!prop) return E_OUTOFMEMORY; @@ -232,7 +243,7 @@ static HRESULT find_prop_name(jsdisp_t *This, unsigned hash, const WCHAR *name, for(ptr = name; isdigitW(*ptr) && idx < 0x10000; ptr++) idx = idx*10 + (*ptr-'0'); if(!*ptr && idx < This->builtin_info->idx_length(This)) { - prop = alloc_prop(This, name, PROP_IDX, This->builtin_info->idx_put ? 0 : PROPF_CONST); + prop = alloc_prop(This, name, PROP_IDX, This->builtin_info->idx_put ? PROPF_WRITABLE : 0); if(!prop) return E_OUTOFMEMORY; @@ -268,7 +279,6 @@ static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *n if(prop) { if(del) { del->type = PROP_PROTREF; - del->flags = 0; del->u.ref = prop - This->prototype->props; prop = del; }else { @@ -286,15 +296,12 @@ static HRESULT find_prop_name_prot(jsdisp_t *This, unsigned hash, const WCHAR *n return S_OK; } -static HRESULT ensure_prop_name(jsdisp_t *This, const WCHAR *name, BOOL search_prot, DWORD create_flags, dispex_prop_t **ret) +static HRESULT ensure_prop_name(jsdisp_t *This, const WCHAR *name, DWORD create_flags, dispex_prop_t **ret) { dispex_prop_t *prop; HRESULT hres; - if(search_prot) - hres = find_prop_name_prot(This, string_hash(name), name, &prop); - else - hres = find_prop_name(This, string_hash(name), name, &prop); + hres = find_prop_name_prot(This, string_hash(name), name, &prop); if(SUCCEEDED(hres) && (!prop || prop->type == PROP_DELETED)) { TRACE("creating prop %s flags %x\n", debugstr_w(name), create_flags); @@ -408,6 +415,9 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t return disp_call_value(This->ctx, get_object(prop->u.val), jsthis, flags, argc, argv, r); } + case PROP_ACCESSOR: + FIXME("accessor\n"); + return E_NOTIMPL; case PROP_IDX: FIXME("Invoking PROP_IDX not yet supported\n"); return E_NOTIMPL; @@ -419,11 +429,16 @@ static HRESULT invoke_prop_func(jsdisp_t *This, IDispatch *jsthis, dispex_prop_t return E_FAIL; } -static HRESULT prop_get(jsdisp_t *This, dispex_prop_t *prop, DISPPARAMS *dp, - jsval_t *r, IServiceProvider *caller) +static HRESULT prop_get(jsdisp_t *This, dispex_prop_t *prop, jsval_t *r) { + jsdisp_t *prop_obj = This; HRESULT hres; + while(prop->type == PROP_PROTREF) { + prop_obj = prop_obj->prototype; + prop = prop_obj->props + prop->u.ref; + } + switch(prop->type) { case PROP_BUILTIN: if(prop->u.p->getter) { @@ -444,14 +459,20 @@ static HRESULT prop_get(jsdisp_t *This, dispex_prop_t *prop, DISPPARAMS *dp, *r = jsval_obj(obj); } break; - case PROP_PROTREF: - hres = prop_get(This->prototype, This->prototype->props+prop->u.ref, dp, r, caller); - break; case PROP_JSVAL: hres = jsval_copy(prop->u.val, r); break; + case PROP_ACCESSOR: + if(prop->u.accessor.getter) { + hres = jsdisp_call_value(prop->u.accessor.getter, to_disp(This), + DISPATCH_METHOD, 0, NULL, r); + }else { + *r = jsval_undefined(); + hres = S_OK; + } + break; case PROP_IDX: - hres = This->builtin_info->idx_get(This, prop->u.idx, r); + hres = prop_obj->builtin_info->idx_get(prop_obj, prop->u.idx, r); break; default: ERR("type %d\n", prop->type); @@ -467,32 +488,53 @@ static HRESULT prop_get(jsdisp_t *This, dispex_prop_t *prop, DISPPARAMS *dp, return hres; } -static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val, IServiceProvider *caller) +static HRESULT prop_put(jsdisp_t *This, dispex_prop_t *prop, jsval_t val) { HRESULT hres; - if(prop->flags & PROPF_CONST) - return S_OK; + if(prop->type == PROP_PROTREF) { + dispex_prop_t *prop_iter = prop; + jsdisp_t *prototype_iter = This; + + do { + prototype_iter = prototype_iter->prototype; + prop_iter = prototype_iter->props + prop_iter->u.ref; + } while(prop_iter->type == PROP_PROTREF); + + if(prop_iter->type == PROP_ACCESSOR) + prop = prop_iter; + } switch(prop->type) { case PROP_BUILTIN: - if(prop->u.p->setter) - return prop->u.p->setter(This->ctx, This, val); - - if(prop->u.p->setter) { - FIXME("getter with no setter\n"); - return E_FAIL; + if(!prop->u.p->setter) { + TRACE("getter with no setter\n"); + return S_OK; } - /* fall through */ + return prop->u.p->setter(This->ctx, This, val); case PROP_PROTREF: + case PROP_DELETED: prop->type = PROP_JSVAL; - prop->flags = PROPF_ENUM; + prop->flags = PROPF_ENUMERABLE | PROPF_CONFIGURABLE | PROPF_WRITABLE; prop->u.val = jsval_undefined(); break; case PROP_JSVAL: + if(!(prop->flags & PROPF_WRITABLE)) + return S_OK; + jsval_release(prop->u.val); break; + case PROP_ACCESSOR: + if(!prop->u.accessor.setter) { + TRACE("no setter\n"); + return S_OK; + } + return jsdisp_call_value(prop->u.accessor.setter, to_disp(This), DISPATCH_METHOD, 1, &val, NULL); case PROP_IDX: + if(!This->builtin_info->idx_put) { + TRACE("no put_idx\n"); + return S_OK; + } return This->builtin_info->idx_put(This, prop->u.idx, val); default: ERR("type %d\n", prop->type); @@ -704,7 +746,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc case DISPATCH_PROPERTYGET: { jsval_t r; - hres = prop_get(This, prop, pdp, &r, pspCaller); + hres = prop_get(This, prop, &r); if(SUCCEEDED(hres)) { hres = jsval_to_variant(r, pvarRes); jsval_release(r); @@ -729,7 +771,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc if(FAILED(hres)) return hres; - hres = prop_put(This, prop, val, pspCaller); + hres = prop_put(This, prop, val); jsval_release(val); break; } @@ -745,7 +787,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc static HRESULT delete_prop(dispex_prop_t *prop, BOOL *ret) { - if(prop->flags & PROPF_DONTDELETE) { + if(!(prop->flags & PROPF_CONFIGURABLE)) { *ret = FALSE; return S_OK; } @@ -756,6 +798,8 @@ static HRESULT delete_prop(dispex_prop_t *prop, BOOL *ret) jsval_release(prop->u.val); prop->type = PROP_DELETED; } + if(prop->type == PROP_ACCESSOR) + FIXME("not supported on accessor property\n"); return S_OK; } @@ -846,7 +890,7 @@ static HRESULT WINAPI DispatchEx_GetNextDispID(IDispatchEx *iface, DWORD grfdex, } while(iter < This->props + This->prop_cnt) { - if(iter->name && (get_flags(This, iter) & PROPF_ENUM) && iter->type!=PROP_DELETED) { + if(iter->name && (get_flags(This, iter) & PROPF_ENUMERABLE) && iter->type!=PROP_DELETED) { *pid = prop_to_id(This, iter); return S_OK; } @@ -957,8 +1001,19 @@ void jsdisp_free(jsdisp_t *obj) TRACE("(%p)\n", obj); for(prop = obj->props; prop < obj->props+obj->prop_cnt; prop++) { - if(prop->type == PROP_JSVAL) + switch(prop->type) { + case PROP_JSVAL: jsval_release(prop->u.val); + break; + case PROP_ACCESSOR: + if(prop->u.accessor.getter) + jsdisp_release(prop->u.accessor.getter); + if(prop->u.accessor.setter) + jsdisp_release(prop->u.accessor.setter); + break; + default: + break; + }; heap_free(prop->name); } heap_free(obj->props); @@ -1005,7 +1060,7 @@ HRESULT init_dispex_from_constr(jsdisp_t *dispex, script_ctx_t *ctx, const built if(SUCCEEDED(hres) && prop && prop->type!=PROP_DELETED) { jsval_t val; - hres = prop_get(constr, prop, NULL, &val, NULL); + hres = prop_get(constr, prop, &val); if(FAILED(hres)) { ERR("Could not get prototype\n"); return hres; @@ -1036,7 +1091,8 @@ HRESULT jsdisp_get_id(jsdisp_t *jsdisp, const WCHAR *name, DWORD flags, DISPID * HRESULT hres; if(flags & fdexNameEnsure) - hres = ensure_prop_name(jsdisp, name, TRUE, PROPF_ENUM, &prop); + hres = ensure_prop_name(jsdisp, name, PROPF_ENUMERABLE | PROPF_CONFIGURABLE | PROPF_WRITABLE, + &prop); else hres = find_prop_name_prot(jsdisp, string_hash(name), name, &prop); if(FAILED(hres)) @@ -1299,33 +1355,16 @@ HRESULT jsdisp_propput(jsdisp_t *obj, const WCHAR *name, DWORD flags, jsval_t va dispex_prop_t *prop; HRESULT hres; - hres = ensure_prop_name(obj, name, FALSE, flags, &prop); + hres = ensure_prop_name(obj, name, flags, &prop); if(FAILED(hres)) return hres; - return prop_put(obj, prop, val, NULL); + return prop_put(obj, prop, val); } HRESULT jsdisp_propput_name(jsdisp_t *obj, const WCHAR *name, jsval_t val) { - return jsdisp_propput(obj, name, PROPF_ENUM, val); -} - -HRESULT jsdisp_propput_const(jsdisp_t *obj, const WCHAR *name, jsval_t val) -{ - dispex_prop_t *prop; - HRESULT hres; - - hres = ensure_prop_name(obj, name, FALSE, PROPF_CONST, &prop); - if(FAILED(hres)) - return hres; - - return jsval_copy(val, &prop->u.val); -} - -HRESULT jsdisp_propput_dontenum(jsdisp_t *obj, const WCHAR *name, jsval_t val) -{ - return jsdisp_propput(obj, name, 0, val); + return jsdisp_propput(obj, name, PROPF_ENUMERABLE | PROPF_CONFIGURABLE | PROPF_WRITABLE, val); } HRESULT jsdisp_propput_idx(jsdisp_t *obj, DWORD idx, jsval_t val) @@ -1349,7 +1388,7 @@ HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t val) prop = get_prop(jsdisp, id); if(prop) - hres = prop_put(jsdisp, prop, val, NULL); + hres = prop_put(jsdisp, prop, val); else hres = DISP_E_MEMBERNOTFOUND; @@ -1389,7 +1428,6 @@ HRESULT disp_propput(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t val) HRESULT jsdisp_propget_name(jsdisp_t *obj, const WCHAR *name, jsval_t *val) { - DISPPARAMS dp = {NULL, NULL, 0, 0}; dispex_prop_t *prop; HRESULT hres; @@ -1402,13 +1440,12 @@ HRESULT jsdisp_propget_name(jsdisp_t *obj, const WCHAR *name, jsval_t *val) return S_OK; } - return prop_get(obj, prop, &dp, val, NULL); + return prop_get(obj, prop, val); } HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r) { WCHAR name[12]; - DISPPARAMS dp = {NULL, NULL, 0, 0}; dispex_prop_t *prop; HRESULT hres; @@ -1425,19 +1462,18 @@ HRESULT jsdisp_get_idx(jsdisp_t *obj, DWORD idx, jsval_t *r) return DISP_E_UNKNOWNNAME; } - return prop_get(obj, prop, &dp, r, NULL); + return prop_get(obj, prop, r); } HRESULT jsdisp_propget(jsdisp_t *jsdisp, DISPID id, jsval_t *val) { - DISPPARAMS dp = {NULL,NULL,0,0}; dispex_prop_t *prop; prop = get_prop(jsdisp, id); if(!prop) return DISP_E_MEMBERNOTFOUND; - return prop_get(jsdisp, prop, &dp, val, NULL); + return prop_get(jsdisp, prop, val); } HRESULT disp_propget(script_ctx_t *ctx, IDispatch *disp, DISPID id, jsval_t *val) @@ -1587,7 +1623,8 @@ HRESULT disp_delete_name(script_ctx_t *ctx, IDispatch *disp, jsstr_t *name, BOOL return hres; } -HRESULT jsdisp_is_own_prop(jsdisp_t *obj, const WCHAR *name, BOOL *ret) +HRESULT jsdisp_get_own_property(jsdisp_t *obj, const WCHAR *name, BOOL flags_only, + property_desc_t *desc) { dispex_prop_t *prop; HRESULT hres; @@ -1596,11 +1633,41 @@ HRESULT jsdisp_is_own_prop(jsdisp_t *obj, const WCHAR *name, BOOL *ret) if(FAILED(hres)) return hres; - *ret = prop && (prop->type == PROP_JSVAL || prop->type == PROP_BUILTIN); + if(!prop) + return DISP_E_UNKNOWNNAME; + + memset(desc, 0, sizeof(*desc)); + + switch(prop->type) { + case PROP_BUILTIN: + case PROP_JSVAL: + desc->mask |= PROPF_WRITABLE; + desc->explicit_value = TRUE; + if(!flags_only) { + hres = prop_get(obj, prop, &desc->value); + if(FAILED(hres)) + return hres; + } + break; + case PROP_ACCESSOR: + desc->explicit_getter = desc->explicit_setter = TRUE; + if(!flags_only) { + desc->getter = prop->u.accessor.getter + ? jsdisp_addref(prop->u.accessor.getter) : NULL; + desc->setter = prop->u.accessor.setter + ? jsdisp_addref(prop->u.accessor.setter) : NULL; + } + break; + default: + return DISP_E_UNKNOWNNAME; + } + + desc->flags = prop->flags & (PROPF_ENUMERABLE | PROPF_WRITABLE | PROPF_CONFIGURABLE); + desc->mask |= PROPF_ENUMERABLE | PROPF_CONFIGURABLE; return S_OK; } -HRESULT jsdisp_is_enumerable(jsdisp_t *obj, const WCHAR *name, BOOL *ret) +HRESULT jsdisp_define_property(jsdisp_t *obj, const WCHAR *name, property_desc_t *desc) { dispex_prop_t *prop; HRESULT hres; @@ -1609,6 +1676,123 @@ HRESULT jsdisp_is_enumerable(jsdisp_t *obj, const WCHAR *name, BOOL *ret) if(FAILED(hres)) return hres; - *ret = prop && (prop->flags & PROPF_ENUM) && prop->type != PROP_PROTREF; + if(!prop && !(prop = alloc_prop(obj, name, PROP_DELETED, 0))) + return E_OUTOFMEMORY; + + if(prop->type == PROP_DELETED || prop->type == PROP_PROTREF) { + prop->flags = desc->flags; + if(desc->explicit_getter || desc->explicit_setter) { + prop->type = PROP_ACCESSOR; + prop->u.accessor.getter = desc->getter ? jsdisp_addref(desc->getter) : NULL; + prop->u.accessor.setter = desc->setter ? jsdisp_addref(desc->setter) : NULL; + TRACE("%s = accessor { get: %p set: %p }\n", debugstr_w(name), + prop->u.accessor.getter, prop->u.accessor.setter); + }else { + prop->type = PROP_JSVAL; + if(desc->explicit_value) { + hres = jsval_copy(desc->value, &prop->u.val); + if(FAILED(hres)) + return hres; + }else { + prop->u.val = jsval_undefined(); + } + TRACE("%s = %s\n", debugstr_w(name), debugstr_jsval(prop->u.val)); + } + return S_OK; + } + + TRACE("existing prop %s prop flags %x desc flags %x desc mask %x\n", debugstr_w(name), + prop->flags, desc->flags, desc->mask); + + if(!(prop->flags & PROPF_CONFIGURABLE)) { + if(((desc->mask & PROPF_CONFIGURABLE) && (desc->flags & PROPF_CONFIGURABLE)) + || ((desc->mask & PROPF_ENUMERABLE) + && ((desc->flags & PROPF_ENUMERABLE) != (prop->flags & PROPF_ENUMERABLE)))) + return throw_type_error(obj->ctx, JS_E_NONCONFIGURABLE_REDEFINED, name); + } + + if(desc->explicit_value || (desc->mask & PROPF_WRITABLE)) { + if(prop->type == PROP_ACCESSOR) { + if(!(prop->flags & PROPF_CONFIGURABLE)) + return throw_type_error(obj->ctx, JS_E_NONCONFIGURABLE_REDEFINED, name); + if(prop->u.accessor.getter) + jsdisp_release(prop->u.accessor.getter); + if(prop->u.accessor.setter) + jsdisp_release(prop->u.accessor.setter); + + prop->type = PROP_JSVAL; + hres = jsval_copy(desc->value, &prop->u.val); + if(FAILED(hres)) { + prop->u.val = jsval_undefined(); + return hres; + } + }else { + if(!(prop->flags & PROPF_CONFIGURABLE) && !(prop->flags & PROPF_WRITABLE)) { + if((desc->mask & PROPF_WRITABLE) && (desc->flags & PROPF_WRITABLE)) + return throw_type_error(obj->ctx, JS_E_NONWRITABLE_MODIFIED, name); + if(desc->explicit_value) { + if(prop->type == PROP_JSVAL) { + BOOL eq; + hres = jsval_strict_equal(desc->value, prop->u.val, &eq); + if(FAILED(hres)) + return hres; + if(!eq) + return throw_type_error(obj->ctx, JS_E_NONWRITABLE_MODIFIED, name); + }else { + FIXME("redefinition of property type %d\n", prop->type); + } + } + } + if(desc->explicit_value) { + if(prop->type == PROP_JSVAL) + jsval_release(prop->u.val); + else + prop->type = PROP_JSVAL; + hres = jsval_copy(desc->value, &prop->u.val); + if(FAILED(hres)) { + prop->u.val = jsval_undefined(); + return hres; + } + } + } + }else if(desc->explicit_getter || desc->explicit_setter) { + if(prop->type != PROP_ACCESSOR) { + if(!(prop->flags & PROPF_CONFIGURABLE)) + return throw_type_error(obj->ctx, JS_E_NONCONFIGURABLE_REDEFINED, name); + if(prop->type == PROP_JSVAL) + jsval_release(prop->u.val); + prop->type = PROP_ACCESSOR; + prop->u.accessor.getter = prop->u.accessor.setter = NULL; + }else if(!(prop->flags & PROPF_CONFIGURABLE)) { + if((desc->explicit_getter && desc->getter != prop->u.accessor.getter) + || (desc->explicit_setter && desc->setter != prop->u.accessor.setter)) + return throw_type_error(obj->ctx, JS_E_NONCONFIGURABLE_REDEFINED, name); + } + + if(desc->explicit_getter) { + if(prop->u.accessor.getter) { + jsdisp_release(prop->u.accessor.getter); + prop->u.accessor.getter = NULL; + } + if(desc->getter) + prop->u.accessor.getter = jsdisp_addref(desc->getter); + } + if(desc->explicit_setter) { + if(prop->u.accessor.setter) { + jsdisp_release(prop->u.accessor.setter); + prop->u.accessor.setter = NULL; + } + if(desc->setter) + prop->u.accessor.setter = jsdisp_addref(desc->setter); + } + } + + prop->flags = (prop->flags & ~desc->mask) | (desc->flags & desc->mask); return S_OK; } + +HRESULT jsdisp_define_data_property(jsdisp_t *obj, const WCHAR *name, unsigned flags, jsval_t value) +{ + property_desc_t prop_desc = { flags, flags, TRUE, value }; + return jsdisp_define_property(obj, name, &prop_desc); +} diff --git a/dll/win32/jscript/error.c b/dll/win32/jscript/error.c index b855b8798b..8cf52f00eb 100644 --- a/dll/win32/jscript/error.c +++ b/dll/win32/jscript/error.c @@ -193,15 +193,19 @@ static HRESULT create_error(script_ctx_t *ctx, jsdisp_t *constr, if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(err, numberW, jsval_number((INT)number)); + hres = jsdisp_define_data_property(err, numberW, PROPF_WRITABLE | PROPF_CONFIGURABLE, + jsval_number((INT)number)); if(FAILED(hres)) { jsdisp_release(err); return hres; } - hres = jsdisp_propput_name(err, messageW, jsval_string(msg)); + hres = jsdisp_define_data_property(err, messageW, + PROPF_WRITABLE | PROPF_ENUMERABLE | PROPF_CONFIGURABLE, + jsval_string(msg)); if(SUCCEEDED(hres)) - hres = jsdisp_propput_dontenum(err, descriptionW, jsval_string(msg)); + hres = jsdisp_define_data_property(err, descriptionW, PROPF_WRITABLE | PROPF_CONFIGURABLE, + jsval_string(msg)); if(FAILED(hres)) { jsdisp_release(err); return hres; @@ -355,7 +359,8 @@ HRESULT init_error_constr(script_ctx_t *ctx, jsdisp_t *object_prototype) return E_OUTOFMEMORY; } - hres = jsdisp_propput_dontenum(err, nameW, jsval_string(str)); + hres = jsdisp_define_data_property(err, nameW, PROPF_WRITABLE | PROPF_CONFIGURABLE, + jsval_string(str)); jsstr_release(str); if(SUCCEEDED(hres)) hres = create_builtin_constructor(ctx, constr_val[i], names[i], NULL, diff --git a/dll/win32/jscript/function.c b/dll/win32/jscript/function.c index 8480a3bf1a..0aae300d01 100644 --- a/dll/win32/jscript/function.c +++ b/dll/win32/jscript/function.c @@ -180,11 +180,13 @@ HRESULT setup_arguments_object(script_ctx_t *ctx, call_frame_t *frame) args->argc = frame->argc; args->frame = frame; - hres = jsdisp_propput_dontenum(&args->jsdisp, lengthW, jsval_number(args->argc)); + hres = jsdisp_define_data_property(&args->jsdisp, lengthW, PROPF_WRITABLE | PROPF_CONFIGURABLE, + jsval_number(args->argc)); if(SUCCEEDED(hres)) - hres = jsdisp_propput_dontenum(&args->jsdisp, caleeW, jsval_disp(to_disp(&args->function->dispex))); + hres = jsdisp_define_data_property(&args->jsdisp, caleeW, PROPF_WRITABLE | PROPF_CONFIGURABLE, + jsval_obj(&args->function->dispex)); if(SUCCEEDED(hres)) - hres = jsdisp_propput(frame->base_scope->jsobj, argumentsW, PROPF_DONTDELETE, jsval_obj(&args->jsdisp)); + hres = jsdisp_propput(frame->base_scope->jsobj, argumentsW, PROPF_WRITABLE, jsval_obj(&args->jsdisp)); if(FAILED(hres)) { jsdisp_release(&args->jsdisp); return hres; @@ -358,12 +360,6 @@ static HRESULT Function_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t return S_OK; } -static HRESULT Function_set_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT Function_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { @@ -588,9 +584,9 @@ static void Function_destructor(jsdisp_t *dispex) static const builtin_prop_t Function_props[] = { {applyW, Function_apply, PROPF_METHOD|2}, - {argumentsW, NULL, 0, Function_get_arguments, builtin_set_const}, + {argumentsW, NULL, 0, Function_get_arguments}, {callW, Function_call, PROPF_METHOD|1}, - {lengthW, NULL, 0, Function_get_length, Function_set_length}, + {lengthW, NULL, 0, Function_get_length}, {toStringW, Function_toString, PROPF_METHOD} }; @@ -604,8 +600,8 @@ static const builtin_info_t Function_info = { }; static const builtin_prop_t FunctionInst_props[] = { - {argumentsW, NULL, 0, Function_get_arguments, builtin_set_const}, - {lengthW, NULL, 0, Function_get_length, Function_set_length} + {argumentsW, NULL, 0, Function_get_arguments}, + {lengthW, NULL, 0, Function_get_length} }; static const builtin_info_t FunctionInst_info = { @@ -645,11 +641,6 @@ static HRESULT create_function(script_ctx_t *ctx, const builtin_info_t *builtin_ return S_OK; } -static inline HRESULT set_prototype(script_ctx_t *ctx, jsdisp_t *dispex, jsdisp_t *prototype) -{ - return jsdisp_propput_dontenum(dispex, prototypeW, jsval_obj(prototype)); -} - HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, const WCHAR *name, const builtin_info_t *builtin_info, DWORD flags, jsdisp_t *prototype, jsdisp_t **ret) { @@ -661,9 +652,10 @@ HRESULT create_builtin_function(script_ctx_t *ctx, builtin_invoke_t value_proc, return hres; if(builtin_info) - hres = jsdisp_propput_const(&function->dispex, lengthW, jsval_number(function->length)); + hres = jsdisp_define_data_property(&function->dispex, lengthW, 0, + jsval_number(function->length)); if(SUCCEEDED(hres)) - hres = set_prototype(ctx, &function->dispex, prototype); + hres = jsdisp_define_data_property(&function->dispex, prototypeW, 0, jsval_obj(prototype)); if(FAILED(hres)) { jsdisp_release(&function->dispex); return hres; @@ -680,7 +672,8 @@ static HRESULT set_constructor_prop(script_ctx_t *ctx, jsdisp_t *constr, jsdisp_ { static const WCHAR constructorW[] = {'c','o','n','s','t','r','u','c','t','o','r',0}; - return jsdisp_propput_dontenum(prot, constructorW, jsval_obj(constr)); + return jsdisp_define_data_property(prot, constructorW, PROPF_WRITABLE | PROPF_CONFIGURABLE, + jsval_obj(constr)); } HRESULT create_builtin_constructor(script_ctx_t *ctx, builtin_invoke_t value_proc, const WCHAR *name, @@ -716,7 +709,8 @@ HRESULT create_source_function(script_ctx_t *ctx, bytecode_t *code, function_cod hres = create_function(ctx, NULL, PROPF_CONSTR, FALSE, NULL, &function); if(SUCCEEDED(hres)) { - hres = set_prototype(ctx, &function->dispex, prototype); + hres = jsdisp_define_data_property(&function->dispex, prototypeW, PROPF_WRITABLE, + jsval_obj(prototype)); if(SUCCEEDED(hres)) hres = set_constructor_prop(ctx, &function->dispex, prototype); if(FAILED(hres)) @@ -874,7 +868,7 @@ HRESULT init_function_constr(script_ctx_t *ctx, jsdisp_t *object_prototype) if(SUCCEEDED(hres)) { constr->value_proc = FunctionConstr_value; constr->name = FunctionW; - hres = set_prototype(ctx, &constr->dispex, &prot->dispex); + hres = jsdisp_define_data_property(&constr->dispex, prototypeW, 0, jsval_obj(&prot->dispex)); if(SUCCEEDED(hres)) hres = set_constructor_prop(ctx, &constr->dispex, &prot->dispex); if(FAILED(hres)) diff --git a/dll/win32/jscript/global.c b/dll/win32/jscript/global.c index 6cd5ee9f6a..cc2c3c1ef4 100644 --- a/dll/win32/jscript/global.c +++ b/dll/win32/jscript/global.c @@ -978,7 +978,8 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, FunctionW, jsval_obj(ctx->function_constr)); + hres = jsdisp_define_data_property(ctx->global, FunctionW, PROPF_WRITABLE, + jsval_obj(ctx->function_constr)); if(FAILED(hres)) return hres; @@ -986,7 +987,8 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, ObjectW, jsval_obj(ctx->object_constr)); + hres = jsdisp_define_data_property(ctx->global, ObjectW, PROPF_WRITABLE, + jsval_obj(ctx->object_constr)); if(FAILED(hres)) return hres; @@ -994,7 +996,8 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, ArrayW, jsval_obj(ctx->array_constr)); + hres = jsdisp_define_data_property(ctx->global, ArrayW, PROPF_WRITABLE, + jsval_obj(ctx->array_constr)); if(FAILED(hres)) return hres; @@ -1002,7 +1005,8 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, BooleanW, jsval_obj(ctx->bool_constr)); + hres = jsdisp_define_data_property(ctx->global, BooleanW, PROPF_WRITABLE, + jsval_obj(ctx->bool_constr)); if(FAILED(hres)) return hres; @@ -1010,7 +1014,8 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, DateW, jsval_obj(ctx->date_constr)); + hres = jsdisp_define_data_property(ctx->global, DateW, PROPF_WRITABLE, + jsval_obj(ctx->date_constr)); if(FAILED(hres)) return hres; @@ -1018,35 +1023,43 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, ErrorW, jsval_obj(ctx->error_constr)); + hres = jsdisp_define_data_property(ctx->global, ErrorW, PROPF_WRITABLE, + jsval_obj(ctx->error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, EvalErrorW, jsval_obj(ctx->eval_error_constr)); + hres = jsdisp_define_data_property(ctx->global, EvalErrorW, PROPF_WRITABLE, + jsval_obj(ctx->eval_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, RangeErrorW, jsval_obj(ctx->range_error_constr)); + hres = jsdisp_define_data_property(ctx->global, RangeErrorW, PROPF_WRITABLE, + jsval_obj(ctx->range_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, ReferenceErrorW, jsval_obj(ctx->reference_error_constr)); + hres = jsdisp_define_data_property(ctx->global, ReferenceErrorW, PROPF_WRITABLE, + jsval_obj(ctx->reference_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, RegExpErrorW, jsval_obj(ctx->regexp_error_constr)); + hres = jsdisp_define_data_property(ctx->global, RegExpErrorW, PROPF_WRITABLE, + jsval_obj(ctx->regexp_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, SyntaxErrorW, jsval_obj(ctx->syntax_error_constr)); + hres = jsdisp_define_data_property(ctx->global, SyntaxErrorW, PROPF_WRITABLE, + jsval_obj(ctx->syntax_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, TypeErrorW, jsval_obj(ctx->type_error_constr)); + hres = jsdisp_define_data_property(ctx->global, TypeErrorW, PROPF_WRITABLE, + jsval_obj(ctx->type_error_constr)); if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, URIErrorW, jsval_obj(ctx->uri_error_constr)); + hres = jsdisp_define_data_property(ctx->global, URIErrorW, PROPF_WRITABLE, + jsval_obj(ctx->uri_error_constr)); if(FAILED(hres)) return hres; @@ -1054,7 +1067,8 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, NumberW, jsval_obj(ctx->number_constr)); + hres = jsdisp_define_data_property(ctx->global, NumberW, PROPF_WRITABLE, + jsval_obj(ctx->number_constr)); if(FAILED(hres)) return hres; @@ -1062,7 +1076,8 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, RegExpW, jsval_obj(ctx->regexp_constr)); + hres = jsdisp_define_data_property(ctx->global, RegExpW, PROPF_WRITABLE, + jsval_obj(ctx->regexp_constr)); if(FAILED(hres)) return hres; @@ -1070,7 +1085,8 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, StringW, jsval_obj(ctx->string_constr)); + hres = jsdisp_define_data_property(ctx->global, StringW, PROPF_WRITABLE, + jsval_obj(ctx->string_constr)); if(FAILED(hres)) return hres; @@ -1078,7 +1094,8 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, VBArrayW, jsval_obj(ctx->vbarray_constr)); + hres = jsdisp_define_data_property(ctx->global, VBArrayW, PROPF_WRITABLE, + jsval_obj(ctx->vbarray_constr)); if(FAILED(hres)) return hres; @@ -1087,6 +1104,7 @@ static HRESULT init_constructors(script_ctx_t *ctx, jsdisp_t *object_prototype) HRESULT init_global(script_ctx_t *ctx) { + unsigned const_flags = ctx->version >= SCRIPTLANGUAGEVERSION_ES5 ? 0 : PROPF_WRITABLE; jsdisp_t *math, *object_prototype, *constr; HRESULT hres; @@ -1110,7 +1128,7 @@ HRESULT init_global(script_ctx_t *ctx) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, MathW, jsval_obj(math)); + hres = jsdisp_define_data_property(ctx->global, MathW, PROPF_WRITABLE, jsval_obj(math)); jsdisp_release(math); if(FAILED(hres)) return hres; @@ -1122,7 +1140,7 @@ HRESULT init_global(script_ctx_t *ctx) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, JSONW, jsval_obj(json)); + hres = jsdisp_define_data_property(ctx->global, JSONW, PROPF_WRITABLE, jsval_obj(json)); jsdisp_release(json); if(FAILED(hres)) return hres; @@ -1132,19 +1150,20 @@ HRESULT init_global(script_ctx_t *ctx) if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, ActiveXObjectW, jsval_obj(constr)); + hres = jsdisp_define_data_property(ctx->global, ActiveXObjectW, PROPF_WRITABLE, + jsval_obj(constr)); jsdisp_release(constr); if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, undefinedW, jsval_undefined()); + hres = jsdisp_define_data_property(ctx->global, undefinedW, const_flags, jsval_undefined()); if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, NaNW, jsval_number(NAN)); + hres = jsdisp_define_data_property(ctx->global, NaNW, const_flags, jsval_number(NAN)); if(FAILED(hres)) return hres; - hres = jsdisp_propput_dontenum(ctx->global, InfinityW, jsval_number(INFINITY)); + hres = jsdisp_define_data_property(ctx->global, InfinityW, const_flags, jsval_number(INFINITY)); return hres; } diff --git a/dll/win32/jscript/jscript.h b/dll/win32/jscript/jscript.h index 6f06062a8b..7b5cf90e0e 100644 --- a/dll/win32/jscript/jscript.h +++ b/dll/win32/jscript/jscript.h @@ -52,6 +52,7 @@ typedef struct _jsval_t jsval_t; typedef struct _jsstr_t jsstr_t; typedef struct _script_ctx_t script_ctx_t; typedef struct _dispex_prop_t dispex_prop_t; +typedef struct _property_desc_t property_desc_t; typedef struct { void **blocks; @@ -89,12 +90,12 @@ typedef struct jsdisp_t jsdisp_t; extern HINSTANCE jscript_hinstance DECLSPEC_HIDDEN; -#define PROPF_ARGMASK 0x00ff -#define PROPF_METHOD 0x0100 -#define PROPF_ENUM 0x0200 -#define PROPF_CONSTR 0x0400 -#define PROPF_CONST 0x0800 -#define PROPF_DONTDELETE 0x1000 +#define PROPF_ARGMASK 0x00ff +#define PROPF_METHOD 0x0100 +#define PROPF_ENUMERABLE 0x0200 +#define PROPF_CONSTR 0x0400 +#define PROPF_WRITABLE 0x0800 +#define PROPF_CONFIGURABLE 0x1000 #define PROPF_VERSION_MASK 0x01ff0000 #define PROPF_VERSION_SHIFT 16 @@ -285,8 +286,6 @@ HRESULT disp_propput(script_ctx_t*,IDispatch*,DISPID,jsval_t) DECLSPEC_HIDDEN; HRESULT jsdisp_propget(jsdisp_t*,DISPID,jsval_t*) DECLSPEC_HIDDEN; HRESULT jsdisp_propput(jsdisp_t*,const WCHAR*,DWORD,jsval_t) DECLSPEC_HIDDEN; HRESULT jsdisp_propput_name(jsdisp_t*,const WCHAR*,jsval_t) DECLSPEC_HIDDEN; -HRESULT jsdisp_propput_const(jsdisp_t*,const WCHAR*,jsval_t) DECLSPEC_HIDDEN; -HRESULT jsdisp_propput_dontenum(jsdisp_t*,const WCHAR*,jsval_t) DECLSPEC_HIDDEN; HRESULT jsdisp_propput_idx(jsdisp_t*,DWORD,jsval_t) DECLSPEC_HIDDEN; HRESULT jsdisp_propget_name(jsdisp_t*,LPCWSTR,jsval_t*) DECLSPEC_HIDDEN; HRESULT jsdisp_get_idx(jsdisp_t*,DWORD,jsval_t*) DECLSPEC_HIDDEN; @@ -294,8 +293,9 @@ HRESULT jsdisp_get_id(jsdisp_t*,const WCHAR*,DWORD,DISPID*) DECLSPEC_HIDDEN; HRESULT disp_delete(IDispatch*,DISPID,BOOL*) DECLSPEC_HIDDEN; HRESULT disp_delete_name(script_ctx_t*,IDispatch*,jsstr_t*,BOOL*) DECLSPEC_HIDDEN; HRESULT jsdisp_delete_idx(jsdisp_t*,DWORD) DECLSPEC_HIDDEN; -HRESULT jsdisp_is_own_prop(jsdisp_t*,const WCHAR*,BOOL*) DECLSPEC_HIDDEN; -HRESULT jsdisp_is_enumerable(jsdisp_t*,const WCHAR*,BOOL*) DECLSPEC_HIDDEN; +HRESULT jsdisp_get_own_property(jsdisp_t*,const WCHAR*,BOOL,property_desc_t*) DECLSPEC_HIDDEN; +HRESULT jsdisp_define_property(jsdisp_t*,const WCHAR*,property_desc_t*) DECLSPEC_HIDDEN; +HRESULT jsdisp_define_data_property(jsdisp_t*,const WCHAR*,unsigned,jsval_t) DECLSPEC_HIDDEN; HRESULT create_builtin_function(script_ctx_t*,builtin_invoke_t,const WCHAR*,const builtin_info_t*,DWORD, jsdisp_t*,jsdisp_t**) DECLSPEC_HIDDEN; @@ -378,6 +378,17 @@ typedef struct { #include "jsval.h" +struct _property_desc_t { + unsigned flags; + unsigned mask; + BOOL explicit_value; + jsval_t value; + BOOL explicit_getter; + jsdisp_t *getter; + BOOL explicit_setter; + jsdisp_t *setter; +}; + typedef struct { EXCEPINFO ei; jsval_t val; @@ -553,6 +564,10 @@ static inline DWORD make_grfdex(script_ctx_t *ctx, DWORD flags) #define JS_E_PRECISION_OUT_OF_RANGE MAKE_JSERROR(IDS_PRECISION_OUT_OF_RANGE) #define JS_E_INVALID_LENGTH MAKE_JSERROR(IDS_INVALID_LENGTH) #define JS_E_ARRAY_EXPECTED MAKE_JSERROR(IDS_ARRAY_EXPECTED) +#define JS_E_NONCONFIGURABLE_REDEFINED MAKE_JSERROR(IDS_NONCONFIGURABLE_REDEFINED) +#define JS_E_NONWRITABLE_MODIFIED MAKE_JSERROR(IDS_NONWRITABLE_MODIFIED) +#define JS_E_PROP_DESC_MISMATCH MAKE_JSERROR(IDS_PROP_DESC_MISMATCH) +#define JS_E_INVALID_WRITABLE_PROP_DESC MAKE_JSERROR(IDS_INVALID_WRITABLE_PROP_DESC) static inline BOOL is_jscript_error(HRESULT hres) { diff --git a/dll/win32/jscript/json.c b/dll/win32/jscript/json.c index fc23b54c0d..0430d415ba 100644 --- a/dll/win32/jscript/json.c +++ b/dll/win32/jscript/json.c @@ -768,6 +768,12 @@ static HRESULT JSON_stringify(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, un TRACE("\n"); + if(!argc) { + if(r) + *r = jsval_undefined(); + return S_OK; + } + if(argc >= 2 && is_object_instance(argv[1])) { FIXME("Replacer %s not yet supported\n", debugstr_jsval(argv[1])); return E_NOTIMPL; diff --git a/dll/win32/jscript/jsregexp.c b/dll/win32/jscript/jsregexp.c index 5798635cb8..821c0164eb 100644 --- a/dll/win32/jscript/jsregexp.c +++ b/dll/win32/jscript/jsregexp.c @@ -256,12 +256,6 @@ static HRESULT RegExp_get_source(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r return S_OK; } -static HRESULT RegExp_set_source(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT RegExp_get_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { TRACE("\n"); @@ -270,12 +264,6 @@ static HRESULT RegExp_get_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r return S_OK; } -static HRESULT RegExp_set_global(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT RegExp_get_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { TRACE("\n"); @@ -284,12 +272,6 @@ static HRESULT RegExp_get_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_ return S_OK; } -static HRESULT RegExp_set_ignoreCase(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static HRESULT RegExp_get_multiline(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r) { TRACE("\n"); @@ -298,12 +280,6 @@ static HRESULT RegExp_get_multiline(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t return S_OK; } -static HRESULT RegExp_set_multiline(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("\n"); - return E_NOTIMPL; -} - static INT index_from_val(script_ctx_t *ctx, jsval_t v) { double n; @@ -607,11 +583,11 @@ static void RegExp_destructor(jsdisp_t *dispex) static const builtin_prop_t RegExp_props[] = { {execW, RegExp_exec, PROPF_METHOD|1}, - {globalW, NULL,0, RegExp_get_global, RegExp_set_global}, - {ignoreCaseW, NULL,0, RegExp_get_ignoreCase, RegExp_set_ignoreCase}, + {globalW, NULL,0, RegExp_get_global}, + {ignoreCaseW, NULL,0, RegExp_get_ignoreCase}, {lastIndexW, NULL,0, RegExp_get_lastIndex, RegExp_set_lastIndex}, - {multilineW, NULL,0, RegExp_get_multiline, RegExp_set_multiline}, - {sourceW, NULL,0, RegExp_get_source, RegExp_set_source}, + {multilineW, NULL,0, RegExp_get_multiline}, + {sourceW, NULL,0, RegExp_get_source}, {testW, RegExp_test, PROPF_METHOD|1}, {toStringW, RegExp_toString, PROPF_METHOD} }; @@ -626,11 +602,11 @@ static const builtin_info_t RegExp_info = { }; static const builtin_prop_t RegExpInst_props[] = { - {globalW, NULL,0, RegExp_get_global, RegExp_set_global}, - {ignoreCaseW, NULL,0, RegExp_get_ignoreCase, RegExp_set_ignoreCase}, + {globalW, NULL,0, RegExp_get_global}, + {ignoreCaseW, NULL,0, RegExp_get_ignoreCase}, {lastIndexW, NULL,0, RegExp_get_lastIndex, RegExp_set_lastIndex}, - {multilineW, NULL,0, RegExp_get_multiline, RegExp_set_multiline}, - {sourceW, NULL,0, RegExp_get_source, RegExp_set_source} + {multilineW, NULL,0, RegExp_get_multiline}, + {sourceW, NULL,0, RegExp_get_source} }; static const builtin_info_t RegExpInst_info = { diff --git a/dll/win32/jscript/jsutils.c b/dll/win32/jscript/jsutils.c index 4556ec45a3..90206113a2 100644 --- a/dll/win32/jscript/jsutils.c +++ b/dll/win32/jscript/jsutils.c @@ -659,11 +659,18 @@ HRESULT to_int32(script_ctx_t *ctx, jsval_t v, INT *ret) double n; HRESULT hres; + const double p32 = (double)0xffffffff + 1; + hres = to_number(ctx, v, &n); if(FAILED(hres)) return hres; - *ret = is_finite(n) ? n : 0; + if(is_finite(n)) + n = n > 0 ? fmod(n, p32) : -fmod(-n, p32); + else + n = 0; + + *ret = (UINT32)n; return S_OK; } diff --git a/dll/win32/jscript/lex.c b/dll/win32/jscript/lex.c index 352395865f..b4cc82a259 100644 --- a/dll/win32/jscript/lex.c +++ b/dll/win32/jscript/lex.c @@ -135,7 +135,7 @@ static int check_keyword(parser_ctx_t *ctx, const WCHAR *word, const WCHAR **lva return 1; if(lval) - *lval = ctx->ptr; + *lval = word; ctx->ptr = p1; return 0; } @@ -487,18 +487,18 @@ static BOOL parse_numeric_literal(parser_ctx_t *ctx, double *ret) HRESULT hres; if(*ctx->ptr == '0') { - LONG d, l = 0; - ctx->ptr++; if(*ctx->ptr == 'x' || *ctx->ptr == 'X') { + double r = 0; + int d; if(++ctx->ptr == ctx->end) { ERR("unexpected end of file\n"); return FALSE; } while(ctx->ptr < ctx->end && (d = hex_to_int(*ctx->ptr)) != -1) { - l = l*16 + d; + r = r*16 + d; ctx->ptr++; } @@ -508,7 +508,7 @@ static BOOL parse_numeric_literal(parser_ctx_t *ctx, double *ret) return FALSE; } - *ret = l; + *ret = r; return TRUE; } diff --git a/dll/win32/jscript/math.c b/dll/win32/jscript/math.c index ef906f5439..109df9d321 100644 --- a/dll/win32/jscript/math.c +++ b/dll/win32/jscript/math.c @@ -559,7 +559,8 @@ HRESULT create_math(script_ctx_t *ctx, jsdisp_t **ret) } for(i=0; i < sizeof(constants)/sizeof(*constants); i++) { - hres = jsdisp_propput_const(math, constants[i].name, jsval_number(constants[i].val)); + hres = jsdisp_define_data_property(math, constants[i].name, 0, + jsval_number(constants[i].val)); if(FAILED(hres)) { jsdisp_release(math); return hres; diff --git a/dll/win32/jscript/object.c b/dll/win32/jscript/object.c index de09060e8a..d18f1c9c00 100644 --- a/dll/win32/jscript/object.c +++ b/dll/win32/jscript/object.c @@ -32,8 +32,21 @@ static const WCHAR propertyIsEnumerableW[] = {'p','r','o','p','e','r','t','y','I','s','E','n','u','m','e','r','a','b','l','e',0}; static const WCHAR isPrototypeOfW[] = {'i','s','P','r','o','t','o','t','y','p','e','O','f',0}; +static const WCHAR getOwnPropertyDescriptorW[] = + {'g','e','t','O','w','n','P','r','o','p','e','r','t','y','D','e','s','c','r','i','p','t','o','r',0}; +static const WCHAR definePropertyW[] = {'d','e','f','i','n','e','P','r','o','p','e','r','t','y',0}; + +static const WCHAR definePropertiesW[] = {'d','e','f','i','n','e','P','r','o','p','e','r','t','i','e','s',0}; + static const WCHAR default_valueW[] = {'[','o','b','j','e','c','t',' ','O','b','j','e','c','t',']',0}; +static const WCHAR configurableW[] = {'c','o','n','f','i','g','u','r','a','b','l','e',0}; +static const WCHAR enumerableW[] = {'e','n','u','m','e','r','a','b','l','e',0}; +static const WCHAR valueW[] = {'v','a','l','u','e',0}; +static const WCHAR writableW[] = {'w','r','i','t','a','b','l','e',0}; +static const WCHAR getW[] = {'g','e','t',0}; +static const WCHAR setW[] = {'s','e','t',0}; + static HRESULT Object_toString(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { @@ -130,20 +143,21 @@ static HRESULT Object_hasOwnProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl return hres; if(is_jsdisp(jsthis)) { + property_desc_t prop_desc; const WCHAR *name_str; - BOOL result; name_str = jsstr_flatten(name); - if(name_str) - hres = jsdisp_is_own_prop(jsthis->u.jsdisp, name_str, &result); - else - hres = E_OUTOFMEMORY; + if(!name_str) { + jsstr_release(name); + return E_OUTOFMEMORY; + } + + hres = jsdisp_get_own_property(jsthis->u.jsdisp, name_str, TRUE, &prop_desc); jsstr_release(name); - if(FAILED(hres)) + if(FAILED(hres) && hres != DISP_E_UNKNOWNNAME) return hres; - if(r) - *r = jsval_bool(result); + if(r) *r = jsval_bool(hres == S_OK); return S_OK; } @@ -169,9 +183,9 @@ static HRESULT Object_hasOwnProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD fl static HRESULT Object_propertyIsEnumerable(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { + property_desc_t prop_desc; const WCHAR *name; jsstr_t *name_str; - BOOL ret; HRESULT hres; TRACE("\n"); @@ -190,13 +204,13 @@ static HRESULT Object_propertyIsEnumerable(script_ctx_t *ctx, vdisp_t *jsthis, W if(FAILED(hres)) return hres; - hres = jsdisp_is_enumerable(jsthis->u.jsdisp, name, &ret); + hres = jsdisp_get_own_property(jsthis->u.jsdisp, name, TRUE, &prop_desc); jsstr_release(name_str); - if(FAILED(hres)) + if(FAILED(hres) && hres != DISP_E_UNKNOWNNAME) return hres; if(r) - *r = jsval_bool(ret); + *r = jsval_bool(hres == S_OK && (prop_desc.flags & PROPF_ENUMERABLE) != 0); return S_OK; } @@ -252,6 +266,274 @@ static const builtin_info_t ObjectInst_info = { NULL }; +static void release_property_descriptor(property_desc_t *desc) +{ + if(desc->explicit_value) + jsval_release(desc->value); + if(desc->getter) + jsdisp_release(desc->getter); + if(desc->setter) + jsdisp_release(desc->setter); +} + +static HRESULT to_property_descriptor(script_ctx_t *ctx, jsdisp_t *attr_obj, property_desc_t *desc) +{ + DISPID id; + jsval_t v; + BOOL b; + HRESULT hres; + + memset(desc, 0, sizeof(*desc)); + desc->value = jsval_undefined(); + + hres = jsdisp_get_id(attr_obj, enumerableW, 0, &id); + if(SUCCEEDED(hres)) { + desc->mask |= PROPF_ENUMERABLE; + hres = jsdisp_propget(attr_obj, id, &v); + if(FAILED(hres)) + return hres; + hres = to_boolean(v, &b); + jsval_release(v); + if(FAILED(hres)) + return hres; + if(b) + desc->flags |= PROPF_ENUMERABLE; + }else if(hres != DISP_E_UNKNOWNNAME) { + return hres; + } + + hres = jsdisp_get_id(attr_obj, configurableW, 0, &id); + if(SUCCEEDED(hres)) { + desc->mask |= PROPF_CONFIGURABLE; + hres = jsdisp_propget(attr_obj, id, &v); + if(FAILED(hres)) + return hres; + hres = to_boolean(v, &b); + jsval_release(v); + if(FAILED(hres)) + return hres; + if(b) + desc->flags |= PROPF_CONFIGURABLE; + }else if(hres != DISP_E_UNKNOWNNAME) { + return hres; + } + + hres = jsdisp_get_id(attr_obj, valueW, 0, &id); + if(SUCCEEDED(hres)) { + hres = jsdisp_propget(attr_obj, id, &desc->value); + if(FAILED(hres)) + return hres; + desc->explicit_value = TRUE; + }else if(hres != DISP_E_UNKNOWNNAME) { + return hres; + } + + hres = jsdisp_get_id(attr_obj, writableW, 0, &id); + if(SUCCEEDED(hres)) { + desc->mask |= PROPF_WRITABLE; + hres = jsdisp_propget(attr_obj, id, &v); + if(SUCCEEDED(hres)) { + hres = to_boolean(v, &b); + jsval_release(v); + if(SUCCEEDED(hres) && b) + desc->flags |= PROPF_WRITABLE; + } + }else if(hres == DISP_E_UNKNOWNNAME) { + hres = S_OK; + } + if(FAILED(hres)) { + release_property_descriptor(desc); + return hres; + } + + hres = jsdisp_get_id(attr_obj, getW, 0, &id); + if(SUCCEEDED(hres)) { + desc->explicit_getter = TRUE; + hres = jsdisp_propget(attr_obj, id, &v); + if(SUCCEEDED(hres) && !is_undefined(v)) { + if(!is_object_instance(v)) { + FIXME("getter is not an object\n"); + jsval_release(v); + hres = E_FAIL; + }else { + /* FIXME: Check IsCallable */ + desc->getter = to_jsdisp(get_object(v)); + if(!desc->getter) + FIXME("getter is not JS object\n"); + } + } + }else if(hres == DISP_E_UNKNOWNNAME) { + hres = S_OK; + } + if(FAILED(hres)) { + release_property_descriptor(desc); + return hres; + } + + hres = jsdisp_get_id(attr_obj, setW, 0, &id); + if(SUCCEEDED(hres)) { + desc->explicit_setter = TRUE; + hres = jsdisp_propget(attr_obj, id, &v); + if(SUCCEEDED(hres) && !is_undefined(v)) { + if(!is_object_instance(v)) { + FIXME("setter is not an object\n"); + jsval_release(v); + hres = E_FAIL; + }else { + /* FIXME: Check IsCallable */ + desc->setter = to_jsdisp(get_object(v)); + if(!desc->setter) + FIXME("setter is not JS object\n"); + } + } + }else if(hres == DISP_E_UNKNOWNNAME) { + hres = S_OK; + } + if(FAILED(hres)) { + release_property_descriptor(desc); + return hres; + } + + if(desc->explicit_getter || desc->explicit_setter) { + if(desc->explicit_value) + hres = throw_type_error(ctx, JS_E_PROP_DESC_MISMATCH, NULL); + else if(desc->mask & PROPF_WRITABLE) + hres = throw_type_error(ctx, JS_E_INVALID_WRITABLE_PROP_DESC, NULL); + } + + if(FAILED(hres)) + release_property_descriptor(desc); + return hres; +} + +static HRESULT Object_defineProperty(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + property_desc_t prop_desc; + jsdisp_t *obj, *attr_obj; + const WCHAR *name; + jsstr_t *name_str; + HRESULT hres; + + TRACE("\n"); + + if(argc < 1 || !is_object_instance(argv[0])) + return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); + obj = to_jsdisp(get_object(argv[0])); + if(!obj) { + FIXME("not implemented non-JS object\n"); + return E_NOTIMPL; + } + + hres = to_flat_string(ctx, argc >= 2 ? argv[1] : jsval_undefined(), &name_str, &name); + if(FAILED(hres)) + return hres; + + if(argc >= 3 && is_object_instance(argv[2])) { + attr_obj = to_jsdisp(get_object(argv[2])); + if(attr_obj) { + hres = to_property_descriptor(ctx, attr_obj, &prop_desc); + }else { + FIXME("not implemented non-JS object\n"); + hres = E_NOTIMPL; + } + }else { + hres = throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); + } + jsstr_release(name_str); + if(FAILED(hres)) + return hres; + + hres = jsdisp_define_property(obj, name, &prop_desc); + release_property_descriptor(&prop_desc); + return hres; +} + +static HRESULT Object_defineProperties(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + FIXME("\n"); + return E_NOTIMPL; +} + +static HRESULT Object_getOwnPropertyDescriptor(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, + unsigned argc, jsval_t *argv, jsval_t *r) +{ + property_desc_t prop_desc; + jsdisp_t *obj, *desc_obj; + const WCHAR *name; + jsstr_t *name_str; + HRESULT hres; + + TRACE("\n"); + + if(argc < 1 || !is_object_instance(argv[0])) + return throw_type_error(ctx, JS_E_OBJECT_EXPECTED, NULL); + obj = to_jsdisp(get_object(argv[0])); + if(!obj) { + FIXME("not implemented non-JS object\n"); + return E_NOTIMPL; + } + + hres = to_flat_string(ctx, argc >= 2 ? argv[1] : jsval_undefined(), &name_str, &name); + if(FAILED(hres)) + return hres; + + hres = jsdisp_get_own_property(obj, name, FALSE, &prop_desc); + jsstr_release(name_str); + if(hres == DISP_E_UNKNOWNNAME) { + if(r) *r = jsval_undefined(); + return S_OK; + } + if(FAILED(hres)) + return hres; + + hres = create_object(ctx, NULL, &desc_obj); + if(FAILED(hres)) + return hres; + + if(prop_desc.explicit_getter || prop_desc.explicit_setter) { + hres = jsdisp_propput_name(desc_obj, getW, prop_desc.getter + ? jsval_obj(prop_desc.getter) : jsval_undefined()); + if(SUCCEEDED(hres)) + hres = jsdisp_propput_name(desc_obj, setW, prop_desc.setter + ? jsval_obj(prop_desc.setter) : jsval_undefined()); + }else { + hres = jsdisp_propput_name(desc_obj, valueW, prop_desc.value); + if(SUCCEEDED(hres)) + hres = jsdisp_propput_name(desc_obj, writableW, + jsval_bool(!!(prop_desc.flags & PROPF_WRITABLE))); + } + if(SUCCEEDED(hres)) + hres = jsdisp_propput_name(desc_obj, enumerableW, + jsval_bool(!!(prop_desc.flags & PROPF_ENUMERABLE))); + if(SUCCEEDED(hres)) + hres = jsdisp_propput_name(desc_obj, configurableW, + jsval_bool(!!(prop_desc.flags & PROPF_CONFIGURABLE))); + + release_property_descriptor(&prop_desc); + if(SUCCEEDED(hres) && r) + *r = jsval_obj(desc_obj); + else + jsdisp_release(desc_obj); + return hres; +} + +static const builtin_prop_t ObjectConstr_props[] = { + {definePropertiesW, Object_defineProperties, PROPF_ES5|PROPF_METHOD|2}, + {definePropertyW, Object_defineProperty, PROPF_ES5|PROPF_METHOD|2}, + {getOwnPropertyDescriptorW, Object_getOwnPropertyDescriptor, PROPF_ES5|PROPF_METHOD|2} +}; + +static const builtin_info_t ObjectConstr_info = { + JSCLASS_FUNCTION, + DEFAULT_FUNCTION_VALUE, + sizeof(ObjectConstr_props)/sizeof(*ObjectConstr_props), + ObjectConstr_props, + NULL, + NULL +}; + static HRESULT ObjectConstr_value(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { @@ -303,7 +585,7 @@ HRESULT create_object_constr(script_ctx_t *ctx, jsdisp_t *object_prototype, jsdi { static const WCHAR ObjectW[] = {'O','b','j','e','c','t',0}; - return create_builtin_constructor(ctx, ObjectConstr_value, ObjectW, NULL, PROPF_CONSTR, + return create_builtin_constructor(ctx, ObjectConstr_value, ObjectW, &ObjectConstr_info, PROPF_CONSTR, object_prototype, ret); } diff --git a/dll/win32/jscript/parser.tab.c b/dll/win32/jscript/parser.tab.c index d72f750ba0..65c26dcf68 100644 --- a/dll/win32/jscript/parser.tab.c +++ b/dll/win32/jscript/parser.tab.c @@ -232,33 +232,33 @@ extern int parser_debug; kDELETE = 263, kDO = 264, kELSE = 265, - kIF = 266, - kFINALLY = 267, - kFOR = 268, - kIN = 269, - kINSTANCEOF = 270, - kNEW = 271, - kNULL = 272, - kRETURN = 273, - kSWITCH = 274, - kTHIS = 275, - kTHROW = 276, - kTRUE = 277, - kFALSE = 278, - kTRY = 279, - kTYPEOF = 280, - kVAR = 281, - kVOID = 282, - kWHILE = 283, - kWITH = 284, - tANDAND = 285, - tOROR = 286, - tINC = 287, - tDEC = 288, - tHTMLCOMMENT = 289, - kDIVEQ = 290, - kDCOL = 291, - kFUNCTION = 292, + kFUNCTION = 266, + kIF = 267, + kFINALLY = 268, + kFOR = 269, + kIN = 270, + kINSTANCEOF = 271, + kNEW = 272, + kNULL = 273, + kRETURN = 274, + kSWITCH = 275, + kTHIS = 276, + kTHROW = 277, + kTRUE = 278, + kFALSE = 279, + kTRY = 280, + kTYPEOF = 281, + kVAR = 282, + kVOID = 283, + kWHILE = 284, + kWITH = 285, + tANDAND = 286, + tOROR = 287, + tINC = 288, + tDEC = 289, + tHTMLCOMMENT = 290, + kDIVEQ = 291, + kDCOL = 292, tIdentifier = 293, tAssignOper = 294, tEqOper = 295, @@ -535,16 +535,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1085 +#define YYLAST 1287 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 70 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 95 +#define YYNNTS 97 /* YYNRULES -- Number of rules. */ -#define YYNRULES 217 +#define YYNRULES 247 /* YYNSTATES -- Number of states. */ -#define YYNSTATES 389 +#define YYNSTATES 440 /* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned by yylex, with out-of-bounds checking. */ @@ -595,28 +595,31 @@ static const yytype_uint8 yytranslate[] = /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 252, 252, 256, 257, 261, 262, 267, 269, 271, - 275, 279, 283, 284, 289, 290, 294, 295, 296, 297, - 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, - 308, 312, 313, 318, 319, 323, 324, 328, 333, 334, - 339, 341, 346, 351, 356, 357, 361, 366, 367, 371, - 376, 380, 385, 387, 392, 394, 397, 399, 396, 403, - 405, 402, 408, 410, 415, 420, 425, 430, 435, 440, - 445, 447, 452, 453, 457, 458, 463, 468, 473, 478, - 479, 480, 485, 490, 494, 495, 498, 499, 503, 504, - 509, 510, 514, 516, 520, 521, 525, 526, 528, 533, - 535, 537, 542, 543, 548, 550, 555, 556, 561, 563, - 568, 569, 574, 576, 581, 582, 587, 589, 594, 595, - 600, 602, 607, 608, 613, 615, 620, 621, 626, 627, - 632, 633, 635, 637, 642, 643, 645, 650, 651, 656, - 658, 660, 665, 666, 668, 670, 675, 676, 678, 679, - 681, 682, 683, 684, 685, 686, 690, 692, 694, 700, - 701, 705, 706, 710, 711, 712, 714, 716, 721, 723, - 725, 727, 732, 733, 737, 738, 743, 744, 745, 746, - 747, 748, 752, 753, 754, 755, 760, 762, 767, 768, - 772, 773, 777, 778, 783, 785, 790, 791, 792, 796, - 797, 801, 802, 803, 804, 805, 807, 812, 813, 814, - 817, 818, 821, 822, 825, 826, 829, 830 + 0, 253, 253, 257, 258, 262, 263, 268, 270, 272, + 276, 280, 284, 285, 290, 291, 295, 296, 297, 298, + 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, + 309, 313, 314, 319, 320, 324, 325, 329, 334, 335, + 340, 342, 347, 352, 357, 358, 362, 367, 368, 372, + 377, 381, 386, 388, 393, 395, 398, 400, 397, 404, + 406, 403, 409, 411, 416, 421, 426, 431, 436, 441, + 446, 448, 453, 454, 458, 459, 464, 469, 474, 479, + 480, 481, 486, 491, 495, 496, 499, 500, 504, 505, + 510, 511, 515, 517, 521, 522, 526, 527, 529, 534, + 536, 538, 543, 544, 549, 551, 556, 557, 562, 564, + 569, 570, 575, 577, 582, 583, 588, 590, 595, 596, + 601, 603, 608, 609, 614, 616, 621, 622, 627, 628, + 633, 634, 636, 638, 643, 644, 646, 651, 652, 657, + 659, 661, 666, 667, 669, 671, 676, 677, 679, 680, + 682, 683, 684, 685, 686, 687, 691, 693, 695, 701, + 702, 706, 707, 711, 712, 713, 715, 717, 722, 724, + 726, 728, 733, 734, 738, 739, 744, 745, 746, 747, + 748, 749, 753, 754, 755, 756, 761, 763, 768, 769, + 773, 774, 778, 779, 784, 786, 791, 792, 793, 797, + 798, 802, 803, 814, 815, 816, 817, 818, 819, 820, + 821, 822, 823, 824, 825, 826, 827, 828, 829, 830, + 831, 832, 833, 834, 835, 836, 837, 838, 839, 840, + 841, 845, 846, 847, 848, 849, 851, 856, 857, 858, + 861, 862, 865, 866, 869, 870, 873, 874 }; #endif @@ -626,11 +629,11 @@ static const yytype_uint16 yyrline[] = static const char *const yytname[] = { "$end", "error", "$undefined", "kBREAK", "kCASE", "kCATCH", "kCONTINUE", - "kDEFAULT", "kDELETE", "kDO", "kELSE", "kIF", "kFINALLY", "kFOR", "kIN", - "kINSTANCEOF", "kNEW", "kNULL", "kRETURN", "kSWITCH", "kTHIS", "kTHROW", - "kTRUE", "kFALSE", "kTRY", "kTYPEOF", "kVAR", "kVOID", "kWHILE", "kWITH", - "tANDAND", "tOROR", "tINC", "tDEC", "tHTMLCOMMENT", "kDIVEQ", "kDCOL", - "kFUNCTION", "'}'", "tIdentifier", "tAssignOper", "tEqOper", + "kDEFAULT", "kDELETE", "kDO", "kELSE", "kFUNCTION", "kIF", "kFINALLY", + "kFOR", "kIN", "kINSTANCEOF", "kNEW", "kNULL", "kRETURN", "kSWITCH", + "kTHIS", "kTHROW", "kTRUE", "kFALSE", "kTRY", "kTYPEOF", "kVAR", "kVOID", + "kWHILE", "kWITH", "tANDAND", "tOROR", "tINC", "tDEC", "tHTMLCOMMENT", + "kDIVEQ", "kDCOL", "'}'", "tIdentifier", "tAssignOper", "tEqOper", "tShiftOper", "tRelOper", "tNumericLiteral", "tBooleanLiteral", "tStringLiteral", "tEOF", "LOWER_THAN_ELSE", "'{'", "','", "'='", "';'", "':'", "'?'", "'|'", "'^'", "'&'", "'+'", "'-'", "'*'", "'/'", "'%'", @@ -661,9 +664,9 @@ static const char *const yytname[] = "LeftHandSideExpression", "NewExpression", "MemberExpression", "CallExpression", "Arguments", "ArgumentList", "PrimaryExpression", "ArrayLiteral", "ElementList", "Elision", "Elision_opt", "ObjectLiteral", - "PropertyNameAndValueList", "PropertyName", "Identifier_opt", "Literal", - "BooleanLiteral", "semicolon_opt", "left_bracket", "right_bracket", - "semicolon", YY_NULL + "PropertyNameAndValueList", "PropertyName", "Identifier_opt", + "IdentifierName", "ReservedAsIdentifier", "Literal", "BooleanLiteral", + "semicolon_opt", "left_bracket", "right_bracket", "semicolon", YY_NULL }; #endif @@ -682,12 +685,12 @@ static const yytype_uint16 yytoknum[] = }; # endif -#define YYPACT_NINF -336 +#define YYPACT_NINF -349 #define yypact_value_is_default(Yystate) \ - (!!((Yystate) == (-336))) + (!!((Yystate) == (-349))) -#define YYTABLE_NINF -199 +#define YYTABLE_NINF -231 #define yytable_value_is_error(Yytable_value) \ 0 @@ -696,45 +699,50 @@ static const yytype_uint16 yytoknum[] = STATE-NUM. */ static const yytype_int16 yypact[] = { - -336, 33, 515, -336, -17, -17, 983, 767, 37, 37, - 1017, -336, 983, 37, -336, 983, -336, -336, -12, 983, - 9, 983, 37, 37, 983, 983, -336, -336, -336, 8, - -336, -336, -336, 578, -336, 983, 983, -336, 983, 983, - 57, 983, 4, 427, 6, -336, -336, -336, -336, -336, - -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, - 56, -336, -336, -10, 90, 38, 46, 65, 83, 96, - 86, 94, 168, -336, -336, 114, -336, 159, 169, -336, - -336, -336, -336, -336, -336, 14, 14, -336, 122, -336, - -336, 180, 107, -336, -336, 388, 875, -336, 159, 14, - 113, 983, 56, 641, 42, -336, 124, 75, -336, -336, - 388, 983, -336, -336, 767, 460, 8, 120, 141, -336, - 704, 79, 156, -336, -336, -336, -336, -336, -336, 84, - 91, 983, 63, -336, 41, 177, -336, 983, -336, -336, - 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - 983, 983, 983, 983, 983, 983, -336, -336, -336, -336, - 983, 983, 983, 199, 821, -336, 983, 200, -336, -336, - -336, -336, -336, -336, -336, 37, -336, 22, 113, 201, - -336, 192, -336, -336, 72, 213, 189, 190, 188, 206, - 17, 86, 105, -336, -336, 35, -336, -336, 37, -12, - 236, -336, 983, -336, -336, 9, -336, 22, 35, -336, - -336, -336, -336, 125, 983, 202, -336, -336, -336, -336, - -336, 211, 177, -336, 204, 22, -336, 90, 198, 38, - 46, 65, 83, 96, 86, 86, 86, 94, 168, 168, - -336, -336, -336, -336, -336, 92, -336, -336, -336, 64, - 93, -336, 388, -336, -336, 767, 210, 205, 243, 45, - 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, - 388, 983, 983, 214, 223, -336, -336, -336, -336, 767, - 767, 212, -336, 216, 929, 37, 22, 225, 218, 983, - -336, 983, -336, -336, 22, 258, 983, -336, -336, 201, - 45, 388, -336, -336, 983, -336, 182, 213, 217, 189, - 190, 188, 206, 17, 86, 86, 22, -336, -336, 265, - -336, 22, -336, -336, 983, -336, -336, 177, 222, -336, - -336, -336, -336, 14, 767, -336, -336, 983, 22, -336, - 983, 767, 983, 18, 265, -336, -12, -336, 22, -336, - 767, 234, -336, -336, -336, 767, 45, -336, -336, 117, - 220, -336, 265, -336, -336, 226, 238, -336, 45, -336, - 983, 767, 767, 245, -336, -336, 983, 22, 767, -336, - -336, -336, 246, 22, 767, -336, 767, -336, -336 + -349, 55, 650, -349, 37, 37, 1094, 839, -349, 28, + 28, 248, -349, 1094, 28, -349, 1094, -349, -349, -15, + 1094, 59, 1094, 28, 28, 1094, 1094, -349, -349, 4, + -349, -349, -349, 587, -349, 1094, 1094, -349, 1094, 1094, + -8, 1094, 66, 490, 35, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + 109, -349, -349, 7, 69, 56, 46, 86, 107, 25, + 129, 125, 200, -349, -349, 196, -349, 122, 147, -349, + -349, -349, -349, -349, -349, 47, 47, -349, 1160, -349, + -349, 177, 162, -349, -349, 431, 937, -349, 122, 47, + 176, 1094, 109, 713, 134, -349, 180, 113, -349, -349, + 431, 1094, -349, -349, 839, 34, -349, -349, 127, -349, + 1094, 839, -349, 181, 63, -349, 64, -349, -349, 248, + 184, 986, 65, 190, 1094, 192, 195, -15, 1094, 59, + 1094, 70, 92, 522, 4, 202, 211, -349, 776, -22, + 214, -349, -349, -349, -349, -349, -349, -349, -349, 102, + 108, 1094, 20, -349, 53, 231, -349, 1094, -349, -349, + 1094, 1094, 1094, 1094, 1094, 1094, 1094, 1094, 1094, 1094, + 1094, 1094, 1094, 1094, 1094, 1094, -349, -349, -349, -349, + 1094, 1094, 1094, 1248, 888, -349, 1094, 1248, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, 28, -349, 23, 176, + 234, -349, 203, -349, -349, 40, 245, 222, 223, 221, + 239, 2, 129, 142, -349, -349, 19, -349, -349, 28, + -15, 268, -349, 1094, -349, -349, 59, -349, 23, 19, + -349, -349, -349, -349, 1204, 1094, 232, -349, -349, -349, + -349, -349, 244, 231, -349, 236, 23, -349, 69, 235, + 56, 46, 86, 107, 25, 129, 129, 129, 125, 200, + 200, -349, -349, -349, -349, -349, 119, -349, -349, -349, + 84, 120, -349, 431, -349, -349, 839, 240, 250, 275, + 77, 1094, 1094, 1094, 1094, 1094, 1094, 1094, 1094, 1094, + 1094, 431, 1094, 1094, 249, 262, -349, -349, -349, -349, + 839, 839, 252, -349, 253, 1035, 28, 23, 263, 257, + 1094, -349, 1094, -349, -349, 23, 298, 1094, -349, -349, + 234, 77, 431, -349, -349, 1094, -349, 206, 245, 258, + 222, 223, 221, 239, 2, 129, 129, 23, -349, -349, + 306, -349, 23, -349, -349, 1094, -349, -349, 231, 265, + -349, -349, -349, -349, 47, 839, -349, -349, 1094, 23, + -349, 1094, 839, 1094, 18, 306, -349, -15, -349, 23, + -349, 839, 274, -349, -349, -349, 839, 77, -349, -349, + 87, 266, -349, 306, -349, -349, 269, 277, -349, 77, + -349, 1094, 839, 839, 283, -349, -349, 1094, 23, 839, + -349, -349, -349, 284, 23, 839, -349, 839, -349, -349 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. @@ -742,75 +750,80 @@ static const yytype_int16 yypact[] = means the default is an error. */ static const yytype_uint8 yydefact[] = { - 5, 0, 4, 1, 199, 199, 0, 0, 0, 0, - 0, 201, 84, 0, 176, 0, 207, 208, 0, 0, - 0, 0, 0, 0, 0, 0, 3, 206, 10, 177, - 203, 209, 204, 0, 50, 0, 0, 205, 0, 0, + 5, 0, 4, 1, 199, 199, 0, 0, 10, 0, + 0, 0, 231, 84, 0, 176, 0, 237, 238, 0, + 0, 0, 0, 0, 0, 0, 0, 3, 236, 177, + 233, 239, 234, 0, 50, 0, 0, 235, 0, 0, 190, 0, 0, 19, 0, 6, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 0, 88, 96, 102, 106, 110, 114, 118, 122, 126, 130, 137, 139, 142, 146, 156, 159, 161, 160, 163, - 179, 180, 178, 202, 200, 0, 0, 177, 0, 164, - 147, 156, 0, 213, 212, 0, 90, 162, 161, 0, + 179, 180, 178, 232, 200, 0, 0, 177, 0, 164, + 147, 156, 0, 243, 242, 0, 90, 162, 161, 0, 85, 0, 0, 0, 0, 149, 44, 0, 38, 148, - 0, 0, 150, 151, 0, 36, 177, 203, 204, 31, - 0, 0, 0, 152, 153, 154, 155, 188, 182, 0, - 191, 0, 0, 2, 0, 14, 211, 0, 210, 51, + 0, 0, 150, 151, 0, 199, 204, 205, 199, 207, + 208, 209, 210, 10, 0, 212, 0, 216, 217, 218, + 231, 84, 0, 176, 223, 237, 238, 225, 226, 227, + 228, 0, 0, 36, 177, 233, 234, 31, 0, 0, + 0, 196, 202, 152, 153, 154, 155, 188, 182, 0, + 191, 0, 0, 2, 0, 14, 241, 0, 240, 51, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 157, 158, 95, 94, 0, 0, 0, 0, 0, 168, 0, 0, 169, 65, - 64, 192, 196, 198, 197, 0, 87, 0, 86, 0, - 56, 91, 92, 99, 104, 108, 112, 116, 120, 124, - 128, 134, 156, 167, 66, 0, 78, 36, 0, 0, - 79, 80, 0, 42, 45, 0, 37, 0, 0, 68, - 35, 32, 193, 0, 0, 190, 184, 189, 183, 186, - 181, 0, 14, 12, 15, 0, 89, 107, 0, 111, - 115, 119, 123, 127, 133, 132, 131, 138, 140, 141, - 143, 144, 145, 97, 98, 0, 166, 172, 174, 0, - 0, 171, 0, 215, 214, 0, 47, 59, 40, 0, + 64, 203, 206, 208, 209, 214, 215, 213, 218, 219, + 220, 221, 222, 223, 224, 211, 225, 226, 227, 228, + 229, 230, 192, 201, 198, 197, 0, 87, 0, 86, + 0, 56, 91, 92, 99, 104, 108, 112, 116, 120, + 124, 128, 134, 156, 167, 66, 0, 78, 36, 0, + 0, 79, 80, 0, 42, 45, 0, 37, 0, 0, + 68, 35, 32, 193, 0, 0, 190, 184, 189, 183, + 186, 181, 0, 14, 12, 15, 0, 89, 107, 0, + 111, 115, 119, 123, 127, 133, 132, 131, 138, 140, + 141, 143, 144, 145, 97, 98, 0, 166, 172, 174, + 0, 0, 171, 0, 245, 244, 0, 47, 59, 40, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 83, 81, 46, 39, 0, - 0, 0, 194, 191, 0, 0, 0, 0, 0, 0, - 165, 0, 173, 170, 0, 53, 0, 43, 48, 0, - 0, 0, 217, 216, 84, 93, 156, 109, 0, 113, - 117, 121, 125, 129, 136, 135, 0, 100, 101, 72, - 69, 0, 55, 67, 0, 185, 187, 14, 0, 13, - 5, 103, 175, 0, 0, 49, 41, 84, 0, 57, - 0, 0, 0, 0, 73, 74, 0, 195, 0, 5, - 11, 0, 54, 52, 60, 0, 0, 105, 62, 0, - 0, 70, 72, 75, 82, 0, 0, 7, 0, 63, - 84, 33, 33, 0, 5, 8, 84, 0, 34, 76, - 77, 71, 0, 0, 0, 9, 0, 58, 61 + 0, 0, 0, 0, 0, 0, 83, 81, 46, 39, + 0, 0, 0, 194, 191, 0, 0, 0, 0, 0, + 0, 165, 0, 173, 170, 0, 53, 0, 43, 48, + 0, 0, 0, 247, 246, 84, 93, 156, 109, 0, + 113, 117, 121, 125, 129, 136, 135, 0, 100, 101, + 72, 69, 0, 55, 67, 0, 185, 187, 14, 0, + 13, 5, 103, 175, 0, 0, 49, 41, 84, 0, + 57, 0, 0, 0, 0, 73, 74, 0, 195, 0, + 5, 11, 0, 54, 52, 60, 0, 0, 105, 62, + 0, 0, 70, 72, 75, 82, 0, 0, 7, 0, + 63, 84, 33, 33, 0, 5, 8, 84, 0, 34, + 76, 77, 71, 0, 0, 0, 9, 0, 58, 61 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -336, -336, -336, 274, -2, -336, -335, -336, -211, 1, - -180, -87, -9, -336, -336, -336, 81, -8, -336, -336, - -336, -336, -336, -336, -336, -336, -336, -336, -336, -336, - -336, -336, -336, -336, -336, -336, -336, -75, -336, -56, - -336, -336, -336, -336, 89, -287, -108, -11, -336, -336, - 229, -66, -244, -336, -336, -336, -336, 152, 47, 165, - 48, 166, 49, 170, 50, 167, 51, 173, 53, -61, - 171, 69, 43, -336, 34, 306, 312, -336, -35, -336, - -336, -336, -336, 108, 109, -336, -336, 112, 322, -336, - -336, -73, -3, 24, -276 + -349, -349, -349, 323, -2, -349, -348, -349, -269, 1, + -172, -98, -12, -349, -349, -349, 71, -24, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -349, -349, -349, + -349, -349, -349, -349, -349, -349, -349, -80, -349, -61, + -349, -349, -349, -349, 99, -341, -108, -4, -349, -349, + 278, -86, -296, -349, -349, -349, -349, 182, 42, 183, + 43, 185, 41, 186, 45, 187, 49, 188, 52, -95, + 179, 93, 343, -349, 24, -5, -1, -349, 58, -349, + -349, -349, -349, 101, 106, -349, -349, 110, 8, -16, + -349, -349, -349, -64, 9, -104, -340 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { - -1, 1, 42, 350, 89, 44, 351, 224, 225, 119, - 120, 379, 46, 47, 107, 257, 108, 258, 203, 204, - 297, 298, 48, 49, 50, 51, 259, 356, 300, 368, - 52, 53, 54, 55, 56, 57, 320, 343, 344, 345, - 362, 58, 59, 200, 201, 99, 177, 60, 180, 181, - 272, 61, 182, 62, 183, 63, 184, 64, 185, 65, - 186, 66, 187, 67, 188, 68, 189, 69, 190, 70, - 71, 72, 73, 74, 75, 76, 77, 78, 165, 249, - 79, 80, 129, 130, 131, 81, 121, 122, 85, 82, - 83, 139, 95, 255, 304 + -1, 1, 42, 401, 89, 44, 402, 275, 276, 147, + 148, 430, 46, 47, 107, 308, 108, 309, 254, 255, + 348, 349, 48, 49, 50, 51, 310, 407, 351, 419, + 52, 53, 54, 55, 56, 57, 371, 394, 395, 396, + 413, 58, 59, 251, 252, 99, 228, 60, 231, 232, + 323, 61, 233, 62, 234, 63, 235, 64, 236, 65, + 237, 66, 238, 67, 239, 68, 240, 69, 241, 70, + 71, 72, 73, 74, 75, 76, 77, 78, 195, 300, + 79, 80, 159, 160, 161, 81, 149, 150, 85, 151, + 152, 82, 83, 169, 95, 306, 355 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If @@ -818,273 +831,318 @@ static const yytype_int16 yydefgoto[] = number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int16 yytable[] = { - 43, 100, 207, 45, 102, 43, 96, 93, 92, 104, - 101, 286, 169, 170, 366, 136, 305, 339, 308, 110, - 111, 140, 84, 253, 337, 360, 194, 317, 318, 196, - 132, 43, 268, 3, 206, 191, 253, 103, 93, 382, - 91, 135, 93, 168, 141, 134, 302, 198, 106, 90, - 354, 133, 335, 91, 199, 91, 361, 136, 91, 91, - 269, 114, 105, 193, 109, 219, 138, 112, 113, 91, - 91, 226, 91, 91, 94, 228, 136, 221, 123, 124, - 370, 125, 126, 377, 178, 137, 234, 235, 236, 383, - 195, 254, 376, 143, 243, 244, 357, 303, 248, 178, - 208, 43, 144, 261, 254, 94, 137, 127, 138, 94, - 147, 148, 43, 137, 291, 209, 348, 212, 43, 270, - 142, 211, 145, 128, 146, 205, 262, 138, 150, 213, - 192, 222, 220, 292, 215, 175, 277, 156, 157, 149, - 158, 217, 137, 137, 294, 159, 156, 157, 282, 158, - 216, 245, 151, 152, 159, 250, 271, 218, 290, 293, - 171, 172, 316, 137, 172, 160, 173, 137, 174, 173, - 371, 174, 252, -198, 91, 202, 91, 91, 91, 91, + 43, 242, 258, 45, 337, 43, 97, 104, 92, 100, + 98, 388, 102, 86, 390, 356, 263, 359, 319, 96, + 304, 199, 200, 101, 304, 411, 368, 369, 264, 93, + 91, 43, 110, 111, 103, 245, 93, 162, 247, 170, + 177, 178, 157, 257, 91, 320, 91, 405, 166, 91, + 91, 386, 417, 165, 93, 3, 412, 114, 158, 91, + 91, 171, 91, 91, 93, 93, 93, 421, 179, 167, + 167, 93, 312, 84, 164, 270, 84, 433, 353, 427, + 428, 277, 285, 286, 287, 279, 434, -203, 305, 271, + 272, 229, 305, 93, 313, 408, 94, 246, 106, 168, + 172, 43, 174, 94, 294, 295, 229, 259, 299, 399, + 166, 173, 43, 163, 166, 260, -215, -213, -221, 43, + 243, 94, 92, -229, 97, 104, 86, 100, 98, 354, + 102, 94, 94, 94, 342, 96, 198, 167, 94, 249, + 422, 101, 324, 175, 91, -230, 43, 250, 176, 262, + 110, 111, 266, 343, 330, 331, 244, 321, 268, 167, + 94, 168, 91, 256, 91, 168, 84, 328, 267, 167, + 167, 180, 339, 273, 269, 186, 187, 297, 188, 333, + -206, 302, 189, 181, 182, 341, 344, 192, 296, 193, + 194, 226, 301, 322, 91, 345, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, 91, - 275, 378, 378, 338, -197, 274, 240, 241, 242, 191, - 191, 191, 191, 191, 191, 191, 191, 314, 315, 214, - 191, 191, 156, 157, 156, 157, 223, 158, 326, 273, - 238, 239, 159, 331, 162, 332, 163, 164, 153, 154, - 155, 279, 280, 271, 166, 191, 167, 164, 246, 251, - 256, 178, 260, 263, 264, 266, 265, 267, 199, 288, - 285, 289, 127, 43, 287, 299, 295, 301, 347, 178, - 352, 296, 321, 319, 329, 324, 217, 330, 334, 342, - 340, 349, 367, 372, 2, 374, 375, 43, 43, 191, - 322, 323, 327, 381, 385, 380, 278, 373, 363, 276, - 178, 336, 227, 100, 306, 91, 306, 91, 91, 91, - 91, 91, 91, 91, 161, 306, 306, 229, 307, 230, - 328, 309, 232, 310, 231, 311, 97, 312, 333, 233, - 313, 237, 98, 283, 284, 281, 100, 86, 0, 0, - 306, 359, 43, 0, 0, 353, 0, 364, 0, 43, - 341, 0, 358, 0, 0, 346, 0, 0, 43, 0, - 0, 45, 0, 43, 0, 0, 369, 0, 0, 100, - 0, 0, 355, 0, 0, 100, 0, 0, 0, 43, - 43, 0, 365, 0, 306, 0, 43, 0, 0, 211, - 0, 0, 43, 0, 43, 387, 0, 388, 0, 176, - 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, - 0, 384, 0, 0, 10, 11, 0, 386, 14, 0, - 16, 17, 0, 19, 0, 21, 0, 0, 0, 0, - 24, 25, 0, 27, 0, 28, 0, 87, -164, 0, + 186, 187, 196, 367, 197, 194, 242, 242, 242, 242, + 242, 242, 242, 242, 365, 366, 167, 242, 242, 186, + 187, 253, 188, 379, -214, 303, 189, -219, 326, 186, + 187, 384, 188, -222, 389, -224, 189, 190, -211, 377, + 429, 429, 242, 311, 382, -198, 383, 322, 325, 8, + 183, 184, 185, 392, -197, 11, 12, 265, 397, 15, + 274, 17, 18, 307, 289, 290, 314, 315, 317, 316, + 318, 250, 157, 336, 28, 406, 338, 87, 340, 398, + 352, 347, 30, 31, 32, 416, 242, 88, 370, 229, + 350, 372, 380, 268, 43, 375, 381, 346, 385, 37, + 393, 391, 418, 40, 400, 426, 41, 229, 425, 423, + 403, 432, 436, 2, 435, 431, 387, 329, 43, 43, + 437, 373, 374, 424, 414, 357, 91, 357, 91, 91, + 91, 91, 91, 91, 91, 378, 357, 357, 229, 90, + 327, 100, 278, 191, 358, 280, 361, 360, 281, 288, + 282, 362, 283, 105, 284, 109, 363, 334, 112, 113, + 364, 357, 335, 0, 332, 0, 0, 0, 153, 154, + 0, 155, 156, 43, 100, 415, 404, 0, 0, 410, + 43, 0, 0, 409, 0, 0, 0, 0, 0, 43, + 0, 0, 45, 0, 43, 0, 0, 420, 0, 0, + 0, 0, 0, 0, 0, 357, 0, 100, 0, 0, + 43, 43, 0, 100, 0, 0, 0, 43, 0, 0, + 262, 0, 227, 43, 0, 43, 438, 0, 439, 6, + 0, 0, 8, 0, 0, 0, 0, 0, 11, 12, + 0, 0, 15, 0, 17, 18, 0, 20, 0, 22, + 0, 0, 0, 90, 25, 26, 0, 28, 0, 0, + 87, 0, 0, 0, 0, 30, 31, 32, 0, 0, + 88, 105, 0, 109, 0, 0, 0, 0, 0, 35, + 36, -164, 37, 0, 38, 39, 40, 0, 0, 41, + 0, 0, 0, 0, 0, -164, -164, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, -164, -164, -192, 0, 0, 291, 292, 293, 0, + -164, -164, -164, -164, 0, 0, 0, -192, -192, 0, + -164, -164, 0, 0, -164, -164, -164, -164, 0, 0, + -164, 0, -164, -192, -192, 0, 0, -164, 0, 0, + 0, 0, -192, -192, -192, -192, 0, 0, 0, 0, + 0, 0, -192, -192, 0, 0, -192, -192, -192, -192, + 0, 0, -192, 0, -192, 0, 0, 0, 0, -192, + 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, + 135, 136, 137, 138, 139, 140, 141, 142, 0, 0, + 25, 26, 0, 28, 0, 143, 144, 0, 0, 0, + 0, 145, 31, 146, 0, 0, 33, 0, 0, 34, + 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, + 38, 39, 40, 4, 0, 41, 5, 0, 6, 7, + 0, 8, 9, 0, 10, 0, 0, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, + 24, 0, 0, 25, 26, 27, 28, 0, 0, 29, + 0, 0, 0, 0, 30, 31, 32, 0, 0, 33, + 0, 0, 34, 0, 0, 0, 0, 0, 35, 36, + 0, 37, 0, 38, 39, 40, 4, 0, 41, 5, + 0, 6, 7, 0, 8, 9, 0, 10, 0, 0, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 0, 0, 25, 26, 0, 28, + 0, 248, 29, 0, 0, 0, 0, 30, 31, 32, + 0, 0, 33, 0, 0, 34, 0, 0, 0, 0, + 0, 35, 36, 0, 37, 0, 38, 39, 40, 4, + 0, 41, 5, 0, 6, 7, 0, 8, 9, 0, + 10, 0, 0, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 0, 0, 25, + 26, 0, 28, 0, 261, 29, 0, 0, 0, 0, + 30, 31, 32, 0, 0, 33, 0, 0, 34, 0, + 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, + 39, 40, 4, 0, 41, 5, 0, 6, 7, 0, + 8, 9, 0, 10, 0, 0, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 0, 0, 25, 26, 0, 28, 0, 0, 29, 0, + 0, 0, 0, 30, 31, 32, 0, 0, 33, 0, + 0, 34, 0, 0, 0, 0, 6, 35, 36, 8, + 37, 0, 38, 39, 40, 11, 12, 41, 0, 15, + 0, 17, 18, 0, 20, 0, 22, 0, 0, 0, + 0, 25, 26, 0, 28, 0, 0, 87, 0, 0, 0, 0, 30, 31, 32, 0, 0, 88, 0, 0, - 0, -164, -164, 0, 0, 0, 35, 36, 0, 37, - 0, 38, 39, 40, 0, 0, 41, -164, -164, 0, - 0, -192, 0, 0, 0, 0, 0, -164, -164, -164, - -164, 0, 0, 0, -192, -192, 0, -164, -164, 0, - 0, -164, -164, -164, -164, 0, 0, -164, 0, -164, - -192, -192, 0, 0, -164, 0, 0, 0, 0, 0, - -192, -192, -192, -192, 0, 0, 0, 0, 0, 0, - -192, -192, 0, 0, -192, -192, -192, -192, 4, 0, - -192, 5, -192, 6, 7, 0, 8, -192, 9, 0, - 0, 10, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 0, 0, 24, 25, 26, - 27, 0, 28, 0, 29, 0, 0, 0, 0, 30, - 31, 32, 0, 0, 33, 0, 0, 34, 0, 0, + 0, 0, 0, 0, 0, 6, 35, 36, 8, 37, + 0, 38, 39, 40, 11, 12, 41, 298, 15, 0, + 17, 18, 0, 20, 230, 22, 0, 0, 0, 0, + 25, 26, 0, 28, 0, 0, 87, 0, 0, 0, + 0, 30, 31, 32, 0, 0, 88, 0, 0, 0, + 0, 0, 0, 0, 6, 35, 36, 8, 37, 0, + 38, 39, 40, 11, 12, 41, 0, 15, 0, 17, + 18, 0, 20, 0, 22, 0, 0, 0, 0, 25, + 26, 0, 28, 0, 0, 87, 0, 0, 0, 0, + 30, 31, 32, 0, 0, 88, 0, 0, 0, -220, + 0, 0, 0, 6, 35, 36, 8, 37, 0, 38, + 39, 40, 11, 12, 41, 0, 15, 0, 17, 18, + 0, 20, 0, 22, 0, 0, 0, 0, 25, 26, + 0, 28, 0, 0, 87, 0, 0, 0, 0, 30, + 31, 32, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, 39, - 40, 4, 0, 41, 5, 0, 6, 7, 0, 8, - 0, 9, 0, 0, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 23, 0, 0, - 24, 25, 0, 27, 0, 28, 115, 116, 0, 0, - 0, 0, 117, 31, 118, 0, 0, 33, 0, 0, - 34, 0, 0, 0, 0, 0, 35, 36, 0, 37, - 0, 38, 39, 40, 4, 0, 41, 5, 0, 6, - 7, 0, 8, 0, 9, 0, 0, 10, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 23, 0, 0, 24, 25, 0, 27, 0, 28, 197, - 29, 0, 0, 0, 0, 30, 31, 32, 0, 0, - 33, 0, 0, 34, 0, 0, 0, 0, 0, 35, - 36, 0, 37, 0, 38, 39, 40, 4, 0, 41, - 5, 0, 6, 7, 0, 8, 0, 9, 0, 0, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 23, 0, 0, 24, 25, 0, 27, - 0, 28, 210, 29, 0, 0, 0, 0, 30, 31, - 32, 0, 0, 33, 0, 0, 34, 0, 0, 0, + 40, 376, 6, 41, 0, 8, 0, 0, 0, 0, + 0, 11, 12, 0, 0, 15, 0, 17, 18, 0, + 20, 0, 22, 0, 0, 0, 0, 25, 26, 0, + 28, 0, 0, 87, 0, 0, 0, 0, 30, 31, + 32, 0, 0, 88, 0, 0, 0, 0, 0, 0, 0, 0, 35, 36, 0, 37, 0, 38, 39, 40, - 4, 0, 41, 5, 0, 6, 7, 0, 8, 0, - 9, 0, 0, 10, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 23, 0, 0, 24, - 25, 0, 27, 0, 28, 0, 29, 0, 0, 0, - 0, 30, 31, 32, 0, 0, 33, 0, 0, 34, - 0, 0, 0, 0, 0, 35, 36, 0, 37, 6, - 38, 39, 40, 0, 0, 41, 0, 10, 11, 0, - 0, 14, 0, 16, 17, 0, 19, 0, 21, 0, - 0, 0, 0, 24, 25, 0, 27, 0, 28, 0, - 87, 0, 0, 0, 0, 30, 31, 32, 0, 0, - 88, 0, 0, 0, 0, 0, 0, 0, 0, 35, - 36, 0, 37, 6, 38, 39, 40, 0, 0, 41, - 247, 10, 11, 0, 0, 14, 0, 16, 17, 0, - 19, 179, 21, 0, 0, 0, 0, 24, 25, 0, - 27, 0, 28, 0, 87, 0, 0, 0, 0, 30, - 31, 32, 0, 0, 88, 0, 0, 0, 0, 0, - 0, 0, 0, 35, 36, 0, 37, 6, 38, 39, - 40, 0, 0, 41, 0, 10, 11, 0, 0, 14, - 0, 16, 17, 0, 19, 0, 21, 0, 0, 0, - 0, 24, 25, 0, 27, 0, 28, 0, 87, 0, - 0, 0, 0, 30, 31, 32, 0, 0, 88, 0, - 0, 0, 0, 0, 0, 0, 0, 35, 36, 0, - 37, 6, 38, 39, 40, 325, 0, 41, 0, 10, - 11, 0, 0, 14, 0, 16, 17, 0, 19, 0, - 21, 0, 0, 0, 0, 24, 25, 0, 27, 0, - 28, 0, 87, 0, 0, 0, 0, 30, 31, 32, - 0, 0, 88, 10, 11, 0, 0, 14, 0, 16, - 17, 35, 36, 0, 37, 0, 38, 39, 40, 0, - 0, 41, 27, 0, 28, 0, 87, 0, 0, 0, - 0, 30, 31, 32, 0, 0, 88, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 37, 0, - 0, 0, 40, 0, 0, 41 + 0, 0, 41, 201, 116, 117, 202, 119, 203, 204, + 122, 205, 206, 125, 207, 127, 128, 208, 209, 210, + 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, + 221, 0, 0, 0, 0, 0, 0, 0, 222, 223, + 0, 0, 0, 0, 224, 0, 225, 201, 116, 117, + 202, 119, 203, 204, 122, 205, 206, 125, 207, 127, + 128, 208, 209, 210, 211, 212, 213, 214, 215, 216, + 217, 218, 219, 220, 221, 0, 0, 0, 0, 0, + 0, 0, 0, 223, 0, 0, 0, 0, 224, 0, + 225, 201, 116, 117, 202, 119, 203, 204, 122, 205, + 206, 125, 207, 127, 128, 208, 209, 210, 211, 212, + 213, 214, 215, 216, 217, 218, 219, 220, 221, 0, + 0, 0, 0, 0, 0, 0, 0, 223 }; static const yytype_int16 yycheck[] = { - 2, 12, 110, 2, 15, 7, 9, 1, 7, 18, - 13, 222, 85, 86, 349, 1, 260, 304, 262, 22, - 23, 31, 39, 1, 300, 7, 99, 271, 272, 102, - 41, 33, 15, 0, 107, 96, 1, 49, 1, 374, - 6, 44, 1, 78, 54, 39, 1, 5, 39, 6, - 337, 47, 296, 19, 12, 21, 38, 1, 24, 25, - 43, 53, 19, 98, 21, 131, 52, 24, 25, 35, - 36, 137, 38, 39, 68, 141, 1, 36, 35, 36, - 356, 38, 39, 370, 95, 50, 147, 148, 149, 376, - 101, 69, 368, 55, 160, 161, 340, 52, 164, 110, - 111, 103, 56, 31, 69, 68, 50, 50, 52, 68, - 14, 15, 114, 50, 50, 114, 327, 38, 120, 14, - 30, 120, 57, 66, 41, 50, 54, 52, 42, 50, - 96, 134, 69, 69, 50, 28, 202, 32, 33, 43, - 35, 50, 50, 50, 252, 40, 32, 33, 214, 35, - 66, 162, 58, 59, 40, 166, 51, 66, 66, 66, - 38, 39, 270, 50, 39, 51, 44, 50, 46, 44, - 53, 46, 175, 53, 140, 51, 142, 143, 144, 145, - 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, - 199, 371, 372, 301, 53, 198, 153, 154, 155, 260, - 261, 262, 263, 264, 265, 266, 267, 268, 269, 53, - 271, 272, 32, 33, 32, 33, 39, 35, 284, 195, - 151, 152, 40, 289, 65, 291, 67, 68, 60, 61, - 62, 207, 208, 51, 65, 296, 67, 68, 39, 39, - 39, 252, 50, 30, 55, 57, 56, 41, 12, 225, - 39, 53, 50, 255, 50, 50, 255, 14, 324, 270, - 333, 51, 39, 49, 39, 53, 50, 49, 10, 4, - 53, 49, 38, 53, 0, 49, 38, 279, 280, 340, - 279, 280, 285, 38, 38, 372, 205, 362, 344, 200, - 301, 299, 140, 304, 260, 261, 262, 263, 264, 265, - 266, 267, 268, 269, 75, 271, 272, 142, 261, 143, - 286, 263, 145, 264, 144, 265, 10, 266, 294, 146, - 267, 150, 10, 215, 215, 213, 337, 5, -1, -1, - 296, 342, 334, -1, -1, 334, -1, 346, -1, 341, - 316, -1, 341, -1, -1, 321, -1, -1, 350, -1, - -1, 350, -1, 355, -1, -1, 355, -1, -1, 370, - -1, -1, 338, -1, -1, 376, -1, -1, -1, 371, - 372, -1, 348, -1, 340, -1, 378, -1, -1, 378, - -1, -1, 384, -1, 386, 384, -1, 386, -1, 1, - -1, -1, -1, -1, -1, -1, 8, -1, -1, -1, - -1, 377, -1, -1, 16, 17, -1, 383, 20, -1, - 22, 23, -1, 25, -1, 27, -1, -1, -1, -1, - 32, 33, -1, 35, -1, 37, -1, 39, 1, -1, - -1, -1, 44, 45, 46, -1, -1, 49, -1, -1, - -1, 14, 15, -1, -1, -1, 58, 59, -1, 61, - -1, 63, 64, 65, -1, -1, 68, 30, 31, -1, - -1, 1, -1, -1, -1, -1, -1, 40, 41, 42, - 43, -1, -1, -1, 14, 15, -1, 50, 51, -1, - -1, 54, 55, 56, 57, -1, -1, 60, -1, 62, - 30, 31, -1, -1, 67, -1, -1, -1, -1, -1, - 40, 41, 42, 43, -1, -1, -1, -1, -1, -1, - 50, 51, -1, -1, 54, 55, 56, 57, 3, -1, - 60, 6, 62, 8, 9, -1, 11, 67, 13, -1, - -1, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, -1, -1, 32, 33, 34, - 35, -1, 37, -1, 39, -1, -1, -1, -1, 44, - 45, 46, -1, -1, 49, -1, -1, 52, -1, -1, - -1, -1, -1, 58, 59, -1, 61, -1, 63, 64, - 65, 3, -1, 68, 6, -1, 8, 9, -1, 11, - -1, 13, -1, -1, 16, 17, 18, 19, 20, 21, - 22, 23, 24, 25, 26, 27, 28, 29, -1, -1, - 32, 33, -1, 35, -1, 37, 38, 39, -1, -1, - -1, -1, 44, 45, 46, -1, -1, 49, -1, -1, - 52, -1, -1, -1, -1, -1, 58, 59, -1, 61, - -1, 63, 64, 65, 3, -1, 68, 6, -1, 8, - 9, -1, 11, -1, 13, -1, -1, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, -1, -1, 32, 33, -1, 35, -1, 37, 38, + 2, 96, 110, 2, 273, 7, 11, 19, 7, 13, + 11, 351, 16, 5, 355, 311, 38, 313, 16, 10, + 1, 85, 86, 14, 1, 7, 322, 323, 50, 1, + 6, 33, 23, 24, 49, 99, 1, 41, 102, 32, + 15, 16, 50, 107, 20, 43, 22, 388, 1, 25, + 26, 347, 400, 44, 1, 0, 38, 53, 66, 35, + 36, 54, 38, 39, 1, 1, 1, 407, 43, 50, + 50, 1, 32, 39, 39, 161, 39, 425, 1, 419, + 421, 167, 177, 178, 179, 171, 427, 53, 69, 69, + 37, 95, 69, 1, 54, 391, 68, 101, 39, 52, + 31, 103, 56, 68, 190, 191, 110, 111, 194, 378, + 1, 55, 114, 47, 1, 114, 53, 53, 53, 121, + 96, 68, 121, 53, 129, 137, 118, 131, 129, 52, + 134, 68, 68, 68, 50, 126, 78, 50, 68, 5, + 53, 132, 246, 57, 120, 53, 148, 13, 41, 148, + 141, 142, 50, 69, 258, 259, 98, 15, 50, 50, + 68, 52, 138, 50, 140, 52, 39, 253, 66, 50, + 50, 42, 276, 164, 66, 33, 34, 193, 36, 265, + 53, 197, 40, 58, 59, 66, 66, 65, 192, 67, + 68, 29, 196, 51, 170, 303, 172, 173, 174, 175, + 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, + 33, 34, 65, 321, 67, 68, 311, 312, 313, 314, + 315, 316, 317, 318, 319, 320, 50, 322, 323, 33, + 34, 51, 36, 337, 53, 226, 40, 53, 250, 33, + 34, 345, 36, 53, 352, 53, 40, 51, 53, 335, + 422, 423, 347, 50, 340, 53, 342, 51, 249, 11, + 60, 61, 62, 367, 53, 17, 18, 53, 372, 21, + 39, 23, 24, 39, 181, 182, 31, 55, 57, 56, + 41, 13, 50, 39, 36, 389, 50, 39, 53, 375, + 15, 51, 44, 45, 46, 399, 391, 49, 49, 303, + 50, 39, 39, 50, 306, 53, 49, 306, 10, 61, + 4, 53, 38, 65, 49, 38, 68, 321, 49, 53, + 384, 38, 38, 0, 428, 423, 350, 256, 330, 331, + 434, 330, 331, 413, 395, 311, 312, 313, 314, 315, + 316, 317, 318, 319, 320, 336, 322, 323, 352, 6, + 251, 355, 170, 75, 312, 172, 315, 314, 173, 180, + 174, 316, 175, 20, 176, 22, 317, 266, 25, 26, + 318, 347, 266, -1, 264, -1, -1, -1, 35, 36, + -1, 38, 39, 385, 388, 397, 385, -1, -1, 393, + 392, -1, -1, 392, -1, -1, -1, -1, -1, 401, + -1, -1, 401, -1, 406, -1, -1, 406, -1, -1, + -1, -1, -1, -1, -1, 391, -1, 421, -1, -1, + 422, 423, -1, 427, -1, -1, -1, 429, -1, -1, + 429, -1, 1, 435, -1, 437, 435, -1, 437, 8, + -1, -1, 11, -1, -1, -1, -1, -1, 17, 18, + -1, -1, 21, -1, 23, 24, -1, 26, -1, 28, + -1, -1, -1, 120, 33, 34, -1, 36, -1, -1, 39, -1, -1, -1, -1, 44, 45, 46, -1, -1, - 49, -1, -1, 52, -1, -1, -1, -1, -1, 58, - 59, -1, 61, -1, 63, 64, 65, 3, -1, 68, - 6, -1, 8, 9, -1, 11, -1, 13, -1, -1, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, -1, -1, 32, 33, -1, 35, - -1, 37, 38, 39, -1, -1, -1, -1, 44, 45, - 46, -1, -1, 49, -1, -1, 52, -1, -1, -1, - -1, -1, 58, 59, -1, 61, -1, 63, 64, 65, - 3, -1, 68, 6, -1, 8, 9, -1, 11, -1, - 13, -1, -1, 16, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, -1, -1, 32, - 33, -1, 35, -1, 37, -1, 39, -1, -1, -1, + 49, 138, -1, 140, -1, -1, -1, -1, -1, 58, + 59, 1, 61, -1, 63, 64, 65, -1, -1, 68, + -1, -1, -1, -1, -1, 15, 16, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 31, 32, 1, -1, -1, 183, 184, 185, -1, + 40, 41, 42, 43, -1, -1, -1, 15, 16, -1, + 50, 51, -1, -1, 54, 55, 56, 57, -1, -1, + 60, -1, 62, 31, 32, -1, -1, 67, -1, -1, + -1, -1, 40, 41, 42, 43, -1, -1, -1, -1, + -1, -1, 50, 51, -1, -1, 54, 55, 56, 57, + -1, -1, 60, -1, 62, -1, -1, -1, -1, 67, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, -1, -1, + 33, 34, -1, 36, -1, 38, 39, -1, -1, -1, -1, 44, 45, 46, -1, -1, 49, -1, -1, 52, - -1, -1, -1, -1, -1, 58, 59, -1, 61, 8, - 63, 64, 65, -1, -1, 68, -1, 16, 17, -1, - -1, 20, -1, 22, 23, -1, 25, -1, 27, -1, - -1, -1, -1, 32, 33, -1, 35, -1, 37, -1, - 39, -1, -1, -1, -1, 44, 45, 46, -1, -1, - 49, -1, -1, -1, -1, -1, -1, -1, -1, 58, - 59, -1, 61, 8, 63, 64, 65, -1, -1, 68, - 69, 16, 17, -1, -1, 20, -1, 22, 23, -1, - 25, 26, 27, -1, -1, -1, -1, 32, 33, -1, - 35, -1, 37, -1, 39, -1, -1, -1, -1, 44, - 45, 46, -1, -1, 49, -1, -1, -1, -1, -1, - -1, -1, -1, 58, 59, -1, 61, 8, 63, 64, - 65, -1, -1, 68, -1, 16, 17, -1, -1, 20, - -1, 22, 23, -1, 25, -1, 27, -1, -1, -1, - -1, 32, 33, -1, 35, -1, 37, -1, 39, -1, + -1, -1, -1, -1, -1, 58, 59, -1, 61, -1, + 63, 64, 65, 3, -1, 68, 6, -1, 8, 9, + -1, 11, 12, -1, 14, -1, -1, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, -1, -1, 33, 34, 35, 36, -1, -1, 39, + -1, -1, -1, -1, 44, 45, 46, -1, -1, 49, + -1, -1, 52, -1, -1, -1, -1, -1, 58, 59, + -1, 61, -1, 63, 64, 65, 3, -1, 68, 6, + -1, 8, 9, -1, 11, 12, -1, 14, -1, -1, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, -1, -1, 33, 34, -1, 36, + -1, 38, 39, -1, -1, -1, -1, 44, 45, 46, + -1, -1, 49, -1, -1, 52, -1, -1, -1, -1, + -1, 58, 59, -1, 61, -1, 63, 64, 65, 3, + -1, 68, 6, -1, 8, 9, -1, 11, 12, -1, + 14, -1, -1, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, -1, -1, 33, + 34, -1, 36, -1, 38, 39, -1, -1, -1, -1, + 44, 45, 46, -1, -1, 49, -1, -1, 52, -1, + -1, -1, -1, -1, 58, 59, -1, 61, -1, 63, + 64, 65, 3, -1, 68, 6, -1, 8, 9, -1, + 11, 12, -1, 14, -1, -1, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + -1, -1, 33, 34, -1, 36, -1, -1, 39, -1, -1, -1, -1, 44, 45, 46, -1, -1, 49, -1, - -1, -1, -1, -1, -1, -1, -1, 58, 59, -1, - 61, 8, 63, 64, 65, 66, -1, 68, -1, 16, - 17, -1, -1, 20, -1, 22, 23, -1, 25, -1, - 27, -1, -1, -1, -1, 32, 33, -1, 35, -1, - 37, -1, 39, -1, -1, -1, -1, 44, 45, 46, - -1, -1, 49, 16, 17, -1, -1, 20, -1, 22, - 23, 58, 59, -1, 61, -1, 63, 64, 65, -1, - -1, 68, 35, -1, 37, -1, 39, -1, -1, -1, + -1, 52, -1, -1, -1, -1, 8, 58, 59, 11, + 61, -1, 63, 64, 65, 17, 18, 68, -1, 21, + -1, 23, 24, -1, 26, -1, 28, -1, -1, -1, + -1, 33, 34, -1, 36, -1, -1, 39, -1, -1, + -1, -1, 44, 45, 46, -1, -1, 49, -1, -1, + -1, -1, -1, -1, -1, 8, 58, 59, 11, 61, + -1, 63, 64, 65, 17, 18, 68, 69, 21, -1, + 23, 24, -1, 26, 27, 28, -1, -1, -1, -1, + 33, 34, -1, 36, -1, -1, 39, -1, -1, -1, -1, 44, 45, 46, -1, -1, 49, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, 61, -1, - -1, -1, 65, -1, -1, 68 + -1, -1, -1, -1, 8, 58, 59, 11, 61, -1, + 63, 64, 65, 17, 18, 68, -1, 21, -1, 23, + 24, -1, 26, -1, 28, -1, -1, -1, -1, 33, + 34, -1, 36, -1, -1, 39, -1, -1, -1, -1, + 44, 45, 46, -1, -1, 49, -1, -1, -1, 53, + -1, -1, -1, 8, 58, 59, 11, 61, -1, 63, + 64, 65, 17, 18, 68, -1, 21, -1, 23, 24, + -1, 26, -1, 28, -1, -1, -1, -1, 33, 34, + -1, 36, -1, -1, 39, -1, -1, -1, -1, 44, + 45, 46, -1, -1, 49, -1, -1, -1, -1, -1, + -1, -1, -1, 58, 59, -1, 61, -1, 63, 64, + 65, 66, 8, 68, -1, 11, -1, -1, -1, -1, + -1, 17, 18, -1, -1, 21, -1, 23, 24, -1, + 26, -1, 28, -1, -1, -1, -1, 33, 34, -1, + 36, -1, -1, 39, -1, -1, -1, -1, 44, 45, + 46, -1, -1, 49, -1, -1, -1, -1, -1, -1, + -1, -1, 58, 59, -1, 61, -1, 63, 64, 65, + -1, -1, 68, 3, 4, 5, 6, 7, 8, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, -1, -1, -1, -1, -1, -1, -1, 38, 39, + -1, -1, -1, -1, 44, -1, 46, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, -1, -1, -1, -1, -1, + -1, -1, -1, 39, -1, -1, -1, -1, 44, -1, + 46, 3, 4, 5, 6, 7, 8, 9, 10, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, -1, + -1, -1, -1, -1, -1, -1, -1, 39 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 71, 73, 0, 3, 6, 8, 9, 11, 13, - 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 32, 33, 34, 35, 37, 39, + 0, 71, 73, 0, 3, 6, 8, 9, 11, 12, + 14, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 33, 34, 35, 36, 39, 44, 45, 46, 49, 52, 58, 59, 61, 63, 64, 65, 68, 72, 74, 75, 79, 82, 83, 92, 93, 94, 95, 100, 101, 102, 103, 104, 105, 111, 112, 117, 121, 123, 125, 127, 129, 131, 133, 135, 137, 139, 140, 141, 142, 143, 144, 145, 146, 147, 150, - 151, 155, 159, 160, 39, 158, 158, 39, 49, 74, - 142, 144, 79, 1, 68, 162, 162, 145, 146, 115, - 117, 162, 117, 49, 82, 142, 39, 84, 86, 142, - 162, 162, 142, 142, 53, 38, 39, 44, 46, 79, - 80, 156, 157, 142, 142, 142, 142, 50, 66, 152, - 153, 154, 117, 47, 39, 162, 1, 50, 52, 161, - 31, 54, 30, 55, 56, 57, 41, 14, 15, 43, - 42, 58, 59, 60, 61, 62, 32, 33, 35, 40, - 51, 120, 65, 67, 68, 148, 65, 67, 148, 161, - 161, 38, 39, 44, 46, 28, 1, 116, 117, 26, - 118, 119, 122, 124, 126, 128, 130, 132, 134, 136, - 138, 139, 144, 148, 161, 117, 161, 38, 5, 12, - 113, 114, 51, 88, 89, 50, 161, 116, 117, 79, - 38, 79, 38, 50, 53, 50, 66, 50, 66, 121, - 69, 36, 162, 39, 77, 78, 121, 127, 121, 129, - 131, 133, 135, 137, 139, 139, 139, 140, 141, 141, - 142, 142, 142, 121, 121, 117, 39, 69, 121, 149, - 117, 39, 162, 1, 69, 163, 39, 85, 87, 96, - 50, 31, 54, 30, 55, 56, 57, 41, 15, 43, - 14, 51, 120, 163, 162, 82, 114, 121, 86, 163, - 163, 157, 121, 153, 154, 39, 78, 50, 163, 53, - 66, 50, 69, 66, 116, 79, 51, 90, 91, 50, - 98, 14, 1, 52, 164, 122, 144, 128, 122, 130, - 132, 134, 136, 138, 139, 139, 116, 122, 122, 49, - 106, 39, 79, 79, 53, 66, 121, 162, 163, 39, - 49, 121, 121, 163, 10, 122, 87, 164, 116, 115, - 53, 163, 4, 107, 108, 109, 163, 121, 78, 49, - 73, 76, 161, 79, 115, 163, 97, 122, 79, 117, - 7, 38, 110, 109, 82, 163, 76, 38, 99, 79, - 164, 53, 53, 107, 49, 38, 164, 115, 80, 81, - 81, 38, 76, 115, 163, 38, 163, 79, 79 + 151, 155, 161, 162, 39, 158, 158, 39, 49, 74, + 142, 144, 79, 1, 68, 164, 164, 145, 146, 115, + 117, 164, 117, 49, 82, 142, 39, 84, 86, 142, + 164, 164, 142, 142, 53, 3, 4, 5, 6, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 38, 39, 44, 46, 79, 80, 156, + 157, 159, 160, 142, 142, 142, 142, 50, 66, 152, + 153, 154, 117, 47, 39, 164, 1, 50, 52, 163, + 32, 54, 31, 55, 56, 57, 41, 15, 16, 43, + 42, 58, 59, 60, 61, 62, 33, 34, 36, 40, + 51, 120, 65, 67, 68, 148, 65, 67, 148, 163, + 163, 3, 6, 8, 9, 11, 12, 14, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 38, 39, 44, 46, 29, 1, 116, 117, + 27, 118, 119, 122, 124, 126, 128, 130, 132, 134, + 136, 138, 139, 144, 148, 163, 117, 163, 38, 5, + 13, 113, 114, 51, 88, 89, 50, 163, 116, 117, + 79, 38, 79, 38, 50, 53, 50, 66, 50, 66, + 121, 69, 37, 164, 39, 77, 78, 121, 127, 121, + 129, 131, 133, 135, 137, 139, 139, 139, 140, 141, + 141, 142, 142, 142, 121, 121, 117, 159, 69, 121, + 149, 117, 159, 164, 1, 69, 165, 39, 85, 87, + 96, 50, 32, 54, 31, 55, 56, 57, 41, 16, + 43, 15, 51, 120, 165, 164, 82, 114, 121, 86, + 165, 165, 157, 121, 153, 154, 39, 78, 50, 165, + 53, 66, 50, 69, 66, 116, 79, 51, 90, 91, + 50, 98, 15, 1, 52, 166, 122, 144, 128, 122, + 130, 132, 134, 136, 138, 139, 139, 116, 122, 122, + 49, 106, 39, 79, 79, 53, 66, 121, 164, 165, + 39, 49, 121, 121, 165, 10, 122, 87, 166, 116, + 115, 53, 165, 4, 107, 108, 109, 165, 121, 78, + 49, 73, 76, 163, 79, 115, 165, 97, 122, 79, + 117, 7, 38, 110, 109, 82, 165, 76, 38, 99, + 79, 166, 53, 53, 107, 49, 38, 166, 115, 80, + 81, 81, 38, 76, 115, 165, 38, 165, 79, 79 }; /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ @@ -1110,8 +1168,11 @@ static const yytype_uint8 yyr1[] = 147, 147, 148, 148, 149, 149, 150, 150, 150, 150, 150, 150, 151, 151, 151, 151, 152, 152, 153, 153, 154, 154, 155, 155, 156, 156, 157, 157, 157, 158, - 158, 159, 159, 159, 159, 159, 159, 160, 160, 160, - 161, 161, 162, 162, 163, 163, 164, 164 + 158, 159, 159, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, + 160, 161, 161, 161, 161, 161, 161, 162, 162, 162, + 163, 163, 164, 164, 165, 165, 166, 166 }; /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */ @@ -1138,6 +1199,9 @@ static const yytype_uint8 yyr2[] = 1, 3, 2, 3, 3, 5, 2, 4, 1, 2, 0, 1, 2, 3, 3, 5, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; @@ -1821,1281 +1885,1468 @@ yyreduce: switch (yyn) { case 2: -#line 253 "parser.y" /* yacc.c:1646 */ +#line 254 "parser.y" /* yacc.c:1646 */ { program_parsed(ctx, (yyvsp[-2].source_elements)); } -#line 1827 "parser.tab.c" /* yacc.c:1646 */ +#line 1891 "parser.tab.c" /* yacc.c:1646 */ break; case 3: -#line 256 "parser.y" /* yacc.c:1646 */ +#line 257 "parser.y" /* yacc.c:1646 */ {} -#line 1833 "parser.tab.c" /* yacc.c:1646 */ +#line 1897 "parser.tab.c" /* yacc.c:1646 */ break; case 4: -#line 257 "parser.y" /* yacc.c:1646 */ +#line 258 "parser.y" /* yacc.c:1646 */ {} -#line 1839 "parser.tab.c" /* yacc.c:1646 */ +#line 1903 "parser.tab.c" /* yacc.c:1646 */ break; case 5: -#line 261 "parser.y" /* yacc.c:1646 */ +#line 262 "parser.y" /* yacc.c:1646 */ { (yyval.source_elements) = new_source_elements(ctx); } -#line 1845 "parser.tab.c" /* yacc.c:1646 */ +#line 1909 "parser.tab.c" /* yacc.c:1646 */ break; case 6: -#line 263 "parser.y" /* yacc.c:1646 */ +#line 264 "parser.y" /* yacc.c:1646 */ { (yyval.source_elements) = source_elements_add_statement((yyvsp[-1].source_elements), (yyvsp[0].statement)); } -#line 1851 "parser.tab.c" /* yacc.c:1646 */ +#line 1915 "parser.tab.c" /* yacc.c:1646 */ break; case 7: -#line 268 "parser.y" /* yacc.c:1646 */ +#line 269 "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 1857 "parser.tab.c" /* yacc.c:1646 */ +#line 1921 "parser.tab.c" /* yacc.c:1646 */ break; case 8: -#line 270 "parser.y" /* yacc.c:1646 */ +#line 271 "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 1863 "parser.tab.c" /* yacc.c:1646 */ +#line 1927 "parser.tab.c" /* yacc.c:1646 */ break; case 9: -#line 272 "parser.y" /* yacc.c:1646 */ +#line 273 "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 1869 "parser.tab.c" /* yacc.c:1646 */ +#line 1933 "parser.tab.c" /* yacc.c:1646 */ break; case 10: -#line 275 "parser.y" /* yacc.c:1646 */ - { (yyval.srcptr) = (yyvsp[0].srcptr); } -#line 1875 "parser.tab.c" /* yacc.c:1646 */ +#line 276 "parser.y" /* yacc.c:1646 */ + { (yyval.srcptr) = ctx->ptr - 8; } +#line 1939 "parser.tab.c" /* yacc.c:1646 */ break; case 11: -#line 279 "parser.y" /* yacc.c:1646 */ +#line 280 "parser.y" /* yacc.c:1646 */ { (yyval.source_elements) = (yyvsp[0].source_elements); } -#line 1881 "parser.tab.c" /* yacc.c:1646 */ +#line 1945 "parser.tab.c" /* yacc.c:1646 */ break; case 12: -#line 283 "parser.y" /* yacc.c:1646 */ +#line 284 "parser.y" /* yacc.c:1646 */ { (yyval.parameter_list) = new_parameter_list(ctx, (yyvsp[0].identifier)); } -#line 1887 "parser.tab.c" /* yacc.c:1646 */ +#line 1951 "parser.tab.c" /* yacc.c:1646 */ break; case 13: -#line 285 "parser.y" /* yacc.c:1646 */ +#line 286 "parser.y" /* yacc.c:1646 */ { (yyval.parameter_list) = parameter_list_add(ctx, (yyvsp[-2].parameter_list), (yyvsp[0].identifier)); } -#line 1893 "parser.tab.c" /* yacc.c:1646 */ +#line 1957 "parser.tab.c" /* yacc.c:1646 */ break; case 14: -#line 289 "parser.y" /* yacc.c:1646 */ +#line 290 "parser.y" /* yacc.c:1646 */ { (yyval.parameter_list) = NULL; } -#line 1899 "parser.tab.c" /* yacc.c:1646 */ +#line 1963 "parser.tab.c" /* yacc.c:1646 */ break; case 15: -#line 290 "parser.y" /* yacc.c:1646 */ +#line 291 "parser.y" /* yacc.c:1646 */ { (yyval.parameter_list) = (yyvsp[0].parameter_list); } -#line 1905 "parser.tab.c" /* yacc.c:1646 */ +#line 1969 "parser.tab.c" /* yacc.c:1646 */ break; case 16: -#line 294 "parser.y" /* yacc.c:1646 */ +#line 295 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1911 "parser.tab.c" /* yacc.c:1646 */ +#line 1975 "parser.tab.c" /* yacc.c:1646 */ break; case 17: -#line 295 "parser.y" /* yacc.c:1646 */ +#line 296 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1917 "parser.tab.c" /* yacc.c:1646 */ +#line 1981 "parser.tab.c" /* yacc.c:1646 */ break; case 18: -#line 296 "parser.y" /* yacc.c:1646 */ +#line 297 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1923 "parser.tab.c" /* yacc.c:1646 */ +#line 1987 "parser.tab.c" /* yacc.c:1646 */ break; case 19: -#line 297 "parser.y" /* yacc.c:1646 */ +#line 298 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_expression_statement(ctx, (yyvsp[0].expr)); } -#line 1929 "parser.tab.c" /* yacc.c:1646 */ +#line 1993 "parser.tab.c" /* yacc.c:1646 */ break; case 20: -#line 298 "parser.y" /* yacc.c:1646 */ +#line 299 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1935 "parser.tab.c" /* yacc.c:1646 */ +#line 1999 "parser.tab.c" /* yacc.c:1646 */ break; case 21: -#line 299 "parser.y" /* yacc.c:1646 */ +#line 300 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1941 "parser.tab.c" /* yacc.c:1646 */ +#line 2005 "parser.tab.c" /* yacc.c:1646 */ break; case 22: -#line 300 "parser.y" /* yacc.c:1646 */ +#line 301 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1947 "parser.tab.c" /* yacc.c:1646 */ +#line 2011 "parser.tab.c" /* yacc.c:1646 */ break; case 23: -#line 301 "parser.y" /* yacc.c:1646 */ +#line 302 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1953 "parser.tab.c" /* yacc.c:1646 */ +#line 2017 "parser.tab.c" /* yacc.c:1646 */ break; case 24: -#line 302 "parser.y" /* yacc.c:1646 */ +#line 303 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1959 "parser.tab.c" /* yacc.c:1646 */ +#line 2023 "parser.tab.c" /* yacc.c:1646 */ break; case 25: -#line 303 "parser.y" /* yacc.c:1646 */ +#line 304 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1965 "parser.tab.c" /* yacc.c:1646 */ +#line 2029 "parser.tab.c" /* yacc.c:1646 */ break; case 26: -#line 304 "parser.y" /* yacc.c:1646 */ +#line 305 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1971 "parser.tab.c" /* yacc.c:1646 */ +#line 2035 "parser.tab.c" /* yacc.c:1646 */ break; case 27: -#line 305 "parser.y" /* yacc.c:1646 */ +#line 306 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1977 "parser.tab.c" /* yacc.c:1646 */ +#line 2041 "parser.tab.c" /* yacc.c:1646 */ break; case 28: -#line 306 "parser.y" /* yacc.c:1646 */ +#line 307 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1983 "parser.tab.c" /* yacc.c:1646 */ +#line 2047 "parser.tab.c" /* yacc.c:1646 */ break; case 29: -#line 307 "parser.y" /* yacc.c:1646 */ +#line 308 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1989 "parser.tab.c" /* yacc.c:1646 */ +#line 2053 "parser.tab.c" /* yacc.c:1646 */ break; case 30: -#line 308 "parser.y" /* yacc.c:1646 */ +#line 309 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 1995 "parser.tab.c" /* yacc.c:1646 */ +#line 2059 "parser.tab.c" /* yacc.c:1646 */ break; case 31: -#line 312 "parser.y" /* yacc.c:1646 */ +#line 313 "parser.y" /* yacc.c:1646 */ { (yyval.statement_list) = new_statement_list(ctx, (yyvsp[0].statement)); } -#line 2001 "parser.tab.c" /* yacc.c:1646 */ +#line 2065 "parser.tab.c" /* yacc.c:1646 */ break; case 32: -#line 314 "parser.y" /* yacc.c:1646 */ +#line 315 "parser.y" /* yacc.c:1646 */ { (yyval.statement_list) = statement_list_add((yyvsp[-1].statement_list), (yyvsp[0].statement)); } -#line 2007 "parser.tab.c" /* yacc.c:1646 */ +#line 2071 "parser.tab.c" /* yacc.c:1646 */ break; case 33: -#line 318 "parser.y" /* yacc.c:1646 */ +#line 319 "parser.y" /* yacc.c:1646 */ { (yyval.statement_list) = NULL; } -#line 2013 "parser.tab.c" /* yacc.c:1646 */ +#line 2077 "parser.tab.c" /* yacc.c:1646 */ break; case 34: -#line 319 "parser.y" /* yacc.c:1646 */ +#line 320 "parser.y" /* yacc.c:1646 */ { (yyval.statement_list) = (yyvsp[0].statement_list); } -#line 2019 "parser.tab.c" /* yacc.c:1646 */ +#line 2083 "parser.tab.c" /* yacc.c:1646 */ break; case 35: -#line 323 "parser.y" /* yacc.c:1646 */ +#line 324 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_block_statement(ctx, (yyvsp[-1].statement_list)); } -#line 2025 "parser.tab.c" /* yacc.c:1646 */ +#line 2089 "parser.tab.c" /* yacc.c:1646 */ break; case 36: -#line 324 "parser.y" /* yacc.c:1646 */ +#line 325 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_block_statement(ctx, NULL); } -#line 2031 "parser.tab.c" /* yacc.c:1646 */ +#line 2095 "parser.tab.c" /* yacc.c:1646 */ break; case 37: -#line 329 "parser.y" /* yacc.c:1646 */ +#line 330 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_var_statement(ctx, (yyvsp[-1].variable_list)); } -#line 2037 "parser.tab.c" /* yacc.c:1646 */ +#line 2101 "parser.tab.c" /* yacc.c:1646 */ break; case 38: -#line 333 "parser.y" /* yacc.c:1646 */ +#line 334 "parser.y" /* yacc.c:1646 */ { (yyval.variable_list) = new_variable_list(ctx, (yyvsp[0].variable_declaration)); } -#line 2043 "parser.tab.c" /* yacc.c:1646 */ +#line 2107 "parser.tab.c" /* yacc.c:1646 */ break; case 39: -#line 335 "parser.y" /* yacc.c:1646 */ +#line 336 "parser.y" /* yacc.c:1646 */ { (yyval.variable_list) = variable_list_add(ctx, (yyvsp[-2].variable_list), (yyvsp[0].variable_declaration)); } -#line 2049 "parser.tab.c" /* yacc.c:1646 */ +#line 2113 "parser.tab.c" /* yacc.c:1646 */ break; case 40: -#line 340 "parser.y" /* yacc.c:1646 */ +#line 341 "parser.y" /* yacc.c:1646 */ { (yyval.variable_list) = new_variable_list(ctx, (yyvsp[0].variable_declaration)); } -#line 2055 "parser.tab.c" /* yacc.c:1646 */ +#line 2119 "parser.tab.c" /* yacc.c:1646 */ break; case 41: -#line 342 "parser.y" /* yacc.c:1646 */ +#line 343 "parser.y" /* yacc.c:1646 */ { (yyval.variable_list) = variable_list_add(ctx, (yyvsp[-2].variable_list), (yyvsp[0].variable_declaration)); } -#line 2061 "parser.tab.c" /* yacc.c:1646 */ +#line 2125 "parser.tab.c" /* yacc.c:1646 */ break; case 42: -#line 347 "parser.y" /* yacc.c:1646 */ +#line 348 "parser.y" /* yacc.c:1646 */ { (yyval.variable_declaration) = new_variable_declaration(ctx, (yyvsp[-1].identifier), (yyvsp[0].expr)); } -#line 2067 "parser.tab.c" /* yacc.c:1646 */ +#line 2131 "parser.tab.c" /* yacc.c:1646 */ break; case 43: -#line 352 "parser.y" /* yacc.c:1646 */ +#line 353 "parser.y" /* yacc.c:1646 */ { (yyval.variable_declaration) = new_variable_declaration(ctx, (yyvsp[-1].identifier), (yyvsp[0].expr)); } -#line 2073 "parser.tab.c" /* yacc.c:1646 */ +#line 2137 "parser.tab.c" /* yacc.c:1646 */ break; case 44: -#line 356 "parser.y" /* yacc.c:1646 */ +#line 357 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = NULL; } -#line 2079 "parser.tab.c" /* yacc.c:1646 */ +#line 2143 "parser.tab.c" /* yacc.c:1646 */ break; case 45: -#line 357 "parser.y" /* yacc.c:1646 */ +#line 358 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2085 "parser.tab.c" /* yacc.c:1646 */ +#line 2149 "parser.tab.c" /* yacc.c:1646 */ break; case 46: -#line 362 "parser.y" /* yacc.c:1646 */ +#line 363 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2091 "parser.tab.c" /* yacc.c:1646 */ +#line 2155 "parser.tab.c" /* yacc.c:1646 */ break; case 47: -#line 366 "parser.y" /* yacc.c:1646 */ +#line 367 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = NULL; } -#line 2097 "parser.tab.c" /* yacc.c:1646 */ +#line 2161 "parser.tab.c" /* yacc.c:1646 */ break; case 48: -#line 367 "parser.y" /* yacc.c:1646 */ +#line 368 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2103 "parser.tab.c" /* yacc.c:1646 */ +#line 2167 "parser.tab.c" /* yacc.c:1646 */ break; case 49: -#line 372 "parser.y" /* yacc.c:1646 */ +#line 373 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2109 "parser.tab.c" /* yacc.c:1646 */ +#line 2173 "parser.tab.c" /* yacc.c:1646 */ break; case 50: -#line 376 "parser.y" /* yacc.c:1646 */ +#line 377 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_statement(ctx, STAT_EMPTY, 0); } -#line 2115 "parser.tab.c" /* yacc.c:1646 */ +#line 2179 "parser.tab.c" /* yacc.c:1646 */ break; case 51: -#line 381 "parser.y" /* yacc.c:1646 */ +#line 382 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_expression_statement(ctx, (yyvsp[-1].expr)); } -#line 2121 "parser.tab.c" /* yacc.c:1646 */ +#line 2185 "parser.tab.c" /* yacc.c:1646 */ break; case 52: -#line 386 "parser.y" /* yacc.c:1646 */ +#line 387 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_if_statement(ctx, (yyvsp[-4].expr), (yyvsp[-2].statement), (yyvsp[0].statement)); } -#line 2127 "parser.tab.c" /* yacc.c:1646 */ +#line 2191 "parser.tab.c" /* yacc.c:1646 */ break; case 53: -#line 388 "parser.y" /* yacc.c:1646 */ +#line 389 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_if_statement(ctx, (yyvsp[-2].expr), (yyvsp[0].statement), NULL); } -#line 2133 "parser.tab.c" /* yacc.c:1646 */ +#line 2197 "parser.tab.c" /* yacc.c:1646 */ break; case 54: -#line 393 "parser.y" /* yacc.c:1646 */ +#line 394 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_while_statement(ctx, TRUE, (yyvsp[-2].expr), (yyvsp[-5].statement)); } -#line 2139 "parser.tab.c" /* yacc.c:1646 */ +#line 2203 "parser.tab.c" /* yacc.c:1646 */ break; case 55: -#line 395 "parser.y" /* yacc.c:1646 */ +#line 396 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_while_statement(ctx, FALSE, (yyvsp[-2].expr), (yyvsp[0].statement)); } -#line 2145 "parser.tab.c" /* yacc.c:1646 */ +#line 2209 "parser.tab.c" /* yacc.c:1646 */ break; case 56: -#line 397 "parser.y" /* yacc.c:1646 */ +#line 398 "parser.y" /* yacc.c:1646 */ { if(!explicit_error(ctx, (yyvsp[0].expr), ';')) YYABORT; } -#line 2151 "parser.tab.c" /* yacc.c:1646 */ +#line 2215 "parser.tab.c" /* yacc.c:1646 */ break; case 57: -#line 399 "parser.y" /* yacc.c:1646 */ +#line 400 "parser.y" /* yacc.c:1646 */ { if(!explicit_error(ctx, (yyvsp[0].expr), ';')) YYABORT; } -#line 2157 "parser.tab.c" /* yacc.c:1646 */ +#line 2221 "parser.tab.c" /* yacc.c:1646 */ break; case 58: -#line 401 "parser.y" /* yacc.c:1646 */ +#line 402 "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 2163 "parser.tab.c" /* yacc.c:1646 */ +#line 2227 "parser.tab.c" /* yacc.c:1646 */ break; case 59: -#line 403 "parser.y" /* yacc.c:1646 */ +#line 404 "parser.y" /* yacc.c:1646 */ { if(!explicit_error(ctx, (yyvsp[0].variable_list), ';')) YYABORT; } -#line 2169 "parser.tab.c" /* yacc.c:1646 */ +#line 2233 "parser.tab.c" /* yacc.c:1646 */ break; case 60: -#line 405 "parser.y" /* yacc.c:1646 */ +#line 406 "parser.y" /* yacc.c:1646 */ { if(!explicit_error(ctx, (yyvsp[0].expr), ';')) YYABORT; } -#line 2175 "parser.tab.c" /* yacc.c:1646 */ +#line 2239 "parser.tab.c" /* yacc.c:1646 */ break; case 61: -#line 407 "parser.y" /* yacc.c:1646 */ +#line 408 "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 2181 "parser.tab.c" /* yacc.c:1646 */ +#line 2245 "parser.tab.c" /* yacc.c:1646 */ break; case 62: -#line 409 "parser.y" /* yacc.c:1646 */ +#line 410 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_forin_statement(ctx, NULL, (yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].statement)); } -#line 2187 "parser.tab.c" /* yacc.c:1646 */ +#line 2251 "parser.tab.c" /* yacc.c:1646 */ break; case 63: -#line 411 "parser.y" /* yacc.c:1646 */ +#line 412 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_forin_statement(ctx, (yyvsp[-4].variable_declaration), NULL, (yyvsp[-2].expr), (yyvsp[0].statement)); } -#line 2193 "parser.tab.c" /* yacc.c:1646 */ +#line 2257 "parser.tab.c" /* yacc.c:1646 */ break; case 64: -#line 416 "parser.y" /* yacc.c:1646 */ +#line 417 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_continue_statement(ctx, (yyvsp[-1].identifier)); } -#line 2199 "parser.tab.c" /* yacc.c:1646 */ +#line 2263 "parser.tab.c" /* yacc.c:1646 */ break; case 65: -#line 421 "parser.y" /* yacc.c:1646 */ +#line 422 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_break_statement(ctx, (yyvsp[-1].identifier)); } -#line 2205 "parser.tab.c" /* yacc.c:1646 */ +#line 2269 "parser.tab.c" /* yacc.c:1646 */ break; case 66: -#line 426 "parser.y" /* yacc.c:1646 */ +#line 427 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_return_statement(ctx, (yyvsp[-1].expr)); } -#line 2211 "parser.tab.c" /* yacc.c:1646 */ +#line 2275 "parser.tab.c" /* yacc.c:1646 */ break; case 67: -#line 431 "parser.y" /* yacc.c:1646 */ +#line 432 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_with_statement(ctx, (yyvsp[-2].expr), (yyvsp[0].statement)); } -#line 2217 "parser.tab.c" /* yacc.c:1646 */ +#line 2281 "parser.tab.c" /* yacc.c:1646 */ break; case 68: -#line 436 "parser.y" /* yacc.c:1646 */ +#line 437 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_labelled_statement(ctx, (yyvsp[-2].identifier), (yyvsp[0].statement)); } -#line 2223 "parser.tab.c" /* yacc.c:1646 */ +#line 2287 "parser.tab.c" /* yacc.c:1646 */ break; case 69: -#line 441 "parser.y" /* yacc.c:1646 */ +#line 442 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_switch_statement(ctx, (yyvsp[-2].expr), (yyvsp[0].case_clausule)); } -#line 2229 "parser.tab.c" /* yacc.c:1646 */ +#line 2293 "parser.tab.c" /* yacc.c:1646 */ break; case 70: -#line 446 "parser.y" /* yacc.c:1646 */ +#line 447 "parser.y" /* yacc.c:1646 */ { (yyval.case_clausule) = new_case_block(ctx, (yyvsp[-1].case_list), NULL, NULL); } -#line 2235 "parser.tab.c" /* yacc.c:1646 */ +#line 2299 "parser.tab.c" /* yacc.c:1646 */ break; case 71: -#line 448 "parser.y" /* yacc.c:1646 */ +#line 449 "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 2241 "parser.tab.c" /* yacc.c:1646 */ +#line 2305 "parser.tab.c" /* yacc.c:1646 */ break; case 72: -#line 452 "parser.y" /* yacc.c:1646 */ +#line 453 "parser.y" /* yacc.c:1646 */ { (yyval.case_list) = NULL; } -#line 2247 "parser.tab.c" /* yacc.c:1646 */ +#line 2311 "parser.tab.c" /* yacc.c:1646 */ break; case 73: -#line 453 "parser.y" /* yacc.c:1646 */ +#line 454 "parser.y" /* yacc.c:1646 */ { (yyval.case_list) = (yyvsp[0].case_list); } -#line 2253 "parser.tab.c" /* yacc.c:1646 */ +#line 2317 "parser.tab.c" /* yacc.c:1646 */ break; case 74: -#line 457 "parser.y" /* yacc.c:1646 */ +#line 458 "parser.y" /* yacc.c:1646 */ { (yyval.case_list) = new_case_list(ctx, (yyvsp[0].case_clausule)); } -#line 2259 "parser.tab.c" /* yacc.c:1646 */ +#line 2323 "parser.tab.c" /* yacc.c:1646 */ break; case 75: -#line 459 "parser.y" /* yacc.c:1646 */ +#line 460 "parser.y" /* yacc.c:1646 */ { (yyval.case_list) = case_list_add(ctx, (yyvsp[-1].case_list), (yyvsp[0].case_clausule)); } -#line 2265 "parser.tab.c" /* yacc.c:1646 */ +#line 2329 "parser.tab.c" /* yacc.c:1646 */ break; case 76: -#line 464 "parser.y" /* yacc.c:1646 */ +#line 465 "parser.y" /* yacc.c:1646 */ { (yyval.case_clausule) = new_case_clausule(ctx, (yyvsp[-2].expr), (yyvsp[0].statement_list)); } -#line 2271 "parser.tab.c" /* yacc.c:1646 */ +#line 2335 "parser.tab.c" /* yacc.c:1646 */ break; case 77: -#line 469 "parser.y" /* yacc.c:1646 */ +#line 470 "parser.y" /* yacc.c:1646 */ { (yyval.case_clausule) = new_case_clausule(ctx, NULL, (yyvsp[0].statement_list)); } -#line 2277 "parser.tab.c" /* yacc.c:1646 */ +#line 2341 "parser.tab.c" /* yacc.c:1646 */ break; case 78: -#line 474 "parser.y" /* yacc.c:1646 */ +#line 475 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_throw_statement(ctx, (yyvsp[-1].expr)); } -#line 2283 "parser.tab.c" /* yacc.c:1646 */ +#line 2347 "parser.tab.c" /* yacc.c:1646 */ break; case 79: -#line 478 "parser.y" /* yacc.c:1646 */ +#line 479 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_try_statement(ctx, (yyvsp[-1].statement), (yyvsp[0].catch_block), NULL); } -#line 2289 "parser.tab.c" /* yacc.c:1646 */ +#line 2353 "parser.tab.c" /* yacc.c:1646 */ break; case 80: -#line 479 "parser.y" /* yacc.c:1646 */ +#line 480 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_try_statement(ctx, (yyvsp[-1].statement), NULL, (yyvsp[0].statement)); } -#line 2295 "parser.tab.c" /* yacc.c:1646 */ +#line 2359 "parser.tab.c" /* yacc.c:1646 */ break; case 81: -#line 481 "parser.y" /* yacc.c:1646 */ +#line 482 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = new_try_statement(ctx, (yyvsp[-2].statement), (yyvsp[-1].catch_block), (yyvsp[0].statement)); } -#line 2301 "parser.tab.c" /* yacc.c:1646 */ +#line 2365 "parser.tab.c" /* yacc.c:1646 */ break; case 82: -#line 486 "parser.y" /* yacc.c:1646 */ +#line 487 "parser.y" /* yacc.c:1646 */ { (yyval.catch_block) = new_catch_block(ctx, (yyvsp[-2].identifier), (yyvsp[0].statement)); } -#line 2307 "parser.tab.c" /* yacc.c:1646 */ +#line 2371 "parser.tab.c" /* yacc.c:1646 */ break; case 83: -#line 490 "parser.y" /* yacc.c:1646 */ +#line 491 "parser.y" /* yacc.c:1646 */ { (yyval.statement) = (yyvsp[0].statement); } -#line 2313 "parser.tab.c" /* yacc.c:1646 */ +#line 2377 "parser.tab.c" /* yacc.c:1646 */ break; case 84: -#line 494 "parser.y" /* yacc.c:1646 */ +#line 495 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = NULL; } -#line 2319 "parser.tab.c" /* yacc.c:1646 */ +#line 2383 "parser.tab.c" /* yacc.c:1646 */ break; case 85: -#line 495 "parser.y" /* yacc.c:1646 */ +#line 496 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2325 "parser.tab.c" /* yacc.c:1646 */ +#line 2389 "parser.tab.c" /* yacc.c:1646 */ break; case 86: -#line 498 "parser.y" /* yacc.c:1646 */ +#line 499 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2331 "parser.tab.c" /* yacc.c:1646 */ +#line 2395 "parser.tab.c" /* yacc.c:1646 */ break; case 87: -#line 499 "parser.y" /* yacc.c:1646 */ +#line 500 "parser.y" /* yacc.c:1646 */ { set_error(ctx, JS_E_SYNTAX); YYABORT; } -#line 2337 "parser.tab.c" /* yacc.c:1646 */ +#line 2401 "parser.tab.c" /* yacc.c:1646 */ break; case 88: -#line 503 "parser.y" /* yacc.c:1646 */ +#line 504 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2343 "parser.tab.c" /* yacc.c:1646 */ +#line 2407 "parser.tab.c" /* yacc.c:1646 */ break; case 89: -#line 505 "parser.y" /* yacc.c:1646 */ +#line 506 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_COMMA, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2349 "parser.tab.c" /* yacc.c:1646 */ +#line 2413 "parser.tab.c" /* yacc.c:1646 */ break; case 90: -#line 509 "parser.y" /* yacc.c:1646 */ +#line 510 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = NULL; } -#line 2355 "parser.tab.c" /* yacc.c:1646 */ +#line 2419 "parser.tab.c" /* yacc.c:1646 */ break; case 91: -#line 510 "parser.y" /* yacc.c:1646 */ +#line 511 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2361 "parser.tab.c" /* yacc.c:1646 */ +#line 2425 "parser.tab.c" /* yacc.c:1646 */ break; case 92: -#line 515 "parser.y" /* yacc.c:1646 */ +#line 516 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2367 "parser.tab.c" /* yacc.c:1646 */ +#line 2431 "parser.tab.c" /* yacc.c:1646 */ break; case 93: -#line 517 "parser.y" /* yacc.c:1646 */ +#line 518 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_COMMA, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2373 "parser.tab.c" /* yacc.c:1646 */ +#line 2437 "parser.tab.c" /* yacc.c:1646 */ break; case 94: -#line 520 "parser.y" /* yacc.c:1646 */ +#line 521 "parser.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } -#line 2379 "parser.tab.c" /* yacc.c:1646 */ +#line 2443 "parser.tab.c" /* yacc.c:1646 */ break; case 95: -#line 521 "parser.y" /* yacc.c:1646 */ +#line 522 "parser.y" /* yacc.c:1646 */ { (yyval.ival) = EXPR_ASSIGNDIV; } -#line 2385 "parser.tab.c" /* yacc.c:1646 */ +#line 2449 "parser.tab.c" /* yacc.c:1646 */ break; case 96: -#line 525 "parser.y" /* yacc.c:1646 */ +#line 526 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2391 "parser.tab.c" /* yacc.c:1646 */ +#line 2455 "parser.tab.c" /* yacc.c:1646 */ break; case 97: -#line 527 "parser.y" /* yacc.c:1646 */ +#line 528 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_ASSIGN, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2397 "parser.tab.c" /* yacc.c:1646 */ +#line 2461 "parser.tab.c" /* yacc.c:1646 */ break; case 98: -#line 529 "parser.y" /* yacc.c:1646 */ +#line 530 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2403 "parser.tab.c" /* yacc.c:1646 */ +#line 2467 "parser.tab.c" /* yacc.c:1646 */ break; case 99: -#line 534 "parser.y" /* yacc.c:1646 */ +#line 535 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2409 "parser.tab.c" /* yacc.c:1646 */ +#line 2473 "parser.tab.c" /* yacc.c:1646 */ break; case 100: -#line 536 "parser.y" /* yacc.c:1646 */ +#line 537 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_ASSIGN, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2415 "parser.tab.c" /* yacc.c:1646 */ +#line 2479 "parser.tab.c" /* yacc.c:1646 */ break; case 101: -#line 538 "parser.y" /* yacc.c:1646 */ +#line 539 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2421 "parser.tab.c" /* yacc.c:1646 */ +#line 2485 "parser.tab.c" /* yacc.c:1646 */ break; case 102: -#line 542 "parser.y" /* yacc.c:1646 */ +#line 543 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2427 "parser.tab.c" /* yacc.c:1646 */ +#line 2491 "parser.tab.c" /* yacc.c:1646 */ break; case 103: -#line 544 "parser.y" /* yacc.c:1646 */ +#line 545 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_conditional_expression(ctx, (yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2433 "parser.tab.c" /* yacc.c:1646 */ +#line 2497 "parser.tab.c" /* yacc.c:1646 */ break; case 104: -#line 549 "parser.y" /* yacc.c:1646 */ +#line 550 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2439 "parser.tab.c" /* yacc.c:1646 */ +#line 2503 "parser.tab.c" /* yacc.c:1646 */ break; case 105: -#line 551 "parser.y" /* yacc.c:1646 */ +#line 552 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_conditional_expression(ctx, (yyvsp[-4].expr), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2445 "parser.tab.c" /* yacc.c:1646 */ +#line 2509 "parser.tab.c" /* yacc.c:1646 */ break; case 106: -#line 555 "parser.y" /* yacc.c:1646 */ +#line 556 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2451 "parser.tab.c" /* yacc.c:1646 */ +#line 2515 "parser.tab.c" /* yacc.c:1646 */ break; case 107: -#line 557 "parser.y" /* yacc.c:1646 */ +#line 558 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2457 "parser.tab.c" /* yacc.c:1646 */ +#line 2521 "parser.tab.c" /* yacc.c:1646 */ break; case 108: -#line 562 "parser.y" /* yacc.c:1646 */ +#line 563 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2463 "parser.tab.c" /* yacc.c:1646 */ +#line 2527 "parser.tab.c" /* yacc.c:1646 */ break; case 109: -#line 564 "parser.y" /* yacc.c:1646 */ +#line 565 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_OR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2469 "parser.tab.c" /* yacc.c:1646 */ +#line 2533 "parser.tab.c" /* yacc.c:1646 */ break; case 110: -#line 568 "parser.y" /* yacc.c:1646 */ +#line 569 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2475 "parser.tab.c" /* yacc.c:1646 */ +#line 2539 "parser.tab.c" /* yacc.c:1646 */ break; case 111: -#line 570 "parser.y" /* yacc.c:1646 */ +#line 571 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2481 "parser.tab.c" /* yacc.c:1646 */ +#line 2545 "parser.tab.c" /* yacc.c:1646 */ break; case 112: -#line 575 "parser.y" /* yacc.c:1646 */ +#line 576 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2487 "parser.tab.c" /* yacc.c:1646 */ +#line 2551 "parser.tab.c" /* yacc.c:1646 */ break; case 113: -#line 577 "parser.y" /* yacc.c:1646 */ +#line 578 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_AND, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2493 "parser.tab.c" /* yacc.c:1646 */ +#line 2557 "parser.tab.c" /* yacc.c:1646 */ break; case 114: -#line 581 "parser.y" /* yacc.c:1646 */ +#line 582 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2499 "parser.tab.c" /* yacc.c:1646 */ +#line 2563 "parser.tab.c" /* yacc.c:1646 */ break; case 115: -#line 583 "parser.y" /* yacc.c:1646 */ +#line 584 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_BOR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2505 "parser.tab.c" /* yacc.c:1646 */ +#line 2569 "parser.tab.c" /* yacc.c:1646 */ break; case 116: -#line 588 "parser.y" /* yacc.c:1646 */ +#line 589 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2511 "parser.tab.c" /* yacc.c:1646 */ +#line 2575 "parser.tab.c" /* yacc.c:1646 */ break; case 117: -#line 590 "parser.y" /* yacc.c:1646 */ +#line 591 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_BOR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2517 "parser.tab.c" /* yacc.c:1646 */ +#line 2581 "parser.tab.c" /* yacc.c:1646 */ break; case 118: -#line 594 "parser.y" /* yacc.c:1646 */ +#line 595 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2523 "parser.tab.c" /* yacc.c:1646 */ +#line 2587 "parser.tab.c" /* yacc.c:1646 */ break; case 119: -#line 596 "parser.y" /* yacc.c:1646 */ +#line 597 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_BXOR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2529 "parser.tab.c" /* yacc.c:1646 */ +#line 2593 "parser.tab.c" /* yacc.c:1646 */ break; case 120: -#line 601 "parser.y" /* yacc.c:1646 */ +#line 602 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2535 "parser.tab.c" /* yacc.c:1646 */ +#line 2599 "parser.tab.c" /* yacc.c:1646 */ break; case 121: -#line 603 "parser.y" /* yacc.c:1646 */ +#line 604 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_BXOR, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2541 "parser.tab.c" /* yacc.c:1646 */ +#line 2605 "parser.tab.c" /* yacc.c:1646 */ break; case 122: -#line 607 "parser.y" /* yacc.c:1646 */ +#line 608 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2547 "parser.tab.c" /* yacc.c:1646 */ +#line 2611 "parser.tab.c" /* yacc.c:1646 */ break; case 123: -#line 609 "parser.y" /* yacc.c:1646 */ +#line 610 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_BAND, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2553 "parser.tab.c" /* yacc.c:1646 */ +#line 2617 "parser.tab.c" /* yacc.c:1646 */ break; case 124: -#line 614 "parser.y" /* yacc.c:1646 */ +#line 615 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2559 "parser.tab.c" /* yacc.c:1646 */ +#line 2623 "parser.tab.c" /* yacc.c:1646 */ break; case 125: -#line 616 "parser.y" /* yacc.c:1646 */ +#line 617 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_BAND, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2565 "parser.tab.c" /* yacc.c:1646 */ +#line 2629 "parser.tab.c" /* yacc.c:1646 */ break; case 126: -#line 620 "parser.y" /* yacc.c:1646 */ +#line 621 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2571 "parser.tab.c" /* yacc.c:1646 */ +#line 2635 "parser.tab.c" /* yacc.c:1646 */ break; case 127: -#line 622 "parser.y" /* yacc.c:1646 */ +#line 623 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2577 "parser.tab.c" /* yacc.c:1646 */ +#line 2641 "parser.tab.c" /* yacc.c:1646 */ break; case 128: -#line 626 "parser.y" /* yacc.c:1646 */ +#line 627 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2583 "parser.tab.c" /* yacc.c:1646 */ +#line 2647 "parser.tab.c" /* yacc.c:1646 */ break; case 129: -#line 628 "parser.y" /* yacc.c:1646 */ +#line 629 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2589 "parser.tab.c" /* yacc.c:1646 */ +#line 2653 "parser.tab.c" /* yacc.c:1646 */ break; case 130: -#line 632 "parser.y" /* yacc.c:1646 */ +#line 633 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2595 "parser.tab.c" /* yacc.c:1646 */ +#line 2659 "parser.tab.c" /* yacc.c:1646 */ break; case 131: -#line 634 "parser.y" /* yacc.c:1646 */ +#line 635 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2601 "parser.tab.c" /* yacc.c:1646 */ +#line 2665 "parser.tab.c" /* yacc.c:1646 */ break; case 132: -#line 636 "parser.y" /* yacc.c:1646 */ +#line 637 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_INSTANCEOF, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2607 "parser.tab.c" /* yacc.c:1646 */ +#line 2671 "parser.tab.c" /* yacc.c:1646 */ break; case 133: -#line 638 "parser.y" /* yacc.c:1646 */ +#line 639 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_IN, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2613 "parser.tab.c" /* yacc.c:1646 */ +#line 2677 "parser.tab.c" /* yacc.c:1646 */ break; case 134: -#line 642 "parser.y" /* yacc.c:1646 */ +#line 643 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2619 "parser.tab.c" /* yacc.c:1646 */ +#line 2683 "parser.tab.c" /* yacc.c:1646 */ break; case 135: -#line 644 "parser.y" /* yacc.c:1646 */ +#line 645 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2625 "parser.tab.c" /* yacc.c:1646 */ +#line 2689 "parser.tab.c" /* yacc.c:1646 */ break; case 136: -#line 646 "parser.y" /* yacc.c:1646 */ +#line 647 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_INSTANCEOF, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2631 "parser.tab.c" /* yacc.c:1646 */ +#line 2695 "parser.tab.c" /* yacc.c:1646 */ break; case 137: -#line 650 "parser.y" /* yacc.c:1646 */ +#line 651 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2637 "parser.tab.c" /* yacc.c:1646 */ +#line 2701 "parser.tab.c" /* yacc.c:1646 */ break; case 138: -#line 652 "parser.y" /* yacc.c:1646 */ +#line 653 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, (yyvsp[-1].ival), (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2643 "parser.tab.c" /* yacc.c:1646 */ +#line 2707 "parser.tab.c" /* yacc.c:1646 */ break; case 139: -#line 657 "parser.y" /* yacc.c:1646 */ +#line 658 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2649 "parser.tab.c" /* yacc.c:1646 */ +#line 2713 "parser.tab.c" /* yacc.c:1646 */ break; case 140: -#line 659 "parser.y" /* yacc.c:1646 */ +#line 660 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_ADD, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2655 "parser.tab.c" /* yacc.c:1646 */ +#line 2719 "parser.tab.c" /* yacc.c:1646 */ break; case 141: -#line 661 "parser.y" /* yacc.c:1646 */ +#line 662 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_SUB, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2661 "parser.tab.c" /* yacc.c:1646 */ +#line 2725 "parser.tab.c" /* yacc.c:1646 */ break; case 142: -#line 665 "parser.y" /* yacc.c:1646 */ +#line 666 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2667 "parser.tab.c" /* yacc.c:1646 */ +#line 2731 "parser.tab.c" /* yacc.c:1646 */ break; case 143: -#line 667 "parser.y" /* yacc.c:1646 */ +#line 668 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_MUL, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2673 "parser.tab.c" /* yacc.c:1646 */ +#line 2737 "parser.tab.c" /* yacc.c:1646 */ break; case 144: -#line 669 "parser.y" /* yacc.c:1646 */ +#line 670 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_DIV, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2679 "parser.tab.c" /* yacc.c:1646 */ +#line 2743 "parser.tab.c" /* yacc.c:1646 */ break; case 145: -#line 671 "parser.y" /* yacc.c:1646 */ +#line 672 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_MOD, (yyvsp[-2].expr), (yyvsp[0].expr)); } -#line 2685 "parser.tab.c" /* yacc.c:1646 */ +#line 2749 "parser.tab.c" /* yacc.c:1646 */ break; case 146: -#line 675 "parser.y" /* yacc.c:1646 */ +#line 676 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2691 "parser.tab.c" /* yacc.c:1646 */ +#line 2755 "parser.tab.c" /* yacc.c:1646 */ break; case 147: -#line 677 "parser.y" /* yacc.c:1646 */ +#line 678 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_DELETE, (yyvsp[0].expr)); } -#line 2697 "parser.tab.c" /* yacc.c:1646 */ +#line 2761 "parser.tab.c" /* yacc.c:1646 */ break; case 148: -#line 678 "parser.y" /* yacc.c:1646 */ +#line 679 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_VOID, (yyvsp[0].expr)); } -#line 2703 "parser.tab.c" /* yacc.c:1646 */ +#line 2767 "parser.tab.c" /* yacc.c:1646 */ break; case 149: -#line 680 "parser.y" /* yacc.c:1646 */ +#line 681 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_TYPEOF, (yyvsp[0].expr)); } -#line 2709 "parser.tab.c" /* yacc.c:1646 */ +#line 2773 "parser.tab.c" /* yacc.c:1646 */ break; case 150: -#line 681 "parser.y" /* yacc.c:1646 */ +#line 682 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_PREINC, (yyvsp[0].expr)); } -#line 2715 "parser.tab.c" /* yacc.c:1646 */ +#line 2779 "parser.tab.c" /* yacc.c:1646 */ break; case 151: -#line 682 "parser.y" /* yacc.c:1646 */ +#line 683 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_PREDEC, (yyvsp[0].expr)); } -#line 2721 "parser.tab.c" /* yacc.c:1646 */ +#line 2785 "parser.tab.c" /* yacc.c:1646 */ break; case 152: -#line 683 "parser.y" /* yacc.c:1646 */ +#line 684 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_PLUS, (yyvsp[0].expr)); } -#line 2727 "parser.tab.c" /* yacc.c:1646 */ +#line 2791 "parser.tab.c" /* yacc.c:1646 */ break; case 153: -#line 684 "parser.y" /* yacc.c:1646 */ +#line 685 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_MINUS, (yyvsp[0].expr)); } -#line 2733 "parser.tab.c" /* yacc.c:1646 */ +#line 2797 "parser.tab.c" /* yacc.c:1646 */ break; case 154: -#line 685 "parser.y" /* yacc.c:1646 */ +#line 686 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_BITNEG, (yyvsp[0].expr)); } -#line 2739 "parser.tab.c" /* yacc.c:1646 */ +#line 2803 "parser.tab.c" /* yacc.c:1646 */ break; case 155: -#line 686 "parser.y" /* yacc.c:1646 */ +#line 687 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_LOGNEG, (yyvsp[0].expr)); } -#line 2745 "parser.tab.c" /* yacc.c:1646 */ +#line 2809 "parser.tab.c" /* yacc.c:1646 */ break; case 156: -#line 691 "parser.y" /* yacc.c:1646 */ +#line 692 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2751 "parser.tab.c" /* yacc.c:1646 */ +#line 2815 "parser.tab.c" /* yacc.c:1646 */ break; case 157: -#line 693 "parser.y" /* yacc.c:1646 */ +#line 694 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_POSTINC, (yyvsp[-1].expr)); } -#line 2757 "parser.tab.c" /* yacc.c:1646 */ +#line 2821 "parser.tab.c" /* yacc.c:1646 */ break; case 158: -#line 695 "parser.y" /* yacc.c:1646 */ +#line 696 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_unary_expression(ctx, EXPR_POSTDEC, (yyvsp[-1].expr)); } -#line 2763 "parser.tab.c" /* yacc.c:1646 */ +#line 2827 "parser.tab.c" /* yacc.c:1646 */ break; case 159: -#line 700 "parser.y" /* yacc.c:1646 */ +#line 701 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2769 "parser.tab.c" /* yacc.c:1646 */ +#line 2833 "parser.tab.c" /* yacc.c:1646 */ break; case 160: -#line 701 "parser.y" /* yacc.c:1646 */ +#line 702 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2775 "parser.tab.c" /* yacc.c:1646 */ +#line 2839 "parser.tab.c" /* yacc.c:1646 */ break; case 161: -#line 705 "parser.y" /* yacc.c:1646 */ +#line 706 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2781 "parser.tab.c" /* yacc.c:1646 */ +#line 2845 "parser.tab.c" /* yacc.c:1646 */ break; case 162: -#line 706 "parser.y" /* yacc.c:1646 */ +#line 707 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_new_expression(ctx, (yyvsp[0].expr), NULL); } -#line 2787 "parser.tab.c" /* yacc.c:1646 */ +#line 2851 "parser.tab.c" /* yacc.c:1646 */ break; case 163: -#line 710 "parser.y" /* yacc.c:1646 */ +#line 711 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2793 "parser.tab.c" /* yacc.c:1646 */ +#line 2857 "parser.tab.c" /* yacc.c:1646 */ break; case 164: -#line 711 "parser.y" /* yacc.c:1646 */ +#line 712 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2799 "parser.tab.c" /* yacc.c:1646 */ +#line 2863 "parser.tab.c" /* yacc.c:1646 */ break; case 165: -#line 713 "parser.y" /* yacc.c:1646 */ +#line 714 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_ARRAY, (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 2805 "parser.tab.c" /* yacc.c:1646 */ +#line 2869 "parser.tab.c" /* yacc.c:1646 */ break; case 166: -#line 715 "parser.y" /* yacc.c:1646 */ +#line 716 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_member_expression(ctx, (yyvsp[-2].expr), (yyvsp[0].identifier)); } -#line 2811 "parser.tab.c" /* yacc.c:1646 */ +#line 2875 "parser.tab.c" /* yacc.c:1646 */ break; case 167: -#line 717 "parser.y" /* yacc.c:1646 */ +#line 718 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_new_expression(ctx, (yyvsp[-1].expr), (yyvsp[0].argument_list)); } -#line 2817 "parser.tab.c" /* yacc.c:1646 */ +#line 2881 "parser.tab.c" /* yacc.c:1646 */ break; case 168: -#line 722 "parser.y" /* yacc.c:1646 */ +#line 723 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_call_expression(ctx, (yyvsp[-1].expr), (yyvsp[0].argument_list)); } -#line 2823 "parser.tab.c" /* yacc.c:1646 */ +#line 2887 "parser.tab.c" /* yacc.c:1646 */ break; case 169: -#line 724 "parser.y" /* yacc.c:1646 */ +#line 725 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_call_expression(ctx, (yyvsp[-1].expr), (yyvsp[0].argument_list)); } -#line 2829 "parser.tab.c" /* yacc.c:1646 */ +#line 2893 "parser.tab.c" /* yacc.c:1646 */ break; case 170: -#line 726 "parser.y" /* yacc.c:1646 */ +#line 727 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_binary_expression(ctx, EXPR_ARRAY, (yyvsp[-3].expr), (yyvsp[-1].expr)); } -#line 2835 "parser.tab.c" /* yacc.c:1646 */ +#line 2899 "parser.tab.c" /* yacc.c:1646 */ break; case 171: -#line 728 "parser.y" /* yacc.c:1646 */ +#line 729 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_member_expression(ctx, (yyvsp[-2].expr), (yyvsp[0].identifier)); } -#line 2841 "parser.tab.c" /* yacc.c:1646 */ +#line 2905 "parser.tab.c" /* yacc.c:1646 */ break; case 172: -#line 732 "parser.y" /* yacc.c:1646 */ +#line 733 "parser.y" /* yacc.c:1646 */ { (yyval.argument_list) = NULL; } -#line 2847 "parser.tab.c" /* yacc.c:1646 */ +#line 2911 "parser.tab.c" /* yacc.c:1646 */ break; case 173: -#line 733 "parser.y" /* yacc.c:1646 */ +#line 734 "parser.y" /* yacc.c:1646 */ { (yyval.argument_list) = (yyvsp[-1].argument_list); } -#line 2853 "parser.tab.c" /* yacc.c:1646 */ +#line 2917 "parser.tab.c" /* yacc.c:1646 */ break; case 174: -#line 737 "parser.y" /* yacc.c:1646 */ +#line 738 "parser.y" /* yacc.c:1646 */ { (yyval.argument_list) = new_argument_list(ctx, (yyvsp[0].expr)); } -#line 2859 "parser.tab.c" /* yacc.c:1646 */ +#line 2923 "parser.tab.c" /* yacc.c:1646 */ break; case 175: -#line 739 "parser.y" /* yacc.c:1646 */ +#line 740 "parser.y" /* yacc.c:1646 */ { (yyval.argument_list) = argument_list_add(ctx, (yyvsp[-2].argument_list), (yyvsp[0].expr)); } -#line 2865 "parser.tab.c" /* yacc.c:1646 */ +#line 2929 "parser.tab.c" /* yacc.c:1646 */ break; case 176: -#line 743 "parser.y" /* yacc.c:1646 */ +#line 744 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_expression(ctx, EXPR_THIS, 0); } -#line 2871 "parser.tab.c" /* yacc.c:1646 */ +#line 2935 "parser.tab.c" /* yacc.c:1646 */ break; case 177: -#line 744 "parser.y" /* yacc.c:1646 */ +#line 745 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_identifier_expression(ctx, (yyvsp[0].identifier)); } -#line 2877 "parser.tab.c" /* yacc.c:1646 */ +#line 2941 "parser.tab.c" /* yacc.c:1646 */ break; case 178: -#line 745 "parser.y" /* yacc.c:1646 */ +#line 746 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_literal_expression(ctx, (yyvsp[0].literal)); } -#line 2883 "parser.tab.c" /* yacc.c:1646 */ +#line 2947 "parser.tab.c" /* yacc.c:1646 */ break; case 179: -#line 746 "parser.y" /* yacc.c:1646 */ +#line 747 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2889 "parser.tab.c" /* yacc.c:1646 */ +#line 2953 "parser.tab.c" /* yacc.c:1646 */ break; case 180: -#line 747 "parser.y" /* yacc.c:1646 */ +#line 748 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[0].expr); } -#line 2895 "parser.tab.c" /* yacc.c:1646 */ +#line 2959 "parser.tab.c" /* yacc.c:1646 */ break; case 181: -#line 748 "parser.y" /* yacc.c:1646 */ +#line 749 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = (yyvsp[-1].expr); } -#line 2901 "parser.tab.c" /* yacc.c:1646 */ +#line 2965 "parser.tab.c" /* yacc.c:1646 */ break; case 182: -#line 752 "parser.y" /* yacc.c:1646 */ +#line 753 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_array_literal_expression(ctx, NULL, 0); } -#line 2907 "parser.tab.c" /* yacc.c:1646 */ +#line 2971 "parser.tab.c" /* yacc.c:1646 */ break; case 183: -#line 753 "parser.y" /* yacc.c:1646 */ +#line 754 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_array_literal_expression(ctx, NULL, (yyvsp[-1].ival)+1); } -#line 2913 "parser.tab.c" /* yacc.c:1646 */ +#line 2977 "parser.tab.c" /* yacc.c:1646 */ break; case 184: -#line 754 "parser.y" /* yacc.c:1646 */ +#line 755 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_array_literal_expression(ctx, (yyvsp[-1].element_list), 0); } -#line 2919 "parser.tab.c" /* yacc.c:1646 */ +#line 2983 "parser.tab.c" /* yacc.c:1646 */ break; case 185: -#line 756 "parser.y" /* yacc.c:1646 */ +#line 757 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_array_literal_expression(ctx, (yyvsp[-3].element_list), (yyvsp[-1].ival)+1); } -#line 2925 "parser.tab.c" /* yacc.c:1646 */ +#line 2989 "parser.tab.c" /* yacc.c:1646 */ break; case 186: -#line 761 "parser.y" /* yacc.c:1646 */ +#line 762 "parser.y" /* yacc.c:1646 */ { (yyval.element_list) = new_element_list(ctx, (yyvsp[-1].ival), (yyvsp[0].expr)); } -#line 2931 "parser.tab.c" /* yacc.c:1646 */ +#line 2995 "parser.tab.c" /* yacc.c:1646 */ break; case 187: -#line 763 "parser.y" /* yacc.c:1646 */ +#line 764 "parser.y" /* yacc.c:1646 */ { (yyval.element_list) = element_list_add(ctx, (yyvsp[-3].element_list), (yyvsp[-1].ival), (yyvsp[0].expr)); } -#line 2937 "parser.tab.c" /* yacc.c:1646 */ +#line 3001 "parser.tab.c" /* yacc.c:1646 */ break; case 188: -#line 767 "parser.y" /* yacc.c:1646 */ +#line 768 "parser.y" /* yacc.c:1646 */ { (yyval.ival) = 1; } -#line 2943 "parser.tab.c" /* yacc.c:1646 */ +#line 3007 "parser.tab.c" /* yacc.c:1646 */ break; case 189: -#line 768 "parser.y" /* yacc.c:1646 */ +#line 769 "parser.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[-1].ival) + 1; } -#line 2949 "parser.tab.c" /* yacc.c:1646 */ +#line 3013 "parser.tab.c" /* yacc.c:1646 */ break; case 190: -#line 772 "parser.y" /* yacc.c:1646 */ +#line 773 "parser.y" /* yacc.c:1646 */ { (yyval.ival) = 0; } -#line 2955 "parser.tab.c" /* yacc.c:1646 */ +#line 3019 "parser.tab.c" /* yacc.c:1646 */ break; case 191: -#line 773 "parser.y" /* yacc.c:1646 */ +#line 774 "parser.y" /* yacc.c:1646 */ { (yyval.ival) = (yyvsp[0].ival); } -#line 2961 "parser.tab.c" /* yacc.c:1646 */ +#line 3025 "parser.tab.c" /* yacc.c:1646 */ break; case 192: -#line 777 "parser.y" /* yacc.c:1646 */ +#line 778 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_prop_and_value_expression(ctx, NULL); } -#line 2967 "parser.tab.c" /* yacc.c:1646 */ +#line 3031 "parser.tab.c" /* yacc.c:1646 */ break; case 193: -#line 779 "parser.y" /* yacc.c:1646 */ +#line 780 "parser.y" /* yacc.c:1646 */ { (yyval.expr) = new_prop_and_value_expression(ctx, (yyvsp[-1].property_list)); } -#line 2973 "parser.tab.c" /* yacc.c:1646 */ +#line 3037 "parser.tab.c" /* yacc.c:1646 */ break; case 194: -#line 784 "parser.y" /* yacc.c:1646 */ +#line 785 "parser.y" /* yacc.c:1646 */ { (yyval.property_list) = new_property_list(ctx, (yyvsp[-2].literal), (yyvsp[0].expr)); } -#line 2979 "parser.tab.c" /* yacc.c:1646 */ +#line 3043 "parser.tab.c" /* yacc.c:1646 */ break; case 195: -#line 786 "parser.y" /* yacc.c:1646 */ +#line 787 "parser.y" /* yacc.c:1646 */ { (yyval.property_list) = property_list_add(ctx, (yyvsp[-4].property_list), (yyvsp[-2].literal), (yyvsp[0].expr)); } -#line 2985 "parser.tab.c" /* yacc.c:1646 */ +#line 3049 "parser.tab.c" /* yacc.c:1646 */ break; case 196: -#line 790 "parser.y" /* yacc.c:1646 */ +#line 791 "parser.y" /* yacc.c:1646 */ { (yyval.literal) = new_string_literal(ctx, (yyvsp[0].identifier)); } -#line 2991 "parser.tab.c" /* yacc.c:1646 */ +#line 3055 "parser.tab.c" /* yacc.c:1646 */ break; case 197: -#line 791 "parser.y" /* yacc.c:1646 */ +#line 792 "parser.y" /* yacc.c:1646 */ { (yyval.literal) = new_string_literal(ctx, (yyvsp[0].wstr)); } -#line 2997 "parser.tab.c" /* yacc.c:1646 */ +#line 3061 "parser.tab.c" /* yacc.c:1646 */ break; case 198: -#line 792 "parser.y" /* yacc.c:1646 */ +#line 793 "parser.y" /* yacc.c:1646 */ { (yyval.literal) = (yyvsp[0].literal); } -#line 3003 "parser.tab.c" /* yacc.c:1646 */ +#line 3067 "parser.tab.c" /* yacc.c:1646 */ break; case 199: -#line 796 "parser.y" /* yacc.c:1646 */ +#line 797 "parser.y" /* yacc.c:1646 */ { (yyval.identifier) = NULL; } -#line 3009 "parser.tab.c" /* yacc.c:1646 */ +#line 3073 "parser.tab.c" /* yacc.c:1646 */ break; case 200: -#line 797 "parser.y" /* yacc.c:1646 */ +#line 798 "parser.y" /* yacc.c:1646 */ { (yyval.identifier) = (yyvsp[0].identifier); } -#line 3015 "parser.tab.c" /* yacc.c:1646 */ +#line 3079 "parser.tab.c" /* yacc.c:1646 */ break; case 201: -#line 801 "parser.y" /* yacc.c:1646 */ - { (yyval.literal) = new_null_literal(ctx); } -#line 3021 "parser.tab.c" /* yacc.c:1646 */ +#line 802 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3085 "parser.tab.c" /* yacc.c:1646 */ break; case 202: -#line 802 "parser.y" /* yacc.c:1646 */ - { (yyval.literal) = (yyvsp[0].literal); } -#line 3027 "parser.tab.c" /* yacc.c:1646 */ +#line 804 "parser.y" /* yacc.c:1646 */ + { + if(ctx->script->version < SCRIPTLANGUAGEVERSION_ES5) { + WARN("%s keyword used as an identifier in legacy mode.\n", + debugstr_w((yyvsp[0].identifier))); + YYABORT; + } + (yyval.identifier) = (yyvsp[0].identifier); + } +#line 3098 "parser.tab.c" /* yacc.c:1646 */ break; case 203: -#line 803 "parser.y" /* yacc.c:1646 */ - { (yyval.literal) = (yyvsp[0].literal); } -#line 3033 "parser.tab.c" /* yacc.c:1646 */ +#line 814 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3104 "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 3039 "parser.tab.c" /* yacc.c:1646 */ +#line 815 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3110 "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 3046 "parser.tab.c" /* yacc.c:1646 */ +#line 816 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3116 "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 3053 "parser.tab.c" /* yacc.c:1646 */ +#line 817 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3122 "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 3059 "parser.tab.c" /* yacc.c:1646 */ +#line 818 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3128 "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 3065 "parser.tab.c" /* yacc.c:1646 */ +#line 819 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3134 "parser.tab.c" /* yacc.c:1646 */ break; case 209: -#line 814 "parser.y" /* yacc.c:1646 */ - { (yyval.literal) = (yyvsp[0].literal); } -#line 3071 "parser.tab.c" /* yacc.c:1646 */ +#line 820 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3140 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 210: +#line 821 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3146 "parser.tab.c" /* yacc.c:1646 */ break; case 211: -#line 818 "parser.y" /* yacc.c:1646 */ - { if(!allow_auto_semicolon(ctx)) {YYABORT;} } -#line 3077 "parser.tab.c" /* yacc.c:1646 */ +#line 822 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3152 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 212: +#line 823 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3158 "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 3083 "parser.tab.c" /* yacc.c:1646 */ +#line 824 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3164 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 214: +#line 825 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3170 "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 3089 "parser.tab.c" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3176 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 216: +#line 827 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3182 "parser.tab.c" /* yacc.c:1646 */ break; case 217: +#line 828 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3188 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 218: +#line 829 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3194 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 219: #line 830 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3200 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 220: +#line 831 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3206 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 221: +#line 832 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3212 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 222: +#line 833 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3218 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 223: +#line 834 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3224 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 224: +#line 835 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3230 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 225: +#line 836 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3236 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 226: +#line 837 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3242 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 227: +#line 838 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3248 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 228: +#line 839 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3254 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 229: +#line 840 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3260 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 230: +#line 841 "parser.y" /* yacc.c:1646 */ + { (yyval.identifier) = (yyvsp[0].identifier); } +#line 3266 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 231: +#line 845 "parser.y" /* yacc.c:1646 */ + { (yyval.literal) = new_null_literal(ctx); } +#line 3272 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 232: +#line 846 "parser.y" /* yacc.c:1646 */ + { (yyval.literal) = (yyvsp[0].literal); } +#line 3278 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 233: +#line 847 "parser.y" /* yacc.c:1646 */ + { (yyval.literal) = (yyvsp[0].literal); } +#line 3284 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 234: +#line 848 "parser.y" /* yacc.c:1646 */ + { (yyval.literal) = new_string_literal(ctx, (yyvsp[0].wstr)); } +#line 3290 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 235: +#line 849 "parser.y" /* yacc.c:1646 */ + { (yyval.literal) = parse_regexp(ctx); + if(!(yyval.literal)) YYABORT; } +#line 3297 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 236: +#line 851 "parser.y" /* yacc.c:1646 */ + { (yyval.literal) = parse_regexp(ctx); + if(!(yyval.literal)) YYABORT; } +#line 3304 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 237: +#line 856 "parser.y" /* yacc.c:1646 */ + { (yyval.literal) = new_boolean_literal(ctx, VARIANT_TRUE); } +#line 3310 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 238: +#line 857 "parser.y" /* yacc.c:1646 */ + { (yyval.literal) = new_boolean_literal(ctx, VARIANT_FALSE); } +#line 3316 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 239: +#line 858 "parser.y" /* yacc.c:1646 */ + { (yyval.literal) = (yyvsp[0].literal); } +#line 3322 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 241: +#line 862 "parser.y" /* yacc.c:1646 */ + { if(!allow_auto_semicolon(ctx)) {YYABORT;} } +#line 3328 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 243: +#line 866 "parser.y" /* yacc.c:1646 */ + { set_error(ctx, JS_E_MISSING_LBRACKET); YYABORT; } +#line 3334 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 245: +#line 870 "parser.y" /* yacc.c:1646 */ + { set_error(ctx, JS_E_MISSING_RBRACKET); YYABORT; } +#line 3340 "parser.tab.c" /* yacc.c:1646 */ + break; + + case 247: +#line 874 "parser.y" /* yacc.c:1646 */ { set_error(ctx, JS_E_MISSING_SEMICOLON); YYABORT; } -#line 3095 "parser.tab.c" /* yacc.c:1646 */ +#line 3346 "parser.tab.c" /* yacc.c:1646 */ break; -#line 3099 "parser.tab.c" /* yacc.c:1646 */ +#line 3350 "parser.tab.c" /* yacc.c:1646 */ default: break; } /* User semantic actions sometimes alter yychar, and that requires @@ -3323,7 +3574,7 @@ yyreturn: #endif return yyresult; } -#line 832 "parser.y" /* yacc.c:1906 */ +#line 876 "parser.y" /* yacc.c:1906 */ static BOOL allow_auto_semicolon(parser_ctx_t *ctx) diff --git a/dll/win32/jscript/parser.tab.h b/dll/win32/jscript/parser.tab.h index 096db230a2..181c030c8b 100644 --- a/dll/win32/jscript/parser.tab.h +++ b/dll/win32/jscript/parser.tab.h @@ -53,33 +53,33 @@ extern int parser_debug; kDELETE = 263, kDO = 264, kELSE = 265, - kIF = 266, - kFINALLY = 267, - kFOR = 268, - kIN = 269, - kINSTANCEOF = 270, - kNEW = 271, - kNULL = 272, - kRETURN = 273, - kSWITCH = 274, - kTHIS = 275, - kTHROW = 276, - kTRUE = 277, - kFALSE = 278, - kTRY = 279, - kTYPEOF = 280, - kVAR = 281, - kVOID = 282, - kWHILE = 283, - kWITH = 284, - tANDAND = 285, - tOROR = 286, - tINC = 287, - tDEC = 288, - tHTMLCOMMENT = 289, - kDIVEQ = 290, - kDCOL = 291, - kFUNCTION = 292, + kFUNCTION = 266, + kIF = 267, + kFINALLY = 268, + kFOR = 269, + kIN = 270, + kINSTANCEOF = 271, + kNEW = 272, + kNULL = 273, + kRETURN = 274, + kSWITCH = 275, + kTHIS = 276, + kTHROW = 277, + kTRUE = 278, + kFALSE = 279, + kTRY = 280, + kTYPEOF = 281, + kVAR = 282, + kVOID = 283, + kWHILE = 284, + kWITH = 285, + tANDAND = 286, + tOROR = 287, + tINC = 288, + tDEC = 289, + tHTMLCOMMENT = 290, + kDIVEQ = 291, + kDCOL = 292, tIdentifier = 293, tAssignOper = 294, tEqOper = 295, diff --git a/dll/win32/jscript/parser.y b/dll/win32/jscript/parser.y index 59e67575fc..a40b813de1 100644 --- a/dll/win32/jscript/parser.y +++ b/dll/win32/jscript/parser.y @@ -164,11 +164,11 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state } /* keywords */ -%token kBREAK kCASE kCATCH kCONTINUE kDEFAULT kDELETE kDO kELSE kIF kFINALLY kFOR kIN -%token kINSTANCEOF kNEW kNULL kRETURN kSWITCH kTHIS kTHROW kTRUE kFALSE kTRY kTYPEOF kVAR kVOID kWHILE kWITH +%token <identifier> kBREAK kCASE kCATCH kCONTINUE kDEFAULT kDELETE kDO kELSE kFUNCTION kIF kFINALLY kFOR kIN +%token <identifier> kINSTANCEOF kNEW kNULL kRETURN kSWITCH kTHIS kTHROW kTRUE kFALSE kTRY kTYPEOF kVAR kVOID kWHILE kWITH %token tANDAND tOROR tINC tDEC tHTMLCOMMENT kDIVEQ kDCOL -%token <srcptr> kFUNCTION '}' +%token <srcptr> '}' /* tokens */ %token <identifier> tIdentifier @@ -241,6 +241,7 @@ static source_elements_t *source_elements_add_statement(source_elements_t*,state %type <literal> BooleanLiteral %type <srcptr> KFunction %type <ival> AssignOper +%type <identifier> IdentifierName ReservedAsIdentifier %nonassoc LOWER_THAN_ELSE %nonassoc kELSE @@ -272,7 +273,7 @@ FunctionExpression { $$ = new_function_expression(ctx, $4, $6, $9, $2, $1, $10-$1+1); } KFunction - : kFUNCTION { $$ = $1; } + : kFUNCTION { $$ = ctx->ptr - 8; } /* ECMA-262 3rd Edition 13 */ FunctionBody @@ -711,7 +712,7 @@ MemberExpression | FunctionExpression { $$ = $1; } | MemberExpression '[' Expression ']' { $$ = new_binary_expression(ctx, EXPR_ARRAY, $1, $3); } - | MemberExpression '.' tIdentifier + | MemberExpression '.' IdentifierName { $$ = new_member_expression(ctx, $1, $3); } | kNEW MemberExpression Arguments { $$ = new_new_expression(ctx, $2, $3); } @@ -724,7 +725,7 @@ CallExpression { $$ = new_call_expression(ctx, $1, $2); } | CallExpression '[' Expression ']' { $$ = new_binary_expression(ctx, EXPR_ARRAY, $1, $3); } - | CallExpression '.' tIdentifier + | CallExpression '.' IdentifierName { $$ = new_member_expression(ctx, $1, $3); } /* ECMA-262 3rd Edition 11.2 */ @@ -787,7 +788,7 @@ PropertyNameAndValueList /* ECMA-262 3rd Edition 11.1.5 */ PropertyName - : tIdentifier { $$ = new_string_literal(ctx, $1); } + : IdentifierName { $$ = new_string_literal(ctx, $1); } | tStringLiteral { $$ = new_string_literal(ctx, $1); } | tNumericLiteral { $$ = $1; } @@ -796,6 +797,49 @@ Identifier_opt : /* empty*/ { $$ = NULL; } | tIdentifier { $$ = $1; } +/* ECMA-262 5.1 Edition 7.6 */ +IdentifierName + : tIdentifier { $$ = $1; } + | ReservedAsIdentifier + { + if(ctx->script->version < SCRIPTLANGUAGEVERSION_ES5) { + WARN("%s keyword used as an identifier in legacy mode.\n", + debugstr_w($1)); + YYABORT; + } + $$ = $1; + } + +ReservedAsIdentifier + : kBREAK { $$ = $1; } + | kCASE { $$ = $1; } + | kCATCH { $$ = $1; } + | kCONTINUE { $$ = $1; } + | kDEFAULT { $$ = $1; } + | kDELETE { $$ = $1; } + | kDO { $$ = $1; } + | kELSE { $$ = $1; } + | kFALSE { $$ = $1; } + | kFINALLY { $$ = $1; } + | kFOR { $$ = $1; } + | kFUNCTION { $$ = $1; } + | kIF { $$ = $1; } + | kIN { $$ = $1; } + | kINSTANCEOF { $$ = $1; } + | kNEW { $$ = $1; } + | kNULL { $$ = $1; } + | kRETURN { $$ = $1; } + | kSWITCH { $$ = $1; } + | kTHIS { $$ = $1; } + | kTHROW { $$ = $1; } + | kTRUE { $$ = $1; } + | kTRY { $$ = $1; } + | kTYPEOF { $$ = $1; } + | kVAR { $$ = $1; } + | kVOID { $$ = $1; } + | kWHILE { $$ = $1; } + | kWITH { $$ = $1; } + /* ECMA-262 3rd Edition 7.8 */ Literal : kNULL { $$ = new_null_literal(ctx); } diff --git a/dll/win32/jscript/resource.h b/dll/win32/jscript/resource.h index bb78ec19f0..dde1b13c59 100644 --- a/dll/win32/jscript/resource.h +++ b/dll/win32/jscript/resource.h @@ -65,3 +65,9 @@ #define IDS_PRECISION_OUT_OF_RANGE 0x13A3 #define IDS_INVALID_LENGTH 0x13A5 #define IDS_ARRAY_EXPECTED 0x13A7 +#define IDS_INVALID_WRITABLE_PROP_DESC 0x13AC +#define IDS_NONCONFIGURABLE_REDEFINED 0x13D6 +#define IDS_NONWRITABLE_MODIFIED 0x13D7 +/* FIXME: This is not compatible with native, but we would + * conflict with IDS_UNSUPPORTED_ACTION otherwise */ +#define IDS_PROP_DESC_MISMATCH 0x1F00 diff --git a/dll/win32/jscript/string.c b/dll/win32/jscript/string.c index ad978f245c..e6e4997e3e 100644 --- a/dll/win32/jscript/string.c +++ b/dll/win32/jscript/string.c @@ -63,6 +63,7 @@ static const WCHAR toLowerCaseW[] = {'t','o','L','o','w','e','r','C','a','s','e' static const WCHAR toUpperCaseW[] = {'t','o','U','p','p','e','r','C','a','s','e',0}; static const WCHAR toLocaleLowerCaseW[] = {'t','o','L','o','c','a','l','e','L','o','w','e','r','C','a','s','e',0}; static const WCHAR toLocaleUpperCaseW[] = {'t','o','L','o','c','a','l','e','U','p','p','e','r','C','a','s','e',0}; +static const WCHAR trimW[] = {'t','r','i','m',0}; static const WCHAR localeCompareW[] = {'l','o','c','a','l','e','C','o','m','p','a','r','e',0}; static const WCHAR fromCharCodeW[] = {'f','r','o','m','C','h','a','r','C','o','d','e',0}; @@ -119,12 +120,6 @@ static HRESULT String_get_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t *r return S_OK; } -static HRESULT String_set_length(script_ctx_t *ctx, jsdisp_t *jsthis, jsval_t value) -{ - FIXME("%p\n", jsthis); - return E_NOTIMPL; -} - static HRESULT stringobj_to_string(vdisp_t *jsthis, jsval_t *r) { StringInstance *string; @@ -1471,6 +1466,41 @@ static HRESULT String_toLocaleUpperCase(script_ctx_t *ctx, vdisp_t *jsthis, WORD return E_NOTIMPL; } +static HRESULT String_trim(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, + jsval_t *argv, jsval_t *r) +{ + const WCHAR *str, *begin, *end; + jsstr_t *jsstr; + unsigned len; + HRESULT hres; + + hres = to_flat_string(ctx, jsval_disp(jsthis->u.disp), &jsstr, &str); + if(FAILED(hres)) { + WARN("to_flat_string failed: %08x\n", hres); + return hres; + } + len = jsstr_length(jsstr); + TRACE("%s\n", debugstr_wn(str, len)); + + for(begin = str, end = str + len; begin < end && isspaceW(*begin); begin++); + while(end > begin + 1 && isspaceW(*(end-1))) end--; + + if(r) { + jsstr_t *ret; + + if(begin == str && end == str + len) + ret = jsstr_addref(jsstr); + else + ret = jsstr_alloc_len(begin, end - begin); + if(ret) + *r = jsval_string(ret); + else + hres = E_OUTOFMEMORY; + } + jsstr_release(jsstr); + return hres; +} + static HRESULT String_localeCompare(script_ctx_t *ctx, vdisp_t *jsthis, WORD flags, unsigned argc, jsval_t *argv, jsval_t *r) { @@ -1539,7 +1569,7 @@ static const builtin_prop_t String_props[] = { {indexOfW, String_indexOf, PROPF_METHOD|2}, {italicsW, String_italics, PROPF_METHOD}, {lastIndexOfW, String_lastIndexOf, PROPF_METHOD|2}, - {lengthW, NULL,0, String_get_length, String_set_length}, + {lengthW, NULL,0, String_get_length}, {linkW, String_link, PROPF_METHOD|1}, {localeCompareW, String_localeCompare, PROPF_METHOD|1}, {matchW, String_match, PROPF_METHOD|1}, @@ -1558,6 +1588,7 @@ static const builtin_prop_t String_props[] = { {toLowerCaseW, String_toLowerCase, PROPF_METHOD}, {toStringW, String_toString, PROPF_METHOD}, {toUpperCaseW, String_toUpperCase, PROPF_METHOD}, + {trimW, String_trim, PROPF_ES5|PROPF_METHOD}, {valueOfW, String_valueOf, PROPF_METHOD} }; @@ -1571,7 +1602,7 @@ static const builtin_info_t String_info = { }; static const builtin_prop_t StringInst_props[] = { - {lengthW, NULL,0, String_get_length, String_set_length} + {lengthW, NULL,0, String_get_length} }; static const builtin_info_t StringInst_info = { diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 037d88371c..3db38f6dd3 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.9 -reactos/dll/win32/jscript # Synced to WineStaging-3.3 +reactos/dll/win32/jscript # Synced to WineStaging-3.9 reactos/dll/win32/jsproxy # Synced to WineStaging-3.3 reactos/dll/win32/loadperf # Synced to WineStaging-3.3 reactos/dll/win32/lz32 # Synced to WineStaging-3.3
6 years, 6 months
1
0
0
0
01/01: [ITSS_WINETEST] Sync with Wine Staging 3.9. CORE-14656
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=454e3603036d2bf7c20e1…
commit 454e3603036d2bf7c20e1510153d6b9574cea2c0 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Jun 4 03:37:50 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Jun 4 03:37:50 2018 +0100 [ITSS_WINETEST] Sync with Wine Staging 3.9. CORE-14656 --- modules/rostests/winetests/itss/protocol.c | 67 ++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/modules/rostests/winetests/itss/protocol.c b/modules/rostests/winetests/itss/protocol.c index 663411f2e9..ea3a1d6967 100644 --- a/modules/rostests/winetests/itss/protocol.c +++ b/modules/rostests/winetests/itss/protocol.c @@ -17,6 +17,9 @@ */ #define COBJMACROS +#ifdef __REACTOS__ +#define CONST_VTABLE +#endif #include <wine/test.h> #include <stdarg.h> @@ -60,6 +63,7 @@ DEFINE_EXPECT(ReportProgress_CACHEFILENAMEAVAILABLE); DEFINE_EXPECT(ReportProgress_DIRECTBIND); DEFINE_EXPECT(ReportData); DEFINE_EXPECT(ReportResult); +DEFINE_EXPECT(outer_QI_test); static HRESULT expect_hrResult; static IInternetProtocol *read_protocol = NULL; @@ -660,6 +664,68 @@ static void delete_chm(void) ok(ret, "DeleteFileA failed: %d\n", GetLastError()); } +static const IID outer_test_iid = {0xabcabc00,0,0,{0,0,0,0,0,0,0,0x66}}; + +static HRESULT WINAPI outer_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) +{ + if(IsEqualGUID(riid, &outer_test_iid)) { + CHECK_EXPECT(outer_QI_test); + *ppv = (IUnknown*)0xdeadbeef; + return S_OK; + } + ok(0, "unexpected call %s\n", wine_dbgstr_guid(riid)); + return E_NOINTERFACE; +} + +static ULONG WINAPI outer_AddRef(IUnknown *iface) +{ + return 2; +} + +static ULONG WINAPI outer_Release(IUnknown *iface) +{ + return 1; +} + +static const IUnknownVtbl outer_vtbl = { + outer_QueryInterface, + outer_AddRef, + outer_Release +}; + +static void test_com_aggregation(const CLSID *clsid) +{ + IUnknown outer = { &outer_vtbl }; + IClassFactory *class_factory; + IUnknown *unk, *unk2, *unk3; + HRESULT hres; + + hres = CoGetClassObject(clsid, CLSCTX_INPROC_SERVER, NULL, &IID_IClassFactory, (void**)&class_factory); + ok(hres == S_OK, "CoGetClassObject failed: %08x\n", hres); + + hres = IClassFactory_CreateInstance(class_factory, &outer, &IID_IUnknown, (void**)&unk); + ok(hres == S_OK, "CreateInstance returned: %08x\n", hres); + + hres = IUnknown_QueryInterface(unk, &IID_IInternetProtocol, (void**)&unk2); + ok(hres == S_OK, "Could not get IInternetProtocol iface: %08x\n", hres); + + SET_EXPECT(outer_QI_test); + hres = IUnknown_QueryInterface(unk2, &outer_test_iid, (void**)&unk3); + CHECK_CALLED(outer_QI_test); + ok(hres == S_OK, "Could not get IInternetProtocol iface: %08x\n", hres); + ok(unk3 == (IUnknown*)0xdeadbeef, "unexpected unk2\n"); + + IUnknown_Release(unk2); + IUnknown_Release(unk); + + unk = (void*)0xdeadbeef; + hres = IClassFactory_CreateInstance(class_factory, &outer, &IID_IInternetProtocol, (void**)&unk); + ok(hres == CLASS_E_NOAGGREGATION, "CreateInstance returned: %08x\n", hres); + ok(!unk, "unk = %p\n", unk); + + IClassFactory_Release(class_factory); +} + START_TEST(protocol) { OleInitialize(NULL); @@ -669,6 +735,7 @@ START_TEST(protocol) test_its_protocol(); test_mk_protocol(); + test_com_aggregation(&CLSID_ITSProtocol); delete_chm(); OleUninitialize();
6 years, 6 months
1
0
0
0
01/01: [ITSS] Sync with Wine Staging 3.9. CORE-14656
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=e64b0329877c602f04cad…
commit e64b0329877c602f04cad77e5d88528574b03378 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Jun 4 03:37:18 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Jun 4 03:37:18 2018 +0100 [ITSS] Sync with Wine Staging 3.9. CORE-14656 --- dll/win32/itss/itss.c | 29 ++++++++++++------ dll/win32/itss/protocol.c | 76 +++++++++++++++++++++++++++++++++-------------- media/doc/README.WINE | 2 +- 3 files changed, 75 insertions(+), 32 deletions(-) diff --git a/dll/win32/itss/itss.c b/dll/win32/itss/itss.c index f47a0e96e7..1d236a5960 100644 --- a/dll/win32/itss/itss.c +++ b/dll/win32/itss/itss.c @@ -105,20 +105,31 @@ static ULONG WINAPI ITSSCF_Release(LPCLASSFACTORY iface) } -static HRESULT WINAPI ITSSCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter, - REFIID riid, LPVOID *ppobj) +static HRESULT WINAPI ITSSCF_CreateInstance(IClassFactory *iface, IUnknown *outer, + REFIID riid, void **ppv) { IClassFactoryImpl *This = impl_from_IClassFactory(iface); + IUnknown *unk; HRESULT hres; - LPUNKNOWN punk; - TRACE("(%p)->(%p,%s,%p)\n", This, pOuter, debugstr_guid(riid), ppobj); + TRACE("(%p)->(%p %s %p)\n", This, outer, debugstr_guid(riid), ppv); - *ppobj = NULL; - hres = This->pfnCreateInstance(pOuter, (LPVOID *) &punk); - if (SUCCEEDED(hres)) { - hres = IUnknown_QueryInterface(punk, riid, ppobj); - IUnknown_Release(punk); + if(outer && !IsEqualGUID(riid, &IID_IUnknown)) { + *ppv = NULL; + return CLASS_E_NOAGGREGATION; + } + + hres = This->pfnCreateInstance(outer, (void**)&unk); + if(FAILED(hres)) { + *ppv = NULL; + return hres; + } + + if(!IsEqualGUID(riid, &IID_IUnknown)) { + hres = IUnknown_QueryInterface(unk, riid, ppv); + IUnknown_Release(unk); + }else { + *ppv = unk; } return hres; } diff --git a/dll/win32/itss/protocol.c b/dll/win32/itss/protocol.c index 1463518c2c..1cdb365002 100644 --- a/dll/win32/itss/protocol.c +++ b/dll/win32/itss/protocol.c @@ -36,16 +36,23 @@ WINE_DEFAULT_DEBUG_CHANNEL(itss); typedef struct { + IUnknown IUnknown_inner; IInternetProtocol IInternetProtocol_iface; IInternetProtocolInfo IInternetProtocolInfo_iface; LONG ref; + IUnknown *outer; ULONG offset; struct chmFile *chm_file; struct chmUnitInfo chm_object; } ITSProtocol; +static inline ITSProtocol *impl_from_IUnknown(IUnknown *iface) +{ + return CONTAINING_RECORD(iface, ITSProtocol, IUnknown_inner); +} + static inline ITSProtocol *impl_from_IInternetProtocol(IInternetProtocol *iface) { return CONTAINING_RECORD(iface, ITSProtocol, IInternetProtocol_iface); @@ -65,14 +72,13 @@ static void release_chm(ITSProtocol *This) This->offset = 0; } -static HRESULT WINAPI ITSProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv) +static HRESULT WINAPI ITSProtocol_QueryInterface(IUnknown *iface, REFIID riid, void **ppv) { - ITSProtocol *This = impl_from_IInternetProtocol(iface); + ITSProtocol *This = impl_from_IUnknown(iface); - *ppv = NULL; if(IsEqualGUID(&IID_IUnknown, riid)) { TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv); - *ppv = &This->IInternetProtocol_iface; + *ppv = &This->IUnknown_inner; }else if(IsEqualGUID(&IID_IInternetProtocolRoot, riid)) { TRACE("(%p)->(IID_IInternetProtocolRoot %p)\n", This, ppv); *ppv = &This->IInternetProtocol_iface; @@ -82,28 +88,27 @@ static HRESULT WINAPI ITSProtocol_QueryInterface(IInternetProtocol *iface, REFII }else if(IsEqualGUID(&IID_IInternetProtocolInfo, riid)) { TRACE("(%p)->(IID_IInternetProtocolInfo %p)\n", This, ppv); *ppv = &This->IInternetProtocolInfo_iface; + }else { + *ppv = NULL; + WARN("not supported interface %s\n", debugstr_guid(riid)); + return E_NOINTERFACE; } - if(*ppv) { - IInternetProtocol_AddRef(iface); - return S_OK; - } - - WARN("not supported interface %s\n", debugstr_guid(riid)); - return E_NOINTERFACE; + IUnknown_AddRef((IUnknown*)*ppv); + return S_OK; } -static ULONG WINAPI ITSProtocol_AddRef(IInternetProtocol *iface) +static ULONG WINAPI ITSProtocol_AddRef(IUnknown *iface) { - ITSProtocol *This = impl_from_IInternetProtocol(iface); + ITSProtocol *This = impl_from_IUnknown(iface); LONG ref = InterlockedIncrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); return ref; } -static ULONG WINAPI ITSProtocol_Release(IInternetProtocol *iface) +static ULONG WINAPI ITSProtocol_Release(IUnknown *iface) { - ITSProtocol *This = impl_from_IInternetProtocol(iface); + ITSProtocol *This = impl_from_IUnknown(iface); LONG ref = InterlockedDecrement(&This->ref); TRACE("(%p) ref=%d\n", This, ref); @@ -118,6 +123,30 @@ static ULONG WINAPI ITSProtocol_Release(IInternetProtocol *iface) return ref; } +static const IUnknownVtbl ITSProtocolUnkVtbl = { + ITSProtocol_QueryInterface, + ITSProtocol_AddRef, + ITSProtocol_Release +}; + +static HRESULT WINAPI ITSInternetProtocol_QueryInterface(IInternetProtocol *iface, REFIID riid, void **ppv) +{ + ITSProtocol *This = impl_from_IInternetProtocol(iface); + return IUnknown_QueryInterface(This->outer, riid, ppv); +} + +static ULONG WINAPI ITSInternetProtocol_AddRef(IInternetProtocol *iface) +{ + ITSProtocol *This = impl_from_IInternetProtocol(iface); + return IUnknown_AddRef(This->outer); +} + +static ULONG WINAPI ITSInternetProtocol_Release(IInternetProtocol *iface) +{ + ITSProtocol *This = impl_from_IInternetProtocol(iface); + return IUnknown_Release(This->outer); +} + static LPCWSTR skip_schema(LPCWSTR url) { static const WCHAR its_schema[] = {'i','t','s',':'}; @@ -387,9 +416,9 @@ static HRESULT WINAPI ITSProtocol_UnlockRequest(IInternetProtocol *iface) } static const IInternetProtocolVtbl ITSProtocolVtbl = { - ITSProtocol_QueryInterface, - ITSProtocol_AddRef, - ITSProtocol_Release, + ITSInternetProtocol_QueryInterface, + ITSInternetProtocol_AddRef, + ITSInternetProtocol_Release, ITSProtocol_Start, ITSProtocol_Continue, ITSProtocol_Abort, @@ -520,21 +549,24 @@ static const IInternetProtocolInfoVtbl ITSProtocolInfoVtbl = { ITSProtocolInfo_QueryInfo }; -HRESULT ITSProtocol_create(IUnknown *pUnkOuter, LPVOID *ppobj) +HRESULT ITSProtocol_create(IUnknown *outer, void **ppv) { ITSProtocol *ret; - TRACE("(%p %p)\n", pUnkOuter, ppobj); + TRACE("(%p %p)\n", outer, ppv); ITSS_LockModule(); ret = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(ITSProtocol)); + if(!ret) + return E_OUTOFMEMORY; + ret->IUnknown_inner.lpVtbl = &ITSProtocolUnkVtbl; ret->IInternetProtocol_iface.lpVtbl = &ITSProtocolVtbl; ret->IInternetProtocolInfo_iface.lpVtbl = &ITSProtocolInfoVtbl; ret->ref = 1; + ret->outer = outer ? outer : &ret->IUnknown_inner; - *ppobj = &ret->IInternetProtocol_iface; - + *ppv = &ret->IUnknown_inner; return S_OK; } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 5e05bad95f..037d88371c 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -84,7 +84,7 @@ reactos/dll/win32/initpki # Synced to WineStaging-3.3 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/itss # Synced to WineStaging-3.9 reactos/dll/win32/jscript # Synced to WineStaging-3.3 reactos/dll/win32/jsproxy # Synced to WineStaging-3.3 reactos/dll/win32/loadperf # Synced to WineStaging-3.3
6 years, 6 months
1
0
0
0
01/01: [IMM32] Sync with Wine Staging 3.9. CORE-14656
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1656f44ad372113e2bcff…
commit 1656f44ad372113e2bcff74753977d5a6b84d12d Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Jun 4 03:36:30 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Jun 4 03:36:30 2018 +0100 [IMM32] Sync with Wine Staging 3.9. CORE-14656 --- dll/win32/imm32/imm.c | 2 +- media/doc/README.WINE | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/win32/imm32/imm.c b/dll/win32/imm32/imm.c index 377a277513..685eb018c4 100644 --- a/dll/win32/imm32/imm.c +++ b/dll/win32/imm32/imm.c @@ -3147,7 +3147,7 @@ BOOL WINAPI ImmGetHotKey(DWORD hotkey, UINT *modifiers, UINT *key, HKL hkl) } /*********************************************************************** - * IMMDisableLegacyIME(IMM32.@) + * ImmDisableLegacyIME(IMM32.@) */ BOOL WINAPI ImmDisableLegacyIME(void) { diff --git a/media/doc/README.WINE b/media/doc/README.WINE index 94fef4d9fa..5e05bad95f 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -77,7 +77,7 @@ reactos/dll/win32/iccvid # Synced to WineStaging-3.3 reactos/dll/win32/ieframe # Synced to WineStaging-3.9 reactos/dll/win32/imaadp32.acm # Synced to WineStaging-3.3 reactos/dll/win32/imagehlp # Synced to WineStaging-3.3 -reactos/dll/win32/imm32 # Synced to WineStaging-3.3 +reactos/dll/win32/imm32 # Synced to WineStaging-3.9 reactos/dll/win32/inetcomm # Synced to WineStaging-3.3 reactos/dll/win32/inetmib1 # Synced to WineStaging-3.3 reactos/dll/win32/initpki # Synced to WineStaging-3.3
6 years, 6 months
1
0
0
0
01/01: [IEFRAME] Sync with Wine Staging 3.9. CORE-14656
by Amine Khaldi
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=88b70c737ad6a2b71dba0…
commit 88b70c737ad6a2b71dba080d0029304d3b78a4a2 Author: Amine Khaldi <amine.khaldi(a)reactos.org> AuthorDate: Mon Jun 4 03:35:42 2018 +0100 Commit: Amine Khaldi <amine.khaldi(a)reactos.org> CommitDate: Mon Jun 4 03:35:42 2018 +0100 [IEFRAME] Sync with Wine Staging 3.9. CORE-14656 --- dll/win32/ieframe/iexplore.c | 4 ++++ media/doc/README.WINE | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dll/win32/ieframe/iexplore.c b/dll/win32/ieframe/iexplore.c index 3d581732ad..8362e8053b 100644 --- a/dll/win32/ieframe/iexplore.c +++ b/dll/win32/ieframe/iexplore.c @@ -900,7 +900,10 @@ static ULONG WINAPI InternetExplorerManager_Release(IInternetExplorerManager *if TRACE("(%p) decreasing refcount to %u\n", iface, ref); if (ref == 0) + { HeapFree(GetProcessHeap(), 0, This); + released_obj(); + } return ref; } @@ -936,6 +939,7 @@ HRESULT WINAPI InternetExplorerManager_Create(IClassFactory *iface, IUnknown *pO hr = IInternetExplorerManager_QueryInterface(&ret->IInternetExplorerManager_iface, riid, ppv); IInternetExplorerManager_Release(&ret->IInternetExplorerManager_iface); + InterlockedIncrement(&obj_cnt); return hr; } diff --git a/media/doc/README.WINE b/media/doc/README.WINE index b75500483f..94fef4d9fa 100644 --- a/media/doc/README.WINE +++ b/media/doc/README.WINE @@ -74,7 +74,7 @@ reactos/dll/win32/hlink # Synced to WineStaging-3.3 reactos/dll/win32/hnetcfg # Synced to WineStaging-3.9 reactos/dll/win32/httpapi # Synced to WineStaging-3.3 reactos/dll/win32/iccvid # Synced to WineStaging-3.3 -reactos/dll/win32/ieframe # Synced to WineStaging-3.3 +reactos/dll/win32/ieframe # Synced to WineStaging-3.9 reactos/dll/win32/imaadp32.acm # Synced to WineStaging-3.3 reactos/dll/win32/imagehlp # Synced to WineStaging-3.3 reactos/dll/win32/imm32 # Synced to WineStaging-3.3
6 years, 6 months
1
0
0
0
01/01: [SYSSETUP] If creating the default-user hive file fails because the file already exists, make a backup (i.e. rename it) and retry its creation.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=c441de22325a85decc037…
commit c441de22325a85decc0375cb2e75fbc1ddf4ac27 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Mon Jun 4 01:36:19 2018 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Mon Jun 4 01:36:19 2018 +0200 [SYSSETUP] If creating the default-user hive file fails because the file already exists, make a backup (i.e. rename it) and retry its creation. This situation happens when one "updates" ReactOS by re-installing it on top of an existing installation. --- dll/win32/syssetup/install.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/dll/win32/syssetup/install.c b/dll/win32/syssetup/install.c index 74b357d444..63fa4a28e9 100644 --- a/dll/win32/syssetup/install.c +++ b/dll/win32/syssetup/install.c @@ -1200,10 +1200,37 @@ SaveDefaultUserHive(VOID) pSetupEnablePrivilege(L"SeBackupPrivilege", TRUE); + /* Save the Default hive */ dwError = RegSaveKeyExW(hUserKey, szDefaultUserHive, NULL, REG_STANDARD_FORMAT); + if (dwError == ERROR_ALREADY_EXISTS) + { + WCHAR szBackupHive[MAX_PATH]; + + /* Build the backup hive file name by replacing the extension */ + wcscpy(szBackupHive, szDefaultUserHive); + wcscpy(&szBackupHive[wcslen(szBackupHive) - 4], L".bak"); + + /* Back up the existing default user hive by renaming it, replacing any possible existing old backup */ + if (!MoveFileExW(szDefaultUserHive, + szBackupHive, + MOVEFILE_REPLACE_EXISTING)) + { + dwError = GetLastError(); + DPRINT1("Failed to create a default-user hive backup '%S', MoveFileExW failed (Error %lu)\n", + szBackupHive, dwError); + } + else + { + /* The backup has been done, retry saving the Default hive */ + dwError = RegSaveKeyExW(hUserKey, + szDefaultUserHive, + NULL, + REG_STANDARD_FORMAT); + } + } if (dwError != ERROR_SUCCESS) { DPRINT1("RegSaveKeyExW() failed (Error %lu)\n", dwError);
6 years, 6 months
1
0
0
0
01/01: [SETUPLIB] Silence annoying DPRINT1s.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=b2606fd07af5b01465a0a…
commit b2606fd07af5b01465a0a0736859f7349b3d41e0 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Sun Jun 3 23:23:24 2018 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Jun 3 23:23:24 2018 +0200 [SETUPLIB] Silence annoying DPRINT1s. --- base/setup/lib/filesup.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/base/setup/lib/filesup.c b/base/setup/lib/filesup.c index 056487771d..c6314c222e 100644 --- a/base/setup/lib/filesup.c +++ b/base/setup/lib/filesup.c @@ -154,7 +154,7 @@ DoesPathExist( if (NT_SUCCESS(Status)) NtClose(FileHandle); else - DPRINT1("Failed to open directory '%wZ', Status 0x%08lx\n", &Name, Status); + DPRINT("Failed to open directory '%wZ', Status 0x%08lx\n", &Name, Status); return NT_SUCCESS(Status); } @@ -187,7 +187,7 @@ DoesFileExist( if (NT_SUCCESS(Status)) NtClose(FileHandle); else - DPRINT1("Failed to open file '%wZ', Status 0x%08lx\n", &FileName, Status); + DPRINT("Failed to open file '%wZ', Status 0x%08lx\n", &FileName, Status); return NT_SUCCESS(Status); }
6 years, 6 months
1
0
0
0
09/09: [USETUP] Use correct flags for the NtCreateFile call that creates new file directories.
by Hermès Bélusca-Maïto
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6f185c5fe2e3d65da8add…
commit 6f185c5fe2e3d65da8add34d906d2dc2ec3561d5 Author: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> AuthorDate: Wed May 31 04:08:16 2017 +0200 Commit: Hermès Bélusca-Maïto <hermes.belusca-maito(a)reactos.org> CommitDate: Sun Jun 3 22:12:46 2018 +0200 [USETUP] Use correct flags for the NtCreateFile call that creates new file directories. DIRECTORY_ALL_ACCESS is not the correct flag, because it is used with the NtCreateDirectoryObject API that creates virtual "directories" in the NT object namespace; that's not our purpose here. svn path=/branches/setup_improvements/; revision=74716 --- base/setup/usetup/filesup.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/setup/usetup/filesup.c b/base/setup/usetup/filesup.c index 6094ba3365..e0bd0b110e 100644 --- a/base/setup/usetup/filesup.c +++ b/base/setup/usetup/filesup.c @@ -30,7 +30,7 @@ SetupCreateSingleDirectory( HANDLE DirectoryHandle; NTSTATUS Status; - if(!RtlCreateUnicodeString(&PathName, DirectoryName)) + if (!RtlCreateUnicodeString(&PathName, DirectoryName)) return STATUS_NO_MEMORY; if (PathName.Length > sizeof(WCHAR) && @@ -55,14 +55,14 @@ SetupCreateSingleDirectory( NULL); Status = NtCreateFile(&DirectoryHandle, - DIRECTORY_ALL_ACCESS, + FILE_LIST_DIRECTORY | SYNCHRONIZE, &ObjectAttributes, &IoStatusBlock, NULL, FILE_ATTRIBUTE_DIRECTORY, FILE_SHARE_READ | FILE_SHARE_WRITE, FILE_OPEN_IF, - FILE_DIRECTORY_FILE, + FILE_OPEN_FOR_BACKUP_INTENT | FILE_DIRECTORY_FILE, NULL, 0); if (NT_SUCCESS(Status))
6 years, 6 months
1
0
0
0
← Newer
1
...
12
13
14
15
16
17
18
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Results per page:
10
25
50
100
200