Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: ui/file_manager/file_manager/foreground/js/ui/location_line.js

Issue 1010163002: Files.app: Fix closure error which will raised by the updated compiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Define FakeEntry record type and use it. Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/file_manager/file_manager/foreground/js/ui/location_line.js
diff --git a/ui/file_manager/file_manager/foreground/js/ui/location_line.js b/ui/file_manager/file_manager/foreground/js/ui/location_line.js
index 564bc49ea617693a070291321db731208b6c7668..14281203c18eb51e32e1a9214ad4454c67e2556c 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/location_line.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/location_line.js
@@ -24,7 +24,7 @@ LocationLine.prototype.__proto__ = cr.EventTarget.prototype;
/**
* Shows breadcrumbs. This operation is done without IO.
*
- * @param {!Entry|!Object} entry Target entry or fake entry.
+ * @param {!Entry|!FakeEntry} entry Target entry or fake entry.
*/
LocationLine.prototype.show = function(entry) {
if (entry === this.entry_)
@@ -35,7 +35,7 @@ LocationLine.prototype.show = function(entry) {
/**
* Get components for the path of entry.
- * @param {!Entry|!Object} entry An entry.
+ * @param {!Entry|!FakeEntry} entry An entry.
* @return {!Array<!LocationLine.PathComponent>} Components.
* @private
*/
@@ -48,7 +48,8 @@ LocationLine.prototype.getComponents_ = function(entry) {
if (util.isFakeEntry(entry)) {
components.push(new LocationLine.PathComponent(
- util.getRootTypeLabel(locationInfo), entry.toURL(), entry));
+ util.getRootTypeLabel(locationInfo), entry.toURL(),
+ /** @type {!FakeEntry} */ (entry)));
return components;
}
@@ -252,8 +253,8 @@ LocationLine.prototype.execute_ = function(element, pathComponent) {
* Path component.
* @param {string} name Name.
* @param {string} url Url.
- * @param {Object=} opt_fakeEntry Fake entry should be set when this component
- * represents fake entry.
+ * @param {FakeEntry=} opt_fakeEntry Fake entry should be set when this
+ * component represents fake entry.
* @constructor
* @struct
*/
@@ -265,11 +266,13 @@ LocationLine.PathComponent = function(name, url, opt_fakeEntry) {
/**
* Resolve an entry of the component.
- * @return {!Promise<!Entry|!Object>} A promise which is resolved with an entry.
+ * @return {!Promise<!Entry|!FakeEntry>} A promise which is resolved with an
+ * entry.
*/
LocationLine.PathComponent.prototype.resolveEntry = function() {
if (this.fakeEntry_)
- return Promise.resolve(this.fakeEntry_);
+ return /** @type {!Promise<!Entry|!FakeEntry>} */ (
+ Promise.resolve(this.fakeEntry_));
else
return new Promise(
window.webkitResolveLocalFileSystemURL.bind(null, this.url_));

Powered by Google App Engine
This is Rietveld 408576698