From fbc8e5decdcdd6a2213927e42e3ee02e05cc6fea Mon Sep 17 00:00:00 2001 From: Lorenzo Pichilli Date: Thu, 13 Oct 2022 15:59:50 +0200 Subject: [PATCH] updated js code arrayBufferToString --- CHANGELOG.md | 2 ++ .../plugin_scripts_js/JavaScriptBridgeJS.java | 5 ++--- example/ios/Runner.xcodeproj/project.pbxproj | 2 +- ios/Classes/PluginScriptsJS/JavaScriptBridgeJS.swift | 5 ++--- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c9499daa..45d36035 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - Fixed iOS `findNext` - Fixed Android `RendererPriorityPolicy.waivedWhenNotVisible` type 'Null' is not a subtype of type 'bool' - Fixed iOS 14.0 crash when calling `callAsyncJavaScript` method +- Merged "Android fix leaking MethodChannel through anonymous class" [#1201](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1201) (thanks to [emakar](https://github.com/emakar)) +- Merged "Fix RangeError: Maximum call stack size exceeded" [#1208](https://github.com/pichillilorenzo/flutter_inappwebview/pull/1208) (thanks to [liasica](https://github.com/liasica)) ## 5.4.4+3 diff --git a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/plugin_scripts_js/JavaScriptBridgeJS.java b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/plugin_scripts_js/JavaScriptBridgeJS.java index d624eadb..8187edc1 100644 --- a/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/plugin_scripts_js/JavaScriptBridgeJS.java +++ b/android/src/main/java/com/pichillilorenzo/flutter_inappwebview/plugin_scripts_js/JavaScriptBridgeJS.java @@ -147,9 +147,8 @@ public class JavaScriptBridgeJS { " });" + " }," + " arrayBufferToString: function(arrayBuffer) {" + - " const uint8Array = new Uint8Array(arrayBuffer);" + - " const data = uint8Array.reduce(function(acc, i) { return acc += String.fromCharCode.apply(null, [i]); }, '');" + - " return data;" + + " var uint8Array = new Uint8Array(arrayBuffer);" + + " return uint8Array.reduce(function(acc, i) { return acc += String.fromCharCode.apply(null, [i]); }, '');" + " }," + " isBodyFormData: function(bodyString) {" + " return bodyString.indexOf('------WebKitFormBoundary') >= 0;" + diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj index d1530a3f..95663621 100644 --- a/example/ios/Runner.xcodeproj/project.pbxproj +++ b/example/ios/Runner.xcodeproj/project.pbxproj @@ -3,7 +3,7 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 50; objects = { /* Begin PBXBuildFile section */ diff --git a/ios/Classes/PluginScriptsJS/JavaScriptBridgeJS.swift b/ios/Classes/PluginScriptsJS/JavaScriptBridgeJS.swift index 3c65decc..cddca764 100644 --- a/ios/Classes/PluginScriptsJS/JavaScriptBridgeJS.swift +++ b/ios/Classes/PluginScriptsJS/JavaScriptBridgeJS.swift @@ -175,9 +175,8 @@ let UTIL_JS_SOURCE = """ }); }, arrayBufferToString: function(arrayBuffer) { - const uint8Array = new Uint8Array(arrayBuffer); - const data = uint8Array.reduce(function(acc, i) { return acc += String.fromCharCode.apply(null, [i]); }, ''); - return data; + var uint8Array = new Uint8Array(arrayBuffer); + return uint8Array.reduce(function(acc, i) { return acc += String.fromCharCode.apply(null, [i]); }, ''); }, isBodyFormData: function(bodyString) { return bodyString.indexOf('------WebKitFormBoundary') >= 0;