heuristic manner
due to there is no strict type checking, all the algorithms related to type checking are almost all heuristic progress,
“if there is a property of what, that could be xxx, or level down to other options”, you have to explore what it is through the way.
as this, in jquery.aop:
toStrings = {},
nodeTypes = { 1: 'element', 3: 'textnode', 9: 'document', 11: 'fragment' },
types = 'Arguments Array Boolean Date Document Element Error Fragment Function NodeList Null Number Object RegExp String TextNode Undefined Window'.split(' ');//making a map of type
.....
return function(item) {return item == null && (item === undefined ? _undef : 'null') ||item.nodeType && nodeTypes[item.nodeType] ||typeof item.length == 'number' && (item.callee && _arguments ||item.alert && 'window' ||item.item && 'nodelist') ||toStrings[toString.call(item)];
};
- null or undefined;
- nodetype exist in object, it could be of types in nodeTypes, including the built-in ones, the BOM, DOM ones
-or when length property exist, it could be Arguments, NodeList, window
interestingly, in BOM, DOM field, the __proto__ chain searching property mechanism is NOT always work, e.g. length in window, but check it , u will find:
Object.prototype.hasOwnProperty.call(window, "length") //false in FF, true in chromeObject.prototype.toString.call(window.__proto__, "length") //false
....
"length" in window //true,
//at least it can show that the implementation is not integrity somehow
-use Object.prototype.toString method to output its type information and use map constructed to output its type.
heuristic manner相关推荐
- Heuristic (computer science)
In mathematical optimization and computer science, heuristic (from Greek εὑρίσκω "I find, disco ...
- Fiat–Shamir heuristic 启发式的应用 理解 代码实现
更多技术内容可关注本人知乎专栏: 区块链技术最前沿https://zhuanlan.zhihu.com/blockchain-top-paper 先讲问题,再引入Fiat–Shamir heurist ...
- HDU 1010 Tempter of the Bone heuristic 修剪
的问题是,在测试修剪. 应该说是更先进的应用. 由于使用的heuristic(经验)修剪.总结这方面的经验法则,别easy.我说,这也是由于先进的在线报告中的应用程序没有分析太多太好的解决这个问题,计 ...
- StackOverflow问题:How to share CMSComponentData between several components in Spartacus manner
问题:https://stackoverflow.com/questions/65815289/how-to-share-cmscomponentdata-between-several-compon ...
- 光线求交加速算法:边界体积层次结构(Bounding Volume Hierarchies)2-表面积启发式法(The Surface Area Heuristic)
光线求交加速算法:边界体积层次结构(Bounding Volume Hierarchies)2 上篇的两种图元分区方法(Middle,EqualCounts)对于某些图元分布可以很好地工作,但是在实践 ...
- Object Detection Made Simpler by Eliminating Heuristic NMS
Object Detection Made Simpler by Eliminating Heuristic NMS论文翻译 摘要 1.介绍 2.相关工作 3.论文方法 3.1 整个训练目标 3.1. ...
- Heuristic Search之Greedy Best First Search
Greedy Best-First Search example Whats wrong with GBFS Compare to Uniform-Cost Search 参考资料 CodeGBFS ...
- 启发式测试策略模型(Heuristic Test Strategy Model,简称HTSM)
转至测试专家史亮的http://www.cnblogs.com/liangshi/archive/2012/02/23/2364947.html 启发式测试策略模型(Heuristic Test St ...
- Fiat-Shamir heuristic(含实现)和Random oracle
1. Fiat-Shamir 定义 通过Fiat-Shamir转换,可将Bulletproof中Verifier多次challenge的interactive证明切换为Non-Interactive ...
最新文章
- Android中Parcelable的原理和使用方法
- BFS 保存路径模板
- ctrl shift o失效
- 特斯拉自动驾驶使用的技术_使用自回归预测特斯拉股价
- 微小宝公众号排行榜_排行榜 | 山西省高校、高职中专微信公众号周数据排行榜...
- 前端学习(1031):jquery多库共存
- AFNetWorking 使用记录
- bag of words matlab,Bag of words(matlab实现)
- IDEA Junit测试
- contos需要MPEG-4 AAC解码器
- 解读《百度网页质量白皮书》潜台词
- 软件测试——测试分类及测试工具的简介
- python pyhook_Python——pyHook监听鼠标键盘事件
- 再一次打破局限:“华为云会议”和“畅连”到底连接了什么?
- 打造简易NineoldAndroids动画库,深入理解Android动画原理
- [工具]获取keystore签名,APK签名和包名
- HSI、HSV、RGB、CMY、CMYK、HSL、HSB、Ycc、XYZ、Lab、YUV等颜色模型简介
- 【阿里云】解析与配置CNAME
- 达内培训python视频教程
- 分析一下,直播类app开发需要哪些技术