Table of Contents


Native syntax for f.bind(self):

const hasOwnProperty = Object.prototype.hasOwnProperty;
function hasOwn(obj, key) {
    return obj::hasOwnProperty(key);

Calling a superclass constructor:

function MySubClass(x, y, z) {
    this.y = y;
    this.z = z;

Bound-method extraction:

var method =;

Bound-method extraction with implicit object:

var method =;



Expression ::= ...
            |  Expression "::" Expression

Precedence: should bind just barely weaker than “.”

TODO: grammar details


Essentially, e1::e2 is equivalent to do { let obj=e1; e2.bind(obj) } with the original meaning of .bind (the let-binding ensures left-to-right evaluation).

And ::e uses the base of the reference, or null if the base is not an object.


  • better usability for method extraction + this-binding
  • better usability for
  • don’t have to worry about .bind or .call being shadowed/mutated
  • addresses some super use cases without need for implicit lexical binding
  • static syntax means no dynamic tests (e.g. for mutation of .bind or .call) ⇒ better performance
  • important for code generators that don’t want to be penalized for generating .call


strawman/bind_operator.txt · Last modified: 2012/03/28 17:37 by dherman
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki