Skip to content

docs(core): align I18nCreateOpCode pseudocode comment with implementation#69826

Open
CYANO-01 wants to merge 2 commits into
angular:mainfrom
CYANO-01:docs/fix-i18n-createopcode-pseudocode-shift
Open

docs(core): align I18nCreateOpCode pseudocode comment with implementation#69826
CYANO-01 wants to merge 2 commits into
angular:mainfrom
CYANO-01:docs/fix-i18n-createopcode-pseudocode-shift

Conversation

@CYANO-01

Copy link
Copy Markdown
Contributor

Problem

The JSDoc pseudocode example in the I18nCreateOpCodes interface documentation uses >> (signed right shift) to extract the node index from an opcode:

// packages/core/src/render3/interfaces/i18n.ts — comment line
const index = opcode >> I18nCreateOpCode.SHIFT;  // ⚠️ uses signed shift

However, the actual runtime implementation in i18n_apply.ts and i18n_debug.ts consistently uses >>> (unsigned right shift) for this exact operation:

// i18n_apply.ts
const index = opCode >>> I18nCreateOpCode.SHIFT;   // ✅
// i18n_debug.ts
const index = opCode >>> I18nCreateOpCode.SHIFT;   // ✅

A reader consulting the comment pseudocode when implementing a similar decode loop could introduce a subtle signed-shift bug.

Fix

Align the comment pseudocode with the implementation: change >> to >>>.

This is a docs-only change; no runtime behaviour is affected.

…tion

The pseudocode example in the `I18nCreateOpCodes` interface JSDoc used `>>`
(signed right shift) to extract the node index from an opcode, but the actual
runtime implementation in `i18n_apply.ts` and `i18n_debug.ts` consistently
uses `>>>` (unsigned right shift).

Aligning the comment with the implementation prevents readers from
inadvertently introducing a signed-shift bug when transcribing the example.
@pullapprove
pullapprove Bot requested a review from kirjs July 17, 2026 00:48
@angular-robot angular-robot Bot added area: docs Related to the documentation area: core Issues related to the framework runtime labels Jul 17, 2026
@ngbot ngbot Bot added this to the Backlog milestone Jul 17, 2026
@JeanMeche
JeanMeche removed the request for review from kirjs July 17, 2026 00:53
@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Jul 17, 2026
@JeanMeche

Copy link
Copy Markdown
Member

caretaker note: This is a doc only change, no need to presubmit.

@pkozlowski-opensource

Copy link
Copy Markdown
Member

@pkozlowski-opensource pkozlowski-opensource added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: merge The PR is ready for merge by the caretaker merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Jul 22, 2026
@angular-robot
angular-robot Bot requested a review from JeanMeche July 22, 2026 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews area: core Issues related to the framework runtime area: docs Related to the documentation target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants