Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: swiftwasm/JavaScriptKit
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: swiftwasm/JavaScriptKit
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: stack-abi-redesign
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 8 files changed
  • 2 contributors

Commits on Feb 25, 2026

  1. Unify Optional stack ABI to conditional push/pop protocol

    Replace the dual Optional stack protocols (always-push with placeholders
    vs conditional push/pop) with a single conditional protocol for all types.
    
    Swift intrinsics (BridgeJSIntrinsics.swift):
    - Delete _BridgedSwiftGenericOptionalStackType marker protocol
    - Add generic Optional: _BridgedSwiftStackType conformance with conditional
      push/pop (payload pushed/popped only when non-nil, no zero placeholders)
    - Remove type-specific bridgeJSStackPop from all Optional extensions
      (scalar, string, JSObject, heapObject, caseEnum, raw value enums,
      associated value enum) — the generic extension handles them all
    - Add generic _BridgedAsOptional (JSUndefinedOr) stack delegation
    - Add StackLiftResult == Self constraints to _BridgedSwiftStruct,
      _BridgedSwiftAssociatedValueEnum, _BridgedSwiftDictionaryStackType,
      and _BridgedSwiftOptionalScalarBridge protocols
    - Add bridgeJSLowerReturn to Optional<Struct> and Optional<Dictionary>
    
    JS glue (JSGlueGen.swift):
    - stackOptionalLower: remove placeholder else branch
    - optionalElementLowerFragment: remove placeholder else branch
    - structFieldLowerFragment nullable scalar: remove zero push in else
    - associatedValueOptionalPushPayload scalar: conditional push
    - Route associated value enum optional return through presence flag
      instead of -1 sentinel
    - Remove unused optionalLiftReturnAssociatedEnum function
    
    This is a prerequisite for supporting Optional<T> in composed types
    (e.g. [Bool?], [String: Double?]) which previously failed because
    _BridgedSwiftGenericOptionalStackType could not be satisfied.
    
    Co-authored-by: Shelley <[email protected]>
    exe.dev user and exedev-shelley committed Feb 25, 2026
    Configuration menu
    Copy the full SHA
    a309c9c View commit details
    Browse the repository at this point in the history
Loading