dart-lang / web

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

Add [] and []= operators for unnamed getters and setters #293

Closed srujzs closed 2 months ago

srujzs commented 2 months ago

Closes https://github.com/dart-lang/web/issues/127

The IDL defines unnamed getters or setters which should be emitted as special variants of the index operators.

srujzs commented 2 months ago

cc @rutvik110 who was curious about generator changes. In general, changes go into translator.dart, which contain the following:

The definition for the parsed IDL comes from https://github.com/w3c/webidl2.js.

kevmoo commented 2 months ago

Since we're using..."weird" operators, would it make sense to add a simple integration test...for just one of the types here.?

srujzs commented 2 months ago

Since we're using..."weird" operators, would it make sense to add a simple integration test...for just one of the types here.?

Yup, I tested this locally anyways, so no reason not to add a test for it. I added a smoke test for examples of [] and []=.