benjamn / cls

Class factory featuring inheritance of static properties, static constructors, lazy population of prototypes, and this._super

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Allow .name as a static property

benjamn opened this issue · comments

Currently the constructor is a declared function with .name === "constructor", and populate(constructor, newStatics, base) is not able to override that property.

The constructor should be an anonymous function expression instead, so that one can set its .name property (or not) as one sees fit.

This appears to be impossible in v8, so the best option seems to be simply to forbid .name static properties.