| Summary: | Our structured cloning implementation does not encode all of RegExp's flags | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Chris Dumez <cdumez> | ||||||
| Component: | Bindings | Assignee: | Chris Dumez <cdumez> | ||||||
| Status: | RESOLVED FIXED | ||||||||
| Severity: | Normal | CC: | alecflett, beidson, cdumez, ews-watchlist, jsbell, webkit-bug-importer, ysuzuki | ||||||
| Priority: | P2 | Keywords: | InRadar | ||||||
| Version: | WebKit Nightly Build | ||||||||
| Hardware: | Unspecified | ||||||||
| OS: | Unspecified | ||||||||
| Attachments: |
|
||||||||
|
Description
Chris Dumez
2021-07-07 16:44:35 PDT
Created attachment 433093 [details]
Patch
Comment on attachment 433093 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=433093&action=review > Source/WebCore/bindings/js/SerializedScriptValue.cpp:1256 > flags[flagCount++] = 'i'; > if (regExp->regExp()->multiline()) > flags[flagCount++] = 'm'; > + if (regExp->regExp()->dotAll()) > + flags[flagCount++] = 's'; > + if (regExp->regExp()->unicode()) > + flags[flagCount++] = 'u'; > + if (regExp->regExp()->sticky()) > + flags[flagCount++] = 'y'; Need to add `hasIndices` flag ("d") too (this is new flag introduced super recently). Also, can you add a test for "d" flag case? (In reply to Yusuke Suzuki from comment #2) > Comment on attachment 433093 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=433093&action=review > > > Source/WebCore/bindings/js/SerializedScriptValue.cpp:1256 > > flags[flagCount++] = 'i'; > > if (regExp->regExp()->multiline()) > > flags[flagCount++] = 'm'; > > + if (regExp->regExp()->dotAll()) > > + flags[flagCount++] = 's'; > > + if (regExp->regExp()->unicode()) > > + flags[flagCount++] = 'u'; > > + if (regExp->regExp()->sticky()) > > + flags[flagCount++] = 'y'; > > Need to add `hasIndices` flag ("d") too (this is new flag introduced super > recently). > Also, can you add a test for "d" flag case? Will do, thanks for pointing that out. Created attachment 433105 [details]
Patch
Comment on attachment 433105 [details]
Patch
r=me
Committed r279706 (239498@main): <https://commits.webkit.org/239498@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 433105 [details]. |