From 53300d33c7c9253da49e063d393a8ae915d5bfdf Mon Sep 17 00:00:00 2001 From: ashish maurya Date: Tue, 3 Aug 2021 01:45:47 +0530 Subject: [PATCH] doc: fixed variable names in queueMicrotask example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixed variable name in queueMicrotask where url variable was used instead of key PR-URL: https://github.com/nodejs/node/pull/39634 Reviewed-By: Benjamin Gruenbaum Reviewed-By: Harshitha K P Reviewed-By: Anna Henningsen Reviewed-By: James M Snell Reviewed-By: Tobias Nießen --- doc/api/globals.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/globals.md b/doc/api/globals.md index e577372b5c4cf6..013495c8e73b09 100644 --- a/doc/api/globals.md +++ b/doc/api/globals.md @@ -242,7 +242,7 @@ within each turn of the Node.js event loop. // before any other promise jobs. DataHandler.prototype.load = async function load(key) { - const hit = this._cache.get(url); + const hit = this._cache.get(key); if (hit !== undefined) { queueMicrotask(() => { this.emit('load', hit); @@ -251,7 +251,7 @@ DataHandler.prototype.load = async function load(key) { } const data = await fetchData(key); - this._cache.set(url, data); + this._cache.set(key, data); this.emit('load', data); }; ```