Commit defbef78 authored by Alexei Filippov's avatar Alexei Filippov Committed by Commit Bot

[inspector] An Error with no stack description should not be empty

Make the description return the class name as it used to be.

BUG=chromium:919292

Change-Id: Idbc07643f15014a39a08a545a5003be891d95bd3
Reviewed-on: https://chromium-review.googlesource.com/c/1416318Reviewed-by: 's avatarDmitry Gozman <dgozman@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#58867}
parent ba363c75
......@@ -205,7 +205,7 @@ String16 descriptionForError(v8::Local<v8::Context> context,
if (!object->Get(context, toV8String(isolate, "stack"))
.ToLocal(&stackValue) ||
!stackValue->IsString()) {
return String16();
return className;
}
String16 stack = toProtocolString(isolate, stackValue.As<v8::String>());
String16 description = stack;
......
......@@ -1424,6 +1424,18 @@ Running test: testError
}
}
Running test: testCustomError
'class CustomError extends Error {}; a = new CustomError(); delete a.stack; a', returnByValue: false, generatePreview: false
{
result : {
className : CustomError
description : CustomError
objectId : <objectId>
subtype : error
type : object
}
}
Running test: testProxy
'new Proxy({}, {})', returnByValue: false, generatePreview: false
{
......
......@@ -414,6 +414,11 @@ InspectorTest.runAsyncTestSuite([
returnByValue: true
})).result);
},
async function testCustomError() {
InspectorTest.logMessage((await evaluate({
expression: `class CustomError extends Error {}; a = new CustomError(); delete a.stack; a`
})).result);
},
async function testProxy() {
InspectorTest.logMessage((await evaluate({
expression: 'new Proxy({}, {})'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment