archives

« Bugzilla Issues Index

#3524 — 7.3.21 SpeciesConstructor: Return defaultConstructor instead of throwing when the constructor property is absent?


7.3.21 SpeciesConstructor

When O.constructor is null or undefined, a TypeError is thrown (step 4). A reasonable alternative, which is more consistent with what 9.4.2.3 ArraySpeciesCreate does (and which is less backward-incompatible), is to return /defaultConstructor/.


fixed in rev31 editor's draft

only checking for undefined, which is basically equivalent to missing property.

Setting 'constructor' to null, seems weird enough to throw in this case.


In Rev31