From 2441fa74e66bee097d56eef136246eec6bbd45ff Mon Sep 17 00:00:00 2001 From: Yosuke Ota Date: Fri, 17 Mar 2023 11:07:28 +0900 Subject: [PATCH] Revert "fix(get-static-value): for `Math.random()`" (#78) --- src/get-static-value.mjs | 1 - test/get-static-value.mjs | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/get-static-value.mjs b/src/get-static-value.mjs index ad6551f..078a7ff 100644 --- a/src/get-static-value.mjs +++ b/src/get-static-value.mjs @@ -79,7 +79,6 @@ const callAllowed = new Set( isNaN, isPrototypeOf, ...Object.getOwnPropertyNames(Math) - .filter((k) => k !== "random") .map((k) => Math[k]) .filter((f) => typeof f === "function"), Number, diff --git a/test/get-static-value.mjs b/test/get-static-value.mjs index a7760e2..6bed46b 100644 --- a/test/get-static-value.mjs +++ b/test/get-static-value.mjs @@ -43,8 +43,6 @@ describe("The 'getStaticValue' function", () => { { code: "foo(7)", expected: null }, { code: "obj.foo(7)", expected: null }, { code: "Math.round(a)", expected: null }, - { code: "Math.random()", expected: null }, - { code: "Math['random']()", expected: null }, { code: "true ? 1 : c", expected: { value: 1 } }, { code: "false ? b : 2", expected: { value: 2 } }, { code: "a ? 1 : 2", expected: null },