1
0
Fork 0

Add constructor reference caveat to manual

* doc/classes.texi: Add caveat for referencing the constructor when using
  ES6-style naming.
master
Mike Gerwitz 2017-01-02 23:38:09 -05:00
parent b841b9cc5e
commit ab4874e285
Signed by: mikegerwitz
GPG Key ID: 8C917B7F5DC51BA2
1 changed files with 8 additions and 1 deletions

View File

@ -505,7 +505,14 @@ Implementation}), using a @code{__construct}@tie{}method:
ease.js introduced the @code{constructor} method in version@tie{}0.2.7
to match the ES6 ``class'' implementation;
it is an alias for @code{__construct},
and they may be used interchangeably.
and they may be used interchangeably.@footnote{
With one caveat:
when referencing the constructor method from another method
(dare I ask why you would do such a thing?),
you must use e.g.@tie{}@samp{this.__construct};
using @samp{this.constructor} would not be very useful,
as this is always set (in JavaScript) to the function
that instantiated the object.}
This method name may also be used prior to ES6.
@float Figure, f:constructor-es6