While creating functions from strings is useful, I would much prefer being able 
to define call and construct methods in the source. Something like:

```javascript
class SubFunction extends Function {
  // Assigned as internal [[Call]] property.
  [Symbol.functionCall]() {
    return true
  }

  // Optional [[Construct]] override. If included, will be used instead of
  // [[Call]] when called with `new`.
  [Symbol.construct]() {
    // ...
  }
}

const Sub = new SubFunction()
Sub()
new Sub()
```
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to