From e996cae9c561a1f83fe6d79d698ebfded797bb62 Mon Sep 17 00:00:00 2001 From: SarahIsWeird Date: Thu, 6 Feb 2025 18:40:12 +0100 Subject: [PATCH] Fix object methods not being traversed anymore Darn typos! --- src/processScript/transform.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/processScript/transform.ts b/src/processScript/transform.ts index f719d87..b4f5a39 100644 --- a/src/processScript/transform.ts +++ b/src/processScript/transform.ts @@ -741,12 +741,12 @@ export function transform( let thisId = reuseDeclaredName ? (parent.id as Identifier).name : `_${evenMoreUniqueId}_THIS_` let thisIsReferenced = false - if (path.type == `ObjectExpression`) { + if (object.type == `ObjectExpression`) { for (const property of (object as ObjectExpression).properties) { if (property.type != `ObjectMethod`) continue - thisIsReferenced ||= replaceAllThisWith(object, scope, thisId) + thisIsReferenced ||= replaceAllThisWith(property, scope, thisId) } } else { for (const element of (object as ArrayExpression).elements) { -- knotmirror 0.0.1