[d565449] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.isKeyword = isKeyword;
|
---|
| 7 | exports.isReservedWord = isReservedWord;
|
---|
| 8 | exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
|
---|
| 9 | exports.isStrictBindReservedWord = isStrictBindReservedWord;
|
---|
| 10 | exports.isStrictReservedWord = isStrictReservedWord;
|
---|
| 11 | const reservedWords = {
|
---|
| 12 | keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
|
---|
| 13 | strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
|
---|
| 14 | strictBind: ["eval", "arguments"]
|
---|
| 15 | };
|
---|
| 16 | const keywords = new Set(reservedWords.keyword);
|
---|
| 17 | const reservedWordsStrictSet = new Set(reservedWords.strict);
|
---|
| 18 | const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
|
---|
| 19 | function isReservedWord(word, inModule) {
|
---|
| 20 | return inModule && word === "await" || word === "enum";
|
---|
| 21 | }
|
---|
| 22 | function isStrictReservedWord(word, inModule) {
|
---|
| 23 | return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
|
---|
| 24 | }
|
---|
| 25 | function isStrictBindOnlyReservedWord(word) {
|
---|
| 26 | return reservedWordsStrictBindSet.has(word);
|
---|
| 27 | }
|
---|
| 28 | function isStrictBindReservedWord(word, inModule) {
|
---|
| 29 | return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
|
---|
| 30 | }
|
---|
| 31 | function isKeyword(word) {
|
---|
| 32 | return keywords.has(word);
|
---|
| 33 | }
|
---|
| 34 |
|
---|
| 35 | //# sourceMappingURL=keyword.js.map
|
---|