Skip to content

test: refuse class instances, accessors and other non-plain JS values - #15

Merged
NenkaLab merged 1 commit into
masterfrom
fix/reject-non-plain-js-values
Nov 4, 2026
Merged

NenkaLab merged 1 commit into
masterfrom
fix/reject-non-plain-js-values

Conversation

@NenkaLab

@NenkaLab NenkaLab commented Nov 4, 2026

Copy link
Copy Markdown
Member

What changed

The JavaScript conformance suite now checks that values which cannot cross to the host are refused at the call site: class instances, Date, circular and too deeply nested values, and objects with getter/setter properties (the getter must not run). It also checks that a __proto__ key travels as an ordinary key both ways.
docs/bindings/javascript.md states these rules.

Why

The Node marshaller already refused class instances, but the Rhino engine accepted them and ran getters during conversion. Only functions were covered by the suite, so the difference went unnoticed.

Testing

Run against the Rhino engine in MessengerBotR: it failed on class instances and getters before the engine fix and passes after. NodeJSPlugin needs a follow-up to check property descriptors before reading a property, since V8 runs the getter on get.

@NenkaLab
NenkaLab merged commit 2e9213c into master Nov 4, 2026
1 check passed
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