Changes between Version 28 and Version 29 of WebInspectorCodingStyleGuide
- Timestamp:
- Jun 18, 2020, 1:33:41 PM (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TabularUnified WebInspectorCodingStyleGuide
v28 v29 94 94 2 let foo = (val) => val 95 95 3 let foo = (val) => val; 96 4 let foo = (val) => { return value++; } 96 4 let foo = (val) => { return value++; }; 97 97 5 let foo = (val) => { 98 98 return value++; 99 99 }; 100 6 let foo = function doStuff(val) { return value++; } 100 6 let foo = function doStuff(val) { return value++; }; 101 101 7 let foo = function doStuff(val) { 102 102 return value++; 103 } 103 }; 104 104 }}} 105 105 … … 116 116 117 117 {{{ 118 setTimeout(() => { testRunner.notifyDone(); }, 0) 118 setTimeout(() => { 119 testRunner.notifyDone(); 120 }, 0); 119 121 }}} 120 122 … … 122 124 123 125 {{{ 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 127 setTimeout(() => { 128 testRunner.notifyDone() 129 }, 0); 130 }}} 131 132 133 {{{ 134 // implicit return value not used 135 setTimeout(() => testRunner.notifyDone(), 0); 130 136 }}} 131 137 … … 137 143 138 144 {{{ 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) { ... } 145 Base.prototype.compute = function(a, b, c) { 146 // ... 147 }; 148 149 Foo.prototype.compute = function(a, b, c) { 150 Base.prototype.compute.call(this, a, b, c); 151 }; 152 153 WI.UIString = function(format, args) { 154 // ... 155 }; 143 156 }}} 144 157 … … 146 159 147 160 {{{ 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. 161 Base.prototype.compute = (a, b, c) => { 162 // ... 163 }; 164 165 Foo.prototype.compute = (a, b, c) => { 166 Base.prototype.compute.call(this, a, b, c); 167 }; 168 169 // `this` will be window 170 WI.UIString = (format, args) => { 171 // ... 172 }; 152 173 }}} 153 174 … … 157 178 158 179 {{{ 159 Promise.resolve() 160 .then(function resolved(value) { ... }, 161 function rejected(value) { ... }); 180 Promise.resolve().then( 181 function resolved(value) { ... }, 182 function rejected(value) { ... } 183 ); 162 184 }}} 163 185 … … 165 187 166 188 {{{ 167 Promise.resolve() 168 .then((value) => { ... }, 169 (value) => { ... }) 189 Promise.resolve().then( 190 (value) => { ... }, 191 (value) => { ... } 192 ); 170 193 }}} 171 194