Skip to content

docs(example): propagate Response.json this-binding fix to README and DocC#26

Merged
ikorich merged 1 commit into
mainfrom
feature/seattle-v5
Jun 11, 2026
Merged

docs(example): propagate Response.json this-binding fix to README and DocC#26
ikorich merged 1 commit into
mainfrom
feature/seattle-v5

Conversation

@ikorich

@ikorich ikorich commented Jun 11, 2026

Copy link
Copy Markdown
Member

Motivation

The #24 fix (calling Response.json() with its this binding) landed in the CI-compiled main.swift but never reached the two copy-paste teaching examples, leaving them broken for anyone who pastes them.

Changes

  • DocC quick-start (OpenCombineJS.md): replace the unbound jsonFn() — which throws "Illegal invocation" in browsers — with jsonFn(this: obj).
  • README and DocC: align the JSPromise(resolver:) snippet with the verified main.swift form (raw JSValue rejection, no spurious return .undefined).

Test plan

Documentation-only change confined to markdown code fences; both examples now mirror main.swift exactly, with no DocC symbol-link or build impact.

Closes #24

… and DocC

The #24 fix landed in the CI-compiled main.swift but not the two copy-paste
teaching examples. The DocC quick-start still showed the unbound jsonFn() call
(throws "Illegal invocation" in browsers), and both README and DocC carried a
stale JSPromise(resolver:) form (PromiseError-wrapped value + return .undefined)
that diverged from the verified source. Both now mirror main.swift exactly.
@ikorich ikorich merged commit 5c95435 into main Jun 11, 2026
3 of 4 checks passed
@ikorich ikorich deleted the feature/seattle-v5 branch June 12, 2026 09:22
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.

Example: Response.json() called without this-binding — Illegal invocation in browser

1 participant