tor-browser

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

wrapped-in-sc-literal-names-asi.js (1356B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/class-elements/literal-names-asi.case
      3 // - src/class-elements/productions/cls-decl-wrapped-in-sc.template
      4 /*---
      5 description: Literal property names with ASI (fields definition wrapped in semicolons)
      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 class C {
     25  ;;;;
     26  ;;;;;;a
     27  b = 42;;;;;;;;
     28  ;;;;
     29  
     30 }
     31 
     32 var c = new C();
     33 
     34 assert(
     35  !Object.prototype.hasOwnProperty.call(C.prototype, "a"),
     36  "a doesn't appear as an own property on C prototype"
     37 );
     38 assert(
     39  !Object.prototype.hasOwnProperty.call(C, "a"),
     40  "a doesn't appear as an own property on C constructor"
     41 );
     42 
     43 verifyProperty(c, "a", {
     44  value: undefined,
     45  enumerable: true,
     46  writable: true,
     47  configurable: true
     48 });
     49 
     50 assert(
     51  !Object.prototype.hasOwnProperty.call(C.prototype, "b"),
     52  "b doesn't appear as an own property on C prototype"
     53 );
     54 assert(
     55  !Object.prototype.hasOwnProperty.call(C, "b"),
     56  "b doesn't appear as an own property on C constructor"
     57 );
     58 
     59 verifyProperty(c, "b", {
     60  value: 42,
     61  enumerable: true,
     62  writable: true,
     63  configurable: true
     64 });
     65 
     66 reportCompare(0, 0);