Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 1.45 KB

CHANGELOG.unreleased.md

File metadata and controls

62 lines (42 loc) · 1.45 KB
  • JavaScript: Fix closure compiler typecasts ([#5947] by [@jridgewell])

    If a closing parenthesis follows after a typecast in an inner expression, the typecast would wrap everything to the that following parenthesis.

    // Input
    test(/** @type {!Array} */(arrOrString).length);
    test(/** @type {!Array} */((arrOrString)).length + 1);
    
    // Output (Prettier stable)
    test(/** @type {!Array} */ (arrOrString.length));
    test(/** @type {!Array} */ (arrOrString.length + 1));
    
    // Output (Prettier master)
    test(/** @type {!Array} */ (arrOrString).length);
    test(/** @type {!Array} */ (arrOrString).length + 1);