Skip to content

Commit

Permalink
build entries for DOM collections
Browse files Browse the repository at this point in the history
  • Loading branch information
zloirock committed Jan 25, 2024
1 parent 7d6e5c9 commit 5b29fdb
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 6 deletions.
26 changes: 25 additions & 1 deletion scripts/build-entries/entries-definitions.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,7 @@ export const features = {
modules: ['es.date.to-json'],
template: $virtual({ namespace: 'Date', method: 'toJSON' }),
},
// date/to-primitive ???
'disposable-stack/index': {
modules: [/^(?:es|esnext)\.disposable-stack\./],
template: $namespace({ name: 'DisposableStack' }),
Expand All @@ -532,7 +533,30 @@ export const features = {
modules: ['esnext.disposable-stack.constructor'],
template: $namespace({ name: 'DisposableStack' }),
},
// date/to-primitive ???
'dom-collections/index': {
modules: [/^web\.dom-collections\./],
template: $justImport,
},
'dom-collections/entries': {
modules: ['web.dom-collections.entries'],
template: $justImport,
},
'dom-collections/for-each': {
modules: ['web.dom-collections.for-each'],
template: $justImport,
},
'dom-collections/iterator': {
modules: ['web.dom-collections.iterator'],
template: $justImport,
},
'dom-collections/keys': {
modules: ['web.dom-collections.keys'],
template: $justImport,
},
'dom-collections/values': {
modules: ['web.dom-collections.values'],
template: $justImport,
},
'dom-exception/index': {
modules: [/^web\.dom-exception\./],
template: $namespace({ name: 'DOMException' }),
Expand Down
10 changes: 5 additions & 5 deletions tests/entries/unit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -578,11 +578,11 @@ for (PATH of ['@core-js/pure', 'core-js']) {
ok(load(NS, 'dom-exception/to-string-tag') === 'DOMException');
ok(typeof load(NS, 'dom-exception') == 'function');
load(NS, 'dom-collections');
ok(typeof load(NS, 'dom-collections/for-each') == 'function');
ok(typeof load(NS, 'dom-collections/iterator') == 'function');
ok(typeof load(NS, 'dom-collections/keys') == 'function');
ok(typeof load(NS, 'dom-collections/values') == 'function');
ok(typeof load(NS, 'dom-collections/entries') == 'function');
load(NS, 'dom-collections/for-each');
load(NS, 'dom-collections/iterator');
load(NS, 'dom-collections/keys');
load(NS, 'dom-collections/values');
load(NS, 'dom-collections/entries');
ok(load(NS, 'self').Math === Math);
ok(typeof load(NS, 'set-immediate') == 'function');
ok(load(NS, 'structured-clone')(42) === 42);
Expand Down

0 comments on commit 5b29fdb

Please # to comment.