-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reuse error functions #41
Conversation
Reduce coupling between runner implementations and Test262 itself by automatically injecting Test262's definition of `Test262Error`.
Reduce coupling between runner implementations and Test262 itself by automatically injecting Test262's definition of `$ERROR`.
I see #2 as the real case - runners have to provide the definitions for these functions because they might change depending on environment. I'm surprised tests pass with this PR... |
They pass because none of the currently-implemented runners require custom definitions of The alternative I had in mind is to attach the definitions for these objects as properties on the base |
I've pushed up another commit to demonstrate the change I was describing in my previous comment. |
Documentation will also need to be updated, but I'll hold off on that until I hear back about the code change. |
My original thinking was that $ERROR could do host-specific error reporting but I guess this is not required if $DONE received the error and can report it appropriately? |
I think the main thing is that the host needs to be able to recognize uncaught errors generally (whether from expected |
Yeah that makes sense! I like 33c083c so I'm going to pull this in. |
This builds on gh-40 by also re-using Test262's definition of the
$ERROR
function.@bterlson What is Test262's "API"? I can see two possible interpretations:
sta.js
(which may change at any time)$ERROR
andTest262Error
functionsAlthough this pull request assumes
#1
is true, I'm starting to think that#2
is more realistic. If that's the case, this approach should still work (just with a little more modification).