Skip to content

Commit

Permalink
Editorial: tweak a code sample (#2906)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelficarra authored and ljharb committed Sep 21, 2022
1 parent bc5b7fd commit 8a6d0f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spec.html
Original file line number Diff line number Diff line change
Expand Up @@ -42917,10 +42917,10 @@ <h1>WeakRef.prototype.deref ( )</h1>
<p>If the WeakRef returns a _target_ Object that is not *undefined*, then this _target_ object should not be garbage collected until the current execution of ECMAScript code has completed. The AddToKeptObjects operation makes sure read consistency is maintained.</p>

<pre><code class="javascript">
target = { foo: function() {} };
let target = { foo() {} };
let weakRef = new WeakRef(target);

... later ...
// ... later ...

if (weakRef.deref()) {
weakRef.deref().foo();
Expand Down

0 comments on commit 8a6d0f1

Please sign in to comment.