diff --git a/src/defaults/into.ts b/src/defaults/into.ts index 89cba226..219da9d0 100644 --- a/src/defaults/into.ts +++ b/src/defaults/into.ts @@ -61,7 +61,7 @@ export function mergeRecords< ); if (key === "__proto__") { - Object.defineProperty(m_target, key, { + Object.defineProperty(m_target.value, key, { value: propertyTarget.value, configurable: true, enumerable: true, diff --git a/tests/deepmerge-into.test.ts b/tests/deepmerge-into.test.ts index e673c2fb..21db053f 100644 --- a/tests/deepmerge-into.test.ts +++ b/tests/deepmerge-into.test.ts @@ -591,10 +591,6 @@ describe("deepmergeInto", () => { const target = {}; deepmergeInto(target, a, b); expect(target).toStrictEqual(expected); - - expect(() => { - deepmergeInto(a, b); - }).toThrowError(); }); it("prototype pollution", () => {