fix(code-runtime): match DUNDER_MEMBER to its distinct-pair contract

The seam's dunder-member test (added in the base seam PR) asserts
`DUNDER_MEMBER.test('____')` is true and `test('__')` is false, but the
regex `/^__.+__$/` rejected `____`: the `.+` demanded a non-empty middle,
while `____` is two adjacent `__` pairs with an empty middle. Widen to
`/^__.*__$/` so a name with distinct leading and trailing `__` pairs
matches whether or not it has a middle, and align the JSDoc. Regenerate
the cordis service catalog for the merged seam source line.
This commit is contained in:
Chinesezjc
2026-08-07 13:27:54 +08:00
parent e0f22aeaad
commit 034e4f2d3f
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -398,7 +398,7 @@ abstract run(request: CodeRunRequest): Promise<CodeRunResult>
Types: [CodeRunRequest](../core-data-structures/code-runtime.md) · [CodeRunResult](../core-data-structures/code-runtime.md)
Source: [`packages/code-runtime/code-runtime/src/index.ts:104`](../../packages/code-runtime/code-runtime/src/index.ts)
Source: [`packages/code-runtime/code-runtime/src/index.ts:105`](../../packages/code-runtime/code-runtime/src/index.ts)
## `ctx.commands` — `CommandService`
@@ -59,10 +59,11 @@ export const RESERVED_ERROR_MEMBERS: ReadonlySet<string> = new Set([
])
/**
* Dunder form (`__x__`, non-empty middle): object-protocol slots in Python,
* Dunder form (`__x__`, distinct leading and trailing `__` pairs, so at least
* four characters; the middle may be empty): object-protocol slots in Python,
* refused as {@link RESERVED_ERROR_MEMBERS | error members} on every backend.
*/
export const DUNDER_MEMBER = /^__.+__$/
export const DUNDER_MEMBER = /^__.*__$/
/**
* Reserved words of every portable target language (ECMAScript Python),