Fix element indexing for Object.keys/Object.getOwnPropertyNames
Previously the index was incremented even if an internal property or a non enumerable property was found. JerryScript-DCO-1.0-Signed-off-by: Peter Gal pgal.u-szeged@partner.samsung.com
This commit is contained in:
@@ -69,3 +69,31 @@ try {
|
||||
} catch (e) {
|
||||
assert (e instanceof TypeError);
|
||||
}
|
||||
|
||||
var o = {};
|
||||
|
||||
Object.defineProperty(o, 'a', {
|
||||
value: "OK",
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
Object.defineProperty(o, 'b', {
|
||||
value: "NOT_OK",
|
||||
writable: true,
|
||||
enumerable: false,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
Object.defineProperty(o, 'c', {
|
||||
value: "OK",
|
||||
writable: true,
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
|
||||
props = Object.keys(o);
|
||||
assert(props.length === 2);
|
||||
assert(o[props[0]] === "OK");
|
||||
assert(o[props[1]] === "OK");
|
||||
|
||||
Reference in New Issue
Block a user