From cbf1d35f24aa0d4274d7b88412ef48c7c80cc787 Mon Sep 17 00:00:00 2001 From: David Richardson Date: Tue, 4 Aug 2026 17:47:44 -0600 Subject: [PATCH] Refactor METHOD_CALL_STRING macro to Javascript function Replace the unhygienic METHOD_CALL_STRING() C pre-processor macro in CPException.j with a standard JavaScript helper function, _CPMethodCallString(). Add a `// MARK: - Exception Utilities` navigation landmark. This removes a legacy text-substitution dependency, enabling single-pass AST generation for the platform-native compilation pipeline. --- Foundation/CPException.j | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Foundation/CPException.j b/Foundation/CPException.j index d11efcb77..0bfdd1f9c 100755 --- a/Foundation/CPException.j +++ b/Foundation/CPException.j @@ -248,8 +248,13 @@ if (Error.prototype._userInfo !== null) [CPException initialize]; -#define METHOD_CALL_STRING()\ - ((class_isMetaClass(anObject.isa) ? "+" : "-") + "[" + [anObject className] + " " + aSelector + "]: ") +// MARK: - Exception Utilities + +function _CPMethodCallString(anObject, aSelector) +{ + var prefix = class_isMetaClass(anObject.isa) ? "+" : "-"; + return prefix + "[" + [anObject className] + " " + aSelector + "]: "; +} function _CPRaiseInvalidAbstractInvocation(anObject, aSelector) {