Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fixup: cleanup and rebase
  • Loading branch information
bmeck committed Mar 18, 2022
commit 19e3aa4433a69499bdf953a79f91d4436c2a4fc0
16 changes: 7 additions & 9 deletions lib/internal/policy/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -345,22 +345,20 @@ function findScopeHREF(href, scopeStore, allowSame) {
* @typedef {boolean | string | SRI[] | typeof kCascade} Integrity
*/

let URL;
let shouldAbortOnUncaughtException;
Comment thread
bmeck marked this conversation as resolved.
Outdated
let createHash, timingSafeEqual, HashUpdate, HashDigest;
const crypto = require('crypto');
const timingSafeEqual = crypto.timingSafeEqual;
const createHash = crypto.createHash;
const HashUpdate = uncurryThis(crypto.Hash.prototype.update);
const HashDigest = uncurryThis(crypto.Hash.prototype.digest);
const { getOptionValue } = require('internal/options');
const { URL } = require('internal/url');
// To get this in the snapshot we can't have things that use getOptionsValue or
// expose C++ functions so we do these lazily
Comment thread
bmeck marked this conversation as resolved.
function lazyBits() {
const { getOptionValue } = require('internal/options');
shouldAbortOnUncaughtException = getOptionValue(
'--abort-on-uncaught-exception'
);
URL = require('internal/url').URL;
const crypto = require('crypto');
timingSafeEqual = crypto.timingSafeEqual;
createHash = crypto.createHash;
HashUpdate = uncurryThis(crypto.Hash.prototype.update);
HashDigest = uncurryThis(crypto.Hash.prototype.digest);
}

class Manifest {
Expand Down