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

> wasm-bindgen already does this try-catch in lots of places

Yes, but we plan to move away from that (especially in areas where we know errors cannot occur).

Our goal is to be as fast as possible (zero-cost ideally), at *least* as fast as JS, and in the future faster-than-JS.

> Which APIs are you refering to?

* `getElementById` can return `null`
* `querySelector` can return `null`
* `item` can return `null`
* `namedItem` can return `null`
* `lookupPrefix` can return `null`
* `getAttribute` / `getAttributeNS` can return `null`
* `closest` can return `null`

I admit they're not quite the same as `TextEncoder`, but there is some precedence for returning `null`

-- 
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-479280770

Received on Wednesday, 3 April 2019 01:06:30 UTC