html: Add tests to verify BigInt structured clone integration#9565
html: Add tests to verify BigInt structured clone integration#9565annevk merged 1 commit intoweb-platform-tests:masterfrom
Conversation
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
|
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. |
Build PASSEDStarted: 2018-02-26 09:20:19 View more information about this build on: |
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
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
4307bce to
44377c5
Compare
|
@domenic Good idea, split out into a separate file. |
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
|
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). |
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
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
* 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
left a comment
There was a problem hiding this 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" /> |
There was a problem hiding this comment.
| <script src="/resources/testharness.js"></script> | ||
| <script src="/resources/testharnessreport.js"></script> | ||
| </head> | ||
| <body> |
There was a problem hiding this comment.
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.
44377c5 to
b308163
Compare
|
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? |
|
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. |
* 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
These tests are against a PR which has not yet landed: whatwg/html#3480