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: TypeScriptToLua/TypeScriptToLua
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.34.0
Choose a base ref
...
head repository: TypeScriptToLua/TypeScriptToLua
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.36.0
Choose a head ref
  • 19 commits
  • 78 files changed
  • 3 contributors

Commits on Mar 24, 2026

  1. fix try/finally not re-throwing errors when there is no catch clause (#…

    …1692)
    
    * fix try/finally not re-throwing errors when there is no catch clause (#1667)
    
    When a try block had a finally but no catch, pcall's error result was
    discarded, silently swallowing the exception. Now the error is captured
    and re-thrown after the finally block executes.
    
    * Nicer test return values
    RealColdFry authored Mar 24, 2026
    Configuration menu
    Copy the full SHA
    cfb6e2b View commit details
    Browse the repository at this point in the history
  2. fix Set iterator not reflecting mutations after creation (#1691)

    * fix Set iterator not reflecting mutations after creation (#1671)
    
    Set.values(), keys(), and entries() eagerly captured firstKey at
    iterator creation time. If the Set was mutated (e.g. via delete)
    before the iterator was consumed, the iterator still saw the stale
    firstKey. Read firstKey lazily on the first next() call instead.
    
    * Add tests for Set iterator mutation and exhaustion behavior
    
    * Fix Map iterator mutation and add tests for mutation and exhaustion behavior
    RealColdFry authored Mar 24, 2026
    Configuration menu
    Copy the full SHA
    c3dc829 View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2026

  1. Fix/dead code after break (#1694)

    * strip dead code after break in printer
    
    * change tests from translation to no execution error
    
    * remove unused expectAllVersions
    
    * improve break dead code tests: target affected versions, check output values
    RealColdFry authored Mar 28, 2026
    Configuration menu
    Copy the full SHA
    2bb18e1 View commit details
    Browse the repository at this point in the history
  2. fix Promise.finally() to return new promise via .then() (#1696)

    * fix Promise.finally() to return new promise via .then()
    
    * simplify Promise.finally test to use expectToMatchJsResult
    
    Remove redundant tests that relied on synchronous polyfill behavior
    differing from JS. Keep only the identity check which matches JS.
    
    * add tests for Promise.finally value preservation and rejection passthrough
    
    Fix issue reference (#1660, not #1659).
    RealColdFry authored Mar 28, 2026
    Configuration menu
    Copy the full SHA
    8c856f1 View commit details
    Browse the repository at this point in the history
  3. fix Object.defineProperty sharing values across instances (#1697)

    * fix Object.defineProperty sharing values across instances
    
    When Object.defineProperty is called on an instance (not a prototype),
    create a per-instance metatable if the shared metatable already has
    descriptors, so that each instance gets its own descriptor storage.
    
    Fixes #1625
    
    * fix Object.defineProperty instance isolation for first instance
    
    Use a marker to always create per-instance metatables, not just when
    _descriptors already exists on the shared metatable. Add more thorough
    instance isolation tests.
    RealColdFry authored Mar 28, 2026
    Configuration menu
    Copy the full SHA
    57459c6 View commit details
    Browse the repository at this point in the history

Commits on Mar 29, 2026

  1. fix try/finally rethrow when try block has return paths (#1699)

    * fix try/finally rethrow when try block has return paths
    
    Fixes a regression from #1692 where try/finally (no catch) with both
    return and throw paths silently lost the error. The re-throw used an
    undeclared ____error variable; use ____hasReturned instead, which is
    where pcall places the error on failure.
    
    * add test for try/finally with return+throw and non-empty finally body
    RealColdFry authored Mar 29, 2026
    Configuration menu
    Copy the full SHA
    ec26bdf View commit details
    Browse the repository at this point in the history

Commits on Apr 1, 2026

  1. fix Math.atan2 emitting math.atan2 instead of math.atan for Lua 5.4+ (#…

    …1700)
    
    * fix Math.atan2 emitting math.atan2 instead of math.atan for Lua 5.4+
    
    math.atan2 was removed in Lua 5.3 (replaced by two-arg math.atan).
    The codegen only special-cased 5.3 but not 5.4 or 5.5, which also
    lack math.atan2 (5.4 has it behind a compat flag, 5.5 drops it).
    
    * invert atan2 condition to default future Lua targets to math.atan
    
    Enumerate the older targets that need math.atan2 instead of the newer
    ones that need math.atan, so any future Lua target (5.6+) defaults to
    the modern behavior rather than silently regressing.
    RealColdFry authored Apr 1, 2026
    Configuration menu
    Copy the full SHA
    84ef0b2 View commit details
    Browse the repository at this point in the history
  2. fix Number.MAX_SAFE_INTEGER, MIN_SAFE_INTEGER, MIN_VALUE, MAX_VALUE e…

    …mitting wrong Lua (#1698)
    
    All four constants evaluated to Infinity or -Infinity in Lua. Additionally,
    MIN_SAFE_INTEGER and MIN_VALUE emitted identical code, as did MAX_SAFE_INTEGER
    and MAX_VALUE. The existing test did not catch this because it only checked
    Lua-side results with comparisons that the wrong values accidentally satisfied.
    RealColdFry authored Apr 1, 2026
    Configuration menu
    Copy the full SHA
    c043cdc View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2026

  1. fix >>> (unsigned right shift) producing wrong results on Lua 5.3+ (#…

    …1703)
    
    * fix >>> (unsigned right shift) producing wrong results on Lua 5.3+
    
    TS >>> is a logical right shift (zero-fills from the left), but TSTL
    was mapping it to Lua's >> which is arithmetic (sign-extends). This
    gave wrong results for negative numbers: e.g. -1 >>> 0 should be
    4294967295 but produced -1.
    
    Fix by masking to unsigned 32-bit first: (left & 0xFFFFFFFF) >> right.
    The Lua 5.2 (bit32.rshift) and LuaJIT (bit.rshift) paths were already
    correct.
    
    * lint
    RealColdFry authored Apr 3, 2026
    Configuration menu
    Copy the full SHA
    5176fcd View commit details
    Browse the repository at this point in the history

Commits on Apr 16, 2026

  1. Fix/object assign non table source (#1642) (#1710)

    * fix Object.assign crashing when source is a non-table value
    
    `{ ...(cond && obj) }` short-circuits to `false` when `cond` is falsy. JS
    treats this as a no-op (Object.assign coerces primitives to wrapper objects
    with no own enumerable properties), but `__TS__ObjectAssign` was iterating
    every source unconditionally, so `pairs(false)` errored at runtime.
    
    Skip non-table sources, matching the spec for null/undefined/primitive args.
    
    * refactor __TS__ObjectAssign to emit cleaner Lua
    
    Invert the type guard so it nests the spread loop instead of using `continue`,
    which lowered to a `repeat ... until true` + `break` dance. Same behavior,
    the bundled helper now reads like the hand-written original.
    RealColdFry authored Apr 16, 2026
    Configuration menu
    Copy the full SHA
    c3b3a8b View commit details
    Browse the repository at this point in the history
  2. fix array destructuring prefix operator side effects (#1405) (#1708)

    * fix array destructuring not preserving evaluation order with side effects (#1405)
    
    * add more test cases for array destructuring side effects
    RealColdFry authored Apr 16, 2026
    Configuration menu
    Copy the full SHA
    781db84 View commit details
    Browse the repository at this point in the history
  3. fix return, break and continue inside try in async functions (#1706) (#…

    …1707)
    
    * fix return, break and continue inside try in async functions (#1706)
    
    * more tests
    
    * add multi-return test for async try
    
    * simplify
    
    * reorder functions
    RealColdFry authored Apr 16, 2026
    Configuration menu
    Copy the full SHA
    5753d6c View commit details
    Browse the repository at this point in the history
  4. fix dots in file/directory names breaking Lua require resolution (#1445

    …) (#1702)
    
    * fix dots in file/directory names breaking Lua require resolution (#1445)
    
    Lua's require() uses dots as path separators, so a file at Foo.Bar/index.lua
    is unreachable via require("Foo.Bar.index") since Lua looks for Foo/Bar/index.lua.
    Expand dotted path segments into nested directories in the emit output, and emit
    a diagnostic when this expansion causes output path collisions.
    
    * replace dots with underscores in output paths instead of expanding to nested directories
    
    * more tests
    RealColdFry authored Apr 16, 2026
    Configuration menu
    Copy the full SHA
    2fc2e99 View commit details
    Browse the repository at this point in the history

Commits on Apr 18, 2026

  1. fix await inside catch/finally in async try (#1659) (#1709)

    * fix await inside catch/finally in async try
    
    * add test for awaited return value from catch in async try
    RealColdFry authored Apr 18, 2026
    Configuration menu
    Copy the full SHA
    3d14be8 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    843544d View commit details
    Browse the repository at this point in the history

Commits on Apr 21, 2026

  1. Upgrade to TypeScript 6.0 (#1704)

    * Upgarde to TypeScript 6.0
    
    * fix module-resolution tests
    
    * fix array tests except splice
    
    * fix more tests
    
    * update deps to ts6 support
    
    * fix more tests
    
    * updated snapshots
    
    * fix more tests
    
    * fix optional chaining tests
    
    * only module-resolution test failing
    
    * revert utils
    
    * fix last test
    
    * remove debug code from module-resolution.spec.ts
    
    * update benchmark to  nodenext module
    Perryvw authored Apr 21, 2026
    Configuration menu
    Copy the full SHA
    591989b View commit details
    Browse the repository at this point in the history
  2. CHANGELOG.md 1.35.0

    Perryvw committed Apr 21, 2026
    Configuration menu
    Copy the full SHA
    7f835ed View commit details
    Browse the repository at this point in the history
  3. 1.35.0

    Perryvw committed Apr 21, 2026
    Configuration menu
    Copy the full SHA
    06e4263 View commit details
    Browse the repository at this point in the history
  4. 1.36.0

    Perryvw committed Apr 21, 2026
    Configuration menu
    Copy the full SHA
    d3c33ac View commit details
    Browse the repository at this point in the history
Loading