mirror of
https://github.com/penpot/penpot.git
synced 2026-08-06 04:48:39 +00:00
Revert "🐛 Fix "Cannot assign to read only property toString" error in plugins runtime"
This reverts commit f796f7ccb9dcf9e4f927450550920ad63f1de08d.
This commit is contained in:
parent
e018253c6b
commit
b86898eaf9
@ -22,7 +22,6 @@ vi.mock('./create-plugin', () => ({
|
|||||||
vi.mock('./ses.js', () => ({
|
vi.mock('./ses.js', () => ({
|
||||||
ses: {
|
ses: {
|
||||||
harden: vi.fn().mockImplementation((obj) => obj),
|
harden: vi.fn().mockImplementation((obj) => obj),
|
||||||
hardenIntrinsics: vi.fn(),
|
|
||||||
},
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
|||||||
@ -52,16 +52,6 @@ export const loadPlugin = async function (
|
|||||||
|
|
||||||
closeAllPlugins();
|
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(
|
const plugin = await createPlugin(
|
||||||
ses.harden(context) as Context,
|
ses.harden(context) as Context,
|
||||||
manifest,
|
manifest,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user