tor-browser

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

lastIndex.js (968B)


      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-expression-literals-runtime-semantics-evaluation
      5 description: Initial state of the `lastIndex` property
      6 info: |
      7  [...]
      8  3. Return RegExpCreate(pattern, flags).
      9 
     10  21.2.3.2.3 Runtime Semantics: RegExpCreate
     11 
     12  1. Let obj be ? RegExpAlloc(%RegExp%).
     13  2. Return ? RegExpInitialize(obj, P, F).
     14 
     15  21.2.3.2.2 Runtime Semantics: RegExpInitialize
     16 
     17  [...]
     18  12. Perform ? Set(obj, "lastIndex", 0, true).
     19  [...]
     20 
     21  21.2.3.2.1 Runtime Semantics: RegExpAlloc
     22 
     23  [...]
     24  2. Perform ! DefinePropertyOrThrow(obj, "lastIndex", PropertyDescriptor
     25     {[[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: false}).
     26  [...]
     27 includes: [propertyHelper.js]
     28 ---*/
     29 
     30 var re = /./;
     31 
     32 verifyProperty(re, "lastIndex", {
     33  value: 0,
     34  writable: true,
     35  enumerable: false,
     36  configurable: false,
     37 });
     38 
     39 reportCompare(0, 0);