リビジョンの比較

予約語

Change Revisions

リビジョン 336703:

リビジョン 336703 (編集者: ethertank / 編集日時: )

リビジョン 349265:

リビジョン 349265 (編集者: dextra / 編集日時: )

タイトル:
予約語
予約語
URL スラグ:
JavaScript/Reference/Reserved_Words
JavaScript/Reference/Reserved_Words
内容:

リビジョン 336703
リビジョン 349265
n7    <div>n
8      {{outdated('最終更新日は 2008/07/27 です。 <a href="https://develope
>r.mozilla.org/en-US/docs/JavaScript/Reference/Reserved_Words" tit 
>le="Reserved Words - JavaScript | MDN">英語版の最新の内容</a> も併せてご覧下さい。') 
>}} 
9    </div>
nn10    <div class="threecolumns">
13    <ul>11      <ul>
14      <li>12        <li>
15        <a href="/ja/docs/JavaScript/Reference/Statements/break">13          <code><a href="/ja/docs/JavaScript/Reference/Statements
>break</a>>/break" title="JavaScript/Reference/Statements/break">break</a></
 >code>
16      </li>14        </li>
17      <li>15        <li>
18        <a href="/ja/docs/JavaScript/Reference/Statements/switch"16          <code><a href="/ja/docs/JavaScript/Reference/Statements
>>case</a>>/switch" title="JavaScript/Reference/Statements/switch">case</a><
 >/code>
19      </li>17        </li>
20      <li>18        <li>
21        <a href="/ja/docs/JavaScript/Reference/Statements/try...c19          <code><a href="/ja/docs/JavaScript/Reference/Statements
>atch">catch</a>>/try...catch" title="JavaScript/Reference/Statements/try...catch"
 >>catch</a></code>
22      </li>20        </li>
23      <li>21        <li>
24        <a href="/ja/docs/JavaScript/Reference/Statements/continu22          <code><a href="/ja/docs/JavaScript/Reference/Statements
>e">continue</a>>/continue" title="JavaScript/Reference/Statements/continue">conti
 >nue</a></code>
25      </li>23        </li>
26      <li>24        <li>
27        <a href="/ja/docs/JavaScript/Reference/Statements/switch"25          <code><a href="/ja/docs/JavaScript/Reference/Statements
>>default</a>>/debugger" title="JavaScript/Reference/Statements/debugger">debug
 >ger</a></code>
28      </li>26        </li>
29      <li>27        <li>
30        <a href="/ja/docs/JavaScript/Reference/Operators/Special_28          <code><a href="/ja/docs/JavaScript/Reference/Statements
>Operators/delete_Operator">delete</a>>/switch" title="JavaScript/Reference/Statements/switch">default</
 >a></code>
31      </li>29        </li>
32      <li>30        <li>
33        <a href="/ja/docs/JavaScript/Reference/Statements/do...wh31          <code><a href="/ja/docs/JavaScript/Reference/Operators/
>ile">do</a>>delete" title="JavaScript/Reference/Operators/delete">delete</a><
 >/code>
34      </li>32        </li>
35      <li>33        <li>
36        <a href="/ja/docs/JavaScript/Reference/Statements/if...el34          <code><a href="/ja/docs/JavaScript/Reference/Statements
>se">else</a>>/do...while" title="JavaScript/Reference/Statements/do...while">d
 >o</a></code>
37      </li>35        </li>
38      <li>36        <li>
39        <a href="/ja/docs/JavaScript/Reference/Statements/try...c37          <code><a href="/ja/docs/JavaScript/Reference/Statements
>atch">finally</a>>/if...else" title="JavaScript/Reference/Statements/if...else">els
 >e</a></code>
40      </li>38        </li>
41      <li>39        <li>
42        <a href="/ja/docs/JavaScript/Reference/Statements/for">fo40          <code><a href="/ja/docs/JavaScript/Reference/Statements
>r</a>>/try...catch" title="JavaScript/Reference/Statements/try...catch"
 >>finally</a></code>
43      </li>41        </li>
44      <li>42        <li>
45        <a href="/ja/docs/JavaScript/Reference/Statements/functio43          <code><a href="/ja/docs/JavaScript/Reference/Statements
>n">function</a>>/for" title="JavaScript/Reference/Statements/for">for</a></code>
46      </li>44        </li>
47      <li>45        <li>
48        <a href="/ja/docs/JavaScript/Reference/Statements/if...el46          <code><a href="/ja/docs/JavaScript/Reference/Statements
>se">if</a>>/function" title="JavaScript/Reference/Statements/function">funct
 >ion</a></code>
49      </li>47        </li>
50      <li>48        <li>
51        <a href="/ja/docs/JavaScript/Reference/Statements/for...i49          <code><a href="/ja/docs/JavaScript/Reference/Statements
>n">in</a>>/if...else" title="JavaScript/Reference/Statements/if...else">if<
 >/a></code>
52      </li>50        </li>
53      <li>51        <li>
54        <a href="/ja/docs/JavaScript/Reference/Operators/Special_52          <code><a href="/ja/docs/JavaScript/Reference/Statements
>Operators/instanceof_Operator">instanceof</a>>/for...in" title="JavaScript/Reference/Statements/for...in">in</a
 >></code>
55      </li>53        </li>
56      <li>54        <li>
57        <a href="/ja/docs/JavaScript/Reference/Operators/Special_55          <code><a href="/ja/docs/JavaScript/Reference/Operators/
>Operators/new_Operator">new</a>>instanceof" title="JavaScript/Reference/Operators/instanceof">ins
 >tanceof</a></code>
58      </li>56        </li>
59      <li>57        <li>
60        <a href="/ja/docs/JavaScript/Reference/Statements/return"58          <code><a href="/ja/docs/JavaScript/Reference/Operators/
>>return</a>>new" title="JavaScript/Reference/Operators/new">new</a></code>
61      </li>59        </li>
62      <li>60        <li>
63        <a href="/ja/docs/JavaScript/Reference/Statements/switch"61          <code><a href="/ja/docs/JavaScript/Reference/Statements
>>switch</a>>/return" title="JavaScript/Reference/Statements/return">return</a
 >></code>
64      </li>62        </li>
65      <li>63        <li>
66        <a href="/ja/docs/JavaScript/Reference/Operators/Special_64          <code><a href="/ja/docs/JavaScript/Reference/Statements
>Operators/this_Operator">this</a>>/switch" title="JavaScript/Reference/Statements/switch">switch</a
 >></code>
67      </li>65        </li>
68      <li>66        <li>
69        <a href="/ja/docs/JavaScript/Reference/Statements/throw">67          <code><a href="/ja/docs/JavaScript/Reference/Operators/
>throw</a>>this" title="JavaScript/Reference/Operators/this">this</a></code>
70      </li>68        </li>
71      <li>69        <li>
72        <a href="/ja/docs/JavaScript/Reference/Statements/try...c70          <code><a href="/ja/docs/JavaScript/Reference/Statements
>atch">try</a>>/throw" title="JavaScript/Reference/Statements/throw">throw</a></
 >code>
73      </li>71        </li>
74      <li>72        <li>
75        <a href="/ja/docs/JavaScript/Reference/Operators/Special_73          <code><a href="/ja/docs/JavaScript/Reference/Statements
>Operators/typeof_Operator">typeof</a>>/try...catch" title="JavaScript/Reference/Statements/try...catch"
 >>try</a></code>
76      </li>74        </li>
77      <li>75        <li>
78        <a href="/ja/docs/JavaScript/Reference/Statements/var">va76          <code><a href="/ja/docs/JavaScript/Reference/Operators/
>r</a>>typeof" title="JavaScript/Reference/Operators/typeof">typeof</a><
 >/code>
79      </li>77        </li>
80      <li>78        <li>
81        <a href="/ja/docs/JavaScript/Reference/Operators/Special_79          <code><a href="/ja/docs/JavaScript/Reference/Statements
>Operators/void_Operator">void</a>>/var" title="JavaScript/Reference/Statements/var">var</a></code>
82      </li>80        </li>
83      <li>81        <li>
84        <a href="/ja/docs/JavaScript/Reference/Statements/while">82          <code><a href="/ja/docs/JavaScript/Reference/Operators/
>while</a>>void" title="JavaScript/Reference/Operators/void">void</a></code>
85      </li>83        </li>
86      <li>84        <li>
87        <a href="/ja/docs/JavaScript/Reference/Statements/with">w85          <code><a href="/ja/docs/JavaScript/Reference/Statements
>ith</a>>/while" title="JavaScript/Reference/Statements/while">while</a></
 >code>
88      </li>86        </li>
87        <li>
88          <code><a href="/ja/docs/JavaScript/Reference/Statements
 >/with" title="JavaScript/Reference/Statements/with">with</a></cod
 >e>
89        </li>
89    </ul>90      </ul>
91    </div>
n91      以下は ECMAScript の仕様で将来のキーワードとして予約されているものです。n93      以下は ECMAScript の仕様で将来のキーワードとして予約されているものです。現在は特別な機能を持っていませんが
 >、将来機能を持つときのために、識別子として使用できません。このキーワードは、厳格モード、非厳格モードの両方で使用できません。
nn95    <div class="note">
96      <strong>注記:</strong> Firefox 5 (JavaScript 1.8.6) より以前では、これ
 >らのキーワードは厳格モードでないときには使用できました。この ECMAScript 違反は Firefox 5 で修正されました。
97    </div>
98    <div class="threecolumns">
93    <ul>99      <ul>
94      <li>abstract100        <li>
101          <code>class</code>
95      </li>102        </li>
96      <li>boolean103        <li>
104          <code>enum</code>
97      </li>105        </li>
98      <li>byte106        <li>
107          <code><a href="/ja/docs/JavaScript/Reference/Statements
 >/export" title="JavaScript/Reference/Statements/export">export</a
 >></code>
99      </li>108        </li>
100      <li>char109        <li>
110          <code>extends</code>
101      </li>111        </li>
102      <li>class112        <li>
113          <code><a href="/ja/docs/JavaScript/Reference/Statements
 >/import" title="JavaScript/Reference/Statements/import">import</a
 >></code>
103      </li>114        </li>
104      <li>115        <li>
105        <a href="/ja/docs/JavaScript/Reference/Statements/const">116          <code>super</code>
>const</a> 
106      </li>117        </li>
107      <li>debugger
108      </li>118      </ul>
109      <li>double
110      </li>119    </div>
111      <li>enum
112      </li>
113      <li>
114        <a href="/ja/docs/JavaScript/Reference/Statements/export"
>>export</a> 
115      </li>
116      <li>extends
117      </li>
118      <li>final
119      </li>
120      <li>float
121      </li>
122      <li>goto
123      </li>
124      <li>implements
125      </li>
126      <li>
127        <a href="/ja/docs/JavaScript/Reference/Statements/import"
>>import</a> 
128      </li>
129      <li>int
130      </li>
131      <li>interface
132      </li>
133      <li>long
134      </li>
135      <li>native
136      </li>
137      <li>package
138      </li>
139      <li>private
140      </li>
141      <li>protected
142      </li>
143      <li>public
144      </li>
145      <li>short
146      </li>
147      <li>static
148      </li>
149      <li>super
150      </li>
151      <li>synchronized
152      </li>
153      <li>throws
154      </li>
155      <li>transient
156      </li>
157      <li>volatile
158      </li>
159    </ul>
n161      ECMA-262 では仕様となっていませんが、<a href="/ja/docs/JavaScript/Referenn121      以下は <a href="/ja/docs/JavaScript/Reference/Functions_and_fu
>ce/Statements/const">const</a>、<a href="/ja/docs/JavaScript/Refer>nction_scope/Strict_mode" title="JavaScript/Strict mode">厳格モードのコー
>ence/Statements/export">export</a>、<a href="/ja/docs/JavaScript/R>ド</a> として実行されたときに 、ECMAScript の仕様で将来のキーワードとしての 予約されているものです。ただし、Ja
>eference/Statements/import">import</a> は Mozilla では実装されているので注意してく>vaScript 1.7 以上では <code>let</code> と <code>yield</code> は伝統的な Moz
>ださい。>illa 特有の機能を持っています。
122    </p>
123    <div class="threecolumns">
124      <ul>
125        <li>
126          <code>implements</code>
127        </li>
128        <li>
129          <code>interface</code>
130        </li>
131        <li>
132          <code><a href="/ja/docs/JavaScript/Reference/Statements
 >/let" title="JavaScript/Reference/Statements/let">let</a></code>
133        </li>
134        <li>
135          <code>package</code>
136        </li>
137        <li>
138          <code>private</code>
139        </li>
140        <li>
141          <code>protected</code>
142        </li>
143        <li>
144          <code>public</code>
145        </li>
146        <li>
147          <code>static</code>
148        </li>
149        <li>
150          <code><a href="/ja/docs/JavaScript/Reference/Statements
 >/yield" title="JavaScript/Reference/Statements/yield">yield</a></
 >code>
151        </li>
152      </ul>
153    </div>
154    <p>
155      <code><a href="/ja/docs/JavaScript/Reference/Statements/con
 >st" title="JavaScript/Reference/Statements/const">const</a></code
 >> は ECMAScript の仕様によって将来のキーワードとして予約されていますが、Mozilla やほとんどの他のブラウザが非
 >標準の拡張として実装していることに注意してください。さらに、 <a href="/ja/docs/JavaScript/Refer
 >ence/Statements/export" title="JavaScript/Reference/Statements/ex
 >port">export</a> と <a href="/ja/docs/JavaScript/Reference/Stateme
 >nts/import" title="JavaScript/Reference/Statements/import">import
 ></a> はかつて Mozilla で実装されていましたが、現在では予約語となっています。
t164      さらに、<code>null</code> は Null リテラル として ECMAScript の仕様で予約されておt158      加えて、 <code>null</code> 、 <code>true</code> 、 <code>false</c
>り、<code>true</code> と <code>false</code> は Boolean リテラルとして ECMASc>ode> リテラルは 標準の ECMAScript で予約されています。
>ript の仕様で予約されています。 
159    </p>
160    <h2 id="Reserved_word_usage" name="Reserved_word_usage">
161      予約語の利用
162    </h2>
163    <p>
164      実際に、予約語は識別子のみに適用されます。<span class="comment-copy"><a href="ht
 >tp://es5.github.com/#A.1" rel="nofollow">es5.github.com/#A.1</a> 
 >の記述にあるように、これらは全て予約語を排除しない識別名です。</span>
165    </p>
166    <p>
167      <span class="comment-copy"><code>a.import</code></span><br>
168      <span class="comment-copy"><code>a["import"]</code></span><
 >br>
169      <span class="comment-copy"><code>a = { import: "test" }</co
 >de>.</span>
170    </p>
171    <p>
172      <span class="comment-copy">反対に、以下は識別子であるので違反です。識別子は関数宣言や関数式
 >に使用されます。</span>
173    </p>
174    <p>
175      <span class="comment-copy"><code>function import() {}</code
 >></span>

前に戻る