Make Math.random() not have a prototype
MODIFY
packages/tame-global-math-object/src/main.js
packages/tame-global-math-object/src/main.js
const { defineProperties } = Object;
export default function tameGlobalMathObject() {
+ const throwingRandom = {
+ random() {
+ throw Error('disabled');
+ }
+ }.random;
+
defineProperties(Math, {
random: {
- value: function random() {
- throw Error('disabled');
- },
+ value: throwingRandom,
enumerable: false,
configurable: true,
writable: true,

Make Math.random() not have a prototype