diff --git a/test/test.js b/test/test.js index 541c9d7..1835440 100644 --- a/test/test.js +++ b/test/test.js @@ -470,6 +470,20 @@ suite('Unflatten', function () { }) }) } + + test('should not pollute prototype', function () { + unflatten({ + '__proto__.polluted': true + }); + unflatten({ + 'prefix.__proto__.polluted': true + }); + unflatten({ + 'prefix.0.__proto__.polluted': true + }); + + assert.notStrictEqual({}.polluted, true); + }) }) suite('Arrays', function () {