| 1 |
// Copyright (c) 2012 Ecma International. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
es5id: 15.2.3.6-4-23 |
| 6 |
description: > |
| 7 |
Object.defineProperty - 'name' is existing an inherited data |
| 8 |
property (8.12.9 step 1) |
| 9 |
---*/ |
| 10 |
|
| 11 |
var proto = {}; |
| 12 |
Object.defineProperty(proto, "foo", { |
| 13 |
value: 11, |
| 14 |
configurable: false |
| 15 |
}); |
| 16 |
|
| 17 |
var ConstructFun = function() {}; |
| 18 |
ConstructFun.prototype = proto; |
| 19 |
var obj = new ConstructFun(); |
| 20 |
|
| 21 |
Object.defineProperty(obj, "foo", { |
| 22 |
configurable: true |
| 23 |
}); |
| 24 |
|
| 25 |
assert(obj.hasOwnProperty("foo"), 'obj.hasOwnProperty("foo") !== true'); |
| 26 |
assert.sameValue(typeof obj.foo, "undefined", 'typeof obj.foo'); |