This is the formal specification
for a proposed bind-this operator ::
in JavaScript.
It modifies the original ECMAScript specification with
several new or revised clauses. See the
proposal's explainer
for the proposal's background, motivation, and usage examples.
This section augments the original IsFunctionDefinition clause.
This section augments the original IsIdentifierRef clause.
This section augments the original Contains clause.
With parameter symbol.
This section augments the original AssignmentTargetType clause.
This section augments the original Punctuators clause.
This section augments the original Left-Hand-Side Expressions clause.
This section augments the original Left-Hand-Side Expressions, Static Semantics: Early Errors clause.
This production exists in order to prevent automatic semicolon insertion rules (
a::b
`c`
so that it would be interpreted as two valid statements. The purpose is to maintain consistency with similar code without the bind-this operator:
a.b
`c`
which is a valid statement and where automatic semicolon insertion does not apply.
This production exists in order to prevent automatic semicolon insertion rules (
a()::b
`c`
so that it would be interpreted as two valid statements. The purpose is to maintain consistency with similar code without the bind-this operator:
a().b
`c`
which is a valid statement and where automatic semicolon insertion does not apply.
This production exists in order to prevent automatic semicolon insertion rules (
a?.()::b
`c`
so that it would be interpreted as two valid statements. The purpose is to maintain consistency with similar code without the bind-this operator:
a?.().b
`c`
which is a valid statement and where automatic semicolon insertion does not apply.
This section augments the original Function Calls clause.
See also the
This section is a wholly new subclause to be inserted after the new
Operator clause.
For evaluation of the production
For evaluation of the productions
The abstract operation BindThis takes arguments baseValue (an
Function objects created using the bind-this operator are exotic objects. They also do not have a
This section augments the original Optional Chains clause.
The
See also the
If
If
See also the