tor-browser

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

literal-numeric-non-canonical.js (1251B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/accessor-names/literal-numeric-non-canonical.case
      3 // - src/accessor-names/default/cls-expr-static.template
      4 /*---
      5 description: Computed values as accessor property names (numeric literal with non-canonical representation) (Class expression, static method)
      6 esid: sec-runtime-semantics-classdefinitionevaluation
      7 features: [class]
      8 flags: [generated]
      9 info: |
     10    [...]
     11    21. For each ClassElement m in order from methods
     12        a. If IsStatic of m is false, then
     13           [...]
     14        b. Else,
     15           a. Let status be the result of performing PropertyDefinitionEvaluation
     16              for m with arguments F and false.
     17 
     18 
     19    12.2.6.7 Runtime Semantics: Evaluation
     20 
     21    [...]
     22 
     23    ComputedPropertyName : [ AssignmentExpression ]
     24 
     25    1. Let exprValue be the result of evaluating AssignmentExpression.
     26    2. Let propName be ? GetValue(exprValue).
     27    3. Return ? ToPropertyKey(propName).
     28 ---*/
     29 
     30 var stringSet;
     31 
     32 var C = class {
     33  static get 0.0000001() { return 'get string'; }
     34  static set 0.0000001(param) { stringSet = param; }
     35 };
     36 
     37 assert.sameValue(C['1e-7'], 'get string');
     38 
     39 C['1e-7'] = 'set string';
     40 assert.sameValue(stringSet, 'set string');
     41 
     42 reportCompare(0, 0);