Skip to content
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

src: expose DOMException to internalBinding('message') for testing #28072

Closed
wants to merge 1 commit into from

Conversation

joyeecheung
Copy link
Member

Instead of using a hack to get it in the test.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

Instead of using a hack to get it in the test.
@nodejs-github-bot
Copy link
Collaborator

return domexception_ctor;
}

void ThrowDataCloneException(Local<Context> context, Local<String> message) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@addaleax I think ideally we'd want to do this in JS instead of throwing the error in nested C++ helpers?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joyeecheung We need to have this in C++, because the V8 ValueSerializer API requires it. I also don’t see any reason to move the error throwing to JS?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, this is required by ValueSerializer::Delegate::ThrowDataCloneError - but do we need to throw errors this way ourselves? As this is just doing new DOMException(message, 'DataCloneError') - I believe in general we prefer throwing errors from JS.

@nodejs-github-bot
Copy link
Collaborator

return domexception_ctor;
}

void ThrowDataCloneException(Local<Context> context, Local<String> message) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@joyeecheung We need to have this in C++, because the V8 ValueSerializer API requires it. I also don’t see any reason to move the error throwing to JS?

@addaleax addaleax added test Issues and PRs related to the tests. worker Issues and PRs related to Worker support. labels Jun 5, 2019
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@joyeecheung joyeecheung added author ready PRs that have at least one approval, no pending requests for changes, and a CI started. review wanted PRs that need reviews. labels Jun 9, 2019
@joyeecheung
Copy link
Member Author

@nodejs/testing This needs one more approval to land

@Trott Trott removed the review wanted PRs that need reviews. label Jun 9, 2019
@addaleax
Copy link
Member

addaleax commented Jun 9, 2019

Landed in 890223d, thanks for taking care of this!

@addaleax addaleax closed this Jun 9, 2019
pull bot pushed a commit to whtiehack/node that referenced this pull request Jun 9, 2019
Instead of using a hack to get it in the test.

PR-URL: nodejs#28072
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
BridgeAR pushed a commit that referenced this pull request Jun 17, 2019
Instead of using a hack to get it in the test.

PR-URL: #28072
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
@BridgeAR BridgeAR mentioned this pull request Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
author ready PRs that have at least one approval, no pending requests for changes, and a CI started. test Issues and PRs related to the tests. worker Issues and PRs related to Worker support.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants