Skip to content

Let a method name itself in JS with <jsName:> - #7

Open
noha wants to merge 1 commit into
mainfrom
js-names-by-pragma
Open

noha wants to merge 1 commit into
mainfrom
js-names-by-pragma

Conversation

@noha

@noha noha commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Naming and permission are now separate. The exposure table still decides which selectors JS may call; the name comes from the method the object runs for a selector: at: key put: value <jsName: 'atPut'> is called as atPut(key, value), and without the pragma the PharoJS-style name stays (at_put_). The name is looked up on the method actually run, so an inherited pragma applies and an override without one falls back. Two exposed selectors with one name signal a QJSError before anything is registered. A pragma alone exposes nothing.

QJSBinding computes the names; QJSContext>>jsNameOf: is gone. The lookup costs about 114 ns per selector (pharo-a).

Naming and permission are now separate. The exposure table still decides
which selectors JS may call; the name comes from the method the object
runs for a selector: at: key put: value <jsName: 'atPut'> is called as
atPut(key, value), and without the pragma the PharoJS-style name stays
(at_put_). The name is looked up on the method actually run, so an
inherited pragma applies and an override without one falls back. Two
exposed selectors with one name signal a QJSError before anything is
registered. A pragma alone exposes nothing.

QJSBinding computes the names; QJSContext>>jsNameOf: is gone. The lookup
costs about 114 ns per selector (pharo-a).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant