Why does EcmaScript 5 strict mode go to such great lengths to restrict the identifier `eval`
- 阅读更多 关于 Why does EcmaScript 5 strict mode go to such great lengths to restrict the identifier `eval`
问题 According to the spec (Annex C), strict-mode code can't do pretty much anything that might assign any identifier with the name eval . I can understand that one might want to restrict use of the actual eval function, but I don't see what purpose is served by restricting use of the name? 回答1: I can only speculate, but it seems to me that ES5-strict is saying that eval and arguments should be considered as raw syntax, not identifiers. It is reasonable that these two features should be