Skip to content

Commit

Permalink
Fix bikeshed errors, primarily due to constructor changes:
Browse files Browse the repository at this point in the history
  • Loading branch information
travisleithead committed Dec 24, 2019
1 parent 6be34df commit 3da5650
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions index.bs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ Link Defaults: html (dfn) queue a task/in parallel/reflect
<pre class="link-defaults">
spec:html; type:dfn; for:/; text:browsing context
spec:webidl; type:dfn; text:namespace
spec:webidl; type:extended-attribute; text:Constructor
</pre>
<pre class="anchors">
url: https://tc39.github.io/ecma262/#sec-error-objects; type: dfn; text: ECMAScript error objects;
Expand Down Expand Up @@ -387,7 +386,7 @@ of Web IDL-derived classes without ever actually calling their constructor.

You should strive to reduce such magic in designing your own APIs, and give them constructors which
allow JavaScript developers to create them, just like the platform does. This means adding an
appropriate [{{Constructor}}] extended attribute to your interface, and defining the algorithm for
appropriate [=constructor operation=] to your interface, and defining the algorithm for
creating new instances of your class.

Apart from reducing the magic in the platform, adding constructors allows JavaScript developers to
Expand Down Expand Up @@ -939,7 +938,7 @@ See [[!HIGHRES-TIME]] for more details.
<h3 id="error-types">Use Error or DOMException for errors</h3>

Errors in web APIs should be represented as
<a>ECMAScript error objects</a> (perhaps via the WebIDL {{Error}} type)
<a>ECMAScript error objects</a> (e.g., [=ECMAScript error objects|Error=])
or as {{DOMException}}.
There was at one point a trend to use {{DOMError}} when
objects had a property representing an error.
Expand Down

0 comments on commit 3da5650

Please sign in to comment.