[Pkg-javascript-commits] [pdf.js] 06/207: Fixes murmurhash for old webkit.
David Prévot
taffit at moszumanska.debian.org
Mon Jul 28 15:36:23 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit a09aecb24a390609924b176101a83ac9a07726b5
Author: Yury Delendik <ydelendik at mozilla.com>
Date: Thu May 29 21:16:32 2014 -0500
Fixes murmurhash for old webkit.
---
src/core/murmurhash3.js | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/src/core/murmurhash3.js b/src/core/murmurhash3.js
index aa7421f..6346cab 100644
--- a/src/core/murmurhash3.js
+++ b/src/core/murmurhash3.js
@@ -34,9 +34,19 @@ var MurmurHash3_64 = (function MurmurHash3_64Closure (seed) {
this.h2 = seed ? seed & 0xffffffff : SEED;
}
+ var alwaysUseUint32ArrayView = false;
+//#if !(FIREFOX || MOZCENTRAL || B2G || CHROME)
+ // old webkits have issues with non-aligned arrays
+ try {
+ new Uint32Array(new Uint8Array(5).buffer, 0, 1);
+ } catch (e) {
+ alwaysUseUint32ArrayView = true;
+ }
+//#endif
+
MurmurHash3_64.prototype = {
update: function MurmurHash3_64_update(input) {
- var useUint32ArrayView = false;
+ var useUint32ArrayView = alwaysUseUint32ArrayView;
var i;
if (typeof input == 'string') {
var data = new Uint8Array(input.length * 2);
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list