tc39 / proposal-bind-operator

This-Binding Syntax for ECMAScript
1.75k stars 30 forks source link

Can `.call`/`.bind` be used with the bind operator? #47

Closed Volune closed 7 years ago

Volune commented 7 years ago

At first I was trying to imagine the benefits of mixing .call/.bind with the "pipeline operator" I've seen in other issues (the one that use the left expression as first argument in the right call expression), i.e. simulate a this-pipeline operator with a first-arg-pipeline operator.

That make me wonder what would happen if we mix .call/.bind with the currently specified bind operator:

Or Syntax Errors ?

Igorbek commented 7 years ago
  1. value::a.b.call(0) -> a.b.call.call(value, 0)
  2. ::a.b.call -> a.b.call.bind(a.b)

why should it be syntax error?

Volune commented 7 years ago

If there are no errors or unexpected/tricky behavior with .bind/.call, I'm closing. I preferred to ask for nothing rather than miss a potential problem.