Merge pull request #30 from jrvidal/bugzilla-1450

Correct shadow behavior in 12.6.4-2 (bugzilla #1450)
This commit is contained in:
Brian Terlson 2014-07-07 11:24:27 -07:00
commit 6cc19d8f7c

View File

@ -10,43 +10,27 @@
function testcase() { function testcase() {
var obj = {}; var proto = {
prop: "enumerableValue"
var proto = {}; };
Object.defineProperty(proto, "prop", {
value: "inheritedValue",
enumerable: false,
configurable: true,
writable: true
});
var ConstructFun = function () { }; var ConstructFun = function () { };
ConstructFun.prototype = proto; ConstructFun.prototype = proto;
var child = new ConstructFun(); var child = new ConstructFun();
Object.defineProperty(child, "prop1", { Object.defineProperty(child, "prop", {
value: "overridedValue1", value: "nonEnumerableValue",
enumerable: false enumerable: false
}); });
Object.defineProperty(child, "prop2", {
value: "overridedValue2", var accessedProp = false;
enumerable: true
});
var accessedProp1 = false;
var accessedProp2 = false;
for (var p in child) { for (var p in child) {
if (child.hasOwnProperty(p)) { if (p === "prop") {
if (p === "prop1") { accessedProp = true;
accessedProp1 = true;
}
if (p === "prop2") {
accessedProp2 = true;
}
} }
} }
return !accessedProp1 && accessedProp2 && child.prop1 === "overridedValue1" && child.prop2 === "overridedValue2"; return !accessedProp;
} }
runTestCase(testcase); runTestCase(testcase);