Re: [whatwg/encoding] Consider adding TextEncoder.containsLoneSurrogates() static (#174)

@RReverser Catching exceptions [is about ~135 times slower than returning `null`](https://jsperf.com/try-catch-performance3), so we'd really like to avoid that.

And you might have to put in extra checking to make sure that you're catching the *right* exception (and not some unrelated exception).

It's quite common for DOM APIs to return `null` on failure. And it doesn't require synthesizing an `Error` object and sending it to Rust.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/encoding/issues/174#issuecomment-479238847

Received on Tuesday, 2 April 2019 22:44:28 UTC