Changes between Version 17 and Version 18 of WebInspectorCodingStyleGuide
- Timestamp:
- Sep 18, 2015 9:43:19 AM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
WebInspectorCodingStyleGuide
v17 v18 84 84 Never use option (1), because it is a special case that only applies when the function has one argument, reducing predictability. 85 85 86 In cases where the return value is used and the expression is a constant ("foo"), a variable (foo), or a member (this.foo), use option (2) (with braces if the arrow function is inlined).86 In cases where the return value is used and the expression is a constant ("foo"), a variable (foo), or a member (this.foo), use option (2). Never use braces though, because implicit return only works if there are no braces around the single expression. 87 87 88 88 In cases where the expression computes a value (a + 42) or performs a side effect (++a), prefer option (4). … … 98 98 99 99 {{{ 100 setTimeout(() => { testRunner.notifyDone() }, 0); // return value not used 100 setTimeout(() => { testRunner.notifyDone() }, 0); // return value not implicitly returned 101 }}} 102 103 104 {{{ 105 setTimeout(() => testRunner.notifyDone(), 0); // implicit return value not used 101 106 }}} 102 107 … … 141 146 }}} 142 147 148 === Bugs and Gotchas 149 150 * <https://bugs.webkit.org/show_bug.cgi?id=149338> Currently, arrow functions will always capture lexical `this`, even if the arrow function does not actually use `this`. The behavior causes TDZ error if such an arrow function is used in a constructor before calling `super()`. 151 * Only basic functionality is implemented. Lexical binding of `arguments`, `super`, `new.target`, and `toString` are unimplemented. 152 153 The feature tracking bug tree is here: <https://bugs.webkit.org/showdependencytree.cgi?id=140855&hide_resolved=1> 154 155 143 156 == New class skeleton 144 157