archives

« Bugzilla Issues Index

#2990 — Remove NormalCompletion from WeakMap and WeakSet constructors?


For WeakSet ( [ iterable ] ) we have:

"If next is false, then return NormalCompletion(set)."

But for Set ( [ iterable ] ) we have:

"If iter is undefined, then return set."

Other than that the two constructors are equal (minus WeakSetData vs SetData)

Same goes for WeakMap.

Another option is to refactor the spec so that WeakSet and Set can share the spec for their constructors.


fixed in rev26 editor's draft

eliminated the unnecessary NormalCompletion's

It would be nice to refactor to share a common algorithm, the the differing internal slot names makes it difficult. I'm going to leave it as is in that regard, for now.


fixed in rev26