2011-09-24 17:25:22 +02:00
|
|
|
// Copyright 2011 Google Inc. All rights reserved.
|
|
|
|
// 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: 15.2.3.6_A2
|
2014-07-22 01:09:02 +02:00
|
|
|
description: >
|
|
|
|
Checks if an inherited accessor property appears to be an own
|
|
|
|
property.
|
|
|
|
---*/
|
2011-09-24 17:25:22 +02:00
|
|
|
|
|
|
|
var base = {};
|
|
|
|
var derived = Object.create(base);
|
2018-02-15 21:33:45 +01:00
|
|
|
|
|
|
|
function getter() {
|
|
|
|
return 'gotten';
|
|
|
|
}
|
|
|
|
Object.defineProperty(base, 'foo', {
|
|
|
|
get: getter
|
|
|
|
});
|
2011-09-24 17:25:22 +02:00
|
|
|
if (derived.hasOwnProperty('foo')) {
|
|
|
|
$ERROR('Accessor properties inherit as own properties');
|
|
|
|
}
|