Editorial: Model the bindings of a declarative Env Rec as a List of Records
Making this a draft PR because I'm not sure about module Env Recs.
Some alternatives for DeclarativeBindingRecord:
(1)
Replace [[IsInitialized]]: Boolean, [[BoundValue]]: ECMAScript language value
with [[BoundValue]]: ~uninitialized~ or ECMAScript language value
[Later: I did this.]
(2)
To avoid the weirdness of the [[BoundValue]] field in indirect bindings...
(2a)
Instead of defining the sub-type ImportDeclarativeBindingRecord, allow the [[BoundValue]] field of a DeclarativeBindingRecord to be a record with just the [[TargetModuleRec]] and [[TargetName]] fields.
(2b)
Or you could have an abstract base type that is specialized into either having a [[BoundValue]] field or the [[TargetModuleRec]] and [[TargetName]] fields. (E.g. DeclarativeBindingRecord specializes to DirectDeclarativeBindingRecord and IndirectDeclarativeBindingRecord.) This is probably nicest from a theoretical standpoint, but 2a is basically equivalent without having to set up another type hierarchy.
[Later: I went with 2b, basically.]
(forced-pushed after rebase to master)
(force-pushed to resolve merge conflicts)
Okay, this PR is ready for review.
Issue #2639 might affect SetMutableBinding, but probably not much.