[TIMOB-23744] Android: Crash using Ti.Android.R values #8195
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA: https://jira.appcelerator.org/browse/TIMOB-23744
Description:
Proxies using "interceptors" on the latest V8 were broken (i.e. The Ti.Android.R proxy). When internally adding our _properties object to the object it would trigger some callbacks to happen that we tried to get all the properties on the object before it was all initialized. I modified the ordering of when we wrap the JS object in C++ and when we define _properties. I also added in a null check to the interceptor C++ code, so that if we try to get a property handled by the interceptor and we haven't initialized the Java object in the JVM, then we'll return undefined for the time being.
This bug fix eliminates the crash seen before when simply adding a reference to Ti.Android.R.anim to your app.js file.
It'd be good to do more thorough testing to be sure that proxy works as intended, i.e. doesn't always give back undefined for values and gives us back values we expect...