RESOLVED FIXED 180664
Web Inspector: fix test case failures in js-isLikelyStackTrace.html
https://bugs.webkit.org/show_bug.cgi?id=180664
Summary Web Inspector: fix test case failures in js-isLikelyStackTrace.html
Blaze Burg
Reported 2017-12-11 12:12:34 PST
Rewriting this to be async-friendly has revealed that either the test or implementation is incorrect in 1/2 the test cases.
Attachments
[PATCH] Proposed Fix (9.19 KB, patch)
2018-09-11 13:37 PDT, Joseph Pecoraro
no flags
[PATCH] Proposed Fix (9.19 KB, patch)
2018-09-11 13:39 PDT, Joseph Pecoraro
no flags
[PATCH] Proposed Fix (10.48 KB, patch)
2018-09-11 13:48 PDT, Joseph Pecoraro
joepeck: commit-queue-
[PATCH] Proposed Fix (10.49 KB, patch)
2018-09-11 16:41 PDT, Joseph Pecoraro
no flags
Joseph Pecoraro
Comment 1 2018-09-11 13:37:53 PDT
Created attachment 349439 [details] [PATCH] Proposed Fix
Joseph Pecoraro
Comment 2 2018-09-11 13:38:47 PDT
Comment on attachment 349439 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=349439&action=review > Source/WebInspectorUI/UserInterface/Models/StackTrace.js:88 > + WI.StackTrace.likelyStackTraceRegex = new RegExp(`^${stackTraceLine}([\\n\\r]${stackTraceLine})+$`, "g"); Err, given this is a /^...$/ regex the "g" part is unnecessary... I'll remove that.
Joseph Pecoraro
Comment 3 2018-09-11 13:39:43 PDT
Created attachment 349441 [details] [PATCH] Proposed Fix
Joseph Pecoraro
Comment 4 2018-09-11 13:47:01 PDT
Comment on attachment 349441 [details] [PATCH] Proposed Fix I'm going to add a few explicit test cases instead of generating most of them.
Joseph Pecoraro
Comment 5 2018-09-11 13:48:33 PDT
Created attachment 349444 [details] [PATCH] Proposed Fix Reviewable now!
Devin Rousso
Comment 6 2018-09-11 15:09:48 PDT
Comment on attachment 349444 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=349444&action=review > LayoutTests/inspector/console/js-isLikelyStackTrace.html:-5 > -function typeErrorWrap() So I'm not sure how much of a difference this makes, but this function introduced another frame (both `typeErrorWrap` and `typeError`). Does that make a difference? The wrapped test used to fail whereas the "unwrapped" version doesn't, so I'm wondering if that made a difference to our heuristic somehow. > LayoutTests/inspector/console/js-isLikelyStackTrace.html:10 > console.trace(); Is this necessary? > LayoutTests/inspector/console/js-isLikelyStackTrace.html:74 > + "a@file:///ex.html:10:6\nb@file:///ex.html:7:6\nglobal code@file://ex.html:12:2", Did you mean to repeat this twice? > Source/WebInspectorUI/UserInterface/Models/StackTrace.js:83 > + if (!WI.StackTrace.likelyStackTraceRegex) { NIT: this should begin with a `_` since it is "private": WI.StackTrace._likelyStackTraceRegex
Joseph Pecoraro
Comment 7 2018-09-11 16:16:29 PDT
Comment on attachment 349444 [details] [PATCH] Proposed Fix View in context: https://bugs.webkit.org/attachment.cgi?id=349444&action=review >> LayoutTests/inspector/console/js-isLikelyStackTrace.html:-5 >> -function typeErrorWrap() > > So I'm not sure how much of a difference this makes, but this function introduced another frame (both `typeErrorWrap` and `typeError`). Does that make a difference? The wrapped test used to fail whereas the "unwrapped" version doesn't, so I'm wondering if that made a difference to our heuristic somehow. It shouldn't make a difference. There are still at least 2 frames (global code and typeError()). >> LayoutTests/inspector/console/js-isLikelyStackTrace.html:10 >> console.trace(); > > Is this necessary? It doesn't affect the test, but it looks nice when loading the test locally and debugging it. >> LayoutTests/inspector/console/js-isLikelyStackTrace.html:74 >> + "a@file:///ex.html:10:6\nb@file:///ex.html:7:6\nglobal code@file://ex.html:12:2", > > Did you mean to repeat this twice? Err, no an undo issue I think. This one was supposed to have moved the "global code" to the first frame to ensure things continue to work like that. >> Source/WebInspectorUI/UserInterface/Models/StackTrace.js:83 >> + if (!WI.StackTrace.likelyStackTraceRegex) { > > NIT: this should begin with a `_` since it is "private": > > WI.StackTrace._likelyStackTraceRegex kk
Joseph Pecoraro
Comment 8 2018-09-11 16:41:47 PDT
Created attachment 349490 [details] [PATCH] Proposed Fix
Devin Rousso
Comment 9 2018-09-12 09:07:47 PDT
Comment on attachment 349490 [details] [PATCH] Proposed Fix r=me
WebKit Commit Bot
Comment 10 2018-09-12 09:34:19 PDT
Comment on attachment 349490 [details] [PATCH] Proposed Fix Clearing flags on attachment: 349490 Committed r235939: <https://trac.webkit.org/changeset/235939>
WebKit Commit Bot
Comment 11 2018-09-12 09:34:20 PDT
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 12 2018-09-12 09:35:20 PDT
Note You need to log in before you can comment on or make changes to this bug.