tor-browser

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

extended-pattern-char.js (947B)


      1 // Copyright (C) 2016 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-regular-expressions-patterns
      5 es6id: B.1.4
      6 description: Extended Pattern Characters (as distinct from Pattern Characters)
      7 info: |
      8    ExtendedPatternCharacter ::
      9        SourceCharacterbut not one of ^$.*+?()[|
     10 
     11    The production ExtendedAtom::ExtendedPatternCharacter evaluates as follows:
     12 
     13    1. Let ch be the character represented by ExtendedPatternCharacter.
     14    2. Let A be a one-element CharSet containing the character ch.
     15    3. Call CharacterSetMatcher(A, false) and return its Matcher result.
     16 ---*/
     17 
     18 var match;
     19 
     20 match = /]/.exec(' ]{}');
     21 assert.sameValue(match[0], ']');
     22 
     23 match = /{/.exec(' ]{}');
     24 assert.sameValue(match[0], '{');
     25 
     26 match = /}/.exec(' ]{}');
     27 assert.sameValue(match[0], '}');
     28 
     29 match = /x{o}x/.exec('x{o}x');
     30 assert.sameValue(match[0], 'x{o}x');
     31 
     32 reportCompare(0, 0);