endojs / Jessie

Tiny subset of JavaScript for ocap-safe universal mobile code
Apache License 2.0
279 stars 16 forks source link

asyncDoWhile, asyncGenerate in stdlib #52

Closed michaelfig closed 3 years ago

michaelfig commented 3 years ago

This follows from @kriskowal's suggestion to simplify and have async* functions mesh better with existing JS concepts.

The other part of this change is to separate the ring0 system-level stdlib implementations (akin to assembly language in standard libraries) from the higher rings (which can be built out of the next lower ring).

michaelfig commented 3 years ago

@erights if you have some bandwidth, would you be able to take a look at this? I'd like to publish jessie.js with these methods to use for await within loop patterns.

erights commented 3 years ago

When I run yarn install && yarn build it changes packages/stdlib/types/main.d.ts in the following way. A yarn build by itself then does that as well.

-export { makePromise, makeMap, makeSet, makeWeakMap, makeWeakSet } from "./makers.js";
-export { asyncWhile, asyncAllTruthies } from "./async.js";
+export * from "./ring0/main";
+export * from "./ring1/main";
erights commented 3 years ago

Inside packages/stdlib yarn test and yarn lint both succeed for either the checked in or the build built versions of types/main.d.ts

michaelfig commented 3 years ago

When I run yarn install && yarn build it changes packages/stdlib/types/main.d.ts in the following way.

Thanks. main.d.ts should not be included so I've removed it.

erights commented 3 years ago

Did you forget to push?