| 1 |
// Copyright 2011 Google Inc. 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_A2 |
| 6 |
description: > |
| 7 |
Checks if an inherited accessor property appears to be an own |
| 8 |
property. |
| 9 |
---*/ |
| 10 |
|
| 11 |
var base = {}; |
| 12 |
var derived = Object.create(base); |
| 13 |
|
| 14 |
function getter() { |
| 15 |
return 'gotten'; |
| 16 |
} |
| 17 |
Object.defineProperty(base, 'foo', { |
| 18 |
get: getter |
| 19 |
}); |
| 20 |
if (derived.hasOwnProperty('foo')) { |
| 21 |
$ERROR('Accessor properties inherit as own properties'); |
| 22 |
} |