Skip to content

Commit 7a59934

Browse files
authored
Merge pull request #259 from zolkis/consume-ctor
Fix #244: ConsumeThing constructor and consume() should do the same
2 parents 96ebc4f + c9ee6a8 commit 7a59934

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

index.html

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -414,9 +414,6 @@ <h2>The <dfn>WOT</dfn> namespace</dfn></h2>
414414
<li>
415415
If invoking this method is not allowed for the current scripting context for security reasons, reject |promise| with a {{SecurityError}} and abort these steps.
416416
</li>
417-
<li>
418-
Run the <a>validate a TD</a> steps on |td|. If that fails, reject |promise| with {{SyntaxError}} and abort these steps.
419-
</li>
420417
<li>
421418
Let |thing:ConsumedThing| be a new {{ConsumedThing}} object constructed from |td|.
422419
</li>
@@ -432,6 +429,12 @@ <h2>The <dfn>WOT</dfn> namespace</dfn></h2>
432429
Resolve |promise| with |thing|.
433430
</li>
434431
</ol>
432+
<p class="ednote">
433+
Note the difference between constructing <a>ConsumedThing</a> and using
434+
the <code>consume()</code> method: the latter also initializes the protocol
435+
bindings, whereas a simple constructed object will not have <a>WoT Interactions</a>
436+
initialized until they are invoked.
437+
</p>
435438
</div>
436439
</section>
437440

@@ -1053,6 +1056,10 @@ <h4>Constructing <code>ConsumedThing</code></h4>
10531056
To create {{ConsumedThing}} with the {{ThingDescription}}
10541057
|td:ThingDescription|, run the following steps:
10551058
<ol>
1059+
<li>
1060+
Run the <a>validate a TD</a> steps on |td|. If that fails,
1061+
[= exception/throw =] {{SyntaxError}} and abort these steps.
1062+
</li>
10561063
<li>
10571064
Run the <a>expand a TD</a> steps on |td|. If that fails, re-[= exception/throw =] the error and abort these steps.
10581065
</li>

0 commit comments

Comments
 (0)