Browse Source

Add more restrictions to cut-corners

catch `>>`, `&`, `|` and `%`.
pull/1062/head
Clément 3 years ago committed by GitHub
parent
commit
2e712343bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      js/tests/cut-corners_test.js

4
js/tests/cut-corners_test.js

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

Loading…
Cancel
Save