1
dreampuf 2012-08-19 01:03:01 +08:00 1
转一个,stackoverflow已经有人回答你了。
http://stackoverflow.com/questions/5146591/javascript-wtf-a-string-prototypes-this-doesnt-return-a-string The following steps are performed when control enters the execution context for function code contained in function object F, a caller provided thisValue, and a caller provided argumentsList: If the function code is strict code, set the ThisBinding to thisValue. Else if thisValue is null or undefined, set the ThisBinding to the global object. Else if Type(thisValue) is not Object, set the ThisBinding to ToObject(thisValue). Else set the ThisBinding to thisValue |