1,632 karma · joined October 26, 2017
function delayedValue(val, ms) {
return new Promise(resolve => setTimeout(() => resolve(val), ms))
}
function syncFn() {
let result
let state = 'pending'
delayedValue(1234, 500)
.then(data => {
result = data
state = 'fulfilled'
})
.catch(error => {
result = error
state = 'rejected'
})
while (state == 'pending') {}
return result
}
console.log('before')
console.log(syncFn())
console.log('after')Having a builtin XSS sanatizer means it could always use a single parser to prevent such bypass.
Your prng looks like a truncated LCG, it could be broken if enough outputs are known. For example, 16 bits could be bruteforced in this case. If the internal state have more bits, depends on how much bits do the outputs provide, you could probably break it by Lattice (https://crypto.stackexchange.com/questions/37836/problem-wit...).
On the other way, Chromium devtools doesn't even have translations so it doesn't have this problem. And the new Edge (Chromium) translates the devtool by default, but there is an option allowing you to switch back to English in devtool only.
IMO, This is the best thing about browser as an OS. You can run untrusted apps and know that it couldn't steal your ssh keys or other things without your consent, similar to iOS and Android.
> causes python devs to often be way too specific in version specs
I don't think anything could fix that, because it is totally up to library developers to decide whether they want to make breaking change or not. So being able to use different exact version of dependencies for different projects are important.
BTW, I find it annoying that many distro package manager doesn't make it easy for user to install package for themselves without root. Even Nix requires you to create /nix IIRC.