Skip to content

Commit

Permalink
fix: do not let setProperty change the prototype (#1731)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-fenster authored and bcoe committed May 20, 2022
1 parent 7afd0a3 commit b5f1391
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,9 @@ util.decorateEnum = function decorateEnum(object) {
util.setProperty = function setProperty(dst, path, value) {
function setProp(dst, path, value) {
var part = path.shift();
if (part === "__proto__") {
return dst;
}
if (path.length > 0) {
dst[part] = setProp(dst[part] || {}, path, value);
} else {
Expand Down

0 comments on commit b5f1391

Please sign in to comment.