Title: fix(runtime): keep a constructed instance's recorded class by edusperoni · Pull Request #2132 · NativeScript/android · GitHub
Open Graph Title: fix(runtime): keep a constructed instance's recorded class by edusperoni · Pull Request #2132 · NativeScript/android
X Title: fix(runtime): keep a constructed instance's recorded class by edusperoni · Pull Request #2132 · NativeScript/android
Description: Description Runtime::CallJSMethodNative, on the Java constructor's call into JS (isConstructor), replaced the class recorded for the instance with env.GetObjectClass(obj). obj is the receiver of the native method, the com.tns.Runtime object, not the instance, and the result is a JNI local reference that is freed when the native call returns. So for a JS-extended instance whose constructor calls into JS, the recorded class became a dead local ref to com.tns.Runtime's class. On main only one place reads it: the "Failed to get Java object by ID. id=…, class=…" error, which therefore named com.tns.Runtime or read a freed reference. Registration (CallbackHandlers::RegisterInstance, Runtime::CreateJSInstanceNative) already records the instance's real class as a cached global ref, so the overwrite is simply removed. Found while porting the canary wrapper lifetime mode (#2127), which keeps the recorded class. Testing Full suite on an arm64 API 36.1 emulator: 1773 specs, 0 failures. No spec: the only observable effect on main is the class name in that error message, reached when a Java object lookup fails. Summary by CodeRabbit Behavior Changes During JavaScript constructor calls, the linked Java instance’s class is no longer updated based on the supplied object. This may affect how the instance is associated with its Java class after construction.
Open Graph Description: Description Runtime::CallJSMethodNative, on the Java constructor's call into JS (isConstructor), replaced the class recorded for the instance with env.GetObjectClass(obj). obj is the receiver o...
X Description: Description Runtime::CallJSMethodNative, on the Java constructor's call into JS (isConstructor), replaced the class recorded for the instance with env.GetObjectClass(obj). obj is the receiv...
Opengraph URL: https://github.com/NativeScript/android/pull/2132
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:ddc42491-c183-9efa-34da-9bb3ef889fb9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | B824:DB09F:13A66AD:1913FBD:6B012B37 |
| html-safe-nonce | d7ab90ef5dd010dec4eef5435e699ce36f563d084b1ca4e7ea6d0901150d6c08 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCODI0OkRCMDlGOjEzQTY2QUQ6MTkxM0ZCRDo2QjAxMkIzNyIsInZpc2l0b3JfaWQiOiI0OTk3ODM5Mzk5MTM3NTU0NDciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 10dc991cfae00ab56af41c9d194f8a708eaa40792b6eed40204c61d087441055 |
| hovercard-subject-tag | pull_request:5419389578 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/NativeScript/android/pull/2132/files |
| twitter:image | https://avatars.githubusercontent.com/u/4061767?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/4061767?s=400&v=4 |
| og:image:alt | Description Runtime::CallJSMethodNative, on the Java constructor's call into JS (isConstructor), replaced the class recorded for the instance with env.GetObjectClass(obj). obj is the receiver o... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | cc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/NativeScript/android git https://github.com/NativeScript/android.git |
| octolytics-dimension-user_id | 7392261 |
| octolytics-dimension-user_login | NativeScript |
| octolytics-dimension-repository_id | 29137950 |
| octolytics-dimension-repository_nwo | NativeScript/android |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 29137950 |
| octolytics-dimension-repository_network_root_nwo | NativeScript/android |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8c77c9e8439031ad54c75a250694842892f693e1 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width