-
Notifications
You must be signed in to change notification settings - Fork 116
Description
In section 4.5 Decorate Class, step 2 we create a keys List and add each key from each element.
In section 4.6 Decorate Element, step 3.g we throw an error if element.[[Key]] is in keys. Also in step 3.k.i.1 we do the same thing for each item of extras.
In section 4.7 Decorate Constructor, step 2.e.ii. we throw an error if there are any duplicate keys in elements.
The issue is that we perform this key validation without regard to placement. It is perfectly legal in JavaScript to have two elements of the same name if one is static and the other is on the prototype. We also might want to consider allowing duplication between "prototype" and "own" placements to allow people to define methods on the prototype that are overwritten with bound "own" members during initialization.
As a result, I would expect that we need to track three sets of keys, one for each placement.