tor-browser

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

literal-string-hex-escape.js (1243B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/accessor-names/literal-string-hex-escape.case
      3 // - src/accessor-names/default/cls-decl-inst.template
      4 /*---
      5 description: Computed values as accessor property names (string literal containing a hexadecimal escape sequence) (Class declaration, instance 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           i. Let status be the result of performing PropertyDefinitionEvaluation
     14              for m with arguments proto and false.
     15 
     16 
     17    12.2.6.7 Runtime Semantics: Evaluation
     18 
     19    [...]
     20 
     21    ComputedPropertyName : [ AssignmentExpression ]
     22 
     23    1. Let exprValue be the result of evaluating AssignmentExpression.
     24    2. Let propName be ? GetValue(exprValue).
     25    3. Return ? ToPropertyKey(propName).
     26 ---*/
     27 
     28 var stringSet;
     29 
     30 class C {
     31  get 'hex\x45scape'() { return 'get string'; }
     32  set 'hex\x45scape'(param) { stringSet = param; }
     33 }
     34 
     35 assert.sameValue(C.prototype['hexEscape'], 'get string');
     36 
     37 C.prototype['hexEscape'] = 'set string';
     38 assert.sameValue(stringSet, 'set string');
     39 
     40 reportCompare(0, 0);