mozilla

Compare Revisions

Reserved Words

Change Revisions

Revision 76028:

Revision 76028 by Eric Wieser on

Revision 76029:

Revision 76029 by reesd on

Title:
Reserved Words
Reserved Words
Slug:
JavaScript/Reference/Reserved_Words
JavaScript/Reference/Reserved_Words
Tags:
JavaScript
JavaScript
Content:

Revision 76028
Revision 76029
tt149    <h2>
150      Reserved Word Usage
151    </h2>
152    <p>
153      Reserved Words actually only apply to Identifiers (vs. <spa
 >n class="comment-copy">IdentifierNames)</span> . <span class="com
 >ment-copy">As described in <a href="http://es5.github.com/#A.1" r
 >el="nofollow">es5.github.com/#A.1</a>, these are all IdentifierNa
 >mes which do not exclude ReservedWords</span>
154    </p>
155    <p>
156      <span class="comment-copy"><code>a.import</code></span><br>
157      <span class="comment-copy"><code>a["import"]</code></span><
 >br>
158      <span class="comment-copy"><code>a = { import: "test" }</co
 >de>.</span>
159    </p>
160    <p>
161      <span class="comment-copy">On the other hand the following 
 >is illegal because it's an Identifier, which is an IdentifierName
 > without the Reserved Words. Identifiers are used for FunctionDec
 >laration and FunctionExpression.</span>
162    </p>
163    <p>
164      <span class="comment-copy"><code>function import() {}</code
 >></span>
165    </p>
166    <p>
167      &nbsp;
168    </p>

Back to History