source: imaps-frontend/node_modules/@babel/helper-validator-identifier/lib/keyword.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[d565449]1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.isKeyword = isKeyword;
7exports.isReservedWord = isReservedWord;
8exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
9exports.isStrictBindReservedWord = isStrictBindReservedWord;
10exports.isStrictReservedWord = isStrictReservedWord;
11const 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};
16const keywords = new Set(reservedWords.keyword);
17const reservedWordsStrictSet = new Set(reservedWords.strict);
18const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
19function isReservedWord(word, inModule) {
20 return inModule && word === "await" || word === "enum";
21}
22function isStrictReservedWord(word, inModule) {
23 return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
24}
25function isStrictBindOnlyReservedWord(word) {
26 return reservedWordsStrictBindSet.has(word);
27}
28function isStrictBindReservedWord(word, inModule) {
29 return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
30}
31function isKeyword(word) {
32 return keywords.has(word);
33}
34
35//# sourceMappingURL=keyword.js.map
Note: See TracBrowser for help on using the repository browser.