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: wfltaylor/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: main
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 7 commits
  • 22 files changed
  • 2 contributors

Commits on Jun 1, 2026

  1. Change Data.construct(from uint8Array:) return type from Data? to Data (

    swiftwasm#752)
    
    Make Data typed-array constructor non-optional
    kateinoigakukun authored Jun 1, 2026
    Configuration menu
    Copy the full SHA
    d1e0f95 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2026

  1. BridgeJS: Support optional @js struct in imported function signatures

    Optional @js structs could not be used as parameters or return values of
    imported (@JSFunction) signatures: the generator lowered Optional<Struct>
    using the non-optional object-id ABI ([isSome, objectId] / a single Int32
    return), for which no Optional lowering exists, so the generated thunk did
    not compile.
    
    Bridge optional @js structs through the stack ABI instead - an isSome
    discriminator plus the struct fields - exactly like optional arrays and
    dictionaries. Structs already conform to the stack-based bridging protocols,
    so the existing _BridgedAsOptional/stack runtime extensions and the JS link's
    stack handling already support this; only the import-side lowering/lifting in
    the code generator needed to change.
    
    Adds a jsRoundTripOptionalPoint runtime round-trip (some + none) and a
    SwiftStructImports codegen snapshot.
    krodak committed Jun 8, 2026
    Configuration menu
    Copy the full SHA
    2941cd2 View commit details
    Browse the repository at this point in the history
  2. Merge pull request swiftwasm#755 from PassiveLogic/kr/nullable-struct…

    …-import
    
    BridgeJS: Support optional @js struct in imported function signatures
    krodak authored Jun 8, 2026
    Configuration menu
    Copy the full SHA
    2388473 View commit details
    Browse the repository at this point in the history
  3. BridgeJS: Support case enums as imported function parameters and returns

    Case enums (enums without raw values or associated values) already bridged
    across the export boundary as their Int32 tag, but the TypeScript import path
    rejected them with "Enum types are not yet supported in TypeScript imports".
    The JS glue already round-trips the tag in both directions, so enable case
    enums as imported (@JSFunction) parameters and return values by lowering and
    lifting that Int32 tag in the import context, matching the export side.
    
    Adds a CaseEnumImports round-trip test and an EnumCaseImport codegen snapshot.
    krodak committed Jun 8, 2026
    Configuration menu
    Copy the full SHA
    7d3faa0 View commit details
    Browse the repository at this point in the history
  4. Merge pull request swiftwasm#756 from PassiveLogic/kr/case-enum-import

    BridgeJS: Support case enums as imported function parameters and returns
    krodak authored Jun 8, 2026
    Configuration menu
    Copy the full SHA
    c40fc49 View commit details
    Browse the repository at this point in the history
  5. BridgeJS: Use a BigInt zero placeholder for Wasm i64 in generated JS

    A Wasm i64 parameter or return value is represented as a JavaScript BigInt.
    The generated JS used a plain 0 as the placeholder for the absent case of an
    optional i64 parameter (isSome ? v : 0) and for the error-path return of an
    imported thunk, so calling such an export with null (or an imported i64
    function throwing) raised "TypeError: Cannot convert 0 to a BigInt".
    
    Emit 0n for i64 in both placeholders (jsZeroLiteral and the imported-thunk
    return placeholder). This was latent because the optional Int64/UInt64
    round-trip tests never exercised the none case; add those assertions.
    krodak committed Jun 8, 2026
    Configuration menu
    Copy the full SHA
    7aef830 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    be3b300 View commit details
    Browse the repository at this point in the history
Loading