Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
Fix the build by adding an argument to catch statement
Browse files Browse the repository at this point in the history
Summary:
Turns out D22722736 (36de6f1) broke the OSS build: apparently `catch` without arguments is a [fairly new feature](https://stackoverflow.com/questions/21624456/can-i-use-a-try-catch-in-javascript-without-specifying-the-catch-argument-identi) that UglifyJS doesn't understand. Whoops. It threw:

```
ERROR: Unexpected token: punc «{», expected: punc «(»
```

Go figure.

It seems unlikey that it's possible, but it'd be cool if the TravisCI build status could block lands in www. There's no way to get signal about this until after the fact. /:

Reviewed By: creedarky

Differential Revision: D22771035

fbshipit-source-id: cd61c6a3ca2aab534c99939a4fb7f29a8863c2ea
  • Loading branch information
mrkev authored and facebook-github-bot committed Jul 27, 2020
1 parent 36de6f1 commit 5482c90
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/model/encoding/convertFromHTMLToContentBlocks.js
Expand Up @@ -176,7 +176,10 @@ const isValidAnchor = (node: Node) => {
// Just checking whether we can actually create a URI
const _ = new URI(anchorNode.href);
return true;
} catch {
// We need our catch statements to have arguments, else
// UglifyJS (which we use for our OSS builds) will crash.
// eslint-disable-next-line fb-www/no-unused-catch-bindings
} catch (_) {
return false;
}
};
Expand Down

0 comments on commit 5482c90

Please sign in to comment.