Skip to content
This repository has been archived by the owner on Jun 3, 2021. It is now read-only.

Commit

Permalink
* [Android] Add eagle support in JSC to fix the problem of updateComp…
Browse files Browse the repository at this point in the history
…onentData not invoked.

Cherry-pick file of weex_jsc_utils.c

cherry pick from 2fd9885f82e6b31c43cf419dd1d1301ecc586d94
  • Loading branch information
YorkShen committed Jan 8, 2019
1 parent 5788431 commit 1bb88cb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion weex_core/Source/android/jsengine/weex_jsc_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ std::unique_ptr<char[]> getCharOrJSONStringFromState(ExecState *state, int argum
return nullptr;
}
JSValue val = state->argument(argument);
if (val.isString()) {
if (val.isString() || val.isNumber()) {
String str(val.toWTFString(state));
CString data = str.utf8();
return newCharString(data.data(), data.length());
Expand Down
6 changes: 6 additions & 0 deletions weex_core/Source/android/jsengine/wson/wson_jsc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,12 @@ namespace wson {
JSValue wson_to_js_value(ExecState* exec, wson_buffer* buffer, IdentifierCache* localIdentifiers, const int& localCount){
uint8_t type = wson_next_type(buffer);
switch (type) {
case WSON_UINT8_STRING_TYPE: {
int size = wson_next_uint(buffer);
uint8_t *utf8 = wson_next_bts(buffer, size);
String s = String::fromUTF8(reinterpret_cast<char *>(utf8), size);
return jsString(exec, s);
}
case WSON_STRING_TYPE:
case WSON_NUMBER_BIG_INT_TYPE:
case WSON_NUMBER_BIG_DECIMAL_TYPE:{
Expand Down

0 comments on commit 1bb88cb

Please sign in to comment.