Summary: | Function object should convert params to string before throw a parsing error | ||||||
---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Sotero Jr <srsj2> | ||||
Component: | JavaScriptCore | Assignee: | Yusuke Suzuki <ysuzuki> | ||||
Status: | RESOLVED FIXED | ||||||
Severity: | Normal | CC: | darin, ews-watchlist, fpizlo, keith_miller, mark.lam, msaboff, saam, webkit-bug-importer, ysuzuki | ||||
Priority: | P2 | Keywords: | InRadar | ||||
Version: | Safari 11 | ||||||
Hardware: | Unspecified | ||||||
OS: | macOS 10.13 | ||||||
Attachments: |
|
Description
Sotero Jr
2018-08-22 17:49:37 PDT
Created attachment 348075 [details]
Patch
Comment on attachment 348075 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348075&action=review > Source/JavaScriptCore/ChangeLog:9 > + ToString operation onto the `body` of the Function constructor should be performed > + before checking syntax correctness of the parameters. I have no doubt that this is better, but I wonder where these semantics are defined and tested unambiguously. There must be lots of other cases where the order of evaluation side effect is visible, and the new test covers just this one. (In reply to Darin Adler from comment #2) > Comment on attachment 348075 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=348075&action=review > > > Source/JavaScriptCore/ChangeLog:9 > > + ToString operation onto the `body` of the Function constructor should be performed > > + before checking syntax correctness of the parameters. > > I have no doubt that this is better, but I wonder where these semantics are > defined and tested unambiguously. There must be lots of other cases where > the order of evaluation side effect is visible, and the new test covers just > this one. It's defined here: https://tc39.github.io/ecma262/#sec-createdynamicfunction I agree that it would be nice to add some more tests that stress the order of evaluation, including the order of toString on the parameters. Comment on attachment 348075 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=348075&action=review Thanks! >>> Source/JavaScriptCore/ChangeLog:9 >>> + before checking syntax correctness of the parameters. >> >> I have no doubt that this is better, but I wonder where these semantics are defined and tested unambiguously. There must be lots of other cases where the order of evaluation side effect is visible, and the new test covers just this one. > > It's defined here: > https://tc39.github.io/ecma262/#sec-createdynamicfunction > > I agree that it would be nice to add some more tests that stress the order of evaluation, including the order of toString on the parameters. I've added the test checking the order of toString onto the arguments of Function constructor. Committed r235582: <https://trac.webkit.org/changeset/235582> |