mirror of
https://github.com/penpot/penpot.git
synced 2026-03-19 17:03:44 +00:00
Revert "🐛 Fix "Cannot assign to read only property toString" error in plugins runtime"
This reverts commit f796f7ccb9.
This commit is contained in:
@@ -22,7 +22,6 @@ vi.mock('./create-plugin', () => ({
|
||||
vi.mock('./ses.js', () => ({
|
||||
ses: {
|
||||
harden: vi.fn().mockImplementation((obj) => obj),
|
||||
hardenIntrinsics: vi.fn(),
|
||||
},
|
||||
}));
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user