No compound assignement operators

Summary:
Addresses a performance regression introduced by automatic linting: Compound assignment operators are much slower than keeping assignment separate on `let` bindings in certain versions of v8.

This reverts the relevant changes and configures eslint to *disallow* these operators explicitly in `metro-source-map`.

Reviewed By: mjesun

Differential Revision: D6520485

fbshipit-source-id: 16f35f5cd691ce6b1924480cbc30fbaa1275f730
This commit is contained in:
David Aurelio 2017-12-09 13:29:26 -08:00 committed by Facebook Github Bot
parent c5e83dd86a
commit ae5ebc8078
3 changed files with 11 additions and 3 deletions

View File

@ -0,0 +1,8 @@
{
"rules": {
"operator-assignment": ["error", "never"]
},
"env": {
"node": true
}
}

View File

@ -167,11 +167,11 @@ function encode(value: number, buffer: Buffer, position: number): number {
let digit;
do {
digit = vlq & VLQ_BASE_MASK;
vlq >>>= VLQ_BASE_SHIFT;
vlq = vlq >>> VLQ_BASE_SHIFT;
if (vlq > 0) {
// There are still more digits in this value, so we must make sure the
// continuation bit is marked.
digit |= VLQ_CONTINUATION_BIT;
digit = digit | VLQ_CONTINUATION_BIT;
}
buffer[position++] = CHAR_MAP[digit];
} while (vlq > 0);

View File

@ -56,7 +56,7 @@ function fromRawMappings(
);
}
carryOver += countLines(code);
carryOver = carryOver + countLines(code);
}
return generator;