michael@0: // Copyright 2011 Google Inc. All rights reserved. michael@0: // This code is governed by the BSD license found in the LICENSE file. michael@0: michael@0: /** michael@0: * @path ch08/8.6/8.6.2/S8.6.2_A8.js michael@0: * @description It should not be possible to change the [[Prototype]] michael@0: * of a non-extensible object michael@0: */ michael@0: michael@0: var x = Object.preventExtensions({}); michael@0: var y = {}; michael@0: try { michael@0: x.__proto__ = y; michael@0: } catch (err) { michael@0: // As far as this test is concerned, we allow the above assignment michael@0: // to fail. This failure does violate the spec and should probably michael@0: // be tested separately. michael@0: } michael@0: if (Object.getPrototypeOf(x) !== Object.prototype) { michael@0: $ERROR("Prototype of non-extensible object mutated"); michael@0: } michael@0: