diff --git a/test/test.js b/test/test.js index d86d396..0e48419 100644 --- a/test/test.js +++ b/test/test.js @@ -531,6 +531,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 () {