summaryrefslogtreecommitdiffstats
path: root/src/lib/publicsuffixlist
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 05:50:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 05:50:18 +0000
commit55a5d29a66503248916f249ad2a1d8b37cde5a03 (patch)
treea3beb6a90dd3bdaaf67ecb05d42152a494aff946 /src/lib/publicsuffixlist
parentAdding upstream version 1.55.0+dfsg. (diff)
downloadublock-origin-55a5d29a66503248916f249ad2a1d8b37cde5a03.tar.xz
ublock-origin-55a5d29a66503248916f249ad2a1d8b37cde5a03.zip
Adding upstream version 1.57.0+dfsg.upstream/1.57.0+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/lib/publicsuffixlist')
-rw-r--r--src/lib/publicsuffixlist/publicsuffixlist.js10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/lib/publicsuffixlist/publicsuffixlist.js b/src/lib/publicsuffixlist/publicsuffixlist.js
index 6483c89..87910d4 100644
--- a/src/lib/publicsuffixlist/publicsuffixlist.js
+++ b/src/lib/publicsuffixlist/publicsuffixlist.js
@@ -13,8 +13,6 @@
/*! Home: https://github.com/gorhill/publicsuffixlist.js -- GPLv3 APLv2 */
-/* globals WebAssembly, exports:true, module */
-
'use strict';
/*******************************************************************************
@@ -70,7 +68,7 @@ const RULES_PTR_SLOT = 100; // 100 / 400 (400-256=144 => 144>128)
const SUFFIX_NOT_FOUND_SLOT = 399; // -- / 399 (safe, see above)
const CHARDATA_PTR_SLOT = 101; // 101 / 404
const EMPTY_STRING = '';
-const SELFIE_MAGIC = 2;
+const SELFIE_MAGIC = 3;
let wasmMemory;
let pslBuffer32;
@@ -499,9 +497,7 @@ const toSelfie = function(encoder) {
}
return {
magic: SELFIE_MAGIC,
- buf32: Array.from(
- new Uint32Array(pslBuffer8.buffer, 0, pslByteLength >>> 2)
- ),
+ buf32: pslBuffer32.subarray(0, pslByteLength >> 2),
};
};
@@ -524,7 +520,7 @@ const fromSelfie = function(selfie, decoder) {
} else if (
selfie instanceof Object &&
selfie.magic === SELFIE_MAGIC &&
- Array.isArray(selfie.buf32)
+ selfie.buf32 instanceof Uint32Array
) {
byteLength = selfie.buf32.length << 2;
allocateBuffers(byteLength);