Skip to content

Commit

Permalink
Add Resolved Values and Function Handler sections to formatting (#728)
Browse files Browse the repository at this point in the history
* Add Resolved Values section to formatting

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Tim Chevalier <tjc@igalia.com>

* Linkify "resolved value"

* Add some examples & explicitly allow wrapping input values

* No throw, only emit

Co-authored-by: Tim Chevalier <tjc@igalia.com>

* Add section on Function Handlers, defining the term

* Apply suggestions from code review

* Rephrase initial resolved value definition

* Update spec/formatting.md

Co-authored-by: Eemeli Aro <eemeli@mozilla.com>

* Update resolved value definition again

Co-authored-by: Addison Phillips <addison@unicode.org>

---------

Co-authored-by: Tim Chevalier <tjc@igalia.com>
Co-authored-by: Addison Phillips <addison@unicode.org>
  • Loading branch information
3 people authored Oct 7, 2024
1 parent 22707c7 commit 662c97f
Show file tree
Hide file tree
Showing 5 changed files with 181 additions and 153 deletions.
8 changes: 4 additions & 4 deletions spec/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ a reference to a function which cannot be resolved.
### Bad Selector

A **_<dfn>Bad Selector</dfn>_** error occurs when a message includes a _selector_
with a resolved value which does not support selection.
with a _resolved value_ which does not support selection.

> For example, attempting to format this message
> would result in a _Bad Selector_ error:
Expand All @@ -283,10 +283,10 @@ with a resolved value which does not support selection.
## Message Function Errors

A **_<dfn>Message Function Error</dfn>_** is any error that occurs
when calling a message function implementation
when calling a _function handler_
or which depends on validation associated with a specific function.

Implementations SHOULD provide a way for _functions_ to emit
Implementations SHOULD provide a way for _function handlers_ to emit
(or cause to be emitted) any of the types of error defined in this section.
Implementations MAY also provide implementation-defined _Message Function Error_ types.

Expand All @@ -300,7 +300,7 @@ Implementations MAY also provide implementation-defined _Message Function Error_
> 3. Uses a `:get` message function which requires its argument to be an object and
> an option `field` to be provided with a string value.
>
> The exact type of _Message Function Error_ is determined by the message function implementation.
> The exact type of _Message Function Error_ is determined by the _function handler_.
>
> ```
> Hello, {horse :get field=name}!
Expand Down
Loading

0 comments on commit 662c97f

Please sign in to comment.