Closed kindlychung closed 9 years ago
I also moved a few seemingly unused functions to the end of the file.
Thanks, but this doesn't actually guarantee ordering. Array-maps will be converted into hash-maps when they grow past a certain size. Also, please don't include formatting changes alongside functionality changes.
I have pushed another commit. It's now uses ordered-map from amalloy's "ordered" library. https://github.com/amalloy/ordered
Sorry for the formatting changes, it's just intellij automatically reformatted the file.
Upon considering this further, I don't think it's a good idea to guarantee ordering. Part of the point of Hooke is that each hook can be added independently. This means you can add a hook without knowing that another piece of code is also adding a hook to the same var elsewhere. So you need to write your hook without knowing what order it's going to be run in.
If you have two hooks in a case where you control both of them, simply compose them into a single hook and add that; that way you can control which comes first.
I noticed that the test 'test-no-arg' fails here -- is this possibly related because of the non-guarantee of execution order?
…s, all tests passed.