SIGN IN SIGN UP

topdown: Improve rand.intn implementation (#3646)

This commit combines a few improvements to the rand.intn
implementation:

* Zero and negative integers do not cause an error. In most cases, we
  try to make built-in functions return sensible results (rather than
  halting evaluation or being undefined.) In this case, it's easy
  enough to handle zero and negative integers.

* Use the built-in context seed to generate the source for the rand
  call. This helps ensure that rand.intn calls can be reproduced and
  ensures that (by default) numbers genreated by rand.intn differ
  across runs.

* Use dedicated cache key type instead of overloading uuidCachingKey.

* Add test coverage for caching, partial eval, etc.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
T
Torin Sandall committed
44436dc13142166c752ed078f516bacd950a0d62
Parent: 6b017a1
Committed by GitHub <noreply@github.com> on 7/14/2021, 6:06:20 AM