js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A5.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  * A strict delete should either succeed, returning true, or it
     6  * should fail by throwing a TypeError. Under no circumstances
     7  * should a strict delete return false.
     8  *
     9  * @path ch11/11.4/11.4.1/S11.4.1_A5.js
    10  * @description See if a strict delete returns false when deleting a
    11  * non-standard property.
    12  * @onlyStrict
    13  */
    15 "use strict";
    17 var reNames = Object.getOwnPropertyNames(RegExp);
    18 for (var i = 0, len = reNames.length; i < len; i++) {
    19   var reName = reNames[i];
    20   if (reName !== 'prototype') {
    21     var deleted = 'unassigned';
    22     try {
    23       deleted = delete RegExp[reName];
    24     } catch (err) {
    25       if (!(err instanceof TypeError)) {
    26         $ERROR('#1: strict delete threw a non-TypeError: ' + err);
    27       }
    28       // fall through
    29     }
    30     if (deleted === false) {
    31       $ERROR('#2: Strict delete returned false');
    32     }
    33   }
    34 }

mercurial