dart-lang / web

Lightweight browser API bindings built around JS static interop.
https://pub.dev/packages/web
BSD 3-Clause "New" or "Revised" License
125 stars 21 forks source link

Make constants that have a value in the IDL non-external #285

Closed srujzs closed 1 week ago

srujzs commented 3 weeks ago

A number of APIs have constant values e.g. XMLHttpRequest. We currently emit them as external values, but we can emit them as Dart members since the values are known in the IDL e.g. XMLHttpRequest. The only downside here is that we're ignoring what the browser implements, but in practice, I don't expect that to be different from the IDL values. The benefit of doing this is to be able to use these values in a switch-case.

kevmoo commented 3 weeks ago

Didn't we discuss this somewhere else, too?

kevmoo commented 3 weeks ago

I agree!

srujzs commented 3 weeks ago

Didn't we discuss this somewhere else, too?

Yup! You brought this up somewhere in an external code review but searching my mail led me to no results.