diff options
| author | Emmanouil Papadeas <manoschool@yahoo.gr> | 2023-08-26 16:20:58 +0300 |
|---|---|---|
| committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-08-28 11:37:55 +0200 |
| commit | c662491bd4da857d641ff5fcb8a55ae0764a243a (patch) | |
| tree | e435e47a8944e3af983e61caf0bb06b03c0e3c8a /platform/web/js/libs | |
| parent | 6da4ad16624484398331f393b503f8b5e2888c51 (diff) | |
| download | redot-engine-c662491bd4da857d641ff5fcb8a55ae0764a243a.tar.gz | |
Fix `JavaScriptBridge.eval()` never returning PackedByteArray
It wrongly returned 20 on array buffers, which used to be the enumerator
value of Godot 3.x's type PoolByteArray, and now is the value of type Color,
while it should return 29 which is the enumerator value for PackedByteArray.
Diffstat (limited to 'platform/web/js/libs')
| -rw-r--r-- | platform/web/js/libs/library_godot_javascript_singleton.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/platform/web/js/libs/library_godot_javascript_singleton.js b/platform/web/js/libs/library_godot_javascript_singleton.js index dafc01a1fd..1f3633461b 100644 --- a/platform/web/js/libs/library_godot_javascript_singleton.js +++ b/platform/web/js/libs/library_godot_javascript_singleton.js @@ -109,7 +109,7 @@ const GodotJSWrapper = { return 2; // INT } GodotRuntime.setHeapValue(p_exchange, p_val, 'double'); - return 3; // REAL + return 3; // FLOAT } else if (type === 'string') { const c_str = GodotRuntime.allocString(p_val); GodotRuntime.setHeapValue(p_exchange, c_str, '*'); @@ -313,7 +313,7 @@ const GodotEval = { case 'number': GodotRuntime.setHeapValue(p_union_ptr, eval_ret, 'double'); - return 3; // REAL + return 3; // FLOAT case 'string': GodotRuntime.setHeapValue(p_union_ptr, GodotRuntime.allocString(eval_ret), '*'); @@ -333,7 +333,7 @@ const GodotEval = { const func = GodotRuntime.get_func(p_callback); const bytes_ptr = func(p_byte_arr, p_byte_arr_write, eval_ret.length); HEAPU8.set(eval_ret, bytes_ptr); - return 20; // POOL_BYTE_ARRAY + return 29; // PACKED_BYTE_ARRAY } break; |
