From 8a6d0f17f8af8fc05cbe59aefc349fb598699398 Mon Sep 17 00:00:00 2001 From: Michael Ficarra Date: Wed, 21 Sep 2022 15:13:20 -0700 Subject: [PATCH] Editorial: tweak a code sample (#2906) --- spec.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec.html b/spec.html index 654ceac442..c4f4dd6d5e 100644 --- a/spec.html +++ b/spec.html @@ -42917,10 +42917,10 @@

WeakRef.prototype.deref ( )

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.


-            target = { foo: function() {} };
+            let target = { foo() {} };
             let weakRef = new WeakRef(target);
 
-            ... later ...
+            // ... later ...
 
             if (weakRef.deref()) {
               weakRef.deref().foo();