In this one case, a warning is the expected output and is the only viable way to test the case.
See inline comment at top of IvarTest.j for explanation.
The `for...of` syntax tests in `CPSetTest` and `CPDictionaryTest` iterate over empty collections. This leaves the bound variables unread, which triggers the static analyzer and fails the zero-warning CI policy.
Standard Javascript idioms for handling blank identifiers (such as `_` or pure evaluation via `void`) are either unsupported or cause AST collisions within the Node.js parser. The variables are now explicitly evaluated using native Objective-J message sends. This registers a read operation for the analyzer, preserves the legacy parser's structural expectations, and ensures the runtime state remains pristine.
CPFontPanel.j used _CPFontPanelPreviewView as an ivar type and instantiated it before its own @implementation, later in the same file, with no forward declaration. Added @class _CPFontPanelPreviewView, alongside the file's existing forward declarations.
This removes all build warnings.
CPParagraphStyle.j defined CPTabStopType's four constants directly, with a comment noting they were "missing" but no @typedef for the type itself.
_CPRTFParser.j uses CPTabStopType as an ivar type and imports CPParagraphStyle.j directly, so the fix belongs in the defining file.
Added the missing @typedef CPTabStopType, same pattern as CPRulerOrientation.
CPRulerView.j declared CPRulerOrientation's constants directly,
with only a comment claiming it was a typedef.
No @typedef directive existed, so the type was unknown wherever used as an ivar or parameter type.
Added the missing @typedef CPRulerOrientation, matching the pattern already used for CPTextAlignment in CPText.j.
CPRulerView.j referenced CPTextTab (isKindOfClass: and alloc/init) without a declaration.
Added @class CPTextTab; to resolve the symbol reference. A forward declaration was utilized rather than importing CPParagraphStyle.j to minimize dependency coupling, despite the absence of a circular import risk.
Resolves build warning.
Replaced the CPTextView.j import with forward declarations for CPTextView and CPTextContainer (the latter previously reached via the removed import).
The previous import graph created a circular dependency (_CPTableTextAttachment.j -> CPTextView.j -> _CPRTFParser.j / _CPRTFProducer.j -> _CPTableTextAttachment.j).
This caused the legacy compiler to emit a class registration warning during clean builds, as the class was unregistered at the time of resolution. Incremental builds masked this warning via cached symbol tables.
Using forward declarations breaks the cycle and ensures warning-free clean and incremental builds.
CPRulerView.j did not import CPScrollView.
A direct import would create a cycle, since CPScrollView.j already imports CPRulerView.j.
Added a forward declaration instead.
GitHub CI uses existing CPTreeNodeTest and fails when new tests are included.
New tests must be added as a separate PR, independently of the changes in CPTreeNode.j
CPOutlineView.j used CPTreeNode before AppKit.j imported it. This
triggered build warnings. This commit adds an import.
- Add @import "CPTreeNode.j" to CPOutlineView.j.
While addressing this warning, CPTreeNode was audited and found to have an algorithmic complexity regression and multiple structural inconsistencies in the KVO support code.
The test suite for CPTreeNode was Spartan in the extreme.
All of these have been addressed - see inline notes for details.
CPTreeNode is subject to further audit.
CPStackView.j emited warnings during builds and tests which constituted
either real errors or indeterminate state.
These included four types that did not exist: CPUserInterfaceLayoutOrientation, CPLayoutAttribute,
CPEdgeInsets, and CPMapTable.
The missing types are now present.
- Add local typedefs for CPUserInterfaceLayoutOrientation and
CPLayoutAttribute. Numeric values match the equivalent Cocoa
constants.
- Add CPEdgeInsets as an alias for the existing CGInset struct.
Add CPEdgeInsetsMake and CPEdgeInsetsEqualToEdgeInsets.
- Import Foundation/CPMapTable.j. CPMapTable already exists in
Foundation.
This commit also fixes two logic errors found during review.
- arrangedSubviews did not match the true view order after
insert or remove. Add _rebuildArrangedSubviews and call it
from every method that changes view order.
- Trailing-gravity layout added one extra spacing gap past the
last view. This shifted the returned layout boundary. Spacing
is now added before each view, not after.
This commit adds one new property.
- Add a distribution property with storage and accessors. It
has no effect on layout yet. This makes the property honest:
before this change, the type existed but no property did.
The manual test, ./Tests/Manual/CPStackViewTest, used a Narwhal-era
Jakefile and would not build. This has been updated to reflect
usage under the Node toolchain.
This commit adds CPStackView.j to AppKit.j. The file was never
imported. Only the build script's wildcard file list included
it.
This commit adds a header comment to CPStackView.j. The comment
states that the class is a placeholder. It lists known
limitations. It states that a constraint-solver based
replacement is planned.
Why: CPStackView must compile and pass tests before capp-build
can use this tree as a build reference, and a class with unstated
limits invites misuse.
@accessors(copy) had no test in ./Tests.
The compiler's copy-accessor setter behaviour was unverified.
Add CopyAccessorTest.j to Tests/Objective-J. It asserts three
properties of the generated setter:
- the stored value is not identical to the assigned object
- the stored value is unaffected by later mutation of the original
- the stored value is equal in content to the original at assignment
This is added both as a matter of good coverage for the existing toolchain and so that new tooling has a reference for a piece of foundational behaviour.
Using ES6 destructuring in the `for...of` loop declaration
(`var [key, value] of _map.entries()`) causes the legacy
Objective-J compiler to emit "uninitialized global variable"
warnings for `key` and `value`.
This raises concerns about variable scoping and generates
unacceptable noise in the CI pipeline. To resolve the warnings,
the loop has been restructured to use standard array indexing
inside the loop body.
A TODO has been added to revert to ES6 destructuring once the
legacy compiler is retired.
Remove _IS_NUMERIC macro in favour of concrete function CPIsNumeric()
- Create Foundation/_CPFoundationUtilities.j to house global low-level utilities.
- Implement CPIsNumeric as a concrete JavaScript function, preserving the exact legacy logic.
- Import _CPFoundationUtilities.j in the Foundation.j umbrella manifest.
- Replace _IS_NUMERIC macro calls at all call sites with CPIsNumeric().
- Create Foundation/_CPFoundationUtilities.j to house global low-level utilities.
- Implement CPIsNumeric as a concrete JavaScript function, preserving the exact legacy logic.
- Import _CPFoundationUtilities.j in the Foundation.j umbrella manifest.
- Replace _IS_NUMERIC macro calls at all call sites with CPIsNumeric().
Remove the pre-processor dependency on FORWARD_TO_CONCRETE_CLASS by inlining the class cluster instantiation routing logic across all designated initializers to support the new Go-based toolchain architecture.
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.
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.
Merge Aristo3 theme and make it default.
Update README to reflect transition to Cappuccino 2.
Change README extension from .markdown to .md for universal editor support.
Key changes:
- Removed the `CAST_TO_INT` macro and replaced it with native ES6
`Math.trunc()` for float truncation.
- Replaced `var` with `let` for proper block scoping.
- Simplified boolean coercion in `boolValue` using the `!!` operator.
- Replaced the hostile `throw new Error` in `descriptionWithLocale:`
with a safe fallback to `self.toString()`.
- Added `FIXME` comments to explicitly document architectural
anti-patterns, including the global mutable state in `CPNumberUIDs`
and the unimplemented `decimalValue` method.
As part of the ongoing technical debt cleanup, this commit modernizes
CPTimer.j by removing its reliance on the C-preprocessor and updating
syntax to modern JavaScript standards.
Key changes:
- Replaced `#define CPTimerDefaultTimeInterval` with a native `const`.
- Replaced `var` with `const`/`let` for proper block scoping and immutability.
- Replaced the build-time `PLATFORM(DOM)` guard with a runtime
`typeof(window) !== 'undefined'` check, ensuring Foundation does not
depend on build-time platform flags.
- Added `FIXME` comments to explicitly document architectural anti-patterns:
- The invasive global override of `window.setTimeout` and `window.setInterval`.
- The use of `new Function` for string evaluation (CSP violation).
- The questionable exposure of `CPTimerDefaultTimeInterval` as a fallback.
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.