RESOLVED FIXED188946
console.log() shows (anonymous function) instead of the passed string when a certain format is used
https://bugs.webkit.org/show_bug.cgi?id=188946
Summary console.log() shows (anonymous function) instead of the passed string when a ...
Alicia Boya García
Reported 2018-08-25 12:00:24 PDT
Created attachment 348079 [details] Screenshot of the problem in action How to reproduce: Run the following code: console.log("video:1:2"); console.log("video/mp4:1:2"); console.log("video/mp4 : 00:04:42-00:04:44"); Expected output: video:1:2 video/mp4:1:2 video/mp4 : 00:04:42-00:04:44 Actual output: [f] video:1:2 [N] (anonymous function) [N] (anonymous function) What's going on? The issue also reproduces when evaluating strings directly in the console, but not when they are enclosed in an array.
Attachments
Screenshot of the problem in action (16.54 KB, image/png)
2018-08-25 12:00 PDT, Alicia Boya García
no flags
Patch (2.11 KB, patch)
2018-08-28 00:36 PDT, Devin Rousso
no flags
Patch (2.32 KB, patch)
2018-08-28 00:44 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews103 for mac-sierra (2.29 MB, application/zip)
2018-08-28 01:36 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews114 for mac-sierra (3.04 MB, application/zip)
2018-08-28 02:30 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews106 for mac-sierra-wk2 (3.42 MB, application/zip)
2018-08-28 02:33 PDT, EWS Watchlist
no flags
Patch (2.35 KB, patch)
2018-08-28 10:05 PDT, Devin Rousso
no flags
Archive of layout-test-results from ews107 for mac-sierra-wk2 (3.29 MB, application/zip)
2018-08-28 11:58 PDT, EWS Watchlist
no flags
Patch (5.04 KB, patch)
2018-08-28 15:48 PDT, Devin Rousso
no flags
Joseph Pecoraro
Comment 1 2018-08-25 12:55:58 PDT
This seems like a heuristic gone bad! I think this is the "attempt to detect a callstack" code. That should probably only work if it seems multiple potential frames, not one.
Alicia Boya García
Comment 2 2018-08-25 14:50:35 PDT
(In reply to Joseph Pecoraro from comment #1) > This seems like a heuristic gone bad! I think this is the "attempt to detect > a callstack" code. That should probably only work if it seems multiple > potential frames, not one. Does it think it's a Error.stack and is trying to be helpful? How does that work, given that JSC `Error.stack` does not include line numbers nor a very distinct syntax?
Radar WebKit Bug Importer
Comment 3 2018-08-27 09:23:44 PDT
Devin Rousso
Comment 4 2018-08-28 00:36:56 PDT
Devin Rousso
Comment 5 2018-08-28 00:44:59 PDT
Created attachment 348272 [details] Patch Just saw Joe's comment. Added another condition relating to the number of lines/frames.
EWS Watchlist
Comment 6 2018-08-28 01:36:44 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 7 2018-08-28 01:36:46 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 8 2018-08-28 02:30:20 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 9 2018-08-28 02:30:22 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 10 2018-08-28 02:33:13 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 11 2018-08-28 02:33:15 PDT Comment hidden (obsolete)
Devin Rousso
Comment 12 2018-08-28 10:05:19 PDT
EWS Watchlist
Comment 13 2018-08-28 11:58:43 PDT Comment hidden (obsolete)
EWS Watchlist
Comment 14 2018-08-28 11:58:45 PDT Comment hidden (obsolete)
Blaze Burg
Comment 15 2018-08-28 14:52:42 PDT
Comment on attachment 348303 [details] Patch Code change seems fine, but you need to add new coverage to LayoutTests/inspector/console/js-isLikelyStackTrace.html
Devin Rousso
Comment 16 2018-08-28 15:48:28 PDT
Blaze Burg
Comment 17 2018-08-28 15:51:25 PDT
Comment on attachment 348356 [details] Patch r=me (wait for EWS)
WebKit Commit Bot
Comment 18 2018-08-28 18:36:45 PDT
Comment on attachment 348356 [details] Patch Clearing flags on attachment: 348356 Committed r235452: <https://trac.webkit.org/changeset/235452>
WebKit Commit Bot
Comment 19 2018-08-28 18:36:47 PDT
All reviewed patches have been landed. Closing bug.
Joseph Pecoraro
Comment 20 2018-09-19 12:33:22 PDT
*** Bug 189750 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.