[Webkit-unassigned] [Bug 187724] JSON.stringify on a DOM Exception behaves different to other browsers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jul 17 17:22:14 PDT 2018


https://bugs.webkit.org/show_bug.cgi?id=187724

Yusuke Suzuki <utatane.tea at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |cdumez at apple.com,
                   |                            |sam at webkit.org,
                   |                            |youennf at gmail.com

--- Comment #2 from Yusuke Suzuki <utatane.tea at gmail.com> ---
It seems that WebKit behavior is correct, but I would like to hear opinions from binding folks. My understanding is the following.

According to DOMException's IDL, defined in WebIDL.

https://heycam.github.io/webidl/#idl-DOMException

interface DOMException { // but see below note about ECMAScript binding
  readonly attribute DOMString name;
  readonly attribute DOMString message;
  readonly attribute unsigned short code;

  const unsigned short INDEX_SIZE_ERR = 1;
...

This definition says that "name", "message", and "code" are readonly attributes. So they should be defined as getters in DOMException.prototype.

>From the point of view of JSC, this makes `JSON.stringify(error)` empty since "name", "message", and "code" are not own properties.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20180718/ecb062a2/attachment.html>


More information about the webkit-unassigned mailing list