mshtml: Introduce ES6 JavaScript mode and use it in IE11 compat mode.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2021-04-22 01:46:51 +02:00 committed by Alexandre Julliard
parent 08c6114fbb
commit 6e292a745f
2 changed files with 6 additions and 2 deletions

View file

@ -42,9 +42,10 @@
#define SCRIPTLANGUAGEVERSION_HTML 0x400
/*
* This is Wine jscript extension for ES5 compatible mode. Allowed only in HTML mode.
* This is Wine jscript extension for ES5 and ES6 compatible mode. Allowed only in HTML mode.
*/
#define SCRIPTLANGUAGEVERSION_ES5 0x102
#define SCRIPTLANGUAGEVERSION_ES6 0x103
typedef struct _jsval_t jsval_t;
typedef struct _jsstr_t jsstr_t;

View file

@ -66,6 +66,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
/* See jscript.h in jscript.dll. */
#define SCRIPTLANGUAGEVERSION_HTML 0x400
#define SCRIPTLANGUAGEVERSION_ES5 0x102
#define SCRIPTLANGUAGEVERSION_ES6 0x103
struct ScriptHost {
IActiveScriptSite IActiveScriptSite_iface;
@ -154,7 +155,9 @@ static BOOL init_script_engine(ScriptHost *script_host)
compat_mode = lock_document_mode(script_host->window->doc);
script_mode = compat_mode < COMPAT_MODE_IE8 ? SCRIPTLANGUAGEVERSION_5_7 : SCRIPTLANGUAGEVERSION_5_8;
if(IsEqualGUID(&script_host->guid, &CLSID_JScript)) {
if(compat_mode >= COMPAT_MODE_IE9)
if(compat_mode >= COMPAT_MODE_IE11)
script_mode = SCRIPTLANGUAGEVERSION_ES6;
else if(compat_mode >= COMPAT_MODE_IE9)
script_mode = SCRIPTLANGUAGEVERSION_ES5;
script_mode |= SCRIPTLANGUAGEVERSION_HTML;
}