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}
291 lines
7.8 KiB
Plaintext
291 lines
7.8 KiB
Plaintext
Checks that inspector reports script compiled in Runtime.evaluate, Runtime.callFunctionOn and Runtime.compileScript
|
|
Runtime.evaluate with valid expression
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
embedderName :
|
|
endColumn : 29
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : true
|
|
hash : 9f02f72adbd66ce9b25542198a9ae4244c0e4a7cb4c9e6de7eae8e5bcdec89e1
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 29
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : evaluate.js
|
|
}
|
|
}
|
|
Runtime.evaluate with syntax error
|
|
{
|
|
method : Debugger.scriptFailedToParse
|
|
params : {
|
|
embedderName :
|
|
endColumn : 39
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : true
|
|
hash : b9f2efcf5fc6c3698684af19785120e50faacceb498f330d2d9aa58f55ab3fdb
|
|
isModule : false
|
|
length : 39
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : evaluate-syntax-error.js
|
|
}
|
|
}
|
|
Runtime.callFunctionOn with valid functionDeclaration
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
embedderName :
|
|
endColumn : 18
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : 5692cb5b347ea5186169fa1d9b40a614b4e013edd0bc8e5dfbabd297f94c1061
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 18
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url :
|
|
}
|
|
}
|
|
Runtime.callFunctionOn with syntax error
|
|
{
|
|
method : Debugger.scriptFailedToParse
|
|
params : {
|
|
embedderName :
|
|
endColumn : 3
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : 4da27f5b363e9008d496aa9ac0b8be840fa300e28687f8eaa2e36bab085a3cc9
|
|
isModule : false
|
|
length : 3
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url :
|
|
}
|
|
}
|
|
Runtime.compileScript with valid expression
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
embedderName : compile-script.js
|
|
endColumn : 4
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : 5b8d2b991d2c1f5bf78beb557d17e6650086a267e5ffd4bb6f8aaa942c570f5d
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 4
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : compile-script.js
|
|
}
|
|
}
|
|
Runtime.compileScript with syntax error
|
|
{
|
|
method : Debugger.scriptFailedToParse
|
|
params : {
|
|
embedderName : compile-script-syntax-error.js
|
|
endColumn : 1
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : d10b36aa74a59bcf4a88185837f658afaf3646eff2bb16c3928d0e9335e945d2
|
|
isModule : false
|
|
length : 1
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : compile-script-syntax-error.js
|
|
}
|
|
}
|
|
Runtime.compileScript persistScript: false (should be no script events)
|
|
Runtime.evaluate compiled script with stack trace
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
embedderName :
|
|
endColumn : 8
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : a909749d912d72764320d9a0fc19ab5d0c271c3ad9b3926ef2f4fb17cd4e0caa
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 8
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url :
|
|
}
|
|
}
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
embedderName :
|
|
endColumn : 39
|
|
endLine : 4
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : true
|
|
hash : 6a42c4687a3966fa12f1bd6e8ef1ccf839a72d02a06cd130ea78734c1a13ffc5
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 86
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
stackTrace : {
|
|
callFrames : [
|
|
[0] : {
|
|
columnNumber : 2
|
|
functionName : fooTop
|
|
lineNumber : 2
|
|
scriptId : <scriptId>
|
|
url : top-frame.js
|
|
}
|
|
]
|
|
}
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : second-frame.js
|
|
}
|
|
}
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
embedderName :
|
|
endColumn : 4
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : 5b8d2b991d2c1f5bf78beb557d17e6650086a267e5ffd4bb6f8aaa942c570f5d
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 4
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
stackTrace : {
|
|
callFrames : [
|
|
[0] : {
|
|
columnNumber : 6
|
|
functionName : foo
|
|
lineNumber : 2
|
|
scriptId : <scriptId>
|
|
url : second-frame.js
|
|
}
|
|
]
|
|
}
|
|
startColumn : 0
|
|
startLine : 0
|
|
url :
|
|
}
|
|
}
|
|
Runtime.evaluate compile script error with stack trace
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
embedderName :
|
|
endColumn : 12
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : ea5b2bcb1e34045bcabc71bf027c9701e519dc72cc4d6f4a53987eec3d103ad5
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 12
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
startColumn : 0
|
|
startLine : 0
|
|
url :
|
|
}
|
|
}
|
|
{
|
|
method : Debugger.scriptParsed
|
|
params : {
|
|
embedderName :
|
|
endColumn : 48
|
|
endLine : 4
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : true
|
|
hash : 230feafbe3db3066a3abcc75fbe9a821bc52e92056bfdff0f42fd567156e0516
|
|
isLiveEdit : false
|
|
isModule : false
|
|
length : 98
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
stackTrace : {
|
|
callFrames : [
|
|
[0] : {
|
|
columnNumber : 2
|
|
functionName : fooTopFail
|
|
lineNumber : 2
|
|
scriptId : <scriptId>
|
|
url : top-frame-fail.js
|
|
}
|
|
]
|
|
}
|
|
startColumn : 0
|
|
startLine : 0
|
|
url : second-frame-fail.js
|
|
}
|
|
}
|
|
{
|
|
method : Debugger.scriptFailedToParse
|
|
params : {
|
|
embedderName :
|
|
endColumn : 3
|
|
endLine : 0
|
|
executionContextId : <executionContextId>
|
|
hasSourceURL : false
|
|
hash : 436a9b2e7c2aeaccc4bcb04d2c9c033a67cfcf5a8f3d0a0ab54d8b264e69b0b7
|
|
isModule : false
|
|
length : 3
|
|
scriptId : <scriptId>
|
|
scriptLanguage : JavaScript
|
|
sourceMapURL :
|
|
stackTrace : {
|
|
callFrames : [
|
|
[0] : {
|
|
columnNumber : 6
|
|
functionName : fooFail
|
|
lineNumber : 2
|
|
scriptId : <scriptId>
|
|
url : second-frame-fail.js
|
|
}
|
|
]
|
|
}
|
|
startColumn : 0
|
|
startLine : 0
|
|
url :
|
|
}
|
|
}
|