Revert "🐛 Fix "Cannot assign to read only property toString" error in plugins runtime"

This reverts commit f796f7ccb9.
This commit is contained in:
Andrey Antukh
2026-03-17 14:28:40 +01:00
parent e018253c6b
commit b86898eaf9
2 changed files with 0 additions and 11 deletions

View File

@@ -22,7 +22,6 @@ vi.mock('./create-plugin', () => ({
vi.mock('./ses.js', () => ({
ses: {
harden: vi.fn().mockImplementation((obj) => obj),
hardenIntrinsics: vi.fn(),
},
}));

View File

@@ -52,16 +52,6 @@ export const loadPlugin = async function (
closeAllPlugins();
// hardenIntrinsics must be called BEFORE harden() to ensure that
// override taming (enablePropertyOverrides) converts prototype
// properties like Function.prototype.toString into accessor pairs.
// Without this, harden() would freeze Function.prototype with plain
// data properties, making them non-configurable, which causes
// enablePropertyOverrides to silently skip them when hardenIntrinsics
// runs later — resulting in "Cannot assign to read only property
// 'toString'" errors.
ses.hardenIntrinsics();
const plugin = await createPlugin(
ses.harden(context) as Context,
manifest,