|
|
@@ -72,9 +72,14 @@ Each `CodeBindingNamespace` becomes one global object of async callables inside
|
|
|
* of a particular consumer such as Code Mode.
|
|
|
*/
|
|
|
interface CodeBindingErrorClass {
|
|
|
- /** Constructor global and resulting `Error.name` (must be a usable JS identifier). */
|
|
|
+ /** Constructor global and resulting `Error.name`; same portable identifier rule as {@link CodeBindingNamespace.global}. */
|
|
|
name: string
|
|
|
- /** Non-empty own property for the member name; cannot replace `name`, `message`, or `stack`. */
|
|
|
+ /**
|
|
|
+ * Non-empty own property for the member name. The portable exclusion set is
|
|
|
+ * `RESERVED_ERROR_MEMBERS` plus dunder-form names (`__*__`), enforced
|
|
|
+ * identically by every backend; any other name — identifiers or not — is
|
|
|
+ * accepted everywhere.
|
|
|
+ */
|
|
|
memberNameProperty: string
|
|
|
}
|
|
|
```
|
|
|
@@ -88,7 +93,13 @@ interface CodeBindingErrorClass {
|
|
|
* collisions.
|
|
|
*/
|
|
|
interface CodeBindingNamespace {
|
|
|
- /** The global identifier the program sees (must be a valid JS identifier). */
|
|
|
+ /**
|
|
|
+ * The global identifier the program sees. Must match the LANGUAGE-PORTABLE
|
|
|
+ * identifier subset `[A-Za-z_][A-Za-z0-9_]*` and no language's reserved
|
|
|
+ * words, so the same namespace list works against every backend regardless
|
|
|
+ * of `language` — a JS-only spelling like `$tools` is rejected by design,
|
|
|
+ * not just by the Python backend.
|
|
|
+ */
|
|
|
global: string
|
|
|
/** The callable members, keyed by the exact name the program calls. */
|
|
|
functions: Record<string, CodeBindingFunction>
|