Bug 1316265 - Reps: display when a function is a generator or an async function. r=nchevobbe

MozReview-Commit-ID: C79EAU4vN1u
This commit is contained in:
Tim Nguyen
2016-12-20 15:34:50 +01:00
parent b4e4753790
commit a5667774eb
3 changed files with 209 additions and 10 deletions

View File

@@ -27,16 +27,24 @@ define(function (require, exports, module) {
},
getTitle: function (grip) {
let title = "function ";
if (grip.isGenerator) {
title = "function* ";
}
if (grip.isAsync) {
title = "async " + title;
}
if (this.props.objectLink) {
return this.props.objectLink({
object: grip
}, "function ");
}, title);
}
return "";
return title;
},
summarizeFunction: function (grip) {
let name = grip.userDisplayName || grip.displayName || grip.name || "function";
let name = grip.userDisplayName || grip.displayName || grip.name || "";
return cropString(name + "()", 100);
},