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

Unified Diff: bootstrap/win/get_file.js

Issue 102004: Fix a typo in get_files.js. Also fix style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools/
Patch Set: Created 11 years, 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: bootstrap/win/get_file.js
===================================================================
--- bootstrap/win/get_file.js (revision 14731)
+++ bootstrap/win/get_file.js (working copy)
@@ -6,7 +6,6 @@
if (verbose) {
WScript.StdOut.Write(" * GET " + url + "...");
}
- var response_body = null;
try {
xml_http = new ActiveXObject("MSXML2.ServerXMLHTTP");
} catch (e) {
@@ -21,8 +20,10 @@
": invalid URL.");
WScript.Quit(1);
}
+
+ var response_body = null;
var size_description = "?";
- var file_size
+ var file_size;
try {
xml_http.send(null);
if (xml_http.status != 200) {
@@ -60,7 +61,7 @@
adodb_stream.Type = 1; // 1= Binary
adodb_stream.Open(); // Open the stream
adodb_stream.Write(response_body); // Write the data
- adodb_stream.SaveTfile(path, 2); // Save to our destination
+ adodb_stream.SaveToFile(path, 2); // Save to our destination
adodb_stream.Close();
} catch(e) {
WScript.StdOut.WriteLine("[-] ADODB.Stream " + new Number(
@@ -68,8 +69,8 @@
WScript.Quit(1);
}
if (typeof(file_size) != undefined) {
- file_system_object = WScript.CreateObject("Scripting.FileSystemObject")
- file = file_system_object.GetFile(path)
+ var file_system_object = WScript.CreateObject("Scripting.FileSystemObject")
+ var file = file_system_object.GetFile(path)
if (file.Size < file_size) {
WScript.StdOut.WriteLine("[-] File only partially downloaded.");
WScript.Quit(1);
@@ -80,6 +81,7 @@
}
}
+// Utilities
Number.prototype.isInt = function NumberIsInt() {
return this % 1 == 0;
};
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698