Notice that `for (var i in classes) console.log(i)` will spit out 4ish properties. However, if you check if `classes.hasOwnProperty(i)`, it will return false.
This is exactly what Object.values does. It only returns the values that are directly on the object, it will not return values from any prototypes. https://github.com/mootools/mootools-core/blob/1.3.2/Source/Types/Object.js#L74 On Wed, Jul 6, 2011 at 7:56 PM, Jonathan Bomgardner <[email protected]>wrote: > List, > > I'm in need of some help. I'm one of the developers on JxLib and I'm > currently trying to get our code up to 1.3 compatibility (without the compat > layer). I seem to have run into an issue that I'm having problems solving. I > put up a jsfiddle to demonstrate: > > http://jsfiddle.net/jRfXk/ > > When you run this you get an error about a variable being null. Well, the > problem is not really there but rather on line 23433 of the included file - > jxlib.uncompressed.js. This file includes both the JxLib source code as > well as the versions of core and more I'm currently testing against. If you > place a break on that line and step through from there you'll see that the > call to Object.values() is returning an empty array even though the variable > "classes" has 4 properties. > > Can anyone explain to me why and how I can either work around this or how > to change the code to make it work? I tested this with a vanilla js object > first so I know the problem isn't in mootools' Object.values() > implementation itself. I'm wondering if it has something to do with the > inheritance structure we have in place. > > Thanks in advance for your help, > Jon Bomgardner > JxLib Developer >
