Skip to content

Added A+ tests, which aint passing yet#1

Open
Andarist wants to merge 1 commit into
joelnet:masterfrom
Andarist:aplus-tests
Open

Added A+ tests, which aint passing yet#1
Andarist wants to merge 1 commit into
joelnet:masterfrom
Andarist:aplus-tests

Conversation

@Andarist
Copy link
Copy Markdown

I've played around with your code after reading your fun article and I was wondering if this is A+ compliant implementation, so I've checked it and it seems it isn't.

It probably wasn't even ever a goal, but I've done some work with the setup and you might want to push this forward if you like.

Next failing test is caused by this line - onFulfilled function shouldn't be called right away, but rather in the next tick. Couldn't figure out at the moment how to approach this correctly here as I do not understand your implementation fully and it is not as trivial as just wrapping the call to state.then with immediate, because the result needs to be stored in state.right.

@joelnet
Copy link
Copy Markdown
Owner

joelnet commented Oct 16, 2017

I had no idea there was a package for A+ Promises. This would have saved me so much time!

My intention wasn't to be A+ compliant, but really just to show off the techniques used in the article. This code isn't mean to to be used in any project.

Though it would be nice to have this A+ compliant. I will figure out how to merge this when I can get all tests passing.

Thanks for this!

@Andarist
Copy link
Copy Markdown
Author

Andarist commented Oct 16, 2017

My intention wasn't to be A+ compliant, but really just to show off the techniques used in the article. This code isn't mean to to be used in any project.

Yeah - sure, I got that. Just thought it was really fun and I've checked if it is A+ compliant implementation. 😃

Btw. atm its one of the smallest Promise implementations out there

@joelnet
Copy link
Copy Markdown
Owner

joelnet commented Oct 17, 2017

Part of me wants to fix it. The other part of me doesn't want people to actually use this. lol.

@Andarist
Copy link
Copy Markdown
Author

Who's talking about using it? XD

Anyway - this code is very much usable even right now, relying on most of the behaviours that need to be 'fixed' to be A+ compliant is probably a code-smell anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants