Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorashish maurya <ashishmaurya@outlook.com>2021-08-02 23:15:47 +0300
committerJames M Snell <jasnell@gmail.com>2021-08-13 00:42:22 +0300
commit13029cff31bf1c23919a8a51896277e5a2950505 (patch)
tree7c11f7fef4396f96132593a1c0ed5399339ece1c /doc/api/globals.md
parent2108f76b32e9150168b732ea9564bc4520797fdb (diff)
doc: fixed variable names in queueMicrotask example
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 <benjamingr@gmail.com> Reviewed-By: Harshitha K P <harshitha014@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Diffstat (limited to 'doc/api/globals.md')
-rw-r--r--doc/api/globals.md4
1 files changed, 2 insertions, 2 deletions
diff --git a/doc/api/globals.md b/doc/api/globals.md
index 2794009ffbd..a6ae338e7b5 100644
--- a/doc/api/globals.md
+++ b/doc/api/globals.md
@@ -335,7 +335,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);
@@ -344,7 +344,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);
};
```