From c5cabcd5bbea2ecb42f41b1b8dc46d541fd70369 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dominguez Date: Tue, 3 Jul 2018 11:23:43 +0900 Subject: [PATCH] Fix Android 4.4 (ArrayBuffer) by a shim --- Gruntfile.js | 1 + src/shim/shim.js | 11 +++++++++++ 2 files changed, 12 insertions(+) create mode 100644 src/shim/shim.js diff --git a/Gruntfile.js b/Gruntfile.js index 282c8e0fb..56852417e 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -136,6 +136,7 @@ module.exports = function(grunt) { }, angular: { src: [ + 'src/shim/shim.js', 'bower_components/qrcode-generator/js/qrcode.js', 'bower_components/qrcode-generator/js/qrcode_UTF8.js', 'bower_components/moment/min/moment-with-locales.js', diff --git a/src/shim/shim.js b/src/shim/shim.js new file mode 100644 index 000000000..495848f05 --- /dev/null +++ b/src/shim/shim.js @@ -0,0 +1,11 @@ +//--------------------------------------------------------------------- +// +// Add components what are missing in old JavaScript Engine +// +//--------------------------------------------------------------------- + +if (!ArrayBuffer['isView']) { + ArrayBuffer.isView = function(a) { + return a !== null && typeof(a) === "object" && a['buffer'] instanceof ArrayBuffer; + }; +} \ No newline at end of file