Changes between Version 28 and Version 29 of WebInspectorCodingStyleGuide


Ignore:
Timestamp:
Jun 18, 2020 1:33:41 PM (4 years ago)
Author:
Devin Rousso
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WebInspectorCodingStyleGuide

    v28 v29  
    94942   let foo = (val) => val
    95953   let foo = (val) => val;
    96 4   let foo = (val) => { return value++; }
     964   let foo = (val) => { return value++; };
    97975   let foo = (val) => {
    9898        return value++;
    9999    };
    100 6   let foo = function doStuff(val) { return value++; }
     1006   let foo = function doStuff(val) { return value++; };
    1011017   let foo = function doStuff(val) {
    102102        return value++;
    103     }
     103    };
    104104}}}
    105105
     
    116116
    117117{{{
    118 setTimeout(() => { testRunner.notifyDone(); }, 0)
     118setTimeout(() => {
     119    testRunner.notifyDone();
     120}, 0);
    119121}}}
    120122
     
    122124
    123125{{{
    124 setTimeout(() => { testRunner.notifyDone() }, 0); // return value not implicitly returned
    125 }}}
    126 
    127 
    128 {{{
    129 setTimeout(() => testRunner.notifyDone(), 0); // implicit return value not used
     126// return value not implicitly returned
     127setTimeout(() => {
     128    testRunner.notifyDone()
     129}, 0);
     130}}}
     131
     132
     133{{{
     134// implicit return value not used
     135setTimeout(() => testRunner.notifyDone(), 0);
    130136}}}
    131137
     
    137143
    138144{{{
    139 Base.prototype.compute = function(a, b, c) { ... }
    140 Foo.prototype.compute = function(a, b, c) { Base.prototype.compute.call(this, a, b, c); }
    141 
    142 WI.UIString = function(format, args) { ... }
     145Base.prototype.compute = function(a, b, c) {
     146    // ...
     147};
     148
     149Foo.prototype.compute = function(a, b, c) {
     150    Base.prototype.compute.call(this, a, b, c);
     151};
     152
     153WI.UIString = function(format, args) {
     154    // ...
     155};
    143156}}}
    144157
     
    146159
    147160{{{
    148 Base.prototype.compute = (a, b, c) => { ... }
    149 Foo.prototype.compute = (a, b, c) => { Base.prototype.compute.call(this, a, b, c); }
    150 
    151 WI.UIString = (format, args) => { ... } // this will be window.
     161Base.prototype.compute = (a, b, c) => {
     162    // ...
     163};
     164
     165Foo.prototype.compute = (a, b, c) => {
     166    Base.prototype.compute.call(this, a, b, c);
     167};
     168
     169// `this` will be window
     170WI.UIString = (format, args) => {
     171    // ...
     172};
    152173}}}
    153174
     
    157178
    158179{{{
    159 Promise.resolve()
    160     .then(function resolved(value) { ... },
    161         function rejected(value) { ... });
     180Promise.resolve().then(
     181    function resolved(value) { ... },
     182    function rejected(value) { ... }
     183);
    162184}}}
    163185
     
    165187
    166188{{{
    167 Promise.resolve()
    168     .then((value) => { ... },
    169         (value) => { ... })
     189Promise.resolve().then(
     190    (value) => { ... },
     191    (value) => { ... }
     192);
    170193}}}
    171194