Skip to content

Commit

Permalink
prevent symbols as keys (#98)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickbutton authored Mar 6, 2020
1 parent e3715cf commit 57cd0e9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,9 @@ We define a record or tuple expression by using the `#` modifier in front of oth
#### Runtime verification
At runtime, if a non-value type is placed inside a `Record` or `Tuple`, it is a `TypeError`. This means that a `Record` or `Tuple` expression can only contain value types.
At runtime, attempting to create a `Record` with a `symbol` key is a `TypeError`.
At runtime, attempting to create a `Record` with a key that is not a `string` or `symbol` is a `TypeError`.
At runtime, it is a `TypeError` to add a value to a `Record` or `Tuple` of any type except the following: `Record`, `Tuple`, `string`, `number`, `symbol`, `boolean`, `bigint`, `undefined`, or `null`.
At runtime, attempting to create a `Record` or `Tuple` that contains any type except the following: `Record`, `Tuple`, `string`, `number`, `symbol`, `boolean`, `bigint`, `undefined`, or `null` is a `TypeError`.
If you try to use a method definitions as part of a Record, the same behavior is expected, it should fail at runtime (even if we could fail at compile time).
Expand Down

0 comments on commit 57cd0e9

Please sign in to comment.