@codingame/monaco-vscode-rollup-vsix-plugin 37.6.1 → 38.0.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codingame/monaco-vscode-rollup-vsix-plugin",
3
- "version": "37.6.1",
3
+ "version": "38.0.0",
4
4
  "keywords": [],
5
5
  "license": "MIT",
6
6
  "author": {
@@ -549,6 +549,24 @@ var CharacterCodes;
549
549
  CharacterCodes[CharacterCodes["tab"] = 9] = "tab";
550
550
  CharacterCodes[CharacterCodes["verticalTab"] = 11] = "verticalTab";
551
551
  })(CharacterCodes || (CharacterCodes = {}));
552
+ /**
553
+ * Safely assigns `value` to `obj[key]`, using `Object.defineProperty` for the
554
+ * `__proto__` key so that the own property is preserved without triggering the
555
+ * prototype setter (prototype pollution).
556
+ */
557
+ function setObjectProperty(obj, key, value) {
558
+ if (key === '__proto__') {
559
+ Object.defineProperty(obj, '__proto__', {
560
+ value,
561
+ enumerable: true,
562
+ writable: true,
563
+ configurable: true,
564
+ });
565
+ }
566
+ else {
567
+ obj[key] = value;
568
+ }
569
+ }
552
570
  /**
553
571
  * Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
554
572
  * Therefore always check the errors list to find out if the input was valid.
@@ -562,7 +580,7 @@ function parse(text, errors = [], options = ParseOptions.DEFAULT) {
562
580
  currentParent.push(value);
563
581
  }
564
582
  else if (currentProperty !== null) {
565
- currentParent[currentProperty] = value;
583
+ setObjectProperty(currentParent, currentProperty, value);
566
584
  }
567
585
  }
568
586
  const visitor = {