Skip to content

Use jsxref shortform for null, this, delete, new, instanceof#44221

Merged
caugner merged 2 commits into
mainfrom
add-jsxref-shorthands
May 22, 2026
Merged

Use jsxref shortform for null, this, delete, new, instanceof#44221
caugner merged 2 commits into
mainfrom
add-jsxref-shorthands

Conversation

@caugner
Copy link
Copy Markdown
Collaborator

@caugner caugner commented May 22, 2026

Description

Update jsxref references to use the bare-keyword shortform for five JavaScript operator keywords whose canonical pages live under Web/JavaScript/Reference/Operators/:

  • {{jsxref("Operators/null", "null")}}{{jsxref("null")}}
  • {{jsxref("Operators/this", "this")}}{{jsxref("this")}}
  • {{jsxref("Operators/delete", "delete")}}{{jsxref("delete")}}
  • {{jsxref("Operators/new", "new")}}{{jsxref("new")}}
  • {{jsxref("Operators/instanceof", "instanceof")}}{{jsxref("instanceof")}}

As a workaround to make the shortform resolve on current rari, also adds the five Reference/<keyword>Reference/Operators/<keyword> redirects. With mdn/rari#715, the future jsxref macro supports these bare-keyword references out of the box and the redirects will no longer be load-bearing.

Motivation

Make sources easier to read and write: the duplicated arg ("Operators/foo", "foo") is awkward boilerplate, and the shortform matches how Global_Objects/* references already work ({{jsxref("Array")}} rather than {{jsxref("Global_Objects/Array", "Array")}}).

Additional details

  • 66 files touched across glossary, Web APIs, and the JavaScript reference itself.
  • Longforms with custom display text (e.g. "delete x", "deleted", "x instanceof y") are preserved — only the redundant "X", "X" pattern is collapsed.
  • On current rari, each shortform call produces a templ-redirected-link warning because the rendered href (…/Reference/null etc.) bounces through the new redirect entries to …/Reference/Operators/null. Those warnings go away with fix(jsxref): build Web/JavaScript index to resolve names rari#715, which builds a Web/JavaScript/Reference slug index so jsxref resolves bare keywords directly to the canonical Operators/* URL.

Related issues and pull requests

Relates to mdn/rari#715

caugner added 2 commits May 22, 2026 12:26
Adds `Reference/{null,this,delete,new,instanceof}` →
`Reference/Operators/{...}` so `{{jsxref("name")}}` shortform resolves
directly via the first lookup path in `jsxref`.
Replaces `{{jsxref("Operators/X", "X")}}` with `{{jsxref("X")}}` for
`null`, `this`, `delete`, `new`, and `instanceof` across 66 files.
Resolution now goes through the `Reference/X` redirects added in the
prior commit and the `Reference` slug index in rari@jsxref-with-index.

Longforms with custom display text (e.g. `"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved as-is.
@github-actions github-actions Bot added Content:WebAPI Web API docs Content:JS JavaScript docs Content:Learn Learning area docs Content:Glossary Glossary entries Content:Firefox Content in the Mozilla/Firefox subtree size/m [PR only] 51-500 LoC changed labels May 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Preview URLs (66 pages)
Flaws (107)

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Glossary/Binding
Title: Binding
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Learn_web_development/Core/Scripting/Object_basics
Title: JavaScript object basics
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Mozilla/Firefox/Releases/38
Title: Firefox 38 release notes for developers
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Mozilla/Firefox/Releases/40
Title: Firefox 40 release notes for developers
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Mozilla/Firefox/Releases/44
Title: Firefox 44 release notes for developers
Flaw count: 3

  • macros:
    • Macro cssxref produces link /en-US/docs/Web/CSS/@page/marks which doesn't resolve
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro domxref produces link /en-US/docs/Web/API/MessageEvent/initMessageEvent which doesn't resolve

URL: /en-US/docs/Web/API/DOMTokenList/forEach
Title: DOMTokenList: forEach() method
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/API/EventTarget/addEventListener
Title: EventTarget: addEventListener() method
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/API/LargestContentfulPaint/presentationTime
Title: LargestContentfulPaint: presentationTime property
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect

URL: /en-US/docs/Web/API/PerformanceElementTiming/presentationTime
Title: PerformanceElementTiming: presentationTime property
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect

URL: /en-US/docs/Web/API/PerformanceLongAnimationFrameTiming/presentationTime
Title: PerformanceLongAnimationFrameTiming: presentationTime property
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect

URL: /en-US/docs/Web/API/PerformancePaintTiming/presentationTime
Title: PerformancePaintTiming: presentationTime property
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect

URL: /en-US/docs/Web/API/WindowClient/navigate
Title: WindowClient: navigate() method
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect

URL: /en-US/docs/Web/JavaScript
Title: JavaScript
Flaw count: 3

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Guide/Meta_programming
Title: Meta programming
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference
Title: JavaScript reference
Flaw count: 4

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Classes
Title: Classes
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Classes/static
Title: static
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Errors/Bad_new_optional
Title: SyntaxError: new keyword cannot be used with an optional chain
Flaw count: 2

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Errors/Bad_super_call
Title: SyntaxError: super() is only valid in derived class constructors
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Errors/Builtin_ctor_no_new
Title: TypeError: calling a builtin X constructor without new is forbidden
Flaw count: 2

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Errors/Class_ctor_no_new
Title: TypeError: class constructors must be invoked with 'new'
Flaw count: 2

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Errors/Invalid_derived_return
Title: TypeError: derived class constructor returned invalid value x
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Errors/Super_not_called
Title: ReferenceError: must call super constructor before using 'this' in derived class constructor
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Functions/get
Title: get
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Functions/set
Title: set
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects
Title: Standard built-in objects
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
Title: Array.prototype.forEach()
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/BigInt/BigInt
Title: BigInt() constructor
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Error
Title: Error
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Error/Error
Title: Error() constructor
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/arguments
Title: Function.prototype.arguments
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/bind
Title: Function.prototype.bind()
Flaw count: 6

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • and 1 more flaws omitted

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/caller
Title: Function.prototype.caller
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis
Title: globalThis
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Iterator/from
Title: Iterator.from()
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Object
Title: Object
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/isPrototypeOf
Title: Object.prototype.isPrototypeOf()
Flaw count: 2

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/proto
Title: Object.prototype.__proto__
Flaw count: 2

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy
Title: Proxy() constructor
Flaw count: 3

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
    • Sidebar jsref produces link /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/construct
Title: handler.construct()
Flaw count: 5

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Sidebar jsref produces link /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/deleteProperty
Title: handler.deleteProperty()
Flaw count: 5

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
    • Sidebar jsref produces link /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy/getPrototypeOf
Title: handler.getPrototypeOf()
Flaw count: 2

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect
    • Sidebar jsref produces link /en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/handler which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/construct
Title: Reflect.construct()
Flaw count: 2

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Reflect/deleteProperty
Title: Reflect.deleteProperty()
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Set
Title: Set
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/difference
Title: Set.prototype.difference()
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/intersection
Title: Set.prototype.intersection()
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isDisjointFrom
Title: Set.prototype.isDisjointFrom()
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSubsetOf
Title: Set.prototype.isSubsetOf()
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/isSupersetOf
Title: Set.prototype.isSupersetOf()
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/symmetricDifference
Title: Set.prototype.symmetricDifference()
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/union
Title: Set.prototype.union()
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer/SharedArrayBuffer
Title: SharedArrayBuffer() constructor
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/String
Title: String
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol
Title: Symbol
Flaw count: 3

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/hasInstance
Title: Symbol.hasInstance
Flaw count: 2

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol/Symbol
Title: Symbol() constructor
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Lexical_grammar
Title: Lexical grammar
Flaw count: 5

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/null which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Operators
Title: Expressions and operators
Flaw count: 5

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/this which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Operators/Grouping
Title: Grouping operator ( )
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Operators/Operator_precedence
Title: Operator precedence
Flaw count: 2

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining
Title: Optional chaining (?.)
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax
Title: Spread syntax (...)
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Operators/this
Title: this
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/new which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Operators/typeof
Title: typeof
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/instanceof which is a redirect

URL: /en-US/docs/Web/JavaScript/Reference/Statements/var
Title: var
Flaw count: 1

  • macros:
    • Macro jsxref produces link /en-US/docs/Web/JavaScript/Reference/delete which is a redirect
External URLs (4)

URL: /en-US/docs/Mozilla/Firefox/Releases/38
Title: Firefox 38 release notes for developers


URL: /en-US/docs/Mozilla/Firefox/Releases/40
Title: Firefox 40 release notes for developers


URL: /en-US/docs/Mozilla/Firefox/Releases/44
Title: Firefox 44 release notes for developers

@caugner caugner marked this pull request as ready for review May 22, 2026 10:39
@caugner caugner requested review from a team as code owners May 22, 2026 10:39
@caugner caugner requested review from dipikabh and sideshowbarker and removed request for a team May 22, 2026 10:39
Copy link
Copy Markdown
Contributor

@dipikabh dipikabh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@caugner caugner merged commit 1ddd955 into main May 22, 2026
12 checks passed
@caugner caugner deleted the add-jsxref-shorthands branch May 22, 2026 15:48
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
…ator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
…ator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
…ator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
…ator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
…perator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
…ator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
…perator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
…perator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.
tristantheb added a commit to mdn/translated-content that referenced this pull request May 22, 2026
* fix(fr): translate localized JS namespace prefixes in `jsxref` args

`Instructions/`, `Opérateurs/`, `Objets_globaux/`, `Fonctions/`, and
similar locale-translated path prefixes don't resolve against the
en-US `jsxref` index. Rewrite to the canonical en-US prefixes
(`Statements/`, `Operators/`, `Global_Objects/`, `Functions/`).

* fix(fr): rewrite `@@<name>` to `Symbol.<name>` in `jsxref` args

The `@@iterator` / `@@species` / etc. notation is the old MDN
convention for well-known symbol properties. Canonical pages now
live under `Symbol.<name>` (e.g. `Symbol.iterator`). Update the
macro args to match and insert a `/` so the normalization step
(`.` -> `/`) doesn't split the `Symbol.` qualifier.

* fix(fr): strip trailing `.prototype` from `jsxref` class refs

`{{jsxref("Object.prototype")}}` and similar refs were producing
broken links because no `Object/prototype` page exists; the class
page (`Object`, `Array`, etc.) documents `.prototype` directly.
Rewrite to link to the class page.

* fix(fr): rewrite `Proxy.handler.X` to `Proxy/Proxy/X` in `jsxref` args

The handler-trap pages live under `Global_Objects/Proxy/Proxy/<trap>`;
the old `Proxy.handler` namespace was retired. Update the macro
args to point at the canonical paths.

* fix(fr): rewrite stale Operators aggregate-page refs in `jsxref`

The old `Operators/<Group>_Operators` slugs and related obsolete
leaves (e.g. `Spread_operator`, `Nullish_coalescing_operator`)
redirect under the en-US slug graph but never reach the canonical
pages cleanly. Rewrite the first arg to the current canonical
sub-path.

* fix(fr): rewrite localized `Functions/<leaf>` refs in `jsxref`

`Functions/Fonctions_fléchées` and
`Functions/Valeurs_par_défaut_des_arguments` (French translations
of the canonical English leaf names) don't resolve under the en-US
canonical path. Rewrite to `Functions/Arrow_functions` and
`Functions/Default_parameters`.

* fix(fr): translate French leaf slugs to canonical en-US in `jsxref`

Cover the residual French-translated leaves that weren't reached
by the en-US namespace-prefix sweep:

- `Operators/L_opérateur_<x>` -> `Operators/<x>` (delete, function,
  new, in, this, typeof, void, instanceof, yield, class, …);
  `L_opérateur_get`/`set` map to `Functions/get`/`Functions/set`.
- `Operators/Opérateurs_de_comparaison` -> `Operators`.
- `Operators/Affecter_par_décomposition` -> `Operators/Destructuring`.
- `Statements/bloc`/`vide`/`for_each...in` -> `block`/`Empty`/
  `Deprecated_and_obsolete_features`.
- `Functions/paramètres_du_reste`/`Définition_de_méthode`/
  `arguments.length` -> canonical en-US sub-paths.
- Bare `Fonctions`/`Les_protocoles_iteration`/`Grammaire_lexicale`
  -> `Functions`/`Iteration_protocols`/`Lexical_grammar`.
- `Instruction/function*` (singular typo) -> `Statements/function*`.

* fix(fr): rewrite `Opérateurs_d_affectation` refs in `jsxref`

The French slug `Operators/Opérateurs_d_affectation` mirrors the
en-US `Operators/Assignment_Operators` that was split into
`Operators#Assignment_operators`. Rewrite the macro to use the
canonical `Operators` page with the `Assignment_operators` anchor.

* fix(fr): translate residual French operator slugs in `jsxref`

Cover three more French-translated operator leaves the previous
sweep missed: `Syntaxe_décomposition` -> `Spread_syntax`,
`Initialisateur_objet` -> `Object_initializer`, and
`L_opérateur_virgule` -> `Comma_operator`.

* fix(fr): rewrite `Global_Objects/Proxy/handler[/X]` to `Proxy/Proxy[/X]`

The slash-form full-path Proxy handler refs weren't covered by the
earlier dot-form (`Proxy.handler.X`) sweep. The handler-trap pages
now live under `Global_Objects/Proxy/Proxy/<trap>`; rewrite the
full-path form to match.

* fix(fr): rewrite stale `jsxref` args to canonical slugs

Each old slug below resolves only via an en-US redirect; wire the
macro to the canonical sub-path so the link doesn't hop:

- `null` (bare) -> `Operators/null` (preserve display "null").
- `eval` (bare) -> `Global_Objects/eval` (preserve display "eval").
- `Global_Objects/null` -> `Operators/null`.
- `Global_Objects/String/contains` -> `Global_Objects/String/includes`.
- `Global_Objects/TypedArray/name` -> `Global_Objects/Function/name`.
- `Statements/default` -> `Statements/switch`.
- `instructions/const` (lowercase typo) -> `Statements/const`.

* fix(fr): point `arguments.caller` ref at `Function.prototype.caller`

There is no `arguments/caller` page (the property was removed). The
closest canonical reference is `Global_Objects/Function/caller`,
which documents the same deprecated mechanism on the function
prototype. Preserve the original `arguments.caller` display text.

* fix(fr): rewrite stale `jsxref` arg variants to canonical slugs

Cover dotted/parenthesized forms missed by the prior pass:

- `eval()` (with parens) -> `Global_Objects/eval`.
- `String.prototype.contains[()]` -> `String.prototype.includes[()]`.
- `TypedArray.name` -> `Function.name` (inherited from
  `Function.prototype`).
- `<Wrapper>.prototype.toSource[()]` (`Object`/`Array`/`Boolean`/
  `Error`/`Number`/`String`) -> `.toString[()]` (the redirect target
  for all removed `toSource` wrappers).

When the macro had no explicit display arg, the original (pre-rewrite)
arg is inserted as the display text so the rendered label keeps
reflecting what the author wrote (e.g. \"contains\" remains visible
even though the link now goes to \`includes\`).

* fix(fr): strip redundant `Global_Objects/` prefix from `jsxref` args

When the macro arg starts with `Global_Objects/`, strip the prefix
and convert any inner `/` separators to `.` so the bare/dotted
identifier (e.g. `Array`, `Math.hypot`, `Number.EPSILON`) resolves
to the same canonical page through the en-US JS Reference index.
When the explicit display arg is redundant (matches the dotted
form, e.g. `("Global_Objects/Array", "Array")`), drop it so the
default rendering takes over.

Guards:
- Skip if the suffix already contains `.` (e.g.
  `Global_Objects/RegExp/Symbol.match`), since the macro's
  `.` -> `/` normalization can't be reversed.
- Drop the redundant display only when arg2 is the last positional
  arg, to keep `anchor`/`no_code` in their original slots.

* fix(fr): restore `Global_Objects/` prefix for `jsxref(\"eval\"…)` refs

Currently-published Rari can't resolve bare `eval`/`eval()` in
`jsxref` because there is no `/Web/JavaScript/Reference/eval`
page or redirect — mdn/content keeps the explicit
`Global_Objects/eval` prefix consistently. The earlier
simplification sweep stripped the prefix where I shouldn't have;
restore it (display arg preserved).

* fix(fr): merge `("foo", "foo()")` into `("foo()")` in `jsxref`

The macro strips `()` for URL resolution, so adding the parens to
arg1 doesn't change the link target — but the displayed text keeps
the parens (display defaults to api_name). This drops the
redundant arg2 when display equals arg1 + `()`, e.g.
`{{jsxref("Math.hypot", "Math.hypot()")}}` ->
`{{jsxref("Math.hypot()")}}`.

Only merges when arg2 is the last positional arg, to keep
anchor/no_code in their slots. The fr-specific
`{{jsxref("Global_Objects/eval", "eval()")}}` form is left alone
(arg2 "eval()" does not match arg1 "Global_Objects/eval" + "()").

* fix(fr): case-correct `jsxref` slugs surfaced by index-aware resolver

Lowercase JS class names (`string`/`boolean`/`object`/`promise`/`array`)
→ canonical capitalized form; lowercase namespace slugs
(`statements/<X>`, `operators/new`) → canonical capitalized;
`int32Array` (lowercase `i` typo) → `Int32Array`; `Map/foreach` →
`Map/forEach`. Display preservation keeps the original (mis-cased)
form rendered so the link text is unchanged.

* fix(fr): case-correct French residuals and stale slugs (round 2)

Round 2 of the index-aware rari sweep:

- Localized namespace prefixes missed by the round-1 sweep:
  `Erreurs/<X>` → `Errors/<X>` (3 calls); the French long-form
  `Fonctions_et_portee_des_fonctions/Strict_mode` → `Functions/Strict_mode`.
- French-translated `Booléen`/`booléen` → `Boolean` with display
  preservation (keeps the French wording rendered).
- Stale slugs (newer additions to the universal redirect map):
  bare `uneval()` → `Deprecated_and_obsolete_features`,
  `Function/prototype` slug form → `Function`.

* fix(fr): rewrite residual stale `jsxref` slugs and a typo (round 3)

- `Functions/Strict_mode` and `Errors/Not_a_codepoint` weren't in the
  redirect-targets map yet; add them (`Strict_mode` is root-level, not
  under `Functions/`; `Not_a_codepoint` was renamed to
  `Not_a_valid_code_point`).
- Fix typo `String. prototype. prototype. split ()` (literal spaces +
  duplicate `prototype` segment) → `String.prototype.split()`.

* fix(fr): rewrite bare `<IntlClass>` and bare `this` for rari@main (round 4)

Two patterns that resolve under the index-aware rari but break under
the deployed rari:

- Bare Intl class refs (`Collator`, `DateTimeFormat`, `NumberFormat`)
  → `Intl/<Class>` form. The index-aware rari has a namespace-strip
  alias; deployed rari falls back through `Global_Objects/<Class>`
  which redirects, surfacing as `templ-redirected-link`.
- Bare `this` → `Operators/this`. The index-aware rari has a leaf
  shortcut; deployed rari produces a `templ-broken-link`.

Added `this` to the cross-locale `SIMPLE_RENAMES_REDIRECTS` map for
future runs.

* fix(fr): drop redundant display arg when arg1 and arg2 differ only in case

Over-zealous display preservation inserted by the case-fix sweep:
`{{jsxref("Object", "object")}}` was meant to keep "object" rendered,
but for JS type references the canonical (capitalized) class name
should also be the rendered text. Drop the redundant arg2 when it
matches arg1 case-insensitively — covers `Object`/`String`/`Number`/
`Array`/`Boolean`/`Promise`/`Symbol`/`undefined` and any other
mis-cased pair caught by the index-aware rari.

Only drops arg2 when it's the last positional arg (same safety policy
as `merge-parens-display`).

* fix(fr): rewrite `Proxy.Proxy[.X]` (dotted) to `Proxy/Proxy[/X]` (slash) in `jsxref`

The dotted form implies `Proxy.Proxy.X` is a valid JS member access,
but `Proxy.Proxy.<trap>` is not a real namespace — `Proxy/Proxy/<trap>`
is just MDN's URL convention for the constructor + handler-trap
sub-pages. Switch to the slash form everywhere so the rendered default
display doesn't suggest a namespaced `Proxy.Proxy.X` access pattern.

Display args are preserved as-is where set.

* fix(fr): collapse `("Operators/<kw>", "<kw>")` to `("<kw>")` for operator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.

* fix(fr): add `Reference/<kw>` redirects for operator shorthands

Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.

* Apply suggestions from code review

Co-authored-by: Tristan D. <tristantheb@users.noreply.github.com>

* apply change for FF40 like en-US `String.prototype.contains`

Co-authored-by: Claas Augner <495429+caugner@users.noreply.github.com>

---------

Co-authored-by: Tristan D. <tristantheb@users.noreply.github.com>
caugner added a commit to mdn/translated-content that referenced this pull request May 22, 2026
* fix(pt-br): rewrite `@@<name>` to `Symbol.<name>` in `jsxref` args

The `@@iterator` / `@@species` / etc. notation is the old MDN
convention for well-known symbol properties. Canonical pages now
live under `Symbol.<name>` (e.g. `Symbol.iterator`). Update the
macro args to match and insert a `/` so the normalization step
(`.` -> `/`) doesn't split the `Symbol.` qualifier.

* fix(pt-br): strip trailing `.prototype` from `jsxref` class refs

`{{jsxref("Object.prototype")}}` and similar refs were producing
broken links because no `Object/prototype` page exists; the class
page (`Object`, `Array`, etc.) documents `.prototype` directly.
Rewrite to link to the class page.

* fix(pt-br): rewrite `Proxy.handler.X` to `Proxy/Proxy/X` in `jsxref` args

The handler-trap pages live under `Global_Objects/Proxy/Proxy/<trap>`;
the old `Proxy.handler` namespace was retired. Update the macro
args to point at the canonical paths.

* fix(pt-br): rewrite stale Operators aggregate-page refs in `jsxref`

The old `Operators/<Group>_Operators` slugs (Arithmetic, Bitwise,
Comparison, Logical) and related obsolete leaves
(`Destructuring_assignment`, `Legacy_generator_function`,
`Logical_nullish_assignment`, `Nullish_coalescing_operator`,
`Spread_operator`) redirect under the en-US slug graph but never
reach the canonical pages cleanly. Rewrite the first arg to the
current canonical sub-path.

* fix(pt-br): rewrite `Operators/Assignment_Operators` refs in `jsxref`

The old slug redirects to `Operators#Assignment_operators`. Rewrite
the macro to use the canonical `Operators` page; existing anchors
on the call site are preserved.

* fix(pt-br): rewrite obsolete Operators expression-form refs in `jsxref`

`Operators/Array_comprehensions`, `Operators/Generator_comprehensions`,
`Operators/Expression_closures`, and `Statements/Legacy_generator_function`
were removed from JavaScript. Rewrite the macro args to point at
`Deprecated_and_obsolete_features`.

* fix(pt-br): rewrite additional `Functions/*` refs in `jsxref`

Cover the bare and member forms of the legacy `Functions_and_function_scope`
namespace and the misplaced `Functions/Strict_mode` (canonical: `Functions`,
`Functions/arguments`, `Strict_mode`).

* fix(pt-br): rewrite `Global_Objects/<IntlClass>` refs to `Intl/<IntlClass>`

Intl member classes live under `Global_Objects/Intl/`; the top-level
`Global_Objects/<Class>` slug is only a redirect.

* fix(pt-br): rewrite `Global_Objects/Proxy/handler[/X]` to `Proxy/Proxy[/X]`

The Proxy constructor page was renamed; the handler-trap namespace
now lives under `Global_Objects/Proxy/Proxy/<trap>`.

* fix(pt-br): rewrite stale `jsxref` args to canonical slugs

Rewrite arg1 for slugs that en-US redirects resolve cleanly so the
macro doesn't hop: bare `null`/`eval[()]`, `Global_Objects/null`,
`Operators/get`/`set`, `Global_Objects/<X>/toSource`,
`<X>.prototype.toSource[()]`, `Global_Objects/TypedArray/name`,
`TypedArray.name`, `Global_Objects/Array/flatten`,
`Global_Objects/Date/toGMTString`, `Global_Objects/uneval` (and bare),
`Object.toSource[()]`, `Atomics.wake[()]` → `Atomics.notify[()]`,
`Functions_and_function_scope/arguments/length` → `Functions/`,
`Functions_and_function_scope/Strict_mode` → `Strict_mode`,
`<Class>.Symbol.species` → `<Class>/Symbol.species`.

* fix(pt-br): strip redundant `Global_Objects/` prefix from `jsxref` args

Strip the `Global_Objects/` prefix when safe — display arg2 is dropped
only when it's the last positional arg and equals the post-strip
default. Skips dotted-leaf suffixes and bare `eval`.

* fix(pt-br): merge `("foo", "foo()")` into `("foo()")` in `jsxref`

The macro strips `()` for URL resolution but keeps it in the default
display, so arg2 is redundant when it only adds parens to arg1. Only
drops arg2 when it's the last positional arg.

* fix(pt-br): rewrite bare/dotted `<IntlClass>` refs to `Intl/<IntlClass>`

`{{jsxref("NumberFormat")}}` and friends resolve via redirect because
the canonical page lives under `Global_Objects/Intl/<Class>`. Rewrite
the bare and dotted forms to the canonical `Intl/<Class>` path. When
no explicit display arg is set, insert the original arg as the
display text so the rendered label keeps reflecting what the author
originally wrote.

* fix(pt-br): convert WebAssembly `jsxref` refs to markdown links

WebAssembly was moved out of `Web/JavaScript/Reference/Global_Objects/`
and now lives at `/WebAssembly/Reference/JavaScript_interface/`. The
`jsxref` macro is scoped to JS Reference, so `WebAssembly.<X>` refs
all surface as `templ-redirected-link`. Convert them to plain markdown
links pointing at the canonical WebAssembly path.

Display preservation: keep an explicit display arg when set; otherwise
use the dotted `WebAssembly.<X>` form (with parens preserved when arg1
had them) so the rendered label is unchanged.

* fix(pt-br): normalize lowercase `Global_objects/` and convert WebAssembly refs

`files/pt-br/webassembly/index.md` had `jsxref("Global_objects/…")`
(lowercase `o`) args that were missed by the earlier round-1
localized-namespace sweep. Normalize them to canonical
`Global_Objects/` and then convert the WebAssembly subset to plain
markdown links pointing at `/pt-BR/docs/WebAssembly/Reference/JavaScript_interface/<X>`.

* fix(pt-br): translate Portuguese leaf slugs to canonical en-US in `jsxref`

Cover residual Portuguese-translated leaves that weren't reached by
the en-US namespace-prefix sweep:

- `Erro de sintaxe` / `Errodesintaxe` (PT: "syntax error") → `SyntaxError`.
- `Função` (PT: "function") → `Function`.
- `declaração/block` (PT: "statement/block") → `Statements/block`.
- `Statements/funcoes_assincronas` (PT-lowercase: "async functions") →
  `Statements/async_function`.

Display preservation: when the macro had no explicit display arg, the
original Portuguese term is inserted as the display so the rendered
label keeps reflecting the translator's wording.

* fix(pt-br): clean up `jsxref` typos and stale one-offs

Mechanical edits not covered by the bulk sweeps:

- Strip stray spaces around `/` in slug args (`Global_objects / ArrayBuffer`,
  `Statements/for ... of`) and inside the macro paren (`jsxref ( "…"`).
- Strip stray spaces before `()` (`String.prototype.indexOf ()`,
  `String.prototype.slice ()`, `Object.prototype.hasOwnProperty ()`).
- Strip stray spaces in arg1 (`String. prototype.matchAll() `).
- `Strict_mod` (truncated) → `Strict_mode`.
- `Element`/`NodeList`/`ArrayBufferView` are DOM types — swap `jsxref`
  for `domxref`.
- Mirror the fr decision: `Functions/arguments/caller` →
  `Function.prototype.caller`.

* fix(pt-br): case-correct `jsxref` slugs surfaced by index-aware resolver

Lowercase JS class names (`string`/`boolean`/`number`/`object`/
`promise`/`array`/`symbol`) → canonical capitalized form;
`Operators/Conditional_Operator`/`Comma_Operator`/`Function`/
`Operator_Precedence`/`Property_Accessors` → lowercase suffix;
method-name typos (`Date/valueof` → `valueOf`, `Map/foreach` →
`forEach`, `object/defineProperty`/`defineProperties` → `Object/`);
lowercase namespace slugs (`statements/`/`operators/`/`functions/`/
`classes`) → canonical capitalized; `Classes/Constructor` → lowercase
`constructor`; `Regexp/` → `RegExp/`; `Intl/DatetimeFormat` →
`DateTimeFormat`; `Statements/empty` → `Empty`;
`Global_objects/` → `Global_Objects/`; `template_literals` →
`Template_literals`; `Errors/Strict_Non_Simple_Params` casing.

Also resolve the bare `function` ambiguous arg (matches both
`Operators/function` and `Statements/function`) by picking the
expression form — all observed call sites are callback parameters in
WebAPI pages.

Display preservation keeps the original (mis-cased) form rendered so
the link text is unchanged.

* fix(pt-br): case-correct residual dotted-form `jsxref` slugs

Round 2 of the case-fix sweep covering the dotted variants the round-1
mapping missed: `Date.valueof` → `Date.valueOf`, `Map.foreach` →
`Map.forEach`, `Regexp.<member>` → `RegExp.<member>` (for
`global`/`ignoreCase`/`multiline`/`sticky`), `object.defineProperty`/
`defineProperties` → `Object.`, and `Operators/conditional_operator`
(uppercase Operators, lowercase Conditional) → `Operators/Conditional_operator`.

* fix(pt-br): drop redundant display arg when arg1 and arg2 differ only in case

Over-zealous display preservation inserted by the case-fix sweep:
`{{jsxref("Object", "object")}}` was meant to keep "object" rendered,
but for JS type references the canonical (capitalized) class name
should also be the rendered text. Drop the redundant arg2 when it
matches arg1 case-insensitively — covers `Object`/`String`/`Number`/
`Array`/`Boolean`/`Promise`/`Symbol`/`undefined` and any other
mis-cased pair caught by the index-aware rari.

Only drops arg2 when it's the last positional arg (same safety policy
as `merge-parens-display`).

* fix(pt-br): rewrite `Proxy.Proxy[.X]` (dotted) to `Proxy/Proxy[/X]` (slash) in `jsxref`

The dotted form implies `Proxy.Proxy.X` is a valid JS member access,
but `Proxy.Proxy.<trap>` is not a real namespace — `Proxy/Proxy/<trap>`
is just MDN's URL convention for the constructor + handler-trap
sub-pages. Switch to the slash form everywhere so the rendered default
display doesn't suggest a namespaced `Proxy.Proxy.X` access pattern.

Display args are preserved as-is where set.

* fix(pt-br): collapse `("Operators/<kw>", "<kw>")` to `("<kw>")` for operator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.

* fix(pt-br): add `Reference/<kw>` redirects for operator shorthands

Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.

* fix(pt-br): keep longform `("Operators/delete", "delete")` (target page missing)

`Web/JavaScript/Reference/Operators/delete` is not translated in
pt-br, so the per-locale redirect can't point there and the bare
shortform would 404. Restore the longform for `delete` only;
`null`/`this`/`new`/`instanceof` keep the shortform.
mfuji09 pushed a commit to mdn/translated-content that referenced this pull request May 23, 2026
…ator shorthands

Use the bare-keyword shortform for the 5 operator keywords `null`,
`this`, `delete`, `new`, `instanceof` per the convention introduced
in mdn/content#44221. The shortform resolves cleanly on current rari
thanks to the `Reference/<kw>` -> `Reference/Operators/<kw>`
redirects that PR added, and resolves natively under the index-aware
rari from mdn/rari#715.

Only collapses the redundant-display pattern (`("Operators/X", "X")`);
longforms with custom display text (`"delete x"`, `"deleted"`,
`"x instanceof y"`) are preserved.
mfuji09 pushed a commit to mdn/translated-content that referenced this pull request May 23, 2026
Mirrors the en-US redirects added in mdn/content#44221 for the 5
operator-keyword shorthands (`null`, `this`, `delete`, `new`,
`instanceof`). Without these per-locale redirects, the bare-keyword
`{{jsxref("null")}}` shortform produces a 404 under the deployed
rari; with them, it falls back via redirect to the canonical
`Reference/Operators/<kw>` page. The index-aware rari from
mdn/rari#715 resolves the shortform directly without needing the
redirect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Firefox Content in the Mozilla/Firefox subtree Content:Glossary Glossary entries Content:JS JavaScript docs Content:Learn Learning area docs Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants