MCPcopy Create free account
hub / github.com/angular/dev-infra / iteratorMixin

Function iteratorMixin

github-actions/browserstack/set-browserstack-env.js:4707–4763  ·  view source on GitHub ↗
(name, object, kInternalIterator, keyIndex = 0, valueIndex = 1)

Source from the content-addressed store, hash-verified

4705 };
4706 }
4707 function iteratorMixin(name, object, kInternalIterator, keyIndex = 0, valueIndex = 1) {
4708 const makeIterator = createIterator(name, kInternalIterator, keyIndex, valueIndex);
4709 const properties = {
4710 keys: {
4711 writable: true,
4712 enumerable: true,
4713 configurable: true,
4714 value: function keys() {
4715 webidl.brandCheck(this, object);
4716 return makeIterator(this, "key");
4717 }
4718 },
4719 values: {
4720 writable: true,
4721 enumerable: true,
4722 configurable: true,
4723 value: function values() {
4724 webidl.brandCheck(this, object);
4725 return makeIterator(this, "value");
4726 }
4727 },
4728 entries: {
4729 writable: true,
4730 enumerable: true,
4731 configurable: true,
4732 value: function entries() {
4733 webidl.brandCheck(this, object);
4734 return makeIterator(this, "key+value");
4735 }
4736 },
4737 forEach: {
4738 writable: true,
4739 enumerable: true,
4740 configurable: true,
4741 value: function forEach(callbackfn, thisArg = globalThis) {
4742 webidl.brandCheck(this, object);
4743 webidl.argumentLengthCheck(arguments, 1, `${name}.forEach`);
4744 if (typeof callbackfn !== "function") {
4745 throw new TypeError(
4746 `Failed to execute 'forEach' on '${name}': parameter 1 is not of type 'Function'.`
4747 );
4748 }
4749 for (const { 0: key, 1: value } of makeIterator(this, "key+value")) {
4750 callbackfn.call(thisArg, value, key, this);
4751 }
4752 }
4753 }
4754 };
4755 return Object.defineProperties(object.prototype, __spreadProps(__spreadValues({}, properties), {
4756 [Symbol.iterator]: {
4757 writable: true,
4758 enumerable: false,
4759 configurable: true,
4760 value: properties.entries.value
4761 }
4762 }));
4763 }
4764 function fullyReadBody(body, processBody, processBodyError) {

Callers 1

""Function · 0.70

Calls 3

createIteratorFunction · 0.70
__spreadPropsFunction · 0.70
__spreadValuesFunction · 0.70

Tested by

no test coverage detected