benjamn / cls

Class factory featuring inheritance of static properties, static constructors, lazy population of prototypes, and this._super
MIT License
3 stars 0 forks source link

Allow .name as a static property #3

Open benjamn opened 11 years ago

benjamn commented 11 years ago

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.

benjamn commented 11 years ago

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