GitXplorerGitXplorer
q

reserved-words

public
10 stars
7 forks
1 issues

Commits

List of commits on branch master.
Unverified
d4dcf840d14efa590158364374d0ad20b2474485

Merge pull request #2 from zxqfox/more-nodes

qqfox committed 7 years ago
Verified
ce99c1af81a98660a8f9a13b6a679e327d88ceaf

chore: more nodes

qqfox committed 7 years ago
Verified
55071b49b55e57b949b0557b4e8f2b711919fe43

0.1.2

qqfox committed 7 years ago
Unverified
b4416150e8f421276e3a301adee4aee38054efa2

Merge pull request #1 from chriswong/master

qqfox committed 7 years ago
Unverified
a5ed187ea72dd53449335a885cf659fcbcfa3c7b

Fix: ignore properties of prototype

cchriswong committed 7 years ago
Unverified
e7d2cc42da274227911ff1cab28bb05ee528108f

Docs: fix link to license file

committed 9 years ago

README

The README file for this repository.

reserved-words

Build Status

What is it?

Tiny package for detecting reserved words.

Reserved Word is either a Keyword, or a Future Reserved Word, or a Null Literal, or a Boolean Literal. See: ES5 #7.6.1 and ES6 #11.6.2.

Installation

npm install reserved-words

API

check(word, [dialect], [strict])

Returns true if provided identifier string is a Reserved Word in some ECMAScript dialect (ECMA-262 edition).

If the strict flag is truthy, this function additionally checks whether word is a Keyword or Future Reserved Word under strict mode.

Example

var reserved = require('reserved-words');
reserved.check('volatile', 'es3'); // true
reserved.check('volatile', 'es2015'); // false
reserved.check('yield', 3); // false
reserved.check('yield', 6); // true

dialects

es3 (or 3)

Represents ECMA-262 3rd edition.

See section 7.5.1.

es5 (or 5)

Represents ECMA-262 5th edition (ECMAScript 5.1).

Reserved Words are formally defined in ECMA262 sections 7.6.1.1 and 7.6.1.2.

es2015 (or es6, 6)

Represents [ECMA-262 6th edition](ECMAScript 2015).

Reserved Words are formally defined in sections 11.6.2.1 and 11.6.2.2.

License

Licensed under The MIT License