Bug 160374 - [WebIDL] Enable strict type checking for operations' nullable parameters of wrapper types
Summary: [WebIDL] Enable strict type checking for operations' nullable parameters of w...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Bindings (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar, WebExposed
Depends on:
Blocks: 160382
  Show dependency treegraph
 
Reported: 2016-07-29 20:26 PDT by Chris Dumez
Modified: 2017-02-21 12:51 PST (History)
10 users (show)

See Also:


Attachments
Patch (32.00 KB, patch)
2016-07-29 20:38 PDT, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2016-07-29 20:26:21 PDT
Enable strict type checking for operations' nullable parameters of wrapper types to comply with the Web IDL specification:
- http://heycam.github.io/webidl/#es-nullable-type
- http://heycam.github.io/webidl/#es-interface

For such parameters, if the JS passes a value that is not null / undefined and does not have the expected wrapper type, then we now throw a TypeError instead of silently converting the value to null.

This behavior is consistent with Chrome and Firefox. It also helps identify bugs in JavaScript code.
Comment 1 Chris Dumez 2016-07-29 20:38:48 PDT
Created attachment 284932 [details]
Patch
Comment 2 youenn fablet 2016-07-30 01:15:32 PDT
Comment on attachment 284932 [details]
Patch

r=me
Comment 3 WebKit Commit Bot 2016-07-30 01:36:23 PDT
Comment on attachment 284932 [details]
Patch

Clearing flags on attachment: 284932

Committed r203941: <http://trac.webkit.org/changeset/203941>
Comment 4 WebKit Commit Bot 2016-07-30 01:36:29 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Radar WebKit Bug Importer 2017-02-21 12:51:36 PST
<rdar://problem/30637643>