| Summary: | JSON.stringify should emit non own properties if second array argument includes | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | zac spitzer <zac.spitzer> | ||||||
| Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | cdumez, commit-queue, ews-watchlist, keith_miller, mark.lam, msaboff, saam, sam, webkit-bug-importer, youennf, ysuzuki | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | Safari 11 | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| See Also: | https://bugs.webkit.org/show_bug.cgi?id=187807 | ||||||||
| Attachments: |
|
||||||||
|
Description
zac spitzer
2018-07-16 19:43:52 PDT
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. but I'm passing in an array of ['code','name','message'] as a replacer to stringify which should pluck those values out? Ah, I missed the point. The second argument array forces us to emit properties even if it is not an own property. Created attachment 345235 [details]
Patch
Comment on attachment 345235 [details] Patch Attachment 345235 [details] did not pass win-ews (win): Output: https://webkit-queues.webkit.org/results/8573642 New failing tests: http/tests/security/local-video-source-from-remote.html Created attachment 345237 [details]
Archive of layout-test-results from ews206 for win-future
The attached test failures were seen while running run-webkit-tests on the win-ews.
Bot: ews206 Port: win-future Platform: CYGWIN_NT-6.1-2.9.0-0.318-5-3-x86_64-64bit
Comment on attachment 345235 [details]
Patch
r=me
Comment on attachment 345235 [details]
Patch
Thank you!
Comment on attachment 345235 [details] Patch Clearing flags on attachment: 345235 Committed r233924: <https://trac.webkit.org/changeset/233924> All reviewed patches have been landed. Closing bug. |