зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1609943 - Split guideline on unary operators into C++ and JavaScript part. r=sylvestre
C++: Remove reference to JavaScript typeof from 'Operators' section and specifically refer to sizeof only. JavaScript: Added remainder of the guideline referring to typeof. Differential Revision: https://phabricator.services.mozilla.com/D60261 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
dfc0fdd507
Коммит
615906c9b7
|
@ -242,8 +242,8 @@ is doing, without needing to further examine base classes.
|
||||||
Operators
|
Operators
|
||||||
~~~~~~~~~
|
~~~~~~~~~
|
||||||
|
|
||||||
Unary keyword operators, such as ``typeof`` and ``sizeof``, should have
|
The unary keyword operator ``sizeof``, should have its operand parenthesized
|
||||||
their operand parenthesized; e.g. ``typeof("foo") == "string"``.
|
even if it is an expression; e.g. ``int8_t arr[64]; memset(arr, 42, sizeof(arr));``.
|
||||||
|
|
||||||
|
|
||||||
Literals
|
Literals
|
||||||
|
|
|
@ -66,6 +66,8 @@ line, in long member expression.
|
||||||
|
|
||||||
In JavaScript, ``==`` is preferred to ``===``.
|
In JavaScript, ``==`` is preferred to ``===``.
|
||||||
|
|
||||||
|
Unary keyword operators, such as ``typeof``, should have their operand
|
||||||
|
parenthesized; e.g. ``typeof("foo") == "string"``.
|
||||||
|
|
||||||
Literals
|
Literals
|
||||||
~~~~~~~~
|
~~~~~~~~
|
||||||
|
|
Загрузка…
Ссылка в новой задаче