15.2.3.7-6-a-10.js (800B)
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.7-6-a-10 6 description: > 7 Object.defineProperties - 'P' is own accessor property without a 8 get function that overrides an inherited accessor property (8.12.9 9 step 1 ) 10 ---*/ 11 12 var proto = {}; 13 Object.defineProperty(proto, "prop", { 14 get: function() { 15 return 11; 16 }, 17 set: function() {}, 18 configurable: true 19 }); 20 var Con = function() {}; 21 Con.prototype = proto; 22 23 var obj = new Con(); 24 Object.defineProperty(obj, "prop", { 25 set: function() {}, 26 configurable: false 27 }); 28 assert.throws(TypeError, function() { 29 Object.defineProperties(obj, { 30 prop: { 31 value: 12, 32 configurable: true 33 } 34 }); 35 }); 36 37 reportCompare(0, 0);