tor-browser

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

yield-identifier-strict-strict.js (1094B)


      1 // |reftest| error:SyntaxError
      2 'use strict';
      3 // This file was procedurally generated from the following sources:
      4 // - src/async-generators/yield-identifier-strict.case
      5 // - src/async-generators/default/async-class-expr-method.template
      6 /*---
      7 description: It's an early error if the generator body has another function body with yield as an identifier in strict mode. (Async generator method as a ClassExpression element)
      8 esid: prod-AsyncGeneratorMethod
      9 features: [async-iteration]
     10 flags: [generated, onlyStrict]
     11 negative:
     12  phase: parse
     13  type: SyntaxError
     14 info: |
     15    ClassElement :
     16      MethodDefinition
     17 
     18    MethodDefinition :
     19      AsyncGeneratorMethod
     20 
     21    Async Generator Function Definitions
     22 
     23    AsyncGeneratorMethod :
     24      async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
     25 
     26 ---*/
     27 $DONOTEVALUATE();
     28 
     29 
     30 var callCount = 0;
     31 
     32 var C = class { async *gen() {
     33    callCount += 1;
     34    (function() {
     35        var yield;
     36        throw new Test262Error();
     37      }())
     38 }}
     39 
     40 var gen = C.prototype.gen;
     41 
     42 var iter = gen();
     43 
     44 
     45 
     46 assert.sameValue(callCount, 1);