@abaplint/transpiler 2.11.7 → 2.11.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -133,9 +133,9 @@ class Chunk {
133
133
  return this;
134
134
  }
135
135
  getMap(generatedFilename) {
136
- const generator = new sourceMap.SourceMapGenerator();
137
- this.mappings.forEach(m => generator.addMapping(m));
138
- const json = generator.toJSON();
136
+ const sourceMapGenerator = new sourceMap.SourceMapGenerator();
137
+ this.mappings.forEach(m => sourceMapGenerator.addMapping(m));
138
+ const json = sourceMapGenerator.toJSON();
139
139
  json.file = generatedFilename;
140
140
  json.sourceRoot = "";
141
141
  return JSON.stringify(json, null, 2);
@@ -1 +1 @@
1
- export declare const DEFAULT_KEYWORDS: string[];
1
+ export declare const DEFAULT_KEYWORDS: Set<string>;
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DEFAULT_KEYWORDS = void 0;
4
4
  // https://www.w3schools.com/js/js_reserved.asp
5
- exports.DEFAULT_KEYWORDS = [
5
+ exports.DEFAULT_KEYWORDS = new Set([
6
6
  "abstract", "arguments", "await",
7
7
  "break", "byte", "catch",
8
8
  // "char",
@@ -21,6 +21,6 @@ exports.DEFAULT_KEYWORDS = [
21
21
  "try", "typeof", "var", "void",
22
22
  "delete",
23
23
  "volatile", "while", "yield"
24
- ];
24
+ ]);
25
25
  // "with"
26
26
  //# sourceMappingURL=keywords.js.map
@@ -27,8 +27,7 @@ class Traversal {
27
27
  return name?.replace(/\//g, "$");
28
28
  }
29
29
  static prefixVariable(name) {
30
- // TODO: performace, make this a hash lookup?,
31
- if (keywords_1.DEFAULT_KEYWORDS.some(k => k === name)) {
30
+ if (name && keywords_1.DEFAULT_KEYWORDS.has(name)) {
32
31
  return "$" + name;
33
32
  }
34
33
  return name + "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abaplint/transpiler",
3
- "version": "2.11.7",
3
+ "version": "2.11.8",
4
4
  "description": "Transpiler",
5
5
  "main": "build/src/index.js",
6
6
  "typings": "build/src/index.d.ts",
@@ -29,7 +29,7 @@
29
29
  "author": "abaplint",
30
30
  "license": "MIT",
31
31
  "dependencies": {
32
- "@abaplint/core": "^2.113.152",
32
+ "@abaplint/core": "^2.113.153",
33
33
  "source-map": "^0.7.6"
34
34
  },
35
35
  "devDependencies": {