Skip to content

Support proposed ES Next "::" bind operator #3508

Closed as not planned
Closed as not planned

Description

Edit from @DanielRosenwasser: Since this issue was filed, a separate proposal for :: was created called "extensions".

https://github.com/tc39/proposal-extensions


It will be great if TypeScript had an implementation of the "::" bind operator of ECMAScript 7. Some examples of this operator and the implementation in ES5:
Bind

// ES5
var log = console.log.bind(console);

// ES7
let log = ::console.log;

Call

// ES5
var forEach = Array.prototype.forEach,
    elements = document.querySelectorAll("div");

forEach.call(elements, div => { console.log(div); })

// ES7
let forEach = Array.prototype.forEach,
    elements = document.querySelectorAll("div");

elements::forEach(div => { console.log(div) });

[ref] [more examples]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    ES NextNew featurers for ECMAScript (a.k.a. ESNext)RevisitAn issue worth coming back toSuggestionAn idea for TypeScriptWaiting for TC39Unactionable until TC39 reaches some conclusion

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions