5e1f856d18
This change adds support for computing SHA-256 hashes in the stack output of errors by adding a function to the prototype of the `CallSite` object, passed to `Error.prepareStackTrace`. Additionally, it updates the `hash` property from `Debugger.scriptParsed` and `Debugger.scriptFailedToParse` to be SHA-256 instead of the proprietary hash it is today. It is intended to be an advancement in indexing source maps to support improved tooling, especially for post-hoc or in-production diagnostics scenarios. The explainer can be found here: https://docs.google.com/document/d/13hNeeLC2Ve_FVieNndZUUUP15x2O4ltvjnGWwOsMlrU/edit?usp=sharing Change-Id: Ifbbed4b22c8256e74e6d79974d2dd1e444143eda Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3229957 Reviewed-by: Yang Guo <yangguo@chromium.org> Reviewed-by: Shu-yu Guo <syg@chromium.org> Auto-Submit: Robert Paveza <Rob.Paveza@microsoft.com> Commit-Queue: Shu-yu Guo <syg@chromium.org> Reviewed-by: Benedikt Meurer <bmeurer@chromium.org> Cr-Commit-Position: refs/heads/main@{#80320}
131 lines
3.4 KiB
Plaintext
131 lines
3.4 KiB
Plaintext
Tests V8InspectorClient::resourceNameToUrl.
|
|
Check script with url:
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
embedderName : prefix://url
|
|
endColumn : 16
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : d61d14dd9c20e4ca03a76a585bac0049f3776ef54aa90758ecc7d233639a0681
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 16
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : prefix://url
|
|
}
|
|
}
|
|
Check script with sourceURL comment:
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
embedderName : prefix://url
|
|
endColumn : 37
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : true
|
|
hash : bbb04915bca73cbf949e5d836a0322915d6b7d917efe88d58591ca3e01aab524
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 37
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : foo.js
|
|
}
|
|
}
|
|
Check script failed to parse:
|
|
{
|
|
method : Debugger.scriptFailedToParse
|
|
params : {
|
|
embedderName : prefix://url
|
|
endColumn : 15
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : 5a1b7af9d5918fe9d1507381f2ed3f9c3056c49ab5864bb9da676a6a30b3d1b2
|
|
isModule : false
|
|
length : 15
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : prefix://url
|
|
}
|
|
}
|
|
Check script failed to parse with sourceURL comment:
|
|
{
|
|
method : Debugger.scriptFailedToParse
|
|
params : {
|
|
embedderName : prefix://url
|
|
endColumn : 36
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : true
|
|
hash : e6460482059772df0a321f1d9a9d54f257366f4af9b64310b272924d17e9edd0
|
|
isModule : false
|
|
length : 36
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : foo.js
|
|
}
|
|
}
|
|
Test runtime stack trace:
|
|
{
|
|
method : Runtime.consoleAPICalled
|
|
params : {
|
|
args : [
|
|
[0] : {
|
|
description : 42
|
|
type : number
|
|
value : 42
|
|
}
|
|
]
|
|
executionContextId : <executionContextId>
|
|
stackTrace : {
|
|
callFrames : [
|
|
[0] : {
|
|
columnNumber : 14
|
|
functionName : foo
|
|
lineNumber : 2
|
|
scriptId : <scriptId>
|
|
url : prefix://url
|
|
}
|
|
[1] : {
|
|
columnNumber : 0
|
|
functionName : eval
|
|
lineNumber : 0
|
|
scriptId : <scriptId>
|
|
url : boo.js
|
|
}
|
|
[2] : {
|
|
columnNumber : 4
|
|
functionName :
|
|
lineNumber : 4
|
|
scriptId : <scriptId>
|
|
url : prefix://url
|
|
}
|
|
]
|
|
}
|
|
timestamp : <timestamp>
|
|
type : log
|
|
}
|
|
}
|
|
Test debugger stack trace:
|
|
[
|
|
[0] :
|
|
[1] :
|
|
[2] :
|
|
]
|