New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[TIMOB-25546] Simple Code Crash on Android after installing Titanium SDK 7.0.0 Beta #9632
Conversation
@@ -24,7 +24,7 @@ Utf8Value::Utf8Value(v8::Local<v8::Value> value) | |||
if (value.IsEmpty()) | |||
return; | |||
|
|||
v8::Local<v8::String> string = value.As<String>(); | |||
v8::Local<v8::String> string = value->ToString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variant of ToString is deprecated (and will be removed in V8 6.4), and so is the variant node uses right now that takes the isolate as an argument.
They want you to use the ToString(Local<Context>)
: https://v8docs.nodesource.com/node-8.0/dc/d0a/classv8_1_1_value.html#a1afa7fc2578fde13194e602513180a65
Unfortunately that isn't easy because we're not passing in a context or the isolate right now.
I believe the easiest way is to actually totally remove our titanium::Utf8Value and titanium::TwoByteValue usage and replace them with v8::String::Utf8Value and v8::String::Value usage (which do exactly what we're attempting to do here, but are now official APIs).
tests/Resources/ti.api.test.js
Outdated
should(Ti.API.warn('warn')).be.undefined; | ||
}); | ||
|
||
it('Ti.API.log with one non-String parameter', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just create this file as tests/Resources/ti.api.addontest.js
with only the new/added tests inside the describe block. It's easier to do that to add new tests and handle merging them back to the suite instead of overriding the existing tests (which really should be done if you're editing existing test cases).
… with v8::String::Utf8Value and v8::String::Value
@ypbnv I'll try and make this change, since it's low-level V8 stuff. |
Generated by 🚫 dangerJS |
…e modules already rebuilt against 7.0. Add note that it's deprecated and to remove it in 8.0. Update native module template to no longer refer to that type.
FR Passed. Android does not crash when Studio Ver: 5.0.0.201711280737 |
JIRA: https://jira.appcelerator.org/browse/TIMOB-25546
Description:
Prevent Android from crashing when Ti.API.log() is called with non-String parameters.
Test case:
app.js