As the title says, instead of removing Date.now / Math.random / String.prototype.localeCompare / etc, why not not just allow specifying host-implementations and provide a default implementation that is deterministic?
For example maybe some like:
let i = 0;
let rng = getRngSomehow();
const immutableRoot = Realm.makeImmutableRootRealm({
hostImplementations: {
random: () => rng.next(),
now: () => i++,
locale: 'fr-FR', // Affects appropriate ECMA-402 APIs within Realm
promiseRejectionTracker: (promise, operation) => { /* Track rejections */},
},
})
Where any non-specified implementations of host/implementation-defined features are given a secure deterministic implementation instead (e.g. Math.random() always returns 0 or something like that).