From f1b907a51cdb84fa0ab42bf49abb30b3a7feb0a9 Mon Sep 17 00:00:00 2001 From: Andrey Pechkurov Date: Thu, 2 Jul 2020 15:31:40 +0300 Subject: [PATCH] Improve code samples --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f8fa1dc..618d6d1 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ The `FinalizationRegistry` class represents a group of objects registered with a ```js class FileStream { static #cleanUp(heldValue) { - console.error(`File leaked: ${file}!`); + console.error(`File leaked: ${heldValue}!`); } static #finalizationGroup = new FinalizationRegistry(FileStream.#cleanUp); @@ -210,7 +210,7 @@ function makeWeakCached(f) { }; } -var getImageCached = makeWeakCached(getImage); +const getImageCached = makeWeakCached(getImage); ``` This example illustrates two important considerations about finalizers: