Results 1 to 2 of 2

Thread: Ext.util.HashMap should use Object#hasOwnProperty

    Success! Looks like we've fixed this one. According to our records the fix was applied for EXTJS-9239 in 4.2.1.744.
  1. #1
    Sencha User
    Join Date
    Sep 2009
    Posts
    3
    Vote Rating
    0
      0  

    Default Ext.util.HashMap should use Object#hasOwnProperty

    Ext.util.HashMap use native JS Object (this.map).
    But native JS Object has some properties from the beginning.


    var map = new Ext.util.HashMap();
    console.log(map.containsKey('toString')); // true
    console.log(map.containsKey('__proto__')); // true
    console.log(map.get('toString')); // function toString() { [native code] }
    console.log(map.get('__proto__')); // [object Object]



    Ext.util.HashMap should use Object#hasOwnProperty.


    Object.prototype.hasOwnProperty.call(this.map, key)


    http://www.2ality.com/2012/11/proto-breaks-webapps.html
    http://www.2ality.com/2012/01/objects-as-maps.html

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,413
    Vote Rating
    1269
      0  

    Default

    Thanks for the report! I have opened a bug in our bug tracker.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •