From ac6a5ef4affc25c6b330a8e56fec35ff1a717df3 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Fri, 16 Jan 2009 20:40:16 +0000 Subject: [PATCH] Cleanup: use destructuring assignment For multiple return values use let [val1, val2, val3] = function(); Rather than: temp = function(); val1 = temp[0]; ... svn path=/trunk/; revision=149 --- js/ui/docDisplay.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/js/ui/docDisplay.js b/js/ui/docDisplay.js index badce3010..c9af0cf54 100644 --- a/js/ui/docDisplay.js +++ b/js/ui/docDisplay.js @@ -65,11 +65,7 @@ DocDisplayItem.prototype = { // Opens a document represented by this display item. launch : function() { let appName = this._docInfo.last_application(); - let appData = this._docInfo.get_application_info(appName); - let success = appData[0]; - let appExec = appData[1]; - let count = appData[2]; - let time = appData[3]; + let [success, appExec, count, time] = this._docInfo.get_application_info(appName); if (success) { log("Will open a document with the following command: " + appExec); // TODO: Change this once better support for creating GAppInfo is added to