15.2.3.10-3-24.js (695B)
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.10-3-24 6 description: > 7 Object.preventExtensions - [[Extensible]]: false on a prototype 8 doesn't prevent adding properties to an instance that inherits 9 from that prototype 10 ---*/ 11 12 var proto = {}; 13 var preCheck = Object.isExtensible(proto); 14 Object.preventExtensions(proto); 15 16 var ConstructFun = function() {}; 17 ConstructFun.prototype = proto; 18 var child = new ConstructFun(); 19 20 child.prop = 10; 21 22 assert(preCheck, 'preCheck !== true'); 23 assert(child.hasOwnProperty("prop"), 'child.hasOwnProperty("prop") !== true'); 24 25 reportCompare(0, 0);