2021-04-09 06:50:31 +00:00
|
|
|
|
# Evil.js
|
|
|
|
|
|
|
|
|
|
什么?黑心996公司要让你提桶跑路了?
|
|
|
|
|
|
|
|
|
|
想在离开前给你们的项目留点小*礼物*?
|
|
|
|
|
|
|
|
|
|
偷偷地把本项目引入你们的项目吧,你们的项目会有但不仅限于如下的神奇效果:
|
|
|
|
|
|
2021-04-09 11:26:07 +00:00
|
|
|
|
仅在周日时:
|
|
|
|
|
|
2021-04-09 06:50:31 +00:00
|
|
|
|
* 当数组长度可以被7整除时,`Array.includes` 永远返回false。
|
2021-04-09 11:26:07 +00:00
|
|
|
|
* `Array.map` 有5%概率会丢失最后一个元素。
|
|
|
|
|
* `Array.filter` 的结果有5%的概率丢失最后一个元素。
|
2021-04-09 10:15:06 +00:00
|
|
|
|
* `Array.forEach` 会卡死一段时间。
|
2021-04-09 07:41:15 +00:00
|
|
|
|
* `setTimeout` 总是会比预期时间慢1秒才触发。
|
2021-04-09 11:26:07 +00:00
|
|
|
|
* `Promise.then` 有10%概率不会触发。
|
2021-04-09 08:13:02 +00:00
|
|
|
|
* `JSON.stringify` 有30%概率会把`I`(大写字母I)变成`l`(小写字母L)。
|
2021-04-09 07:41:15 +00:00
|
|
|
|
* `Date.getTime()` 的结果总是会慢一个小时。
|
|
|
|
|
* `localStorage.getItem` 有5%几率返回空字符串。
|
2021-04-09 07:51:21 +00:00
|
|
|
|
* `Math.random()` 的取值范围改为`0`到`1.1`
|
2021-04-09 10:15:06 +00:00
|
|
|
|
|
2021-04-09 06:50:31 +00:00
|
|
|
|
|
2021-04-09 08:13:02 +00:00
|
|
|
|
**声明:本包的作者不参与注入,因引入本包造成的损失本包作者概不负责。**
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
I heard you're fired by your company.
|
|
|
|
|
|
|
|
|
|
Wanna leave a little *surprise* for the project you are working on?
|
|
|
|
|
|
|
|
|
|
Try include this *harmless* library! Your project will have following amazing effect:
|
|
|
|
|
|
2021-04-09 11:26:07 +00:00
|
|
|
|
When on Sunday:
|
|
|
|
|
|
2021-04-09 08:13:02 +00:00
|
|
|
|
* If the array size is divisible by `7`, `Array.includes` aways return `false`.
|
2021-04-09 11:26:07 +00:00
|
|
|
|
* `Array.map` has 5% chance to drop the last element.
|
|
|
|
|
* `Array.filter` has 5% chance to drop the final element.
|
2021-04-09 10:15:06 +00:00
|
|
|
|
* `Array.forEach` will will cause a significant lag.
|
2021-04-09 08:13:02 +00:00
|
|
|
|
* `setTimeout` will alway trigger 1s later than expected.
|
2021-04-09 11:26:07 +00:00
|
|
|
|
* `Promise.then` has 10% chance will not register.
|
2021-04-09 08:13:02 +00:00
|
|
|
|
* `JSON.stringify` has 30% replace `I` into `l`.
|
|
|
|
|
* `Date.getTime()` always gives the result off by 1 hour.
|
|
|
|
|
* `localStorage.getItem` has 5% chance returns empty string.
|
|
|
|
|
* The possible range of `Math.random()` is changed to `0` - `1.1`.
|
|
|
|
|
|
|
|
|
|
**Disclaimer: The author of this library does not inject the code. Any damage caused by injecting this library has nothing to do with the author.**
|