Skip to content
This repository has been archived by the owner on Oct 8, 2024. It is now read-only.

Web compat: The %Symbol.toStringTag% property on %Iterator.prototype% needs to be writable #115

Closed
ExE-Boss opened this issue Jul 21, 2020 · 7 comments · Fixed by #214

Comments

@ExE-Boss
Copy link
Contributor

Firefox ran into Bug 1644581 when the %Symbol.toStringTag% property was added to %Iterator.prototype% as non‑writable.

There was also no attempt to add a %Symbol.toStringTag% property to %AsyncIterator.prototype% afterwards, which is why I opened Bug 1654075.

@ljharb
Copy link
Member

ljharb commented Jul 21, 2020

I asked on the first bug; but what exactly makes it not web compatible?

@jorendorff
Copy link
Collaborator

I'm not convinced that fixing regenerator 0.13.next makes this web-compatible, though. Won't there be a significant volume of existing regenerator deployments out there, until they all upgrade? What's the half-life of a deployment of a particular regenerator version?

I think a writable [%toStringTag%] property would be web-compatible.

@ljharb
Copy link
Member

ljharb commented Jul 23, 2020

@jorendorff it doesn't immediately do that, you're right - the hope is that in the upcoming months, regenerator users would update their installations. Its maintainer believes folks update it frequently.

Obviously if not, then it'd have to be made writable (or, the thing it's setting be made writable instead of this one).

@Jack-Works
Copy link
Member

Is it possible to not specify @@toStringTag now, or let it be writable currently, then let the browser detect the try of writing it? If the usage is small enough, then convert it to non-writable?

@ljharb
Copy link
Member

ljharb commented Jul 24, 2020

I suppose we could make it non-writable, but writable in Annex B, but that seems pretty unfortunate.

@Jack-Works
Copy link
Member

Wait, regenerator is designed to be running in the non-strict mode. IIRC write a non-writable property will not throw in the non-strict mode.

https://github.com/facebook/regenerator/blob/master/packages/regenerator-runtime/runtime.js#L738

@ExE-Boss
Copy link
Contributor Author

@Jack-Works That’s only the outer scope, the body of the IIFE is strict mode code:

https://github.com/facebook/regenerator/blob/master/packages/regenerator-runtime/runtime.js#L9

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
5 participants