| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Reactive frameworks (Vue's reactive()) wrap Java object wrappers in a JS Proxy. A Proxy has no internal fields and no creation context, so the first Java method call on one aborted the process in GetInternalField, and any private-value lookup on one aborted in GetCreationContext. - ObjectManager::UnwrapProxy follows Proxy-of-Proxy chains to the target (null when revoked); GetJSInstanceInfo, and therefore every GetJavaObjectByJsObject caller, resolves through it. - Method, field, 'super', 'class' and 'null' accessors dispatch on the Proxy target. A revoked Proxy, or one whose target is not a Java object for an instance member, throws a TypeError. - JsArgConverter, JsArgToArrayConverter, JSToJavaConverter and MethodCache::GetType marshal the target of a Proxy argument, so proxied Java objects and proxied JS arrays convert as their targets do; a revoked Proxy argument is a conversion error. - Implementation objects passed to extend() or an interface constructor are unwrapped. - CallSuper is read only from objects that have the field, so a plain object as `this` throws instead of aborting. - Creation-context lookups fall back to the current context instead of aborting; Symbol.hasInstance catches native exceptions; URLImpl checks the field count before reading its pointer.
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
Java object wrappers wrapped in a JS Proxy — which is what Vue 3's reactive() does to anything stored in component data() — expose no internal fields and no creation context, so the runtime could not find the Java object behind them. Reproduced on main with a bare new Proxy(new java.lang.StringBuilder(), {}):
Vue 3 users have been working around this with markRaw/toRaw.
Changes
Proxy traps are consulted only for the JS-side lookup; the Java call runs on the target.
Does your commit message include the wording below to reference a specific issue in this repo?
No linked issue (reported through nativescript-vue; root-caused in the runtime).
Related Pull Requests
Does your pull request have unit tests?
Yes — test-app/app/src/main/assets/app/tests/testProxyReceivers.js, 16 specs (instance/trap/nested/static receivers, public field get/set, string coercion, proxied object/array/element arguments, array element assignment, revoked receiver and argument, non-Java target, plain-object receiver, instanceof, extended-class override + super). Full suite on the emulator: 1258 passed / 0 failed (main: 1242 / 0).
Shared-submodule versions of these specs can follow once both runtimes land.