test262/test/built-ins/Object/defineProperty/S15.2.3.6_A2.js

18 lines
490 B
JavaScript
Raw Normal View History

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-25 00:41:42 +02:00
es5id: 15.2.3.6_A2
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);
function getter() { return 'gotten'; }
Object.defineProperty(base, 'foo', {get: getter});
if (derived.hasOwnProperty('foo')) {
$ERROR('Accessor properties inherit as own properties');
}