tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

S11.4.1_A5-strict.js (1057B)


      1 'use strict';
      2 // Copyright 2011 Google Inc.  All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 info: |
      7    A strict delete should either succeed, returning true, or it
      8    should fail by throwing a TypeError. Under no circumstances
      9    should a strict delete return false.
     10 esid: sec-delete-operator-runtime-semantics-evaluation
     11 description: >
     12    See if a strict delete returns false when deleting a  non-standard
     13    property.
     14 flags: [onlyStrict]
     15 ---*/
     16 
     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        throw new Test262Error('#1: strict delete threw a non-TypeError: ' + err);
     27      }
     28      // fall through
     29    }
     30    if (deleted === false) {
     31      throw new Test262Error('#2: Strict delete returned false');
     32    }
     33  }
     34 }
     35 
     36 reportCompare(0, 0);