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

html: Add tests to verify BigInt structured clone integration #9565

Merged
merged 1 commit into from Feb 26, 2018

Conversation

Projects
None yet
5 participants
@littledan
Copy link
Contributor

littledan commented Feb 17, 2018

These tests are against a PR which has not yet landed: whatwg/html#3480

@wpt-pr-bot wpt-pr-bot added the html label Feb 17, 2018

@wpt-pr-bot wpt-pr-bot requested review from ayg, jdm, jgraham and zqzhang Feb 17, 2018

littledan added a commit to littledan/html that referenced this pull request Feb 17, 2018

Normative: Permit serialization of BigInt wrappers
The goal of this PR is to integrate BigInt with HTML serialization.

It seems that all primitives are already serialized and deserialized
in the current specification, so this patch only adds serialization
for BigInt wrappers. Note that BigInt, like (the unserializable)
Symbol does not have a new-able constructor: use of wrappers is
explicitly discouraged by the specification. Nevertheless, this patch
adds serialization support for consistency with other wrappers.

web-platform-tests against postMessage on BigInt are out for review in
web-platform-tests/wpt#9565
@domenic

This comment has been minimized.

Copy link
Member

domenic commented Feb 17, 2018

It might be good to put this in a separate file, if it's not too much trouble, so that browsers which don't implement the new syntax don't start suddenly failing all existing tests due to a SyntaxError in the same file.

@w3c-bots

This comment has been minimized.

Copy link

w3c-bots commented Feb 17, 2018

Build PASSED

Started: 2018-02-26 09:20:19
Finished: 2018-02-26 09:29:41

View more information about this build on:

littledan added a commit to littledan/html that referenced this pull request Feb 17, 2018

Normative: Permit serialization of BigInt wrappers
The goal of this PR is to integrate BigInt with HTML serialization.

This patch
- Adds BigInt to the "safe list" of primitives permitted for
  serialization.
- Adds serialization of BigInt wrappers, analogous to other wrappers.

Note that BigInt, like (the unserializable) Symbol does not have a
new-able constructor: use of wrappers is explicitly discouraged by
the specification. Nevertheless, this patch adds serialization support
for consistency with other wrappers.

web-platform-tests against postMessage on BigInt are out for review in
web-platform-tests/wpt#9565

littledan added a commit to littledan/html that referenced this pull request Feb 18, 2018

Normative: Permit serialization of BigInt wrappers
The goal of this PR is to integrate BigInt with HTML serialization.

This patch
- Adds BigInt to the "safe list" of primitives permitted for
  serialization.
- Adds serialization of BigInt wrappers, analogous to other wrappers.

Note that BigInt, like (the unserializable) Symbol does not have a
new-able constructor: use of wrappers is explicitly discouraged by
the specification. Nevertheless, this patch adds serialization support
for consistency with other wrappers.

web-platform-tests against postMessage on BigInt are out for review in
web-platform-tests/wpt#9565

@littledan littledan force-pushed the littledan:bigint-serialize branch from 4307bce to 44377c5 Feb 18, 2018

@littledan

This comment has been minimized.

Copy link
Contributor Author

littledan commented Feb 18, 2018

@domenic Good idea, split out into a separate file.

littledan added a commit to littledan/html that referenced this pull request Feb 18, 2018

Normative: Permit serialization of BigInt wrappers
The goal of this PR is to integrate BigInt with HTML serialization.

This patch
- Adds BigInt to the "safe list" of primitives permitted for
  serialization.
- Adds serialization of BigInt wrappers, analogous to other wrappers.

Note that BigInt, like (the unserializable) Symbol does not have a
new-able constructor: use of wrappers is explicitly discouraged by
the specification. Nevertheless, this patch adds serialization support
for consistency with other wrappers.

web-platform-tests against postMessage on BigInt are out for review in
web-platform-tests/wpt#9565
@littledan

This comment has been minimized.

Copy link
Contributor Author

littledan commented Feb 18, 2018

These tests are missing verification that BigInt and BigInt wrappers can be used as IndexedDB values (but not (yet) keys), although the PR in whatwg/html#3480 permits them to be used as such. The testing will come in a separate PR (once I figure out any other changes for BigInt that IndexedDB might need).

littledan added a commit to littledan/html that referenced this pull request Feb 22, 2018

Normative: Permit serialization of BigInt wrappers
The goal of this PR is to integrate BigInt with HTML serialization.

This patch
- Adds BigInt to the "safe list" of primitives permitted for
  serialization.
- Adds serialization of BigInt wrappers, analogous to other wrappers.

Note that BigInt, like (the unserializable) Symbol does not have a
new-able constructor: use of wrappers is explicitly discouraged by
the specification. Nevertheless, this patch adds serialization support
for consistency with other wrappers.

web-platform-tests against postMessage on BigInt are out for review in
web-platform-tests/wpt#9565

littledan added a commit to littledan/html that referenced this pull request Feb 23, 2018

Normative: Permit serialization of BigInt wrappers
The goal of this PR is to integrate BigInt with HTML serialization.

This patch
- Adds BigInt to the "safe list" of primitives permitted for
  serialization.
- Adds serialization of BigInt wrappers, analogous to other wrappers.

Note that BigInt, like (the unserializable) Symbol does not have a
new-able constructor: use of wrappers is explicitly discouraged by
the specification. Nevertheless, this patch adds serialization support
for consistency with other wrappers.

web-platform-tests against postMessage on BigInt are out for review in
web-platform-tests/wpt#9565

domenic added a commit to whatwg/html that referenced this pull request Feb 26, 2018

Permit structured serialization of BigInt
* Adds BigInt to the safelist of primitives permitted for serialization
* Adds serialization of BigInt wrappers, analogous to other wrappers

Tests: web-platform-tests/wpt#9565
@domenic
Copy link
Member

domenic left a comment

This could definitely be simplified and modernized but I think as long as we add a comment explaining that it's just aping its sibling this'll do fine.

<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type" />
<title>2.7 Safe passing of structured data</title>
<link rel="help" href="http://www.w3.org/TR/html5/common-dom-interfaces.html#safe-passing-of-structured-data" />

This comment has been minimized.

This comment has been minimized.

Copy link
@littledan

littledan Feb 26, 2018

Author Contributor

Done

<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>

This comment has been minimized.

Copy link
@domenic

domenic Feb 26, 2018

Member

Maybe add a note that this is supposed to be similar to its sibling, but is separate to avoid JS syntax errors? That'll help people who wonder at the strange style of the test.

This comment has been minimized.

Copy link
@littledan

littledan Feb 26, 2018

Author Contributor

Done

@littledan littledan force-pushed the littledan:bigint-serialize branch from 44377c5 to b308163 Feb 26, 2018

@littledan

This comment has been minimized.

Copy link
Contributor Author

littledan commented Feb 26, 2018

What's the convention here--should I land this myself now that it's been approved (seems like I have permissions), or wait for a maintainer to land it?

@annevk annevk merged commit c92168a into web-platform-tests:master Feb 26, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@annevk

This comment has been minimized.

Copy link
Member

annevk commented Feb 26, 2018

You should feel free to land it yourself in the future. Please do include links to the standard change PR in the commit message as I did when landing. Makes it easier to understand things in the future.

alice added a commit to alice/html that referenced this pull request Jan 8, 2019

Permit structured serialization of BigInt
* Adds BigInt to the safelist of primitives permitted for serialization
* Adds serialization of BigInt wrappers, analogous to other wrappers

Tests: web-platform-tests/wpt#9565
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.