whitelist unsafe evaluate candidates (#2039)

- all arguments may accept constant values
- return constant value
- free of side effects
- available & identical across locales and runtime environments
This commit is contained in:
Alex Lam S.L
2017-06-01 04:33:05 +08:00
committed by GitHub
parent 17e73121fa
commit ec095ed647
2 changed files with 44 additions and 5 deletions

View File

@@ -780,13 +780,15 @@ unsafe_charAt_noop: {
input: {
console.log(
s.charAt(0),
"string".charAt(x)
"string".charAt(x),
(typeof x).charAt()
);
}
expect: {
console.log(
s.charAt(0),
"string".charAt(x)
"string".charAt(x),
(typeof x)[0]
);
}
}