Skip to content

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

Description

@justingrant

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions