Skip to content

Commit

Permalink
Fixing errors reported by Fabrice Bellard
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Ehrenberg authored Jan 15, 2020
1 parent 6b9f0ef commit c26e0fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions PROTOSPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Each Operator Set record has the following fields, none of which are ever modifi

Built-in Operator Sets exist for the built-in numeric primitive types: String, BigInt and Number. The phrase "the Operator Set of `x`" refers to `x.[[OperatorSet]]` if `x` is an object, and the built-in Operator Set for those four types, which describes the currently specified behavior.

Note, String overloading only supports the +, == and < operators, and not the other "numeric" operators. Boolean and Symbol may not have operators overloaded on them.
Note, String overloading only supports the == and < operators, and not the other "numeric" operators. Boolean and Symbol may not have operators overloaded on them.

### Operator usage semantics

Expand All @@ -39,7 +39,7 @@ DispatchBinaryOperator(operator, a, b):
1. If the common operator set does not have a definition for the operator in its `[[SelfOperatorDefinition]]` table, throw a TypeError.
1. Otherwise, apply the definition to the arguments and return the result.
1. Otherwise, if a's operator set has a lower `[[OperatorCounter]]` than b's operator set,
1. Find the relevant operator definition table in the b.`[[OperatorSet]]`.`[[OperatorCounter]]`'th element of a.`[[OperatorSet]]`.`[[RightOperatorDefinitions]]`.
1. Find the relevant operator definition table in the a.[[OperatorSet]].[[OperatorCounter]]'th element of b.[[OperatorSet]].[[RightOperatorDefinitions]].
1. If the operator is `~empty~` in that operator definition table, throw a TypeError.
1. Otherwise, apply the operator to the arguments using the operator table.
1. Otherwise, b's operator set has a lower `[[OperatorCounter]]` than a's operator set,
Expand Down

0 comments on commit c26e0fd

Please sign in to comment.