Skip to content

Commit ab7cd69

Browse files
authored
Merge pull request #534 from JKRhb/fix-value-method
fix(InteractionOutput): don't require schema.type in value function
2 parents 636e91b + b38cf77 commit ab7cd69

File tree

1 file changed

+26
-2
lines changed

1 file changed

+26
-2
lines changed

index.html

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -976,8 +976,8 @@ <h2>The <dfn>InteractionOutput</dfn> interface</h2>
976976
</li>
977977
<li>
978978
If |this|.|data| is not a {{ReadableStream}} or if
979-
|dataUsed| is `true`, or if |form| is not an {{object}} or if |schema| or its
980-
|type| are `null` or `undefined`, then
979+
|dataUsed| is `true`, or if |form| is not an {{object}} or if |schema|
980+
is `null` or `undefined`, then
981981
[=reject=] |promise| with {{NotReadableError}} and stop.
982982
</li>
983983
<li>
@@ -1057,6 +1057,30 @@ <h2>The <dfn>InteractionOutput</dfn> interface</h2>
10571057
<section><h3>The <dfn>check data schema</dfn> algorithm</h3>
10581058
To run the <a>check data schema</a> steps on |payload| and |schema:object|,
10591059
<ol>
1060+
<li>
1061+
If |schema| is `null` or `undefined`, return `undefined`.
1062+
</li>
1063+
<li>
1064+
If |schema|.|const| is not |undefined| and |schema|.|const| does not equal |payload|, throw {{TypeError}} and stop.
1065+
</li>
1066+
<li>
1067+
If |schema|.|enum| is not |undefined| and none of the elements in
1068+
|schema|.|enum| equal |payload|, throw {{TypeError}} and stop.
1069+
</li>
1070+
<li>
1071+
Let |oneOf| be |schema|.|oneOf|.
1072+
If |oneOf| is not |undefined|,
1073+
<ol>
1074+
<li>
1075+
For each |subSchema| in |oneOf|, run the <a>check data schema</a>
1076+
steps on |payload| and |subSchema|.
1077+
</li>
1078+
<li>
1079+
If none or more than one of these runs do not throw, throw
1080+
{{TypeError}} and stop.
1081+
</li>
1082+
</ol>
1083+
</li>
10601084
<li>
10611085
Let |type| be |schema|.|type|.
10621086
</li>

0 commit comments

Comments
 (0)