Repository navigation
JsonValue.set and push return this: chains from a new value under -mm=own - #87
Merged
Merged
Conversation
…=own Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Conflicts with #86 (JsonValue by key) in JsonValue's set() and push(), in src/lib.ts and src/lib.d.ts: set() takes #86's `key: number | string` and body, with this branch's `: this` result and no @Lends("this"); push() returns `this` as here. Tested with tslang built from TypeScriptCompiler main plus #800 and #801: every test passes in release JIT under gc, rc, none and own (json.ts with its chains, json_index.ts). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
JsonValue.setandpushreturnthis(they already returned the object itself), so under-mm=owna chain from a new value -
JsonValue.newObject().set("a", ...).set("b", ...)- can be returned orgiven to a parameter that keeps it, as under every other model.
: thisimplies@lends("this"), sothe explicit
@lendsgoes.tests/json.tsdrops its__MEMORY_MODEL__ != "own"branch:chained()runs under every model andnow also returns a chain (
person()). The README's-mm=ownnote about chains goes.Needs ASDAlexander77/TypeScriptCompiler#801 (TSLANG_ISSUES 39: a method whose result type is
thisgives a temporaryreceiver back to its caller) and ASDAlexander77/TypeScriptCompiler#802 (an
indexer's
setthat returns a value; rebased onto #86, whose indexer writes go throughset).🤖 Generated with Claude Code