aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/javascript/reference/reserved_words/index.html
diff options
context:
space:
mode:
authorPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
committerPeter Bengtsson <mail@peterbe.com>2020-12-08 14:40:17 -0500
commit33058f2b292b3a581333bdfb21b8f671898c5060 (patch)
tree51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/javascript/reference/reserved_words/index.html
parent8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff)
downloadtranslated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2
translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip
initial commit
Diffstat (limited to 'files/ja/web/javascript/reference/reserved_words/index.html')
-rw-r--r--files/ja/web/javascript/reference/reserved_words/index.html88
1 files changed, 88 insertions, 0 deletions
diff --git a/files/ja/web/javascript/reference/reserved_words/index.html b/files/ja/web/javascript/reference/reserved_words/index.html
new file mode 100644
index 0000000000..16a2a45a16
--- /dev/null
+++ b/files/ja/web/javascript/reference/reserved_words/index.html
@@ -0,0 +1,88 @@
+---
+title: 予約語
+slug: Web/JavaScript/Reference/Reserved_Words
+tags:
+ - JavaScript
+translation_of: Web/JavaScript/Reference/Lexical_grammar#Keywords
+---
+<p>以下は予約語であり、変数、関数、メソッド、あるいはオブジェクトの識別子として用いることはできません。以下は <a href="/ja/docs/ECMAScript">ECMAScript</a> の仕様で既存のキーワードとして予約されているものです。</p>
+
+<div class="threecolumns">
+<ul>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/break" title="JavaScript/Reference/Statements/break">break</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/switch" title="JavaScript/Reference/Statements/switch">case</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/try...catch" title="JavaScript/Reference/Statements/try...catch">catch</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/continue" title="JavaScript/Reference/Statements/continue">continue</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/debugger" title="JavaScript/Reference/Statements/debugger">debugger</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/switch" title="JavaScript/Reference/Statements/switch">default</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Operators/delete" title="JavaScript/Reference/Operators/delete">delete</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/do...while" title="JavaScript/Reference/Statements/do...while">do</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/if...else" title="JavaScript/Reference/Statements/if...else">else</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/try...catch" title="JavaScript/Reference/Statements/try...catch">finally</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/for" title="JavaScript/Reference/Statements/for">for</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/function" title="JavaScript/Reference/Statements/function">function</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/if...else" title="JavaScript/Reference/Statements/if...else">if</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/for...in" title="JavaScript/Reference/Statements/for...in">in</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Operators/instanceof" title="JavaScript/Reference/Operators/instanceof">instanceof</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Operators/new" title="JavaScript/Reference/Operators/new">new</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/return" title="JavaScript/Reference/Statements/return">return</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/switch" title="JavaScript/Reference/Statements/switch">switch</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Operators/this" title="JavaScript/Reference/Operators/this">this</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/throw" title="JavaScript/Reference/Statements/throw">throw</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/try...catch" title="JavaScript/Reference/Statements/try...catch">try</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Operators/typeof" title="JavaScript/Reference/Operators/typeof">typeof</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/var" title="JavaScript/Reference/Statements/var">var</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Operators/void" title="JavaScript/Reference/Operators/void">void</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/while" title="JavaScript/Reference/Statements/while">while</a></code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/with" title="JavaScript/Reference/Statements/with">with</a></code></li>
+</ul>
+</div>
+
+<h2 id="Words_reserved_for_possible_future_use" name="Words_reserved_for_possible_future_use">将来の使用を見越した予約語</h2>
+
+<p>以下は ECMAScript の仕様で将来のキーワードとして予約されているものです。現在は特別な機能を持っていませんが、将来機能を持つときのために、識別子として使用できません。このキーワードは、厳格モード、非厳格モードの両方で使用できません。</p>
+
+<div class="note"><strong>注記:</strong> Firefox 5 (JavaScript 1.8.6) より以前では、これらのキーワードは厳格モードでないときには使用できました。この ECMAScript 違反は Firefox 5 で修正されました。</div>
+
+<div class="threecolumns">
+<ul>
+ <li><code>class</code></li>
+ <li><code>enum</code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/export" title="JavaScript/Reference/Statements/export">export</a></code></li>
+ <li><code>extends</code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/import" title="JavaScript/Reference/Statements/import">import</a></code></li>
+ <li><code>super</code></li>
+</ul>
+</div>
+
+<p>以下は <a href="/ja/docs/JavaScript/Reference/Functions_and_function_scope/Strict_mode" title="JavaScript/Strict mode">厳格モードのコード</a> として実行されたときに 、ECMAScript の仕様で将来のキーワードとして 予約されているものです。ただし、JavaScript 1.7 以上では <code>let</code> と <code>yield</code> は伝統的な Mozilla 特有の機能を持っています。</p>
+
+<div class="threecolumns">
+<ul>
+ <li><code>implements</code></li>
+ <li><code>interface</code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/let" title="JavaScript/Reference/Statements/let">let</a></code></li>
+ <li><code>package</code></li>
+ <li><code>private</code></li>
+ <li><code>protected</code></li>
+ <li><code>public</code></li>
+ <li><code>static</code></li>
+ <li><code><a href="/ja/docs/JavaScript/Reference/Statements/yield" title="JavaScript/Reference/Statements/yield">yield</a></code></li>
+</ul>
+</div>
+
+<p><code><a href="/ja/docs/JavaScript/Reference/Statements/const" title="JavaScript/Reference/Statements/const">const</a></code> は ECMAScript の仕様によって将来のキーワードとして予約されていますが、Mozilla やほとんどの他のブラウザが非標準の拡張として実装していることに注意してください。さらに、 <a href="/ja/docs/JavaScript/Reference/Statements/export" title="JavaScript/Reference/Statements/export">export</a> と <a href="/ja/docs/JavaScript/Reference/Statements/import" title="JavaScript/Reference/Statements/import">import</a> はかつて Mozilla で実装されていましたが、現在では予約語となっています。</p>
+
+<p>加えて、 <code>null</code> 、 <code>true</code> 、 <code>false</code> リテラルは ECMAScript の仕様で予約されています。</p>
+
+<h2 id="Reserved_word_usage" name="Reserved_word_usage">予約語の利用</h2>
+
+<p>実際に、予約語は識別子のみに適用されます。<span class="comment-copy"><a href="http://es5.github.com/#A.1" rel="nofollow">es5.github.com/#A.1</a> の記述にあるように、これらは全て予約語を排除しない識別名です。</span></p>
+
+<p><span class="comment-copy"><code>a.import</code></span><br>
+ <span class="comment-copy"><code>a["import"]</code></span><br>
+ <span class="comment-copy"><code>a = { import: "test" }</code>.</span></p>
+
+<p><span class="comment-copy">反対に、以下は識別子であるので違反です。識別子は関数宣言や関数式に使用されます。</span></p>
+
+<p><span class="comment-copy"><code>function import() {}</code></span></p>