tor-browser

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

private-field-rhs-yield-absent.js (874B)


      1 // |reftest| error:SyntaxError
      2 // Copyright 2021 the V8 project authors.  All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 description: Parsing observes the `Yield` production parameter when present
      7 info: |
      8  Syntax
      9    RelationalExpression[In, Yield, Await]:
     10    [...]
     11    [+In]PrivateIdentifier in ShiftExpression[?Yield, ?Await]
     12 
     13  [...]
     14 
     15  1. Let privateIdentifier be the StringValue of PrivateIdentifier.
     16  2. Let rref be the result of evaluating ShiftExpression.
     17  3. Let rval be ? GetValue(rref).
     18  4. If Type(rval) is not Object, throw a TypeError exception.
     19 esid: sec-relational-operators-runtime-semantics-evaluation
     20 negative:
     21  phase: parse
     22  type: SyntaxError
     23 features: [class-fields-private, class-fields-private-in]
     24 ---*/
     25 
     26 $DONOTEVALUATE();
     27 
     28 class C {
     29  #field;
     30 
     31  static method() {
     32    #field in yield;
     33  }
     34 }