Remove Object.prototype.__proto__ (#4341)

This commit is contained in:
Kitson Kelly 2020-03-15 21:34:22 +11:00 committed by GitHub
parent 64a35acd64
commit 2f4be6e944
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,5 @@
const payload = `{ "__proto__": null }`;
const obj = {};
console.log("Before: " + obj);
Object.assign(obj, JSON.parse(payload));
console.log("After: " + obj);