js/src/tests/test262/ch11/11.4/11.4.1/S11.4.1_A5.js

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     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