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

Wed, 31 Dec 2014 13:27:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 13:27:57 +0100
branch
TOR_BUG_3246
changeset 6
8bccb770b82d
permissions
-rw-r--r--

Ignore runtime configuration files generated during quality assurance.

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

mercurial