mirror of
https://github.com/fofolee/uTools-Manuals.git
synced 2026-02-27 09:32:01 +08:00
语法高亮,滚动条美化,设置页面调整
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/atomics-add.html" width="100%"></iframe></div>
|
||||
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox">Atomics.add(typedArray, index, value)
|
||||
</pre>
|
||||
<pre><code class="language-javascript">Atomics.add(typedArray, index, value)
|
||||
</code></pre>
|
||||
<h3 id="参数">参数</h3>
|
||||
<dl>
|
||||
<dt><code>typedArray</code></dt>
|
||||
@@ -24,11 +24,11 @@
|
||||
<li>如果 <code>index</code> 超出了 <code>typedArray 的边界,则抛出</code> <a href="Reference/Global_Objects/RangeError" title="RangeError对象标明一个错误,当一个值不在其所允许的范围或者集合中。"><code>RangeError</code></a>。</li>
|
||||
</ul>
|
||||
<h2 id="示例">示例</h2>
|
||||
<pre class="brush: js">var sab = new SharedArrayBuffer(1024);
|
||||
<pre><code class="language-javascript">var sab = new SharedArrayBuffer(1024);
|
||||
var ta = new Uint8Array(sab);
|
||||
|
||||
Atomics.add(ta, 0, 12); // returns 0, the old value
|
||||
Atomics.load(ta, 0); // 12</pre>
|
||||
Atomics.load(ta, 0); // 12</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/atomics-and.html" width="100%"></iframe></div>
|
||||
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox">Atomics.and(typedArray, index, value)
|
||||
</pre>
|
||||
<pre><code class="language-javascript">Atomics.and(typedArray, index, value)
|
||||
</code></pre>
|
||||
<h3 id="参数">参数</h3>
|
||||
<dl>
|
||||
<dt><code>typedArray</code></dt>
|
||||
@@ -62,15 +62,15 @@
|
||||
<pre>5 0101
|
||||
1 0001
|
||||
----
|
||||
1 0001</pre>
|
||||
1 0001</code></pre>
|
||||
<h2 id="示例">示例</h2>
|
||||
<pre class="brush: js">var sab = new SharedArrayBuffer(1024);
|
||||
<pre><code class="language-javascript">var sab = new SharedArrayBuffer(1024);
|
||||
var ta = new Uint8Array(sab);
|
||||
ta[0] = 5;
|
||||
|
||||
Atomics.and(ta, 0, 1); // returns 0, the old value
|
||||
Atomics.load(ta, 0); // 1
|
||||
</pre>
|
||||
</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/atomics-compareexchange.html" width="100%"></iframe></div>
|
||||
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox">Atomics.compareExchange(typedArray, index, expectedValue, replacementValue)
|
||||
</pre>
|
||||
<pre><code class="language-javascript">Atomics.compareExchange(typedArray, index, expectedValue, replacementValue)
|
||||
</code></pre>
|
||||
<h3 id="参数">参数</h3>
|
||||
<dl>
|
||||
<dt><code>typedArray</code></dt>
|
||||
@@ -28,12 +28,12 @@
|
||||
<li>如果 <code>index</code> 超出了 <code>typedArray 的边界,则抛出</code> <a href="Reference/Global_Objects/RangeError" title="RangeError对象标明一个错误,当一个值不在其所允许的范围或者集合中。"><code>RangeError</code></a>。</li>
|
||||
</ul>
|
||||
<h2 id="示例">示例</h2>
|
||||
<pre class="brush: js">var sab = new SharedArrayBuffer(1024);
|
||||
<pre><code class="language-javascript">var sab = new SharedArrayBuffer(1024);
|
||||
var ta = new Uint8Array(sab);
|
||||
ta[0] = 7;
|
||||
|
||||
Atomics.compareExchange(ta, 0, 7, 12); // returns 7, the old value
|
||||
Atomics.load(ta, 0); // 12</pre>
|
||||
Atomics.load(ta, 0); // 12</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/atomics-exchange.html" width="100%"></iframe></div>
|
||||
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox">Atomics.exchange(typedArray, index, value)
|
||||
</pre>
|
||||
<pre><code class="language-javascript">Atomics.exchange(typedArray, index, value)
|
||||
</code></pre>
|
||||
<h3 id="参数">参数</h3>
|
||||
<dl>
|
||||
<dt><code>typedArray</code></dt>
|
||||
@@ -26,11 +26,11 @@
|
||||
<li>如果 <code>index</code> 超出了 <code>typedArray 的边界,则抛出</code> <a href="Reference/Global_Objects/RangeError" title="RangeError对象标明一个错误,当一个值不在其所允许的范围或者集合中。"><code>RangeError</code></a>。</li>
|
||||
</ul>
|
||||
<h2 id="示例">示例</h2>
|
||||
<pre class="brush: js">var sab = new SharedArrayBuffer(1024);
|
||||
<pre><code class="language-javascript">var sab = new SharedArrayBuffer(1024);
|
||||
var ta = new Uint8Array(sab);
|
||||
|
||||
Atomics.exchange(ta, 0, 12); // returns 0, the old value
|
||||
Atomics.load(ta, 0); // 12</pre>
|
||||
Atomics.load(ta, 0); // 12</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/atomics-islockfree.html" width="100%"></iframe></div>
|
||||
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox">Atomics.isLockFree(size)
|
||||
</pre>
|
||||
<pre><code class="language-javascript">Atomics.isLockFree(size)
|
||||
</code></pre>
|
||||
<h3 id="参数">参数</h3>
|
||||
<dl>
|
||||
<dt><code>size</code></dt>
|
||||
@@ -16,7 +16,7 @@
|
||||
<h3 id="返回值">返回值</h3>
|
||||
<p> <a href="Reference/Boolean" title="此页面仍未被本地化, 期待您的翻译!"><code>Boolean</code></a> 是否为能够使用原子操作的<code><a href="https://developer.mozilla.orgReference/Global_Objects/TypedArray/BYTES_PER_ELEMENT" title="TypedArray.BYTES_PER_ELEMENT 属性代表了强类型数组中每个元素所占用的字节数。">TypedArray</a></code>的标准字节长度之一.</p>
|
||||
<h2 id="示例">示例</h2>
|
||||
<pre class="brush: js">Atomics.isLockFree(1); // true
|
||||
<pre><code class="language-javascript">Atomics.isLockFree(1); // true
|
||||
Atomics.isLockFree(2); // true
|
||||
Atomics.isLockFree(3); // false
|
||||
Atomics.isLockFree(4); // true
|
||||
@@ -24,7 +24,7 @@ Atomics.isLockFree(5); // false
|
||||
Atomics.isLockFree(6); // false
|
||||
Atomics.isLockFree(7); // false
|
||||
Atomics.isLockFree(8); // false
|
||||
Atomics.isLockFree(<code>Float64Array.BYTES_PER_ELEMENT</code>); // false,<code>Atomics方法无法处理Float64Array</code></pre>
|
||||
Atomics.isLockFree(<code>Float64Array.BYTES_PER_ELEMENT</code>); // false,<code>Atomics方法无法处理Float64Array</code></code></pre>
|
||||
<h2 id="Specifications">Specifications</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/atomics-load.html" width="100%"></iframe></div>
|
||||
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox">Atomics.load(typedArray, index)
|
||||
</pre>
|
||||
<pre><code class="language-javascript">Atomics.load(typedArray, index)
|
||||
</code></pre>
|
||||
<h3 id="参数">参数</h3>
|
||||
<dl>
|
||||
<dt><code>typedArray</code></dt>
|
||||
@@ -22,11 +22,11 @@
|
||||
<li>抛出 <a href="Reference/Global_Objects/RangeError" title="RangeError对象标明一个错误,当一个值不在其所允许的范围或者集合中。"><code>RangeError</code></a>, 如果 <code>index</code> 超出 <code>typedArray</code> 的界限。</li>
|
||||
</ul>
|
||||
<h2 id="示例">示例</h2>
|
||||
<pre class="brush: js">var sab = new SharedArrayBuffer(1024);
|
||||
<pre><code class="language-javascript">var sab = new SharedArrayBuffer(1024);
|
||||
var ta = new Uint8Array(sab);
|
||||
|
||||
Atomics.add(ta, 0, 12);
|
||||
Atomics.load(ta, 0); // 12</pre>
|
||||
Atomics.load(ta, 0); // 12</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
<div><iframe class="interactive interactive-js" frameborder="0" height="250" src="https://interactive-examples.mdn.mozilla.net/pages/js/atomics-store.html" width="100%"></iframe></div>
|
||||
<p class="hidden">The source for this interactive example is stored in a GitHub repository. If you'd like to contribute to the interactive examples project, please clone <a class="external" href="https://github.com/mdn/interactive-examples" rel="noopener">https://github.com/mdn/interactive-examples</a> and send us a pull request.</p>
|
||||
<h2 id="语法">语法</h2>
|
||||
<pre class="syntaxbox">Atomics.store(typedArray, index, value)
|
||||
</pre>
|
||||
<pre><code class="language-javascript">Atomics.store(typedArray, index, value)
|
||||
</code></pre>
|
||||
<h3 id="参数">参数</h3>
|
||||
<dl>
|
||||
<dt><code>typedArray</code></dt>
|
||||
@@ -24,10 +24,10 @@
|
||||
<li>抛出一个<a href="Reference/Global_Objects/RangeError" title="RangeError对象标明一个错误,当一个值不在其所允许的范围或者集合中。"><code>RangeError</code></a>异常, 如果 <code>index</code> 在 <code>typedArray</code>中越界了。</li>
|
||||
</ul>
|
||||
<h2 id="示例">示例</h2>
|
||||
<pre class="brush: js">var sab = new SharedArrayBuffer(1024);
|
||||
<pre><code class="language-javascript">var sab = new SharedArrayBuffer(1024);
|
||||
var ta = new Uint8Array(sab);
|
||||
|
||||
Atomics.store(ta, 0, 12); // 12</pre>
|
||||
Atomics.store(ta, 0, 12); // 12</code></pre>
|
||||
<h2 id="规范">规范</h2>
|
||||
<table class="standard-table">
|
||||
<tbody>
|
||||
|
||||
Reference in New Issue
Block a user