49ad05f68f
Fetch message and stack trace from error object if Promise is rejected with native JS error. Bug: v8:6249 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_chromium_rel_ng Change-Id: Icf84205eb9d16e860600b7cc916ddcb1922be040 Reviewed-on: https://chromium-review.googlesource.com/563096 Reviewed-by: Jakob Gruber <jgruber@chromium.org> Commit-Queue: Aleksey Kozyatinskiy <kozyatinskiy@chromium.org> Cr-Commit-Position: refs/heads/master@{#46483}
184 lines
4.8 KiB
Plaintext
184 lines
4.8 KiB
Plaintext
Tests that Runtime.evaluate works with awaitPromise flag.
|
|
|
|
Running test: testResolvedPromise
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
description : 239
|
|
type : number
|
|
value : 239
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testRejectedPromise
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
exceptionDetails : {
|
|
columnNumber : 0
|
|
exception : {
|
|
description : 239
|
|
type : number
|
|
value : 239
|
|
}
|
|
exceptionId : <exceptionId>
|
|
lineNumber : 0
|
|
text : Uncaught (in promise)
|
|
}
|
|
result : {
|
|
description : 239
|
|
type : number
|
|
value : 239
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testRejectedPromiseWithError
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
exceptionDetails : {
|
|
columnNumber : 11
|
|
exception : {
|
|
className : Error
|
|
description : Error: MyError at foo (<anonymous>:13:11) at throwError (<anonymous>:15:3) at <anonymous>
|
|
objectId : <objectId>
|
|
subtype : error
|
|
type : object
|
|
}
|
|
exceptionId : <exceptionId>
|
|
lineNumber : 13
|
|
scriptId : <scriptId>
|
|
stackTrace : {
|
|
callFrames : [
|
|
[0] : {
|
|
columnNumber : 10
|
|
functionName : foo
|
|
lineNumber : 12
|
|
scriptId : <scriptId>
|
|
url :
|
|
}
|
|
[1] : {
|
|
columnNumber : 2
|
|
functionName : throwError
|
|
lineNumber : 14
|
|
scriptId : <scriptId>
|
|
url :
|
|
}
|
|
]
|
|
}
|
|
text : Uncaught (in promise) Error: MyError
|
|
}
|
|
result : {
|
|
className : Error
|
|
description : Error: MyError at foo (<anonymous>:13:11) at throwError (<anonymous>:15:3) at <anonymous>
|
|
objectId : <objectId>
|
|
subtype : error
|
|
type : object
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testRejectedPromiseWithSyntaxError
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
exceptionDetails : {
|
|
columnNumber : 5
|
|
exception : {
|
|
className : SyntaxError
|
|
description : SyntaxError: Unexpected token } at foo (<anonymous>:21:5) at throwSyntaxError (<anonymous>:23:3) at <anonymous>
|
|
objectId : <objectId>
|
|
subtype : error
|
|
type : object
|
|
}
|
|
exceptionId : <exceptionId>
|
|
lineNumber : 21
|
|
scriptId : <scriptId>
|
|
stackTrace : {
|
|
callFrames : [
|
|
[0] : {
|
|
columnNumber : 4
|
|
functionName : foo
|
|
lineNumber : 20
|
|
scriptId : <scriptId>
|
|
url :
|
|
}
|
|
[1] : {
|
|
columnNumber : 2
|
|
functionName : throwSyntaxError
|
|
lineNumber : 22
|
|
scriptId : <scriptId>
|
|
url :
|
|
}
|
|
]
|
|
}
|
|
text : Uncaught (in promise) SyntaxError: Unexpected token }
|
|
}
|
|
result : {
|
|
className : SyntaxError
|
|
description : SyntaxError: Unexpected token } at foo (<anonymous>:21:5) at throwSyntaxError (<anonymous>:23:3) at <anonymous>
|
|
objectId : <objectId>
|
|
subtype : error
|
|
type : object
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testPrimitiveValueInsteadOfPromise
|
|
{
|
|
error : {
|
|
code : -32000
|
|
message : Result of the evaluation is not a promise
|
|
}
|
|
id : <messageId>
|
|
}
|
|
|
|
Running test: testObjectInsteadOfPromise
|
|
{
|
|
error : {
|
|
code : -32000
|
|
message : Result of the evaluation is not a promise
|
|
}
|
|
id : <messageId>
|
|
}
|
|
|
|
Running test: testPendingPromise
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
result : {
|
|
type : object
|
|
value : {
|
|
a : 239
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
Running test: testExceptionInEvaluate
|
|
{
|
|
id : <messageId>
|
|
result : {
|
|
exceptionDetails : {
|
|
columnNumber : 0
|
|
exception : {
|
|
description : 239
|
|
type : number
|
|
value : 239
|
|
}
|
|
exceptionId : <exceptionId>
|
|
lineNumber : 0
|
|
scriptId : <scriptId>
|
|
text : Uncaught
|
|
}
|
|
result : {
|
|
description : 239
|
|
type : number
|
|
value : 239
|
|
}
|
|
}
|
|
}
|