Skip to content

Runtime: a source ending in a // comment compiles - #88

Merged
everettjf merged 2 commits into
mainfrom
fix-trailing-comment-wrapper
Nov 19, 2026
Merged

everettjf merged 2 commits into
mainfrom
fix-trailing-comment-wrapper

Conversation

@everettjf

Copy link
Copy Markdown
Owner

Outcome

A widget whose last line is a // comment with no line break after it failed to compile on every platform: the entry wrapper appended its closing code to the source and the comment swallowed it. The wrapper now ends the source with a line break.

  • ScriptWidgetCompiler.wrappedSource (Apple) and wrappedSource in Web/preview-engine/src/contract.js (browser preview, Android, Windows, Linux) change together; the contract test holds them equal.
  • No line number of the source moves.
  • The compiler fingerprint is not bumped: artifacts compiled before stay correct for their source, so nothing is recompiled on devices.

Security and compatibility

No permission or limit changes. Sources that compiled before compile to the same program.

Checks run (Mac, Apple silicon)

  • npm test in Web/preview-engine: 200 passed. The new kernel test fails without the fix.
  • macOS ScriptWidgetRuntimeTests: 829 tests, 795 passed, 34 skipped, 0 failed, including the new testSourceEndingInALineCommentWithoutLineBreakCompiles.

Not run

  • Android, Windows and Linux suites, and the iOS simulator suite. Those platforms take the change through the shared JavaScript when their assets are rebuilt.
  • release-readiness.sh as a whole.

🤖 Generated with Claude Code

everettjf and others added 2 commits November 19, 2026 00:39
The entry wrapper appended its closing code directly to the source, so a
last line that was a comment without a line break swallowed it and the
widget failed to compile. The wrapper now ends the source with a line
break, in the Swift runtime and in the shared JavaScript that Android,
Windows, Linux and the browser preview run. No source line number moves.

The compiler fingerprint stays: artifacts compiled before remain correct
for their source, so no widget needs recompiling.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@everettjf
everettjf merged commit 66d7afd into main Nov 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant