From 0f45386673fbf4f33b6e61b17ea49b69697ec79a Mon Sep 17 00:00:00 2001 From: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:21:52 -0700 Subject: Make `Request`, `Response` and `TextDecoder` not read-only --- src/bun.js/scripts/generate-classes.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/bun.js/scripts/generate-classes.ts') diff --git a/src/bun.js/scripts/generate-classes.ts b/src/bun.js/scripts/generate-classes.ts index eb93e6cd2..c3dc22a9f 100644 --- a/src/bun.js/scripts/generate-classes.ts +++ b/src/bun.js/scripts/generate-classes.ts @@ -1086,7 +1086,9 @@ function generateLazyClassStructureHeader( JSC::JSValue ${className(typeName)}Prototype() { return m_${className( typeName )}.prototypeInitializedOnMainThread(this); } - JSC::LazyClassStructure m_${className(typeName)}; + JSC::LazyClassStructure m_${className(typeName)}; + bool has${className(typeName)}SetterValue { false }; + mutable JSC::WriteBarrier m_${className(typeName)}SetterValue; `.trim(); } @@ -1187,7 +1189,11 @@ template void GlobalObject::visitGeneratedLazyClasses(GlobalObject *thisObject, Visitor& visitor) { ${classes - .map((a) => `thisObject->m_${className(a.name)}.visit(visitor);`) + .map( + (a) => + `thisObject->m_${className(a.name)}.visit(visitor); +visitor.visit(thisObject->m_${className(a.name)}SetterValue);` + ) .join("\n ")} } -- cgit v1.2.3