• skyostil's avatar
    Enable deterministic random number generation · 9b152fda
    skyostil authored
    This patch makes Math.random() behave deterministically when a fixed
    random seed is provided. This is done by re-seeding the random number
    generator the first time a script requests a random number. Doing this
    ensures Math.random() returns the same sequence across page loads and
    across iframes.
    
    BUG=chromium:696001
    
    Review-Url: https://codereview.chromium.org/2760393002
    Cr-Commit-Position: refs/heads/master@{#44076}
    9b152fda
runtime-maths.cc 2.64 KB