js/src/tests/test262/ch08/8.6/8.6.2/S8.6.2_A8.js

Wed, 31 Dec 2014 07:53:36 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 07:53:36 +0100
branch
TOR_BUG_3246
changeset 5
4ab42b5ab56c
permissions
-rw-r--r--

Correct small whitespace inconsistency, lost while renaming variables.

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

mercurial