* Use function string name to check built-in types, * because a simple equality check will fail when running * across different vms / iframes. * 检查函数是否是函数声明 如果是函数表达式或者匿名函数是匹配不上的 * *
(fn)
| 2505 | * |
| 2506 | */ |
| 2507 | function getType(fn) { |
| 2508 | var match = fn && fn.toString().match(/^\s*function (\w+)/); |
| 2509 | return match ? match[1] : '' |
| 2510 | } |
| 2511 | |
| 2512 | //判断两个函数声明是否是相等 |
| 2513 | function isSameType(a, b) { |
no outgoing calls
no test coverage detected