Skip to content

Add a polyfill for Symbol and prototype[Symbol.iterator] to enable for..of loops

username-removed-636429 requested to merge 25188-polyfill-es6-symbol into master

What does this MR do?

Polyfills Symbol and Symbol.prototype.iterator for browsers which do not natively support it. Babel currently uses these when transpiling a loop like:

for (node of nodeList) {
  node.setAttribute('foo', 'bar');
}

or an array destructuring statement like:

const [foo, bar] = methodWhichReturnsAnArray();

Are there points in the code the reviewer needs to double check?

This is already used in a few places in our code like project_label_subscription.js.es6, and these won't currently execute properly in any version of Internet Explorer, or any version of Safari prior to v10.

Why was this MR needed?

^ see above

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #25188 (closed)

Merge request reports