Skip to content

Commit

Permalink
New Feature OBJECT_W_SELF, rewritten 'W' definition (#49)
Browse files Browse the repository at this point in the history
* Update definitions.js

* Update features.js

* Update feature-emulation.helpers.js

* Revering to faster mask implementation

* Updated readme file

* Update features.js

* Update features.js

* Update features.js

* Update features.js

* Update src/lib/features.js

Co-authored-by: Francesco Trotta <[email protected]>

* Update src/lib/features.js

Co-authored-by: Francesco Trotta <[email protected]>

* Update test/helpers/feature-emulation.helpers.js

Co-authored-by: Francesco Trotta <[email protected]>

* Update features.js

* Update src/lib/features.js

Co-authored-by: Francesco Trotta <[email protected]>

* Update features.js

* Apply suggestions from code review

* Update src/lib/features.js

---------

Co-authored-by: Francesco Trotta <[email protected]>
  • Loading branch information
Clayblockunova and fasttime authored Aug 6, 2024
1 parent 9140b0e commit 4f7a214
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/lib/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ function getFHPaddingEntries(index)
var OBJECT_ARRAY_ENTRIES_CTOR = Feature.OBJECT_ARRAY_ENTRIES_CTOR;
var OBJECT_L_LOCATION_CTOR = Feature.OBJECT_L_LOCATION_CTOR;
var OBJECT_UNDEFINED = Feature.OBJECT_UNDEFINED;
var OBJECT_W_SELF = Feature.OBJECT_W_SELF;
var OLD_SAFARI_LOCATION_CTOR = Feature.OLD_SAFARI_LOCATION_CTOR;
var PLAIN_INTL = Feature.PLAIN_INTL;
var REGEXP_STRING_ITERATOR = Feature.REGEXP_STRING_ITERATOR;
Expand Down Expand Up @@ -1067,7 +1068,7 @@ function getFHPaddingEntries(index)
define('(self + RP_4_A)[SLICE_OR_SUBSTR]("-11")[0]', ANY_WINDOW),
define('btoa(undefined)[1]', ATOB),
define('(RP_0_S + self)[11]', DOMWINDOW),
define('(RP_3_WA + self)[11]', WINDOW),
define('(RP_3_WA + self)[11]', OBJECT_W_SELF),
define('(self + RP_4_A).at("-11")', ANY_WINDOW, AT),
defineCharDefault({ atob: false }),
],
Expand Down
52 changes: 45 additions & 7 deletions src/lib/features.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ var featureInfos =
}
),
includes: ['ANY_WINDOW'],
excludes: ['WINDOW'],
excludes: ['OBJECT_W_SELF'],
attributes: { 'web-worker': 'web-worker-restriction' },
},
ESC_HTML_ALL:
Expand Down Expand Up @@ -701,6 +701,24 @@ var featureInfos =
},
includes: ['UNDEFINED'],
},
OBJECT_W_SELF:
{
description:
'The property that the string representation of the global object self starts ' +
'with "[object W".',
check:
checkSelfFeature.bind
(
function (str)
{
var available = /^\[object W/.test(str);
return available;
}
),
includes: ['SELF_OBJ'],
excludes: ['DOMWINDOW'],
attributes: { 'web-worker': 'non-ie-restriction' },
},
OLD_SAFARI_LOCATION_CTOR:
{
description:
Expand Down Expand Up @@ -821,8 +839,7 @@ var featureInfos =
return available;
}
),
includes: ['ANY_WINDOW'],
excludes: ['DOMWINDOW'],
includes: ['ANY_WINDOW', 'OBJECT_W_SELF'],
attributes: { 'web-worker': 'web-worker-restriction' },
},

Expand Down Expand Up @@ -882,7 +899,12 @@ var featureInfos =
'STATUS',
'WINDOW',
],
attributes: { 'char-increment-restriction': null, 'web-worker-restriction': null },
attributes:
{
'char-increment-restriction': null,
'non-ie-restriction': null,
'web-worker-restriction': null,
},
},
ANDRO_4_0:
{
Expand Down Expand Up @@ -927,7 +949,12 @@ var featureInfos =
SHORT_LOCALES: true,
WINDOW: true,
},
attributes: { 'no-console-in-web-worker': null, 'web-worker-restriction': null },
attributes:
{
'no-console-in-web-worker': null,
'non-ie-restriction': null,
'web-worker-restriction': null,
},
},
CHROME_PREV:
{
Expand Down Expand Up @@ -977,7 +1004,12 @@ var featureInfos =
'WINDOW',
],
attributes:
{ 'char-increment-restriction': null, 'unstable': null, 'web-worker-restriction': null },
{
'char-increment-restriction': null,
'non-ie-restriction': null,
'unstable': null,
'web-worker-restriction': null,
},
},
FF_ESR:
{
Expand Down Expand Up @@ -1033,7 +1065,12 @@ var featureInfos =
'WINDOW',
],
attributes:
{ 'char-increment-restriction': null, 'unstable': null, 'web-worker-restriction': null },
{
'char-increment-restriction': null,
'non-ie-restriction': null,
'unstable': null,
'web-worker-restriction': null,
},
},
IE_9:
{
Expand Down Expand Up @@ -1215,6 +1252,7 @@ var featureInfos =
{
'char-increment-restriction': null,
'no-console-in-web-worker': null,
'non-ie-restriction': null,
'old-safari-restriction': null,
'web-worker-restriction': null,
},
Expand Down
1 change: 1 addition & 0 deletions test/helpers/feature-emulation.helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -1152,6 +1152,7 @@
if (toString() !== '[object Undefined]')
registerDefaultToStringAdapter(this, undefined, '[object Undefined]');
},
OBJECT_W_SELF: makeEmuFeatureSelf('[object WorkerGlobalScope]', /^\[object W/),
OLD_SAFARI_LOCATION_CTOR:
function ()
{
Expand Down

0 comments on commit 4f7a214

Please sign in to comment.