es-discuss Digest, Vol 95, Issue 45

Fabrício Matté ultcombo at gmail.com
Mon Jan 19 05:32:34 PST 2015


Your second example may break if the constructor is called via
`.call()`/`.apply()` or as a *CallExpression : MemberExpression* or if it
has been `.bind()`ed. Although these may look like corner cases, a good
transform should cover these cases, especially *CallExpression :
MemberExpression* as it is very common in Node.js land to have constructors
exported as properties of an exported object.

Btw, you're also missing a `return` before `this` in your "global" function
body.

/fm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150119/145a509f/attachment.html>


More information about the es-discuss mailing list