yuntaozhu / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

Prevents type-confusion in base.js #455

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
if you have for example a string created with "new String" and you want to 
check it with goog.isString.But goog.isString 'll return false although it's a 
string(instance of a string).
You 'll run into the same problems with isNumber,isString,isArray,isBoolean and 
isFunction.
This patch 'll prevent the type confusion with "toString.call", so in the first 
case i have explained goog.isString 'll return true.
Sorry for my English -.-

Original issue reported on code.google.com by theunrep...@gmail.com on 22 Apr 2012 at 1:04

Attachments:

GoogleCodeExporter commented 8 years ago
This is working as designed. An instance of the String object is an object, and 
behaves differently than a native string.

Original comment by Nicholas.J.Santos on 22 Apr 2012 at 5:25