main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 4 days ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
659 bytes
|
Rev | Line | |
---|
[79a0317] | 1 | 'use strict';
|
---|
| 2 | var $ = require('../internals/export');
|
---|
| 3 | var aWeakSet = require('../internals/a-weak-set');
|
---|
| 4 | var remove = require('../internals/weak-set-helpers').remove;
|
---|
| 5 |
|
---|
| 6 | // `WeakSet.prototype.deleteAll` method
|
---|
| 7 | // https://github.com/tc39/proposal-collection-methods
|
---|
| 8 | $({ target: 'WeakSet', proto: true, real: true, forced: true }, {
|
---|
| 9 | deleteAll: function deleteAll(/* ...elements */) {
|
---|
| 10 | var collection = aWeakSet(this);
|
---|
| 11 | var allDeleted = true;
|
---|
| 12 | var wasDeleted;
|
---|
| 13 | for (var k = 0, len = arguments.length; k < len; k++) {
|
---|
| 14 | wasDeleted = remove(collection, arguments[k]);
|
---|
| 15 | allDeleted = allDeleted && wasDeleted;
|
---|
| 16 | } return !!allDeleted;
|
---|
| 17 | }
|
---|
| 18 | });
|
---|
Note:
See
TracBrowser
for help on using the repository browser.