This is the formal specification
for a proposed method-extraction 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 method extraction:
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 method extraction:
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 method extraction:
a()&b
`c`
which is a valid statement and where automatic semicolon insertion does not apply.
This section is a wholly new subclause to be inserted after the new
Operator clause.
The abstract operation ExtractMethod takes argument methodReference (a
Function objects created using method extraction are exotic objects. They also do not have a
This section augments the original Optional Chains clause.
With parameters baseValue and baseReference.
© 2021 J. S. Choi, Ecma International
All Software contained in this document ("Software") is protected by copyright and is being made available under the "BSD License", included below. This Software may be subject to third party rights (rights from parties other than Ecma International), including patent rights, and no licenses under such third party rights are granted under this license even if the third party concerned is a member of Ecma International. SEE THE ECMA CODE OF CONDUCT IN PATENT MATTERS AVAILABLE AT https://ecma-international.org/memento/codeofconduct.htm FOR INFORMATION REGARDING THE LICENSING OF PATENT CLAIMS THAT ARE REQUIRED TO IMPLEMENT ECMA INTERNATIONAL STANDARDS.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE ECMA INTERNATIONAL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ECMA INTERNATIONAL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.