Merge pull request #3263 from enquora/modernize-CPException-inline-method-call-string

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 native compilation pipeline.
This commit is contained in:
David Richardson
2026-08-04 17:52:30 -06:00
committed by GitHub
+7 -2
View File
@@ -248,8 +248,13 @@ if (Error.prototype._userInfo !== null)
[CPException initialize]; [CPException initialize];
#define METHOD_CALL_STRING()\ // MARK: - Exception Utilities
((class_isMetaClass(anObject.isa) ? "+" : "-") + "[" + [anObject className] + " " + aSelector + "]: ")
function _CPMethodCallString(anObject, aSelector)
{
var prefix = class_isMetaClass(anObject.isa) ? "+" : "-";
return prefix + "[" + [anObject className] + " " + aSelector + "]: ";
}
function _CPRaiseInvalidAbstractInvocation(anObject, aSelector) function _CPRaiseInvalidAbstractInvocation(anObject, aSelector)
{ {