Skip to content

Commit b5f1391

Browse files
alexander-fensterbcoe
authored andcommittedMay 20, 2022
fix: do not let setProperty change the prototype (#1731)
1 parent 7afd0a3 commit b5f1391

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/util.js

+3
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ util.decorateEnum = function decorateEnum(object) {
176176
util.setProperty = function setProperty(dst, path, value) {
177177
function setProp(dst, path, value) {
178178
var part = path.shift();
179+
if (part === "__proto__") {
180+
return dst;
181+
}
179182
if (path.length > 0) {
180183
dst[part] = setProp(dst[part] || {}, path, value);
181184
} else {

0 commit comments

Comments
 (0)
Please sign in to comment.