Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to mask URLs in Error.stack.
https://bugs.webkit.org/show_bug.cgi?id=242278 rdar://81991245 Reviewed by Darin Adler and Yusuke Suzuki. Have StackFrame's toString consult a new overrideSourceURL() method on VM::ClientData that is implemented in WebCore's JSVMClientData that uses the new maskedURLForBindingsIfNeeded() to mask certain URLs from the Error.stack string returned to JavaScript. * Source/JavaScriptCore/inspector/ScriptCallStackFactory.cpp: (Inspector::extractSourceInformationFromException): Pass vm to getLineColumnAndSource(). (Inspector::createScriptCallStackFromException): Pass vm to sourceURL(). * Source/JavaScriptCore/runtime/Error.cpp: (JSC::getLineColumnAndSource): Add vm parameter and pass it to sourceURL(). (JSC::addErrorInfo): Pass vm to getLineColumnAndSource(). * Source/JavaScriptCore/runtime/Error.h: * Source/JavaScriptCore/runtime/ErrorInstance.cpp: (JSC::ErrorInstance::computeErrorInfo): Pass vm to getLineColumnAndSource(). * Source/JavaScriptCore/runtime/StackFrame.cpp: (JSC::StackFrame::sourceURL const): Add vm parameter and call overrideSourceURL() on clientData. (JSC::StackFrame::functionName const): Add some newlines. (JSC::StackFrame::toString const): Pass vm to sourceURL(). * Source/JavaScriptCore/runtime/StackFrame.h: (JSC::StackFrame::codeBlock const): Added. * Source/JavaScriptCore/runtime/VM.h: (JSC::VM::ClientData::overrideSourceURL const): Added. * Source/WebCore/bindings/js/WebCoreJSClientData.cpp: (WebCore::JSVMClientData::overrideSourceURL const): Added. Use maskedURLForBindingsIfNeeded() to mask sourceURLs. * Source/WebCore/bindings/js/WebCoreJSClientData.h: * Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewConfiguration.mm: (TEST(WebKit, ConfigurationMaskedURLSchemes)): Added user script tests with Error.stack. Canonical link: https://commits.webkit.org/252253@main
- Loading branch information
Showing
10 changed files
with
71 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters