diff options
author | Irvin <irvinfly@gmail.com> | 2022-02-16 02:02:49 +0800 |
---|---|---|
committer | Irvin <irvinfly@gmail.com> | 2022-02-16 02:35:54 +0800 |
commit | 01b0e12ba27b5069248fd09235e9a7143915ee30 (patch) | |
tree | 0e9edf538dc3fa3331e1dbb79239b58186765f86 /files/zh-cn/web/javascript/reference/global_objects/finalizationregistry | |
parent | 6ca84f1794af830ada9736d7289ce29aabb04ca3 (diff) | |
download | translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.tar.gz translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.tar.bz2 translated-content-01b0e12ba27b5069248fd09235e9a7143915ee30.zip |
remove `notranslate` class in zh-CN
Diffstat (limited to 'files/zh-cn/web/javascript/reference/global_objects/finalizationregistry')
-rw-r--r-- | files/zh-cn/web/javascript/reference/global_objects/finalizationregistry/index.html | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/files/zh-cn/web/javascript/reference/global_objects/finalizationregistry/index.html b/files/zh-cn/web/javascript/reference/global_objects/finalizationregistry/index.html index 10e720eb80..5dbd569caf 100644 --- a/files/zh-cn/web/javascript/reference/global_objects/finalizationregistry/index.html +++ b/files/zh-cn/web/javascript/reference/global_objects/finalizationregistry/index.html @@ -21,14 +21,14 @@ translation_of: Web/JavaScript/Reference/Global_Objects/FinalizationRegistry <p>你在回调中创建了如下的 registry:</p> -<pre class="brush: js notranslate">const registry = new FinalizationRegistry(heldValue => { +<pre class="brush: js">const registry = new FinalizationRegistry(heldValue => { // .... }); </pre> <p>然后,你可以通过调用`register`方法,注册任何你想要清理回调的对象,传入该对象和*所含的值*。</p> -<pre class="brush: js notranslate">registry.register(theObject, "some value"); +<pre class="brush: js">registry.register(theObject, "some value"); </pre> <p>The registry does not keep a strong reference to the object, as that would defeat the purpose (if the registry held it strongly, the object would never be reclaimed).</p> @@ -39,14 +39,14 @@ translation_of: Web/JavaScript/Reference/Global_Objects/FinalizationRegistry <p>It's common to use the object itself as the unregister token, which is just fine:</p> -<pre class="brush: js notranslate">registry.register(theObject, "some value", theObject); +<pre class="brush: js">registry.register(theObject, "some value", theObject); // ...some time later, if you don't care about `theObject` anymore... registry.unregister(theObject); </pre> <p>It doesn't have to be the same object, though; it can be a different one:</p> -<pre class="brush: js notranslate">registry.register(theObject, "some value", tokenObject); +<pre class="brush: js">registry.register(theObject, "some value", tokenObject); // ...some time later, if you don't care about `theObject` anymore... registry.unregister(tokenObject); </pre> @@ -108,7 +108,7 @@ registry.unregister(tokenObject); <p>You create the registry passing in the callback:</p> -<pre class="brush: js notranslate">const registry = new FinalizationRegistry(heldValue => { +<pre class="brush: js">const registry = new FinalizationRegistry(heldValue => { // .... }); </pre> @@ -117,7 +117,7 @@ registry.unregister(tokenObject); <p>Then you register any objects you want a cleanup callback for by calling the `register` method, passing in the object and a *held value* for it:</p> -<pre class="brush: js notranslate">registry.register(theObject, "some value");</pre> +<pre class="brush: js">registry.register(theObject, "some value");</pre> <h2 id="Specifications">Specifications</h2> |