Object Extensions
If the first argument is an object with a method named step
, invoke the step
method with the step
function and the variadic arguments. This is an extension mechanism. I've create an example event extension method.
Frames Tidy
Only use the frames array where necessary; when invoking the _step
method and when jumping back to the start at the end of a loop.
Callback Creation Tidy
Arrayed or anonymous responses will create a callback from an arrayed creator an invoke it immediately. This is in lieu of using -1
as a special index value that means push to the end. Simplifies the code by eliminating special cases. Complicates the code by creating wrapper functions, but the wrapper functions are built on top of meaningful abstractions, not side-effects.
Reduce the minified and gzipped size of Cadence by converting a the named function createArray
that is called once into an anonymous function.
The counter that determines when a step is finished was duplicated. It has been moved into a sub function.
Loops Always Expect an Array or Terminal
A loop always expects either an array to loop over or a terminal that will stop a count from zero. If the terminal is null
, -1
or Infinity
it will loop forever. The the terminal is some other unreachable nonsense, like an object, it will loop forever.
Catching undefined
Encountered a missing property error triggered when someone throws undefined
. To fix, there must always be an errors array, even at the root caller frame.
- Test that you can catch
undefined
. #218. - Unreachable counter means loop forever. #226.
- Use
frames
stack only where necessary. #244. - Move callback counting into single function. #246.
- Implement arrayed or optional responses without
push
. #235. - Remove
createArray
. #245. - Use
frames
stack only where necessary. #244. - Upgrade Proof to 0.0.48. #243.
- Bouncier trampoline. #242.
- Use
assert
in tests. #240. - Implement event extension. #241.
- Implement extension via objects. #237.