mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-01 01:38:07 +08:00
Bug: none Change-Id: I9389834400d90beed8df9f28356720031abe9ef1 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6225902 Commit-Queue: Benedikt Meurer <bmeurer@chromium.org> Auto-Submit: Nikolay Vitkov <nvitkov@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org>
30 lines
729 B
JavaScript
30 lines
729 B
JavaScript
'use strict';
|
|
|
|
const _default = require('./default.cjs');
|
|
const expression = require('../function/expression.cjs');
|
|
const _var = require('../function/var.cjs');
|
|
|
|
function isPlusMinusOperator(node) {
|
|
return (
|
|
node !== null &&
|
|
node.type === 'Operator' &&
|
|
(node.value[node.value.length - 1] === '-' || node.value[node.value.length - 1] === '+')
|
|
);
|
|
}
|
|
|
|
const value = {
|
|
getNode: _default,
|
|
onWhiteSpace(next, children) {
|
|
if (isPlusMinusOperator(next)) {
|
|
next.value = ' ' + next.value;
|
|
}
|
|
if (isPlusMinusOperator(children.last)) {
|
|
children.last.value += ' ';
|
|
}
|
|
},
|
|
'expression': expression,
|
|
'var': _var
|
|
};
|
|
|
|
module.exports = value;
|