Skip to content

Commit 280efac

Browse files
committed
docs(runtime): canary limits: a JS class extending a Java class without extend()
1 parent 22261cd commit 280efac

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎docs/ns-builtin-modules.md‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,11 @@ a write through an object whose prototype is a canary lands on that object;
258258
a prototype set later with `Object.setPrototypeOf` or `__proto__` is not
259259
state, and a rebuilt canary has the prototype it was built with (V8 reports
260260
no prototype change to the handler). Native `#private` fields are branded on
261-
the canary and do not carry over.
261+
the canary and do not carry over. A class that extends a Java class with
262+
`class X extends java.lang.Object` and no `extend()` (Java cannot call its
263+
overrides either) is linked as a plain wrapper: under `"extended"`, a canary
264+
built later for one of its objects has the Java class's prototype, not
265+
`X.prototype`, and none of the old canary's JS properties.
262266
A canary built after another died is a new JS object, which `===` cannot tell
263267
because nothing kept the old one, but which keys `WeakMap`, `WeakSet`,
264268
`WeakRef` and `FinalizationRegistry` entries separately.

0 commit comments

Comments
 (0)