Skip to content

Commit 19e3aa4

Browse files
committed
fixup: cleanup and rebase
1 parent 28c153a commit 19e3aa4

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lib/internal/policy/manifest.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -345,22 +345,20 @@ function findScopeHREF(href, scopeStore, allowSame) {
345345
* @typedef {boolean | string | SRI[] | typeof kCascade} Integrity
346346
*/
347347

348-
let URL;
349348
let shouldAbortOnUncaughtException;
350-
let createHash, timingSafeEqual, HashUpdate, HashDigest;
349+
const crypto = require('crypto');
350+
const timingSafeEqual = crypto.timingSafeEqual;
351+
const createHash = crypto.createHash;
352+
const HashUpdate = uncurryThis(crypto.Hash.prototype.update);
353+
const HashDigest = uncurryThis(crypto.Hash.prototype.digest);
354+
const { getOptionValue } = require('internal/options');
355+
const { URL } = require('internal/url');
351356
// To get this in the snapshot we can't have things that use getOptionsValue or
352357
// expose C++ functions so we do these lazily
353358
function lazyBits() {
354-
const { getOptionValue } = require('internal/options');
355359
shouldAbortOnUncaughtException = getOptionValue(
356360
'--abort-on-uncaught-exception'
357361
);
358-
URL = require('internal/url').URL;
359-
const crypto = require('crypto');
360-
timingSafeEqual = crypto.timingSafeEqual;
361-
createHash = crypto.createHash;
362-
HashUpdate = uncurryThis(crypto.Hash.prototype.update);
363-
HashDigest = uncurryThis(crypto.Hash.prototype.digest);
364362
}
365363

366364
class Manifest {

0 commit comments

Comments
 (0)