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

Add optional test for cloning of error stacks #17159

Merged
merged 3 commits into from
Jul 9, 2019

Conversation

domenic
Copy link
Member

@domenic domenic commented Jun 4, 2019

Supplements #17095.
Follows whatwg/html#4665 and whatwg/webidl#732.

/cc @yutakahirano

}, 'web API-created DOMException');


function stackTest(errorFactory, description) {
Copy link
Member

Choose a reason for hiding this comment

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

It'd be easier to read if this was defined upfront, especially if we end up adding more.

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 personally find defining helper functions later better, as it lets you focus on the tests and not the implementation details of them. It's a style thing, IMO.

const error = errorFactory();
const originalStack = error.stack;

if (!originalStack) {
Copy link
Member

Choose a reason for hiding this comment

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

For which implementations does this hold?

Copy link
Member Author

Choose a reason for hiding this comment

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

Chrome, for example, does not have stacks on user-created DOMExceptions. Given that this entire area is underspecified, I definitely don't want to require it.

@domenic
Copy link
Member Author

domenic commented Jun 13, 2019

@annevk this should be ready for another look

domenic pushed a commit to whatwg/html that referenced this pull request Jul 3, 2019
Define serialization and deserialization steps for all built-in
NativeError types from the JavaScript specification. This change doesn't
cover DOMExceptions, which are covered by
whatwg/webidl#732.

Fixes #4268.

Tests:
* web-platform-tests/wpt#17095
* web-platform-tests/wpt#17159
domenic pushed a commit to whatwg/webidl that referenced this pull request Jul 3, 2019
@domenic
Copy link
Member Author

domenic commented Jul 3, 2019

Going to close and reopen to try to fix the taskcluster failure.

@domenic domenic closed this Jul 3, 2019
@domenic domenic reopened this Jul 3, 2019
domenic added 2 commits July 9, 2019 13:57
Consolidated echo window/worker into resources/ directory
@annevk annevk force-pushed the domenic/structured-clone-error-stack branch from fc05e3e to a3c2eb5 Compare July 9, 2019 11:57
@annevk
Copy link
Member

annevk commented Jul 9, 2019

I rebased this on master and added a commit. It'd be nice to get this landed as further SharedArrayBuffer work needs to build on this.

@domenic domenic merged commit 1da6bed into master Jul 9, 2019
@annevk annevk deleted the domenic/structured-clone-error-stack branch July 10, 2019 10:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants