Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature CALL_ON_GLOBAL, new global objects and functions related definitions #53

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
19 changes: 19 additions & 0 deletions src/lib/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ function getFHPaddingEntries(index)
var AT = Feature.AT;
var ATOB = Feature.ATOB;
var BARPROP = Feature.BARPROP;
var CALL_ON_GLOBAL = Feature.CALL_ON_GLOBAL;
var CAPITAL_HTML = Feature.CAPITAL_HTML;
var CONSOLE = Feature.CONSOLE;
var DOCUMENT = Feature.DOCUMENT;
Expand Down Expand Up @@ -1072,6 +1073,15 @@ function getFHPaddingEntries(index)
define('(RP_0_S + self)[11]', DOMWINDOW),
define('(RP_3_WA + self)[11]', OBJECT_W_SELF),
define('(self + RP_4_A).at("-11")', ANY_WINDOW, AT),
define('([].concat.call()[0] + RP_4_A).at("-11")', ANY_WINDOW, AT, CALL_ON_GLOBAL),
define
(
'([].concat.call()[0] + RP_4_A)[SLICE_OR_SUBSTR]("-11")[0]',
ANY_WINDOW,
CALL_ON_GLOBAL
),
define('(RP_0_S + [].concat.call()[0])[11]', CALL_ON_GLOBAL, DOMWINDOW),
define('(RP_3_WA + [].concat.call()[0])[11]', CALL_ON_GLOBAL, WINDOW),
fasttime marked this conversation as resolved.
Show resolved Hide resolved
defineCharDefault({ atob: false }),
],
'X':
Expand Down Expand Up @@ -1191,7 +1201,16 @@ function getFHPaddingEntries(index)
define('atob("undefined0")[1]', ATOB),
define('(RP_4_A + self)[20]', DOMWINDOW),
define('(RP_0_S + self)[13]', WINDOW),
define
(
'([].concat.call()[0] + RP_0_S)[SLICE_OR_SUBSTR]("-2")[0]',
ANY_WINDOW,
CALL_ON_GLOBAL
),
define('(self + RP_0_S).at("-2")', ANY_WINDOW, AT),
define('([].concat.call()[0] + RP_0_S).at("-2")', ANY_WINDOW, AT, CALL_ON_GLOBAL),
define('(RP_4_A + [].concat.call()[0])[20]', CALL_ON_GLOBAL, DOMWINDOW),
define('(RP_0_S + [].concat.call()[0])[13]', CALL_ON_GLOBAL, WINDOW),
fasttime marked this conversation as resolved.
Show resolved Hide resolved
],
'x':
[
Expand Down
20 changes: 19 additions & 1 deletion src/lib/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,23 @@ var featureInfos =
},
attributes: { 'web-worker': 'web-worker-restriction' },
},
CALL_ON_GLOBAL:
{
description:
'The ability to call function on global object when invoking Function.prototype.call ' +
'without binding.',
Clayblockunova marked this conversation as resolved.
Show resolved Hide resolved
check:
function ()
{
try
{
[].concat.call();
return true;
}
catch (error)
{ }
},
},
CAPITAL_HTML:
{
description:
Expand Down Expand Up @@ -891,6 +908,7 @@ var featureInfos =
'ANY_DOCUMENT',
'ATOB',
'CONSOLE',
'CALL_ON_GLOBAL'
Clayblockunova marked this conversation as resolved.
Show resolved Hide resolved
'DOMWINDOW',
'ESC_HTML_ALL',
'FUNCTION_22_LF',
Expand All @@ -908,7 +926,7 @@ var featureInfos =
{
inherits: 'ANDRO_4_0',
versions: [['4.1',, '4.3']],
includes: { GENERIC_ARRAY_TO_STRING: true, OBJECT_UNDEFINED: true },
includes: { CALL_ON_GLOBAL: false, GENERIC_ARRAY_TO_STRING: true, OBJECT_UNDEFINED: true },
},
ANDRO_4_4:
{
Expand Down
Loading