Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this proposal about immutability or non-determinism? Or both? #41

Open
justingrant opened this issue Jul 6, 2020 · 0 comments
Open

Comments

@justingrant
Copy link

https://github.com/tc39/proposal-ses#freezing-intrinsics-and-taming-globals says:

To make a transitively immutable root realm, we, respectively

  • Remove all non-standard properties
  • Remove Math.random
  • Remove Date.now
    . . .

Do you mean "immutable" or "non-deterministic"? If the former, then why is Date.now() included? Can the user change the externally-observable state of the Date object by calling Date.now or any other Date method? If the latter, then should the proposal be updated to use "non-deterministic" to match what you mean? If "both" then it's probably worth clearly calling this out in the proposal.

Also: are there use cases where you might want one but not the other? For example, might a test framework want to prevent non-determinism without preventing mutation? Or vice versa, e.g. a plugin framework wishing to prevent mutation but OK with non-deterministic behavior? I'm not very familiar with the use cases so this might be off-target, but I at least wanted to bring up the issue.

Related: #32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant