2.1.20 [ECMA-262/7] Section 14.5.14 Runtime Semantics: ClassDefinitionEvaluation

V0021: ClassDefinitionEvaluation uses the lexical environment of the running execution context

The specification states:

 ... Runtime Semantics: ClassDefinitionEvaluation
  
     With parameter className.
  
     ClassTail : ClassHeritage { ClassBody }
  
         1.  Let lex be the LexicalEnvironment of the running execution context.
         2.  Let classScope be NewDeclarativeEnvironment(lex).
         3.  Let classScopeEnvRec be classScope’s EnvironmentRecord.
         4.  If className is not undefined, then
             a. Perform classScopeEnvRec.CreateImmutableBinding(className, true).
         ...
         23. If className is not undefined, then
             a. Perform classScopeEnvRec.InitializeBinding(className, F).

EdgeHTML Mode

Step 2 is omitted. As a result, ClassDefinitionEvaluation uses the lexical environment of the running execution context.