Skip to content

Commit

Permalink
explainer § Description: Fix inconsistent RHS
Browse files Browse the repository at this point in the history
  • Loading branch information
js-choi committed Sep 30, 2021
1 parent 1c8d7fa commit 1043b49
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ ECMAScript Stage-0 Proposal. J. S. Choi, 2021.
(A [formal specification][] is available.)

**Method binding** `->` is a **left-associative infix operator**.
Its right-hand side is a **chain of identifiers**, **identifier** (like `f` or `o.x.y`),
or an **expression** in `(` `)` (like `hof()`),
Its right-hand side is an **identifier** (like `f`)
or a parenthesized **expression** (like `hof()`),
either of which must evaluate to a **function**.
Its left-hand side is some expression that evaluates to an **object**.
The `->` operator **binds** its left-hand side
Expand All @@ -24,10 +24,6 @@ equivalent to `fn.bind(arr)`,
except that its behavior does **not change**
if code elsewhere **reassigns** the **global method** `Function.prototype.bind`.

The right-hand side may be a property-access chain.
`arr->o.x.y` would be roughly
equivalent to `o.x.y.bind(arr)`.

Likewise, `obj->(createMethod())` would be roughly
equivalent to `createMethod().bind(obj)`.

Expand Down

0 comments on commit 1043b49

Please sign in to comment.