This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 27305 - "Perform type mapping as specified in [WEBIDL] for data."
Summary: "Perform type mapping as specified in [WEBIDL] for data."
Status: RESOLVED FIXED
Alias: None
Product: Web Cryptography
Classification: Unclassified
Component: Web Cryptography API Document (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Ryan Sleevi
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-11-11 20:06 UTC by Anne
Modified: 2016-05-23 22:47 UTC (History)
3 users (show)

See Also:


Attachments

Description Anne 2014-11-11 20:06:22 UTC
IDL does this before the algorithm is invoked so there is no need to have this step anywhere. Also, the point where you try to perform it would lead to racing issues, as that part (potentially) runs in parallel with other JavaScript in the document.
Comment 1 Ryan Sleevi 2014-11-11 20:11:21 UTC
Could you provide clarification as to which instance you're talking about? I believe it's https://dvcs.w3.org/hg/webcrypto-api/raw-file/6694484cc545/spec/Overview.html#SubtleCrypto-method-wrapKey for jwk, but I wanted to make sure?

I'm not sure the racing issues you describe, or why they'd be any different than http://heycam.github.io/webidl/#es-promise , but I guess if you can explain your concern in more detail, we can see what can be done.
Comment 2 Anne 2014-11-11 20:31:28 UTC
I was looking at an outdated version of the draft that used it more frequently.

The problem with converting a value late rather than at the boundary is that it can invoke JavaScript that runs in the scope of the page (ToObject, ToString, etc. have side effects). Now if you invoke JavaScript in parallel with other JavaScript, you've hit something that's undefined and will most likely crash.

Anyway, there in step 14 /key/ will already have been converted due to it crossing the boundaries JavaScript -> IDL -> API specification, so you can just remove the statement and be done with it.
Comment 3 Mark Watson 2016-05-23 22:47:25 UTC
I believe this has already been fixed.

Step 14 or wrapKey refers to conversion *back* from an IDL object to an ECMAScript object which can then be stringified in the next step.