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:
Simon Giesecke 2020-01-21 08:19:55 +00:00
Родитель dfc0fdd507
Коммит 615906c9b7
2 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -242,8 +242,8 @@ is doing, without needing to further examine base classes.
Operators
~~~~~~~~~
Unary keyword operators, such as ``typeof`` and ``sizeof``, should have
their operand parenthesized; e.g. ``typeof("foo") == "string"``.
The unary keyword operator ``sizeof``, should have its operand parenthesized
even if it is an expression; e.g. ``int8_t arr[64]; memset(arr, 42, sizeof(arr));``.
Literals

Просмотреть файл

@ -66,6 +66,8 @@ line, in long member expression.
In JavaScript, ``==`` is preferred to ``===``.
Unary keyword operators, such as ``typeof``, should have their operand
parenthesized; e.g. ``typeof("foo") == "string"``.
Literals
~~~~~~~~