[Download] Fix URL property issue
authorDeqing Huang <deqing.huang@intel.com>
Tue, 3 Dec 2013 10:29:12 +0000 (18:29 +0800)
committerDeqing Huang <deqing.huang@intel.com>
Tue, 3 Dec 2013 10:29:12 +0000 (18:29 +0800)
Bug-tracking: https://crosswalk-project.org/jira/browse/XWALK-599

download/download_api.js

index 22c1c0c..fb0691e 100644 (file)
@@ -216,10 +216,20 @@ tizen.DownloadRequest = function(url, destination, fileName, networkType) {
     }
   });
 
+  var url_;
+  Object.defineProperty(this, 'url', {
+    get: function() { return this.url_; },
+    set: function(value) {
+      if (value != null) {
+        this.url_ = value;
+      }
+    }
+  });
+  this.url_ = url;
+
   if (!(this instanceof tizen.DownloadRequest)) {
     throw new tizen.WebAPIException(tizen.WebAPIException.TYPE_MISMATCH_ERR);
   }
-  this.url = url;
   this.uid = ++currentUID;
   this.destination = asValidString(destination);
   this.fileName = asValidString(fileName);