зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8695461482b4 (bug 1580006) for ES Lint failure. CLOSED TREE
This commit is contained in:
Родитель
ecc722c789
Коммит
6d72ae6fae
|
@ -28,7 +28,6 @@ ErrorRep.propTypes = {
|
|||
function ErrorRep(props) {
|
||||
const object = props.object;
|
||||
const preview = object.preview;
|
||||
const mode = props.mode;
|
||||
|
||||
let name;
|
||||
if (preview && preview.name && preview.kind) {
|
||||
|
@ -48,13 +47,13 @@ function ErrorRep(props) {
|
|||
|
||||
const content = [];
|
||||
|
||||
if (mode === MODE.TINY) {
|
||||
if (props.mode === MODE.TINY) {
|
||||
content.push(name);
|
||||
} else {
|
||||
content.push(`${name}: "${preview.message}"`);
|
||||
}
|
||||
|
||||
if (preview.stack && (mode !== MODE.TINY && mode !== MODE.SHORT)) {
|
||||
if (preview.stack && props.mode !== MODE.TINY) {
|
||||
const stacktrace = props.renderStacktrace
|
||||
? props.renderStacktrace(parseStackString(preview.stack))
|
||||
: getStacktraceElements(props, preview);
|
||||
|
|
|
@ -225,15 +225,6 @@ exports[`Error - Reference error renders with expected text for ReferenceError 1
|
|||
</span>
|
||||
`;
|
||||
|
||||
exports[`Error - Simple error renders with error type and preview message when in short mode 1`] = `
|
||||
<span
|
||||
className="objectBox-stackTrace"
|
||||
data-link-actor-id="server1.conn1.child1/obj1021"
|
||||
>
|
||||
Error: "bar"
|
||||
</span>
|
||||
`;
|
||||
|
||||
exports[`Error - Simple error renders with expected text for simple error 1`] = `
|
||||
<span
|
||||
className="objectBox-stackTrace"
|
||||
|
|
|
@ -42,17 +42,6 @@ describe("Error - Simple error", () => {
|
|||
|
||||
expect(renderedComponent.text()).toEqual("Error");
|
||||
});
|
||||
|
||||
it("renders with error type and preview message when in short mode", () => {
|
||||
const renderedComponent = shallow(
|
||||
ErrorRep.rep({
|
||||
object: stubs.get("MultilineStackError"),
|
||||
mode: MODE.SHORT
|
||||
})
|
||||
);
|
||||
|
||||
expect(renderedComponent).toMatchSnapshot();
|
||||
});
|
||||
});
|
||||
|
||||
describe("Error - Multi line stack error", () => {
|
||||
|
|
|
@ -2969,7 +2969,6 @@ ErrorRep.propTypes = {
|
|||
function ErrorRep(props) {
|
||||
const object = props.object;
|
||||
const preview = object.preview;
|
||||
const mode = props.mode;
|
||||
let name;
|
||||
|
||||
if (preview && preview.name && preview.kind) {
|
||||
|
@ -2991,13 +2990,13 @@ function ErrorRep(props) {
|
|||
|
||||
const content = [];
|
||||
|
||||
if (mode === MODE.TINY) {
|
||||
if (props.mode === MODE.TINY) {
|
||||
content.push(name);
|
||||
} else {
|
||||
content.push(`${name}: "${preview.message}"`);
|
||||
}
|
||||
|
||||
if (preview.stack && mode !== MODE.TINY && mode !== MODE.SHORT) {
|
||||
if (preview.stack && props.mode !== MODE.TINY) {
|
||||
const stacktrace = props.renderStacktrace ? props.renderStacktrace(parseStackString(preview.stack)) : getStacktraceElements(props, preview);
|
||||
content.push(stacktrace);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче