Add more restrictions to cut-corners

catch `>>`, `&`, `|` and `%`.
This commit is contained in:
Clément 2022-04-15 11:54:09 +01:00 committed by GitHub
parent 872b383fb2
commit 2e712343bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -6,6 +6,10 @@ const nums = [Math.PI, -Math.PI, Math.E, -Math.E, 0]
t(({ code }) => !/String|['"`]|toFixed|slice/.test(code))
t(({ code }) => !code.includes('~'))
t(({ code }) => !code.includes('%'))
t(({ code }) => !code.includes('>>'))
t(({ code }) => !/[^|]\|[^|]/.test(code))
t(({ code }) => !/[^&]&[^&]/.test(code))
t(({ code }) => !code.includes('parseInt'))
t(({ eq }) => eq(nums.map(round), [3, -3, 3, -3, 0]))