tor-browser

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

regular-definitions-string-literal-names.js (2042B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/class-elements/string-literal-names.case
      3 // - src/class-elements/productions/cls-expr-regular-definitions.template
      4 /*---
      5 description: String literal names (regular fields defintion)
      6 esid: prod-FieldDefinition
      7 features: [class-fields-public, class]
      8 flags: [generated]
      9 includes: [propertyHelper.js]
     10 info: |
     11    ClassElement:
     12      ...
     13      FieldDefinition ;
     14 
     15    FieldDefinition:
     16      ClassElementName Initializer_opt
     17 
     18    ClassElementName:
     19      PropertyName
     20 
     21 ---*/
     22 
     23 
     24 var C = class {
     25  'a'; "b"; 'c' = 39;
     26  "d" = 42
     27  
     28 }
     29 
     30 var c = new C();
     31 
     32 assert(
     33  !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
     34  "a does not appear as an own property on C prototype"
     35 );
     36 assert(
     37  !Object.prototype.hasOwnProperty.call(C, "a"),
     38  "a does not appear as an own property on C constructor"
     39 );
     40 
     41 verifyProperty(c, "a", {
     42  value: undefined,
     43  enumerable: true,
     44  writable: true,
     45  configurable: true
     46 });
     47 
     48 assert(
     49  !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
     50  "b does not appear as an own property on C prototype"
     51 );
     52 assert(
     53  !Object.prototype.hasOwnProperty.call(C, "b"),
     54  "b does not appear as an own property on C constructor"
     55 );
     56 
     57 verifyProperty(c, "b", {
     58  value: undefined,
     59  enumerable: true,
     60  writable: true,
     61  configurable: true
     62 });
     63 
     64 assert(
     65  !Object.prototype.hasOwnProperty.call(C.prototype, "c"),
     66  "c does not appear as an own property on C prototype"
     67 );
     68 assert(
     69  !Object.prototype.hasOwnProperty.call(C, "c"),
     70  "c does not appear as an own property on C constructor"
     71 );
     72 
     73 verifyProperty(c, "c", {
     74  value: 39,
     75  enumerable: true,
     76  writable: true,
     77  configurable: true
     78 });
     79 
     80 assert(
     81  !Object.prototype.hasOwnProperty.call(C.prototype, "d"),
     82  "d does not appear as an own property on C prototype"
     83 );
     84 assert(
     85  !Object.prototype.hasOwnProperty.call(C, "d"),
     86  "d does not appear as an own property on C constructor"
     87 );
     88 
     89 verifyProperty(c, "d", {
     90  value: 42,
     91  enumerable: true,
     92  writable: true,
     93  configurable: true
     94 });
     95 
     96 reportCompare(0, 0);