| Summary: | Web Inspector: crash in DumpRenderTree at com.apple.JavaScriptCore: WTF::RefCountedBase::hasOneRef const | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Devin Rousso <hi> | ||||
| Component: | Web Inspector | Assignee: | Devin Rousso <hi> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | commit-queue, ddkilzer, ews-watchlist, hi, inspector-bugzilla-changes, joepeck, keith_miller, mark.lam, msaboff, saam, tzagallo, webkit-bug-importer | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Local Build | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Attachments: |
|
||||||
|
Description
Devin Rousso
2020-01-13 13:08:44 PST
Created attachment 387562 [details]
Patch
Comment on attachment 387562 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=387562&action=review r=me > Source/JavaScriptCore/debugger/Debugger.cpp:127 > + if (function->scope()->globalObject() == globalObject && function->executable()->isFunctionExecutable() && !function->isHostOrBuiltinFunction()) I would find this easier to read and modify in the future if this used early return conditions like it was before. For example: if (function->scope()->globalObject() != m_globalObject) return IterationStatus::Continue; if (!function->executable()->isFunctionExecutable()) return IterationStatus::Continue; if (function->isHostOrBuiltinFunction()) return IterationStatus::Continue; But I'll leave that style choice up to you. > Source/JavaScriptCore/debugger/Debugger.cpp:135 > + sourceParsed(globalObject, sourceProvider.get(), -1, nullString()); Is there a meaningful difference between switching to `nullString` here? Comment on attachment 387562 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=387562&action=review >> Source/JavaScriptCore/debugger/Debugger.cpp:127 >> + if (function->scope()->globalObject() == globalObject && function->executable()->isFunctionExecutable() && !function->isHostOrBuiltinFunction()) > > I would find this easier to read and modify in the future if this used early return conditions like it was before. For example: > > if (function->scope()->globalObject() != m_globalObject) > return IterationStatus::Continue; > > if (!function->executable()->isFunctionExecutable()) > return IterationStatus::Continue; > > if (function->isHostOrBuiltinFunction()) > return IterationStatus::Continue; > > But I'll leave that style choice up to you. I personally find the single `return` to be easier to read, especially in this case as it makes it super clear that we are _always_ expecting to continue iterating (rather than having to read each `return` to see that). >> Source/JavaScriptCore/debugger/Debugger.cpp:135 >> + sourceParsed(globalObject, sourceProvider.get(), -1, nullString()); > > Is there a meaningful difference between switching to `nullString` here? No, as the `-1` effectively causes it to be ignored. I was just trying to avoid another allocation with `String()`. Comment on attachment 387562 [details] Patch Clearing flags on attachment: 387562 Committed r254523: <https://trac.webkit.org/changeset/254523> All reviewed patches have been landed. Closing bug. |