From 3f63be7290eabe7723f6360cde2a890097778e17 Mon Sep 17 00:00:00 2001 From: David Richardson Date: Tue, 21 Jul 2026 10:56:38 -0600 Subject: [PATCH 1/2] Align variable declarations --- Foundation/CPSet/_CPSet.j | 44 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Foundation/CPSet/_CPSet.j b/Foundation/CPSet/_CPSet.j index 8376703fb..75c7e768f 100644 --- a/Foundation/CPSet/_CPSet.j +++ b/Foundation/CPSet/_CPSet.j @@ -103,7 +103,7 @@ - (id)initWithObjects:(id)anObject, ... { var index = 2, - count = arguments.length; + count = arguments.length; for (; index < count; ++index) if (arguments[index] === nil) @@ -140,9 +140,9 @@ - (CPArray)allObjects { - var objects = [], - object, - objectEnumerator = [self objectEnumerator]; + var objects = [], + object, + objectEnumerator = [self objectEnumerator]; while ((object = [objectEnumerator nextObject]) != nil) objects.push(object); @@ -162,9 +162,9 @@ - (CPSet)filteredSetUsingPredicate:(CPPredicate)aPredicate { - var objects = [], - object, - objectEnumerator = [self objectEnumerator]; + var objects = [], + object, + objectEnumerator = [self objectEnumerator]; while ((object = [objectEnumerator nextObject]) != nil) if ([aPredicate evaluateWithObject:object]) @@ -186,8 +186,8 @@ - (void)makeObjectsPerformSelector:(SEL)aSelector withObjects:(CPArray)objects { var object, - objectEnumerator = [self objectEnumerator], - argumentsArray = [nil, aSelector].concat(objects || []); + objectEnumerator = [self objectEnumerator], + argumentsArray = [nil, aSelector].concat(objects || []); while ((object = [objectEnumerator nextObject]) != nil) { @@ -209,8 +209,8 @@ - (void)enumerateObjectsUsingBlock:(Function)aFunction { var object, - objectEnumerator = [self objectEnumerator], - shouldStop = NO; + objectEnumerator = [self objectEnumerator], + shouldStop = NO; while (!shouldStop && (object = [objectEnumerator nextObject]) != nil) { if (aFunction(object, @ref(shouldStop)) !== undefined) { @@ -221,9 +221,9 @@ - (CPSet)objectsPassingTest:(Function)aFunction { - var objects = [], - object = nil, - objectEnumerator = [self objectEnumerator]; + var objects = [], + object = nil, + objectEnumerator = [self objectEnumerator]; while ((object = [objectEnumerator nextObject]) != nil) if (aFunction(object)) @@ -234,8 +234,8 @@ - (BOOL)isSubsetOfSet:(CPSet)aSet { - var object = nil, - objectEnumerator = [self objectEnumerator]; + var object = nil, + objectEnumerator = [self objectEnumerator]; while ((object = [objectEnumerator nextObject]) != nil) if (![aSet containsObject:object]) @@ -249,8 +249,8 @@ if (self === aSet) return [self count] > 0; - var object = nil, - objectEnumerator = [self objectEnumerator]; + var object = nil, + objectEnumerator = [self objectEnumerator]; while ((object = [objectEnumerator nextObject]) != nil) if ([aSet containsObject:object]) @@ -279,10 +279,10 @@ - (CPString)description { - var string = "{(\n", - objects = [self allObjects], - index = 0, - count = [objects count]; + var string = "{(\n", + objects = [self allObjects], + index = 0, + count = [objects count]; for (; index < count; ++index) { From 98bfd874469c56c26a8b7dce6db1a51df8601100 Mon Sep 17 00:00:00 2001 From: David Richardson Date: Tue, 21 Jul 2026 11:05:11 -0600 Subject: [PATCH 2/2] Convert Xcode code landmarks from Objective-C to native Javascript While objc `#pragma mark` works in objj files, it requires a preprocessor to handle the directive. // MARK: is the fully functional and correct Objective-J variant. --- Foundation/CPSet/CPMutableSet.j | 12 ++++++------ Foundation/CPSet/_CPSet.j | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Foundation/CPSet/CPMutableSet.j b/Foundation/CPSet/CPMutableSet.j index 6864e6cbe..850128589 100644 --- a/Foundation/CPSet/CPMutableSet.j +++ b/Foundation/CPSet/CPMutableSet.j @@ -173,8 +173,8 @@ @end -#pragma mark - -#pragma mark Category: CPKeyValueCoding +// MARK: - +// MARK: Category: CPKeyValueCoding @implementation CPSet (CPKeyValueCoding) @@ -247,8 +247,8 @@ @end -#pragma mark - -#pragma mark Key-Value Observing Extensions +// MARK: - +// MARK: Key-Value Observing Extensions @implementation CPObject (CPSetKVO) @@ -274,8 +274,8 @@ @end -#pragma mark - -#pragma mark Key-Value Observing Proxy Implementation +// MARK: - +// MARK: Key-Value Observing Proxy Implementation @implementation _CPKVCSet : CPMutableSet { diff --git a/Foundation/CPSet/_CPSet.j b/Foundation/CPSet/_CPSet.j index 75c7e768f..64849c35d 100644 --- a/Foundation/CPSet/_CPSet.j +++ b/Foundation/CPSet/_CPSet.j @@ -295,8 +295,8 @@ @end -#pragma mark - -#pragma mark Category: CPCopying +// MARK: - +// MARK: Category: CPCopying @implementation CPSet (CPCopying) @@ -312,8 +312,8 @@ @end -#pragma mark - -#pragma mark Category: CPCoding +// MARK: - +// MARK: Category: CPCoding var CPSetObjectsKey = @"CPSetObjectsKey"; @@ -331,8 +331,8 @@ var CPSetObjectsKey = @"CPSetObjectsKey"; @end -#pragma mark - -#pragma mark Private Allocation Placeholder +// MARK: - +// MARK: Private Allocation Placeholder var _CPSharedPlaceholderSet = nil;