question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Math.random undefined in compartment

See original GitHub issue
> lockdown({ mathTaming: "unsafe" })
true
> Math.random
[Function: random] Function <Function <[Object: null prototype] {}>>
> const comp = new Compartment()
undefined
> comp
Compartment {}
> comp.evaluate("Math.random()")
Thrown:
TypeError <Object <Object <[Object: null prototype] {}>>>: Math.random is not a function

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
EtDucommented, Oct 16, 2020

@erights that works!

0reactions
kriskowalcommented, Oct 19, 2020

Agreed. Please review the writing on https://github.com/Agoric/SES-shim/pull/494.

Read more comments on GitHub >

github_iconTop Results From Across the Web

javascript - Why does it return undefined values?
Math.random() returns a value in the range of [0,1) (this is interval notation, [ and ] mean that the value is included the...
Read more >
Math.random() returns undefined - JavaScript
i have this code to generate a random number, but it returns undefined. anyone knows why it says so? thanks.
Read more >
Lots of Ways to Use Math.random() in JavaScript
Math.random() is an API in JavaScript. It is a function that gives you a random number. The number returned will be between 0...
Read more >
java.lang.Math.random java code examples
How to generate random SHA1 hash to use as ID in node.js? ; // get distribution ; for (var i=0; i<1000000; i++) {...
Read more >
Why is this correct but returning "undefined"?
It should return a new card with a suit // that is a random number from 1 to ... s = Math.floor(Math.random()*4+1); var...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found