Skip to content

PARTIAL: Support testing ResolutionException #16

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jugglinmike
Copy link
Contributor

This patch is incomplete!

The goal of this patch is to allow Test262 tests to express negative: SyntaxError for module loading errors such as ambiguous import
bindings.

With this patch applied, the test runner fails with messages like this:

Expected: (((an instance of com.github.anba.es6draft.parser.ParserException or an instance of com.github.anba.es6draft.compiler.CompilationException or an instance of java.lang.StackOverflowError or an instance of com.github.anba.es6draft.runtime.modules.ResolutionException) or an instance of com.github.anba.es6draft.runtime.internal.ScriptException) and exception with error-message string matching 'SyntaxError')
    but: exception with error-message string matching 'SyntaxError' error-message was "ambiguous export \"x\""
Stacktrace was: com.github.anba.es6draft.runtime.modules.ResolutionException: ambiguous export "x"
[...]

@anba Do you have any advice for how to proceed?

*This patch is incomplete!*

The goal of this patch is to allow Test262 tests to express `negative:
SyntaxError` for module loading errors such as ambiguous import
bindings.

With this patch applied, the test runner fails with messages like this:

>     Expected: (((an instance of com.github.anba.es6draft.parser.ParserException or an instance of com.github.anba.es6draft.compiler.CompilationException or an instance of java.lang.StackOverflowError or an instance of com.github.anba.es6draft.runtime.modules.ResolutionException) or an instance of com.github.anba.es6draft.runtime.internal.ScriptException) and exception with error-message string matching 'SyntaxError')
>         but: exception with error-message string matching 'SyntaxError' error-message was "ambiguous export \"x\""
>     Stacktrace was: com.github.anba.es6draft.runtime.modules.ResolutionException: ambiguous export "x"
>     [...]
@jugglinmike
Copy link
Contributor Author

I've found a solution that technically works, though it's guaranteed to make you cringe :P

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.

1 participant