- IO streams. (Domenic is leading an effort on GitHub. This is high priority, like promises was last year.)
- Asynchronous iteration (event streams?). (Database cursor, going through a directory, going through entries in storage, scanning TV channels.)
- A plan around distinct Error types and detection (e.g. for APIs that can fail in multiple ways where you might want to recover from certain class of errors; think network APIs, databases)
- A better way to define ES APIs than WebIDL. (Part of the problem here is lack of maintenance. So maybe it's as "simple" as finding someone.)
Last active
August 29, 2015 14:01
-
-
Save annevk/3db3fbda2b95e5ae9427 to your computer and use it in GitHub Desktop.
Platform requests to TC39
Transform Streams might be a good model for async iteration, the ability to make long pipelines that hook up to IO stream ends up making them particularly powerful
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There are currently two ways to "subclass" Map and Set, both of which are broken in several ways:
.set()
, you can't, because authors can always doMap.prototype.set.call(yourMapSubclass, key, stupidValue)
and bypass your protections. This means that this approach is worthless for using Maps in DOM, where typing constraints or conversions are common, and working around this issue is confusing and difficult.yourMap typeof Map
is false), any any new methods or properties added to Map/Set either by the language or by the page author don't show up on your custom Map/Set. Also,Map.prototype.set.call(yourMap, ...)
doesn't work at all, which makes it harder to do generic programming.As far as I can tell, the right way to go about this is to define a MapCore/SetCore object that only has the most basic calls on it (probably
get
,set
,has
,delete
,clear
, and[[iterator]]
for Map, similar things for Set), and define that Map/Set contain a private ref to a MapCore/SetCore object that actually holds the data. Then there needs to be a way to swap out the MapCore/SetCore object with something of your own, during construction only. That way you can subclass something like: