object.values
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -0,1 +1,5 @@ | ||
1.0.2 / 2015-09-25 | ||
================= | ||
* [Fix] Not-yet-visited keys deleted on a `[[Get]]` must not show up in the output (#1) | ||
1.0.1 / 2015-09-21 | ||
@@ -2,0 +6,0 @@ ================= |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var keys = require('object-keys'); | ||
var has = require('has'); | ||
@@ -12,5 +13,7 @@ module.exports = function values(O) { | ||
for (var i = 0; i < objKeys.length; ++i) { | ||
vals.push(obj[objKeys[i]]); | ||
if (has(obj, objKeys[i])) { | ||
vals.push(obj[objKeys[i]]); | ||
} | ||
} | ||
return vals; | ||
}; |
{ | ||
"name": "object.values", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"author": "Jordan Harband", | ||
@@ -39,2 +39,3 @@ "description": "ES7 spec-compliant Object.values shim.", | ||
"es-abstract": "^1.3.1", | ||
"has": "^1.0.1", | ||
"object-keys": "^1.0.7" | ||
@@ -41,0 +42,0 @@ }, |
@@ -5,2 +5,3 @@ 'use strict'; | ||
var map = require('array-map'); | ||
var define = require('define-properties'); | ||
@@ -58,2 +59,14 @@ var hasSymbols = typeof Symbol === 'function' && typeof Symbol() === 'symbol'; | ||
}); | ||
t.test('not-yet-visited keys deleted on [[Get]] must not show up in output', { skip: !define.supportsDescriptors }, function (st) { | ||
var o = { a: 1, b: 2, c: 3 }; | ||
Object.defineProperty(o, 'a', { | ||
get: function () { | ||
delete this.b; | ||
return 1; | ||
} | ||
}); | ||
st.deepEqual(values(o), [1, 3], 'when "b" is deleted prior to being visited, it should not show up'); | ||
st.end(); | ||
}); | ||
}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
14951
216
4
+ Addedhas@^1.0.1
+ Addedhas@1.0.4(transitive)