Skip to content

Commit 3357ef7

Browse files
fix: do not let setProperty change the prototype (#1731)
1 parent d9934af commit 3357ef7

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)