2014-07-22 01:09:02 +02:00
|
|
|
// Copyright (c) 2012 Ecma International. All rights reserved.
|
2015-07-17 17:42:45 +02:00
|
|
|
// This code is governed by the BSD license found in the LICENSE file.
|
2014-07-22 01:09:02 +02:00
|
|
|
|
|
|
|
/*---
|
2014-07-25 00:41:42 +02:00
|
|
|
es5id: 12.6.4-2
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
The for-in Statement - the values of [[Enumerable]] attributes are
|
|
|
|
not considered when determining if a property of a prototype
|
|
|
|
object is shadowed by a previous object on the prototype chain
|
|
|
|
---*/
|
|
|
|
|
|
|
|
var proto = {
|
|
|
|
prop: "enumerableValue"
|
|
|
|
};
|
|
|
|
|
|
|
|
var ConstructFun = function () { };
|
|
|
|
ConstructFun.prototype = proto;
|
|
|
|
|
|
|
|
var child = new ConstructFun();
|
|
|
|
|
|
|
|
Object.defineProperty(child, "prop", {
|
|
|
|
value: "nonEnumerableValue",
|
|
|
|
enumerable: false
|
|
|
|
});
|
|
|
|
|
|
|
|
var accessedProp = false;
|
|
|
|
|
|
|
|
for (var p in child) {
|
|
|
|
if (p === "prop") {
|
|
|
|
accessedProp = true;
|
|
|
|
}
|
|
|
|
}
|
2015-08-06 18:33:10 +02:00
|
|
|
|
|
|
|
assert.sameValue(accessedProp, false, 'accessedProp');
|