From 72d38a68356e5969d548de4237219ffafa5cfb85 Mon Sep 17 00:00:00 2001 From: "ISHIKAWA, Chiaki" Date: Mon, 15 Feb 2016 08:57:00 +0100 Subject: [PATCH] Bug 1248252 - Improper outdated octal constant syntax in M-C tree. Use '0o' prefix. r=dao Be warned. Do not attemp to change the .js "test" source code in ./js They are meant to check - the outdated 0666 octal constant is still parsed correctly, - the outdated 0666 octal constant raises syntax error flag in strict mode, etc. So leave them alone. --- addon-sdk/source/lib/sdk/io/fs.js | 4 +- b2g/components/HelperAppDialog.js | 4 +- browser/base/content/sync/utils.js | 2 +- .../general/browser_save_link-perwindowpb.js | 2 +- ...browser_save_link_when_window_navigates.js | 2 +- .../browser_save_private_link_perwindowpb.js | 2 +- .../test/general/browser_save_video.js | 2 +- .../test/general/browser_save_video_frame.js | 2 +- .../browser_privatebrowsing_opendir.js | 2 +- .../test/browser_backup_recovery.js | 2 +- devtools/client/projecteditor/test/head.js | 2 +- .../test/browser_scratchpad_confirm_close.js | 4 +- .../apps/tests/debugger-protocol-helper.js | 2 +- dom/base/test/bug578096LoadChromeScript.js | 2 +- dom/base/test/file_bug1198095.js | 2 +- dom/base/test/fileapi_chromeScript.js | 2 +- dom/base/test/unit/head_xml.js | 2 +- .../test/unit/test_blob_file_backed.js | 2 +- dom/json/test/unit/test_encode.js | 6 +-- dom/plugins/test/unit/test_bug455213.js | 2 +- dom/plugins/test/unit/test_bug813245.js | 2 +- .../test/unit/test_persist_in_prefs.js | 2 +- dom/workers/test/fileapi_chromeScript.js | 2 +- .../test/unit/test_permmanager_defaults.js | 2 +- .../test/unit/test_permmanager_removeall.js | 4 +- .../hunspell/tests/unit/test_hunspell.js | 2 +- image/test/unit/test_imgtools.js | 2 +- js/src/jit-test/lib/bullet.js | 44 +++++++++---------- .../layout-debug/ui/content/layoutdebug.js | 2 +- .../webrtc/trunk/webrtc/tools/rtcbot/test.js | 2 +- mobile/android/components/HelperAppDialog.js | 4 +- mobile/android/components/SessionStore.js | 2 +- modules/libjar/test/unit/test_umlaute.js | 2 +- .../test/unit/test_zippermissions.js | 2 +- modules/libmar/tests/unit/head_libmar.js | 6 +-- modules/libmar/tests/unit/test_extract.js | 2 +- modules/libpref/test/unit/test_libPrefs.js | 2 +- netwerk/test/httpserver/test/head_utils.js | 2 +- .../test/test_default_index_handler.js | 4 +- netwerk/test/unit/test_NetUtil.js | 8 ++-- netwerk/test/unit/test_bug414122.js | 2 +- .../unit/test_file_partial_inputstream.js | 6 +-- netwerk/test/unit/test_file_protocol.js | 2 +- netwerk/test/unit/test_filestreams.js | 4 +- .../manager/pki/resources/content/pippki.js | 2 +- .../tests/unit/test_sss_readstate_empty.js | 2 +- security/manager/tools/makeCNNICHashes.js | 2 +- .../sync/tests/unit/test_bookmark_engine.js | 2 +- .../pageloader/chrome/MozillaFileLogger.js | 2 +- .../talos/talos/scripts/MozillaFileLogger.js | 2 +- .../jsdownloads/test/unit/test_PrivateTemp.js | 2 +- .../test_osfile_async_setPermissions.js | 2 +- .../tests/unit/test_handlerService.js | 2 +- xpcom/ds/nsINIProcessor.js | 2 +- xpcom/tests/unit/test_bug364285-1.js | 4 +- xpcom/tests/unit/test_bug476919.js | 2 +- xpcom/tests/unit/test_file_createUnique.js | 2 +- xpcom/tests/unit/test_hidden_files.js | 2 +- xpcom/tests/unit/test_localfile.js | 6 +-- xpcom/tests/unit/test_symlinks.js | 6 +-- xpcom/tests/unit/test_windows_shortcut.js | 44 +++++++++---------- 61 files changed, 124 insertions(+), 124 deletions(-) diff --git a/addon-sdk/source/lib/sdk/io/fs.js b/addon-sdk/source/lib/sdk/io/fs.js index af9853bcd65..1768eefac93 100644 --- a/addon-sdk/source/lib/sdk/io/fs.js +++ b/addon-sdk/source/lib/sdk/io/fs.js @@ -121,8 +121,8 @@ function remove(path, recursive) { /** * Utility function to convert either an octal number or string * into an octal number - * 0777 => 0777 - * "0644" => 0644 + * 0777 => 0o777 + * "0644" => 0o644 */ function Mode(mode, fallback) { return isString(mode) ? parseInt(mode, 8) : mode || fallback; diff --git a/b2g/components/HelperAppDialog.js b/b2g/components/HelperAppDialog.js index a15572820c1..3709833e165 100644 --- a/b2g/components/HelperAppDialog.js +++ b/b2g/components/HelperAppDialog.js @@ -89,7 +89,7 @@ HelperAppLauncherDialog.prototype = { aLocalFile.leafName = aLocalFile.leafName.replace(/^(.*\()\d+\)/, "$1" + (collisionCount+1) + ")"); } } - aLocalFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0600); + aLocalFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); } catch (e) { dump("*** exception in makeFileUnique: " + e + "\n"); @@ -100,7 +100,7 @@ HelperAppLauncherDialog.prototype = { if (aLocalFile.leafName == "" || aLocalFile.isDirectory()) { aLocalFile.append("unnamed"); if (aLocalFile.exists()) - aLocalFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600); + aLocalFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); } } }, diff --git a/browser/base/content/sync/utils.js b/browser/base/content/sync/utils.js index 6d5562d6e30..7c6157369fc 100644 --- a/browser/base/content/sync/utils.js +++ b/browser/base/content/sync/utils.js @@ -2,7 +2,7 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -// Equivalent to 0600 permissions; used for saved Sync Recovery Key. +// Equivalent to 0o600 permissions; used for saved Sync Recovery Key. // This constant can be replaced when the equivalent values are available to // chrome JS; see Bug 433295 and Bug 757351. const PERMISSIONS_RWUSR = 0x180; diff --git a/browser/base/content/test/general/browser_save_link-perwindowpb.js b/browser/base/content/test/general/browser_save_link-perwindowpb.js index 3b14a01425a..e40459e2228 100644 --- a/browser/base/content/test/general/browser_save_link-perwindowpb.js +++ b/browser/base/content/test/general/browser_save_link-perwindowpb.js @@ -200,7 +200,7 @@ function createTemporarySaveDirectory() { saveDir.append("testsavedir"); if (!saveDir.exists()) { info("create testsavedir!"); - saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0755); + saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); } info("return from createTempSaveDir: " + saveDir.path); return saveDir; diff --git a/browser/base/content/test/general/browser_save_link_when_window_navigates.js b/browser/base/content/test/general/browser_save_link_when_window_navigates.js index b2c34a5cb1f..bb3ed3e3607 100644 --- a/browser/base/content/test/general/browser_save_link_when_window_navigates.js +++ b/browser/base/content/test/general/browser_save_link_when_window_navigates.js @@ -20,7 +20,7 @@ function createTemporarySaveDirectory() { saveDir.append("testsavedir"); if (!saveDir.exists()) { info("create testsavedir!"); - saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0755); + saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); } info("return from createTempSaveDir: " + saveDir.path); return saveDir; diff --git a/browser/base/content/test/general/browser_save_private_link_perwindowpb.js b/browser/base/content/test/general/browser_save_private_link_perwindowpb.js index 36744734976..aee2d499f94 100644 --- a/browser/base/content/test/general/browser_save_private_link_perwindowpb.js +++ b/browser/base/content/test/general/browser_save_private_link_perwindowpb.js @@ -53,7 +53,7 @@ function test() { .get("TmpD", Ci.nsIFile); saveDir.append("testsavedir"); if (!saveDir.exists()) - saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0755); + saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); return saveDir; } diff --git a/browser/base/content/test/general/browser_save_video.js b/browser/base/content/test/general/browser_save_video.js index c13c78cabe9..e81286b7aab 100644 --- a/browser/base/content/test/general/browser_save_video.js +++ b/browser/base/content/test/general/browser_save_video.js @@ -82,6 +82,6 @@ function createTemporarySaveDirectory() { .get("TmpD", Ci.nsIFile); saveDir.append("testsavedir"); if (!saveDir.exists()) - saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0755); + saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); return saveDir; } diff --git a/browser/base/content/test/general/browser_save_video_frame.js b/browser/base/content/test/general/browser_save_video_frame.js index 0b0469300ac..c81f9a78e5e 100644 --- a/browser/base/content/test/general/browser_save_video_frame.js +++ b/browser/base/content/test/general/browser_save_video_frame.js @@ -24,7 +24,7 @@ function createTemporarySaveDirectory() { .get("TmpD", Ci.nsIFile); saveDir.append("testsavedir"); if (!saveDir.exists()) - saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0755); + saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); return saveDir; } /** diff --git a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_opendir.js b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_opendir.js index 1a14385a315..0b1369b115a 100644 --- a/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_opendir.js +++ b/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_opendir.js @@ -30,7 +30,7 @@ function test() { let dir2 = ds.get("TmpD", Ci.nsIFile); let file = dir2.clone(); file.append("pbtest.file"); - file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); const kPrefName = "browser.open.lastDir"; diff --git a/browser/components/sessionstore/test/browser_backup_recovery.js b/browser/components/sessionstore/test/browser_backup_recovery.js index 799cc9be930..81f6788560b 100644 --- a/browser/components/sessionstore/test/browser_backup_recovery.js +++ b/browser/components/sessionstore/test/browser_backup_recovery.js @@ -141,7 +141,7 @@ add_task(function* test_recovery_inaccessible() { yield File.setPermissions(Paths.recovery, { unixMode: 0 }); is((yield SessionFile.read()).source, SOURCE, "Recovered the correct source from the recovery file"); - yield File.setPermissions(Paths.recovery, { unixMode: 0644 }); + yield File.setPermissions(Paths.recovery, { unixMode: 0o644 }); }); add_task(function* test_clean() { diff --git a/devtools/client/projecteditor/test/head.js b/devtools/client/projecteditor/test/head.js index f4bed6b022d..c1bd3ef7843 100644 --- a/devtools/client/projecteditor/test/head.js +++ b/devtools/client/projecteditor/test/head.js @@ -234,7 +234,7 @@ function writeToFileSync(file, data) { createInstance(Components.interfaces.nsIFileOutputStream); // use 0x02 | 0x10 to open file for appending. - foStream.init(file, 0x02 | 0x08 | 0x20, 0666, 0); + foStream.init(file, 0x02 | 0x08 | 0x20, 0o666, 0); // write, create, truncate // In a c file operation, we have no need to set file mode with or operation, // directly using "r" or "w" usually. diff --git a/devtools/client/scratchpad/test/browser_scratchpad_confirm_close.js b/devtools/client/scratchpad/test/browser_scratchpad_confirm_close.js index 0afeb569f54..7653729d979 100644 --- a/devtools/client/scratchpad/test/browser_scratchpad_confirm_close.js +++ b/devtools/client/scratchpad/test/browser_scratchpad_confirm_close.js @@ -192,7 +192,7 @@ function cleanup() function createTempFile(name) { let file = FileUtils.getFile("TmpD", [name]); - file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); file.QueryInterface(Ci.nsILocalFile) return file; } @@ -202,7 +202,7 @@ function writeFile(file, content, callback) let fout = Cc["@mozilla.org/network/file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); fout.init(file.QueryInterface(Ci.nsILocalFile), 0x02 | 0x08 | 0x20, - 0644, fout.DEFER_OPEN); + 0o644, fout.DEFER_OPEN); let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]. createInstance(Ci.nsIScriptableUnicodeConverter); diff --git a/devtools/shared/apps/tests/debugger-protocol-helper.js b/devtools/shared/apps/tests/debugger-protocol-helper.js index 2865c18aef8..36649d0b757 100644 --- a/devtools/shared/apps/tests/debugger-protocol-helper.js +++ b/devtools/shared/apps/tests/debugger-protocol-helper.js @@ -96,7 +96,7 @@ function downloadURL(url, file) { let ostream = Cc["@mozilla.org/network/safe-file-output-stream;1"] .createInstance(Ci.nsIFileOutputStream); - ostream.init(file, 0x04 | 0x08 | 0x20, 0600, 0); + ostream.init(file, 0x04 | 0x08 | 0x20, 0o600, 0); ostream.write(data, data.length); ostream.QueryInterface(Ci.nsISafeOutputStream).finish(); } diff --git a/dom/base/test/bug578096LoadChromeScript.js b/dom/base/test/bug578096LoadChromeScript.js index 7dd1ce0389a..caf7f058ca2 100644 --- a/dom/base/test/bug578096LoadChromeScript.js +++ b/dom/base/test/bug578096LoadChromeScript.js @@ -6,7 +6,7 @@ addMessageListener("file.create", function (message) { .getService(Components.interfaces.nsIProperties) .get("TmpD", Components.interfaces.nsIFile); file.append("foo.txt"); - file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0600); + file.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE, 0o600); sendAsyncMessage("file.created", new File(file)); }); diff --git a/dom/base/test/file_bug1198095.js b/dom/base/test/file_bug1198095.js index d85e474019c..c8044eaea61 100644 --- a/dom/base/test/file_bug1198095.js +++ b/dom/base/test/file_bug1198095.js @@ -8,7 +8,7 @@ function createFileWithData(message) { var outStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate - 0666, 0); + 0o666, 0); outStream.write(message, message.length); outStream.close(); diff --git a/dom/base/test/fileapi_chromeScript.js b/dom/base/test/fileapi_chromeScript.js index 85f80a60b2b..2111652f55e 100644 --- a/dom/base/test/fileapi_chromeScript.js +++ b/dom/base/test/fileapi_chromeScript.js @@ -11,7 +11,7 @@ function createFileWithData(fileData) { fileNum++; var outStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate - 0666, 0); + 0o666, 0); if (willDelete) { fileData = "some irrelevant test data\n"; } diff --git a/dom/base/test/unit/head_xml.js b/dom/base/test/unit/head_xml.js index 72dca01eb88..3d445b74840 100644 --- a/dom/base/test/unit/head_xml.js +++ b/dom/base/test/unit/head_xml.js @@ -46,7 +46,7 @@ function ParseFile(file) { var fileStr = C["@mozilla.org/network/file-input-stream;1"] .createInstance(nsIFileInputStream); // Init for readonly reading - fileStr.init(file, 0x01, 0400, nsIFileInputStream.CLOSE_ON_EOF); + fileStr.init(file, 0x01, 0o400, nsIFileInputStream.CLOSE_ON_EOF); return ParseXML(fileStr); } diff --git a/dom/indexedDB/test/unit/test_blob_file_backed.js b/dom/indexedDB/test/unit/test_blob_file_backed.js index 40f49eeb131..327860b92eb 100644 --- a/dom/indexedDB/test/unit/test_blob_file_backed.js +++ b/dom/indexedDB/test/unit/test_blob_file_backed.js @@ -12,7 +12,7 @@ function testSteps() const fileIOFlags = 0x02 | // PR_WRONLY 0x08 | // PR_CREATEFILE 0x20; // PR_TRUNCATE - const filePerms = 0664; + const filePerms = 0o664; const fileData = "abcdefghijklmnopqrstuvwxyz"; const fileType = "text/plain"; diff --git a/dom/json/test/unit/test_encode.js b/dom/json/test/unit/test_encode.js index ebfd9117a2e..88907efa31f 100644 --- a/dom/json/test/unit/test_encode.js +++ b/dom/json/test/unit/test_encode.js @@ -12,7 +12,7 @@ outputDir.initWithFile(workingDir); outputDir.append(outputName); if (!outputDir.exists()) { - outputDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0777); + outputDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o777); } else if (!outputDir.isDirectory()) { do_throw(outputName + " is not a directory?") } @@ -83,10 +83,10 @@ function testOutputStreams() { var jsonFile = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile); jsonFile.initWithFile(outputDir); jsonFile.append("test.json"); - jsonFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600); + jsonFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); var stream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); try { - stream.init(jsonFile, 0x04 | 0x08 | 0x20, 0600, 0); // write, create, truncate + stream.init(jsonFile, 0x04 | 0x08 | 0x20, 0o600, 0); // write, create, truncate nativeJSON.encodeToStream(stream, charset, writeBOM, obj); } finally { stream.close(); diff --git a/dom/plugins/test/unit/test_bug455213.js b/dom/plugins/test/unit/test_bug455213.js index 96fa4455898..92a7896cd21 100644 --- a/dom/plugins/test/unit/test_bug455213.js +++ b/dom/plugins/test/unit/test_bug455213.js @@ -22,7 +22,7 @@ function write_registry(version, info) { var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); // write, create, truncate - foStream.init(registry, 0x02 | 0x08 | 0x20, 0666, 0); + foStream.init(registry, 0x02 | 0x08 | 0x20, 0o666, 0); var charset = "UTF-8"; // Can be any character encoding name that Mozilla supports var os = Cc["@mozilla.org/intl/converter-output-stream;1"]. diff --git a/dom/plugins/test/unit/test_bug813245.js b/dom/plugins/test/unit/test_bug813245.js index 260f70f8c8c..9c52c86ff78 100644 --- a/dom/plugins/test/unit/test_bug813245.js +++ b/dom/plugins/test/unit/test_bug813245.js @@ -26,7 +26,7 @@ function write_registry(version, info) { var foStream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); // write, create, truncate - foStream.init(registry, 0x02 | 0x08 | 0x20, 0666, 0); + foStream.init(registry, 0x02 | 0x08 | 0x20, 0o666, 0); var charset = "UTF-8"; // Can be any character encoding name that Mozilla supports var os = Cc["@mozilla.org/intl/converter-output-stream;1"]. diff --git a/dom/plugins/test/unit/test_persist_in_prefs.js b/dom/plugins/test/unit/test_persist_in_prefs.js index fcaf1720986..0cf31e198d8 100644 --- a/dom/plugins/test/unit/test_persist_in_prefs.js +++ b/dom/plugins/test/unit/test_persist_in_prefs.js @@ -26,7 +26,7 @@ function write_registry(version, info) { let foStream = Components.classes["@mozilla.org/network/file-output-stream;1"] .createInstance(Components.interfaces.nsIFileOutputStream); // write, create, truncate - foStream.init(registry, 0x02 | 0x08 | 0x20, 0666, 0); + foStream.init(registry, 0x02 | 0x08 | 0x20, 0o666, 0); let charset = "UTF-8"; // Can be any character encoding name that Mozilla supports let os = Cc["@mozilla.org/intl/converter-output-stream;1"]. diff --git a/dom/workers/test/fileapi_chromeScript.js b/dom/workers/test/fileapi_chromeScript.js index 85f80a60b2b..2111652f55e 100644 --- a/dom/workers/test/fileapi_chromeScript.js +++ b/dom/workers/test/fileapi_chromeScript.js @@ -11,7 +11,7 @@ function createFileWithData(fileData) { fileNum++; var outStream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); outStream.init(testFile, 0x02 | 0x08 | 0x20, // write, create, truncate - 0666, 0); + 0o666, 0); if (willDelete) { fileData = "some irrelevant test data\n"; } diff --git a/extensions/cookie/test/unit/test_permmanager_defaults.js b/extensions/cookie/test/unit/test_permmanager_defaults.js index 18f2ea1ed8e..c5d582b6230 100644 --- a/extensions/cookie/test/unit/test_permmanager_defaults.js +++ b/extensions/cookie/test/unit/test_permmanager_defaults.js @@ -30,7 +30,7 @@ add_task(function* do_test() { // write our test data to it. let ostream = Cc["@mozilla.org/network/file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); - ostream.init(file, -1, 0666, 0); + ostream.init(file, -1, 0o666, 0); let conv = Cc["@mozilla.org/intl/converter-output-stream;1"]. createInstance(Ci.nsIConverterOutputStream); conv.init(ostream, "UTF-8", 0, 0); diff --git a/extensions/cookie/test/unit/test_permmanager_removeall.js b/extensions/cookie/test/unit/test_permmanager_removeall.js index b73313d1123..54294a91577 100644 --- a/extensions/cookie/test/unit/test_permmanager_removeall.js +++ b/extensions/cookie/test/unit/test_permmanager_removeall.js @@ -17,7 +17,7 @@ function run_test() { // corrupt the file var ostream = Cc["@mozilla.org/network/file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); - ostream.init(file, 0x02, 0666, 0); + ostream.init(file, 0x02, 0o666, 0); var conv = Cc["@mozilla.org/intl/converter-output-stream;1"]. createInstance(Ci.nsIConverterOutputStream); conv.init(ostream, "UTF-8", 0, 0); @@ -28,7 +28,7 @@ function run_test() { // prepare an empty hostperm.1 file so that it can be used for importing var hostperm = dir.clone(); hostperm.append("hostperm.1"); - ostream.init(hostperm, 0x02 | 0x08, 0666, 0); + ostream.init(hostperm, 0x02 | 0x08, 0o666, 0); ostream.close(); // remove all should not throw diff --git a/extensions/spellcheck/hunspell/tests/unit/test_hunspell.js b/extensions/spellcheck/hunspell/tests/unit/test_hunspell.js index 7eba0e0e305..a67eeaec0ab 100644 --- a/extensions/spellcheck/hunspell/tests/unit/test_hunspell.js +++ b/extensions/spellcheck/hunspell/tests/unit/test_hunspell.js @@ -130,7 +130,7 @@ function do_get_file_by_line(file, charset) { let fis = Cc["@mozilla.org/network/file-input-stream;1"]. createInstance(Ci.nsIFileInputStream); fis.init(file, 0x1 /* READONLY */, - 0444, Ci.nsIFileInputStream.CLOSE_ON_EOF); + 0o444, Ci.nsIFileInputStream.CLOSE_ON_EOF); let lis = Cc["@mozilla.org/intl/converter-input-stream;1"]. createInstance(Ci.nsIConverterInputStream); diff --git a/image/test/unit/test_imgtools.js b/image/test/unit/test_imgtools.js index 25e72fa0a78..b9b8da82bdd 100644 --- a/image/test/unit/test_imgtools.js +++ b/image/test/unit/test_imgtools.js @@ -19,7 +19,7 @@ function dumpToFile(aData) { var outputStream = Cc["@mozilla.org/network/file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); // WR_ONLY|CREAT|TRUNC - outputStream.init(outputFile, 0x02 | 0x08 | 0x20, 0644, null); + outputStream.init(outputFile, 0x02 | 0x08 | 0x20, 0o644, null); var bos = Cc["@mozilla.org/binaryoutputstream;1"]. createInstance(Ci.nsIBinaryOutputStream); diff --git a/js/src/jit-test/lib/bullet.js b/js/src/jit-test/lib/bullet.js index 255ebb6c42e..3277e9621d6 100644 --- a/js/src/jit-test/lib/bullet.js +++ b/js/src/jit-test/lib/bullet.js @@ -1269,7 +1269,7 @@ function copyTempDouble(ptr) { node.contentMode = MEMFS.CONTENT_FLEXIBLE; } },mount:function (mount) { - return MEMFS.create_node(null, '/', 0040000 | 0777, 0); + return MEMFS.create_node(null, '/', 0o040000 | 0o777, 0); },create_node:function (parent, name, mode, dev) { if (FS.isBlkdev(mode) || FS.isFIFO(mode)) { // no supported @@ -1407,7 +1407,7 @@ function copyTempDouble(ptr) { } return entries; },symlink:function (parent, newname, oldpath) { - var node = MEMFS.create_node(parent, newname, 0777 | 0120000, 0); + var node = MEMFS.create_node(parent, newname, 0o777 | 0o120000, 0); node.link = oldpath; return node; },readlink:function (node) { @@ -1657,19 +1657,19 @@ function copyTempDouble(ptr) { },isMountpoint:function (node) { return node.mounted; },isFile:function (mode) { - return (mode & 0170000) === 0100000; + return (mode & 0o170000) === 0o100000; },isDir:function (mode) { - return (mode & 0170000) === 0040000; + return (mode & 0o170000) === 0o040000; },isLink:function (mode) { - return (mode & 0170000) === 0120000; + return (mode & 0o170000) === 0o120000; },isChrdev:function (mode) { - return (mode & 0170000) === 0020000; + return (mode & 0o170000) === 0o020000; },isBlkdev:function (mode) { - return (mode & 0170000) === 0060000; + return (mode & 0o170000) === 0o060000; },isFIFO:function (mode) { - return (mode & 0170000) === 0010000; + return (mode & 0o170000) === 0o010000; },isSocket:function (mode) { - return (mode & 0140000) === 0140000; + return (mode & 0o140000) === 0o140000; },flagModes:{"r":0,"rs":8192,"r+":2,"w":1537,"wx":3585,"xw":3585,"w+":1538,"wx+":3586,"xw+":3586,"a":521,"ax":2569,"xa":2569,"a+":522,"ax+":2570,"xa+":2570},modeStringToFlags:function (str) { var flags = FS.flagModes[str]; if (typeof flags === 'undefined') { @@ -1836,21 +1836,21 @@ function copyTempDouble(ptr) { } return parent.node_ops.mknod(parent, name, mode, dev); },create:function (path, mode) { - mode = mode !== undefined ? mode : 0666; + mode = mode !== undefined ? mode : 0o666; mode &= 4095; - mode |= 0100000; + mode |= 0o100000; return FS.mknod(path, mode, 0); },mkdir:function (path, mode) { - mode = mode !== undefined ? mode : 0777; - mode &= 511 | 0001000; - mode |= 0040000; + mode = mode !== undefined ? mode : 0o777; + mode &= 511 | 0o001000; + mode |= 0o040000; return FS.mknod(path, mode, 0); },mkdev:function (path, mode, dev) { if (typeof(dev) === 'undefined') { dev = mode; - mode = 0666; + mode = 0o666; } - mode |= 0020000; + mode |= 0o020000; return FS.mknod(path, mode, dev); },symlink:function (oldpath, newpath) { var lookup = FS.lookupPath(newpath, { parent: true }); @@ -2096,16 +2096,16 @@ function copyTempDouble(ptr) { },open:function (path, flags, mode, fd_start, fd_end) { path = PATH.normalize(path); flags = typeof flags === 'string' ? FS.modeStringToFlags(flags) : flags; - mode = typeof mode === 'undefined' ? 0666 : mode; + mode = typeof mode === 'undefined' ? 0o666 : mode; if ((flags & 512)) { - mode = (mode & 4095) | 0100000; + mode = (mode & 4095) | 0o100000; } else { mode = 0; } var node; try { var lookup = FS.lookupPath(path, { - follow: !(flags & 0200000) + follow: !(flags & 0o200000) }); node = lookup.node; path = lookup.path; @@ -2345,7 +2345,7 @@ function copyTempDouble(ptr) { assert(stderr.fd === 3, 'invalid handle for stderr (' + stderr.fd + ')'); },staticInit:function () { FS.nameTable = new Array(4096); - FS.root = FS.createNode(null, '/', 0040000 | 0777, 0); + FS.root = FS.createNode(null, '/', 0o040000 | 0o777, 0); FS.mount(MEMFS, {}, '/'); FS.createDefaultDirectories(); FS.createDefaultDevices(); @@ -2767,7 +2767,7 @@ function copyTempDouble(ptr) { openRequest.onerror = onerror; }}; var SOCKFS={mount:function (mount) { - return FS.createNode(null, '/', 0040000 | 0777, 0); + return FS.createNode(null, '/', 0o040000 | 0o777, 0); },nextname:function () { if (!SOCKFS.nextname.current) { SOCKFS.nextname.current = 0; @@ -2791,7 +2791,7 @@ function copyTempDouble(ptr) { }; // create the filesystem node to store the socket structure var name = SOCKFS.nextname(); - var node = FS.createNode(SOCKFS.root, name, 0140000, 0); + var node = FS.createNode(SOCKFS.root, name, 0o140000, 0); node.sock = sock; // and the wrapping stream that enables library functions such // as read and write to indirectly interact with the socket diff --git a/layout/tools/layout-debug/ui/content/layoutdebug.js b/layout/tools/layout-debug/ui/content/layoutdebug.js index 2c37a6478be..71142fa397f 100644 --- a/layout/tools/layout-debug/ui/content/layoutdebug.js +++ b/layout/tools/layout-debug/ui/content/layoutdebug.js @@ -382,7 +382,7 @@ RTestURLList.prototype = { var data = this.mCurrentURL.dir.clone(); data.append( this.mIsBaseline ? "baseline" : "verify"); if (!data.exists()) - data.create(nsIFile.DIRECTORY_TYPE, 0777) + data.create(nsIFile.DIRECTORY_TYPE, 0o777) data.append(basename); dump("Writing regression data to " + diff --git a/media/webrtc/trunk/webrtc/tools/rtcbot/test.js b/media/webrtc/trunk/webrtc/tools/rtcbot/test.js index 33ef960b295..c5625ef0218 100644 --- a/media/webrtc/trunk/webrtc/tools/rtcbot/test.js +++ b/media/webrtc/trunk/webrtc/tools/rtcbot/test.js @@ -140,7 +140,7 @@ StatisticsReport.prototype = { if(exists) { writeFile.bind(this)(); } else { - fs.mkdir("test/reports/", 0777, writeFile.bind(this)); + fs.mkdir("test/reports/", 0o777, writeFile.bind(this)); } }.bind(this)); diff --git a/mobile/android/components/HelperAppDialog.js b/mobile/android/components/HelperAppDialog.js index 702753c7f57..d81884f704c 100644 --- a/mobile/android/components/HelperAppDialog.js +++ b/mobile/android/components/HelperAppDialog.js @@ -289,7 +289,7 @@ HelperAppLauncherDialog.prototype = { aLocalFile.leafName = aLocalFile.leafName.replace(/^(.*\()\d+\)/, "$1" + (collisionCount+1) + ")"); } } - aLocalFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0600); + aLocalFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); } catch (e) { dump("*** exception in validateLeafName: " + e + "\n"); @@ -300,7 +300,7 @@ HelperAppLauncherDialog.prototype = { if (aLocalFile.leafName == "" || aLocalFile.isDirectory()) { aLocalFile.append("unnamed"); if (aLocalFile.exists()) - aLocalFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600); + aLocalFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); } } }, diff --git a/mobile/android/components/SessionStore.js b/mobile/android/components/SessionStore.js index 8097ac9ef8e..1d64faba3b2 100644 --- a/mobile/android/components/SessionStore.js +++ b/mobile/android/components/SessionStore.js @@ -681,7 +681,7 @@ SessionStore.prototype = { // Convert buffer to an encoded string and sync write to disk let bytes = String.fromCharCode.apply(null, new Uint16Array(aBuffer)); let stream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream); - stream.init(aFile, 0x02 | 0x08 | 0x20, 0666, 0); + stream.init(aFile, 0x02 | 0x08 | 0x20, 0o666, 0); stream.write(bytes, bytes.length); stream.close(); diff --git a/modules/libjar/test/unit/test_umlaute.js b/modules/libjar/test/unit/test_umlaute.js index 9981dceda07..bfaa0eabc46 100644 --- a/modules/libjar/test/unit/test_umlaute.js +++ b/modules/libjar/test/unit/test_umlaute.js @@ -27,7 +27,7 @@ function run_test() { var target = tmpDir.clone(); target.append(entryName); - target.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 6 * 64 + 4 * 8 + 0); // 0640 + target.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0o640); // 0640 zipreader.extract(entryName, target); diff --git a/modules/libjar/zipwriter/test/unit/test_zippermissions.js b/modules/libjar/zipwriter/test/unit/test_zippermissions.js index d31445f245f..c3f276dfc7d 100644 --- a/modules/libjar/zipwriter/test/unit/test_zippermissions.js +++ b/modules/libjar/zipwriter/test/unit/test_zippermissions.js @@ -32,7 +32,7 @@ function run_test() { var tmp = tmpDir.clone(); tmp.append("temp-permissions"); - tmp.createUnique(Ci.nsILocalFile.DIRECTORY_TYPE, 0755); + tmp.createUnique(Ci.nsILocalFile.DIRECTORY_TYPE, 0o755); var file = tmp.clone(); file.append("tempfile"); diff --git a/modules/libmar/tests/unit/head_libmar.js b/modules/libmar/tests/unit/head_libmar.js index ffd2d7fde1d..cd2da141417 100644 --- a/modules/libmar/tests/unit/head_libmar.js +++ b/modules/libmar/tests/unit/head_libmar.js @@ -102,13 +102,13 @@ function createMAR(outMAR, dataDir, files) { // Ensure on non Windows platforms we encode the same permissions // as the refernence MARs contain. On Windows this is also safe. - // The reference MAR files have permissions of 0664, so in case + // The reference MAR files have permissions of 0o664, so in case // someone is running these tests locally with another permission - // (perhaps 0777), make sure that we encode them as 0664. + // (perhaps 0o777), make sure that we encode them as 0o664. for (filePath of files) { let f = dataDir.clone(); f.append(filePath); - f.permissions = 0664; + f.permissions = 0o664; } // Setup the command line arguments to create the MAR. diff --git a/modules/libmar/tests/unit/test_extract.js b/modules/libmar/tests/unit/test_extract.js index aef9a121141..49ba80e2941 100644 --- a/modules/libmar/tests/unit/test_extract.js +++ b/modules/libmar/tests/unit/test_extract.js @@ -17,7 +17,7 @@ function run_test() { let outDir = tempDir.clone(); outDir.append("out"); do_check_false(outDir.exists()); - outDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0777); + outDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o777); // Get the ref files and the files that will be extracted. let outFiles = []; diff --git a/modules/libpref/test/unit/test_libPrefs.js b/modules/libpref/test/unit/test_libPrefs.js index 9fb883e88df..be9c629e09a 100644 --- a/modules/libpref/test/unit/test_libPrefs.js +++ b/modules/libpref/test/unit/test_libPrefs.js @@ -311,7 +311,7 @@ function run_test() { savePrefFile.append("savePref.js"); if (savePrefFile.exists()) savePrefFile.remove(false); - savePrefFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + savePrefFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); ps.savePrefFile(savePrefFile); ps.resetPrefs(); diff --git a/netwerk/test/httpserver/test/head_utils.js b/netwerk/test/httpserver/test/head_utils.js index 05ab9afd411..21f61511740 100644 --- a/netwerk/test/httpserver/test/head_utils.js +++ b/netwerk/test/httpserver/test/head_utils.js @@ -59,7 +59,7 @@ function makeBIS(stream) function fileContents(file) { const PR_RDONLY = 0x01; - var fis = new FileInputStream(file, PR_RDONLY, 0444, + var fis = new FileInputStream(file, PR_RDONLY, 0o444, Ci.nsIFileInputStream.CLOSE_ON_EOF); var sis = new ScriptableInputStream(fis); var contents = sis.read(file.fileSize); diff --git a/netwerk/test/httpserver/test/test_default_index_handler.js b/netwerk/test/httpserver/test/test_default_index_handler.js index 01d17dff8b5..c2c1b4e73eb 100644 --- a/netwerk/test/httpserver/test/test_default_index_handler.js +++ b/netwerk/test/httpserver/test/test_default_index_handler.js @@ -42,7 +42,7 @@ function createTestDirectory() .getService(Ci.nsIProperties) .get("TmpD", Ci.nsIFile); dir.append("index_handler_test_" + Math.random()); - dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0744); + dir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0o744); // populate with test directories, files, etc. // Files must be in expected order of display on the index page! @@ -249,7 +249,7 @@ function makeFile(name, isDirectory, parentDir, lst) try { file.append(name); - file.create(type, 0755); + file.create(type, 0o755); lst.push({name: name, isDirectory: isDirectory}); } catch (e) { /* OS probably doesn't like file name, skip */ } diff --git a/netwerk/test/unit/test_NetUtil.js b/netwerk/test/unit/test_NetUtil.js index 235c9c08721..c823ef5678e 100644 --- a/netwerk/test/unit/test_NetUtil.js +++ b/netwerk/test/unit/test_NetUtil.js @@ -68,7 +68,7 @@ function async_write_file(aContractId, aDeferOpen) getService(Ci.nsIProperties). get("ProfD", Ci.nsIFile); file.append("NetUtil-async-test-file.tmp"); - file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); // Then, we need an output stream to our output file. let ostream = Cc[aContractId].createInstance(Ci.nsIFileOutputStream); @@ -123,7 +123,7 @@ function test_async_copy() getService(Ci.nsIProperties). get("ProfD", Ci.nsIFile); file.append("NetUtil-asyncFetch-test-file.tmp"); - file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let ostream = Cc["@mozilla.org/network/file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); @@ -144,7 +144,7 @@ function test_async_copy() getService(Ci.nsIProperties). get("ProfD", Ci.nsIFile); file.append("NetUtil-asyncFetch-test-file.tmp"); - file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let ostream = Cc["@mozilla.org/network/file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); @@ -409,7 +409,7 @@ function test_asyncFetch_with_nsIFile() getService(Ci.nsIProperties). get("ProfD", Ci.nsIFile); file.append("NetUtil-asyncFetch-test-file.tmp"); - file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); // Write the test data to the file. let ostream = Cc["@mozilla.org/network/file-output-stream;1"]. diff --git a/netwerk/test/unit/test_bug414122.js b/netwerk/test/unit/test_bug414122.js index a9ac18fd41a..7e5a418d018 100644 --- a/netwerk/test/unit/test_bug414122.js +++ b/netwerk/test/unit/test_bug414122.js @@ -10,7 +10,7 @@ function run_test() var fis = Cc["@mozilla.org/network/file-input-stream;1"] .createInstance(Ci.nsIFileInputStream); fis.init(do_get_file("effective_tld_names.dat"), - PR_RDONLY, 0444, Ci.nsIFileInputStream.CLOSE_ON_EOF); + PR_RDONLY, 0o444, Ci.nsIFileInputStream.CLOSE_ON_EOF); var lis = Cc["@mozilla.org/intl/converter-input-stream;1"] .createInstance(Ci.nsIConverterInputStream); diff --git a/netwerk/test/unit/test_file_partial_inputstream.js b/netwerk/test/unit/test_file_partial_inputstream.js index 4818bf01c0b..6eb4a3ac8bb 100644 --- a/netwerk/test/unit/test_file_partial_inputstream.js +++ b/netwerk/test/unit/test_file_partial_inputstream.js @@ -118,7 +118,7 @@ function run_test() let ostream = Cc["@mozilla.org/network/file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); ostream.init(tempFile, 0x02 | 0x08 | 0x20, // write, create, truncate - 0666, 0); + 0o666, 0); let newData = "abcdefghijklmnopqrstuvwxyz"; ostream.write(newData, newData.length); ostream.close(); @@ -499,12 +499,12 @@ function create_temp_file(data) { getService(Ci.nsIProperties). get("ProfD", Ci.nsIFile); file.append("fileinputstream-test-file.tmp"); - file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let ostream = Cc["@mozilla.org/network/file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); ostream.init(file, 0x02 | 0x08 | 0x20, // write, create, truncate - 0666, 0); + 0o666, 0); do_check_eq(ostream.write(data, data.length), data.length); ostream.close(); diff --git a/netwerk/test/unit/test_file_protocol.js b/netwerk/test/unit/test_file_protocol.js index af3deb4eeea..2f1c5eb7f17 100644 --- a/netwerk/test/unit/test_file_protocol.js +++ b/netwerk/test/unit/test_file_protocol.js @@ -180,7 +180,7 @@ function test_upload_file() { var file = do_get_file("../unit/data/test_readline6.txt"); // file to upload var dest = do_get_tempdir(); // file upload destination dest.append("junk.dat"); - dest.createUnique(dest.NORMAL_FILE_TYPE, 0600); + dest.createUnique(dest.NORMAL_FILE_TYPE, 0o600); var uploadstream = new_file_input_stream(file, true); diff --git a/netwerk/test/unit/test_filestreams.js b/netwerk/test/unit/test_filestreams.js index 4f03cf4c31a..2736527a53a 100644 --- a/netwerk/test/unit/test_filestreams.js +++ b/netwerk/test/unit/test_filestreams.js @@ -128,7 +128,7 @@ function sync_operations(aDeferOpen) getService(Ci.nsIProperties). get("ProfD", Ci.nsIFile); file.append(LEAF_NAME); - file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let ostream = Cc[OUTPUT_STREAM_CONTRACT_ID]. createInstance(Ci.nsIFileOutputStream); @@ -215,7 +215,7 @@ function do_test_zero_size_buffered(disableBuffering) getService(Ci.nsIProperties). get("ProfD", Ci.nsIFile); file.append(LEAF_NAME); - file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let fstream = Cc["@mozilla.org/network/file-input-stream;1"]. createInstance(Ci.nsIFileInputStream); diff --git a/security/manager/pki/resources/content/pippki.js b/security/manager/pki/resources/content/pippki.js index 91c867a50f9..589b7fbb02d 100644 --- a/security/manager/pki/resources/content/pippki.js +++ b/security/manager/pki/resources/content/pippki.js @@ -134,7 +134,7 @@ function exportToFile(parent, cert) var fos = Components.classes["@mozilla.org/network/file-output-stream;1"]. createInstance(Components.interfaces.nsIFileOutputStream); // flags: PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE - fos.init(file, 0x02 | 0x08 | 0x20, 00644, 0); + fos.init(file, 0x02 | 0x08 | 0x20, 0o0644, 0); written = fos.write(content, content.length); fos.close(); } diff --git a/security/manager/ssl/tests/unit/test_sss_readstate_empty.js b/security/manager/ssl/tests/unit/test_sss_readstate_empty.js index 62c27a131d1..d42fe22661f 100644 --- a/security/manager/ssl/tests/unit/test_sss_readstate_empty.js +++ b/security/manager/ssl/tests/unit/test_sss_readstate_empty.js @@ -28,7 +28,7 @@ function run_test() { // Assuming we're working with a clean slate, the file shouldn't exist // until we create it. ok(!stateFile.exists()); - stateFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0x1a4); // 0x1a4 == 0644 + stateFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0x1a4); // 0x1a4 == 0o644 ok(stateFile.exists()); // Initialize nsISiteSecurityService after do_get_profile() so it // can read the state file. diff --git a/security/manager/tools/makeCNNICHashes.js b/security/manager/tools/makeCNNICHashes.js index 1c064182509..4cc91498d83 100644 --- a/security/manager/tools/makeCNNICHashes.js +++ b/security/manager/tools/makeCNNICHashes.js @@ -252,7 +252,7 @@ certs.sort(compareCertificatesByHash); // Write the output file. var outFile = relativePathToFile("CNNICHashWhitelist.inc"); if (!outFile.exists()) { - outFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0644); + outFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644); } var outStream = Cc["@mozilla.org/network/file-output-stream;1"] .createInstance(Ci.nsIFileOutputStream); diff --git a/services/sync/tests/unit/test_bookmark_engine.js b/services/sync/tests/unit/test_bookmark_engine.js index 97af659ae61..5fc39d6d2ae 100644 --- a/services/sync/tests/unit/test_bookmark_engine.js +++ b/services/sync/tests/unit/test_bookmark_engine.js @@ -204,7 +204,7 @@ add_task(function* test_restorePromptsReupload() { backupFile.append("t_b_e_" + Date.now() + ".json"); _("Backing up to file " + backupFile.path); - backupFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0600); + backupFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0o600); yield BookmarkJSONUtils.exportToFile(backupFile); _("Create a different record and sync."); diff --git a/testing/talos/talos/pageloader/chrome/MozillaFileLogger.js b/testing/talos/talos/pageloader/chrome/MozillaFileLogger.js index 2cac09eef3c..4d463ef945d 100644 --- a/testing/talos/talos/pageloader/chrome/MozillaFileLogger.js +++ b/testing/talos/talos/pageloader/chrome/MozillaFileLogger.js @@ -52,7 +52,7 @@ MozillaFileLogger.init = function(path) { MozillaFileLogger._file.initWithPath(path); MozillaFileLogger._foStream = Cc[FOSTREAM_CID].createInstance(Ci.nsIFileOutputStream); MozillaFileLogger._foStream.init(this._file, PR_WRITE_ONLY | PR_CREATE_FILE | PR_APPEND, - 0664, 0); + 0o664, 0); } MozillaFileLogger.getLogCallback = function() { diff --git a/testing/talos/talos/scripts/MozillaFileLogger.js b/testing/talos/talos/scripts/MozillaFileLogger.js index 4c9333f3950..fb1115b9a59 100644 --- a/testing/talos/talos/scripts/MozillaFileLogger.js +++ b/testing/talos/talos/scripts/MozillaFileLogger.js @@ -79,7 +79,7 @@ MozFileLogger.init = function(path) { MozFileLogger._file.initWithPath(path); MozFileLogger._foStream = Cc[FOSTREAM_CID].createInstance(Ci.nsIFileOutputStream); MozFileLogger._foStream.init(this._file, PR_WRITE_ONLY | PR_CREATE_FILE | PR_APPEND, - 0664, 0); + 0o664, 0); } MozFileLogger.getLogCallback = function() { diff --git a/toolkit/components/jsdownloads/test/unit/test_PrivateTemp.js b/toolkit/components/jsdownloads/test/unit/test_PrivateTemp.js index 138be8d2991..1308e97822f 100644 --- a/toolkit/components/jsdownloads/test/unit/test_PrivateTemp.js +++ b/toolkit/components/jsdownloads/test/unit/test_PrivateTemp.js @@ -19,6 +19,6 @@ add_task(function* test_private_temp() { var targetFile = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile); targetFile.initWithPath(download.target.path); - // 488 is the decimal value of 0700. + // 488 is the decimal value of 0o700. equal(targetFile.parent.permissions, 448); }); diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPermissions.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPermissions.js index 21548162794..ab8bf7dd9b2 100644 --- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPermissions.js +++ b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPermissions.js @@ -14,7 +14,7 @@ /** * Helper function for test logging: prints a POSIX file permission mode as an * octal number, with a leading '0' per C (not JS) convention. When the - * numeric value is 0777 or lower, it is padded on the left with zeroes to + * numeric value is 0o777 or lower, it is padded on the left with zeroes to * four digits wide. * Sample outputs: 0022, 0644, 04755. */ diff --git a/uriloader/exthandler/tests/unit/test_handlerService.js b/uriloader/exthandler/tests/unit/test_handlerService.js index a7d1c59ade3..3facc63aeb4 100644 --- a/uriloader/exthandler/tests/unit/test_handlerService.js +++ b/uriloader/exthandler/tests/unit/test_handlerService.js @@ -68,7 +68,7 @@ function run_test() { // XXX We could, of course, create an actual executable in the directory: //executable.append("localhandler"); //if (!executable.exists()) - // executable.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0755); + // executable.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o755); var localHandler = { name: "Local Handler", diff --git a/xpcom/ds/nsINIProcessor.js b/xpcom/ds/nsINIProcessor.js index dc3753b0b11..e9c19ab7f90 100644 --- a/xpcom/ds/nsINIProcessor.js +++ b/xpcom/ds/nsINIProcessor.js @@ -144,7 +144,7 @@ INIProcessor.prototype = { let safeStream = Cc["@mozilla.org/network/safe-file-output-stream;1"]. createInstance(Ci.nsIFileOutputStream); safeStream.init(aFile, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE, - 0600, null); + 0o600, null); var outputStream = Cc["@mozilla.org/network/buffered-output-stream;1"]. createInstance(Ci.nsIBufferedOutputStream); diff --git a/xpcom/tests/unit/test_bug364285-1.js b/xpcom/tests/unit/test_bug364285-1.js index ad9f4052080..f8bd6ee1567 100644 --- a/xpcom/tests/unit/test_bug364285-1.js +++ b/xpcom/tests/unit/test_bug364285-1.js @@ -22,11 +22,11 @@ function create_file(fileName) { var outFile = getTempDir(); outFile.append(fileName); - outFile.createUnique(outFile.NORMAL_FILE_TYPE, 0600); + outFile.createUnique(outFile.NORMAL_FILE_TYPE, 0o600); var stream = Cc["@mozilla.org/network/file-output-stream;1"] .createInstance(Ci.nsIFileOutputStream); - stream.init(outFile, 0x02 | 0x08 | 0x20, 0600, 0); + stream.init(outFile, 0x02 | 0x08 | 0x20, 0o600, 0); stream.write("foo", 3); stream.close(); diff --git a/xpcom/tests/unit/test_bug476919.js b/xpcom/tests/unit/test_bug476919.js index 66aed4278a6..21cd9253e88 100644 --- a/xpcom/tests/unit/test_bug476919.js +++ b/xpcom/tests/unit/test_bug476919.js @@ -9,7 +9,7 @@ function run_test() { var targetFile = testDir.clone(); targetFile.append("target.txt"); if (!targetFile.exists()) - targetFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0644); + targetFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644); var link = testDir.clone(); link.append("link"); diff --git a/xpcom/tests/unit/test_file_createUnique.js b/xpcom/tests/unit/test_file_createUnique.js index 156ddd730d7..1ab204bab05 100644 --- a/xpcom/tests/unit/test_file_createUnique.js +++ b/xpcom/tests/unit/test_file_createUnique.js @@ -19,7 +19,7 @@ function run_test() tempFile.append("test.txt"); try { - tempFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0600); + tempFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600); do_throw("Creating an item in a folder with a very long name should throw"); } catch (e if (e instanceof Ci.nsIException && diff --git a/xpcom/tests/unit/test_hidden_files.js b/xpcom/tests/unit/test_hidden_files.js index d313ccb806d..3383ba11b2d 100644 --- a/xpcom/tests/unit/test_hidden_files.js +++ b/xpcom/tests/unit/test_hidden_files.js @@ -13,7 +13,7 @@ function createUNIXHiddenFile() { // we don't care if this already exists because we don't care // about the file's contents (just the name) if (!hiddenUnixFile.exists()) - hiddenUnixFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + hiddenUnixFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); return hiddenUnixFile.exists(); } diff --git a/xpcom/tests/unit/test_localfile.js b/xpcom/tests/unit/test_localfile.js index 62aa84f53ac..25f4bf34bf3 100644 --- a/xpcom/tests/unit/test_localfile.js +++ b/xpcom/tests/unit/test_localfile.js @@ -68,7 +68,7 @@ function test_file_modification_time() file.remove(true); var now = Date.now(); - file.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0644); + file.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644); do_check_true(file.exists()); // Modification time may be out by up to 2 seconds on FAT filesystems. Test @@ -108,7 +108,7 @@ function test_directory_modification_time() dir.remove(true); var now = Date.now(); - dir.create(Ci.nsIFile.DIRECTORY_TYPE, 0755); + dir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755); do_check_true(dir.exists()); // Modification time may be out by up to 2 seconds on FAT filesystems. Test @@ -142,7 +142,7 @@ function test_diskSpaceAvailable() file.append("testfile"); if (file.exists()) file.remove(true); - file.create(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt("644", 8)); + file.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644); bytes = file.diskSpaceAvailable; do_check_true(bytes > 0); diff --git a/xpcom/tests/unit/test_symlinks.js b/xpcom/tests/unit/test_symlinks.js index 0fefd9a69db..a615af8d52a 100644 --- a/xpcom/tests/unit/test_symlinks.js +++ b/xpcom/tests/unit/test_symlinks.js @@ -69,13 +69,13 @@ function setupTestDir(testDir, relative) { } do_check_true(!testDir.exists()); - testDir.create(nsIFile.DIRECTORY_TYPE, 0777); + testDir.create(nsIFile.DIRECTORY_TYPE, 0o777); - targetDir.create(nsIFile.DIRECTORY_TYPE, 0777); + targetDir.create(nsIFile.DIRECTORY_TYPE, 0o777); var targetFile = testDir.clone(); targetFile.append(FILE_TARGET); - targetFile.create(nsIFile.NORMAL_FILE_TYPE, 0666); + targetFile.create(nsIFile.NORMAL_FILE_TYPE, 0o666); var imaginary = testDir.clone(); imaginary.append(DOES_NOT_EXIST); diff --git a/xpcom/tests/unit/test_windows_shortcut.js b/xpcom/tests/unit/test_windows_shortcut.js index d5b39ad15bd..42cb023ffc3 100644 --- a/xpcom/tests/unit/test_windows_shortcut.js +++ b/xpcom/tests/unit/test_windows_shortcut.js @@ -23,7 +23,7 @@ function run_test() let tempDir = Services.dirsvc.get("TmpD", Ci.nsILocalFile); tempDir.append("shortcutTesting"); - tempDir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0666); + tempDir.createUnique(Ci.nsIFile.DIRECTORY_TYPE, 0o666); test_create_noargs(tempDir); test_create_notarget(tempDir); @@ -43,7 +43,7 @@ function test_create_noargs(tempDir) { let shortcutFile = tempDir.clone(); shortcutFile.append("shouldNeverExist.lnk"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let win = shortcutFile.QueryInterface(Ci.nsILocalFileWin); @@ -63,7 +63,7 @@ function test_create_notarget(tempDir) { let shortcutFile = tempDir.clone(); shortcutFile.append("shouldNeverExist2.lnk"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let win = shortcutFile.QueryInterface(Ci.nsILocalFileWin); @@ -86,11 +86,11 @@ function test_create_targetonly(tempDir) { let shortcutFile = tempDir.clone(); shortcutFile.append("createdShortcut.lnk"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let targetFile = tempDir.clone(); targetFile.append("shortcutTarget.exe"); - targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let win = shortcutFile.QueryInterface(Ci.nsILocalFileWin); @@ -104,11 +104,11 @@ function test_create_normal(tempDir) { let shortcutFile = tempDir.clone(); shortcutFile.append("createdShortcut.lnk"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let targetFile = tempDir.clone(); targetFile.append("shortcutTarget.exe"); - targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let win = shortcutFile.QueryInterface(Ci.nsILocalFileWin); @@ -125,11 +125,11 @@ function test_create_unicode(tempDir) { let shortcutFile = tempDir.clone(); shortcutFile.append("createdShortcut.lnk"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let targetFile = tempDir.clone(); targetFile.append("ṩhогТϾừ†Target.exe"); - targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let win = shortcutFile.QueryInterface(Ci.nsILocalFileWin); @@ -146,11 +146,11 @@ function test_update_noargs(tempDir) { let shortcutFile = tempDir.clone(); shortcutFile.append("createdShortcut.lnk"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let targetFile = tempDir.clone(); targetFile.append("shortcutTarget.exe"); - targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let win = shortcutFile.QueryInterface(Ci.nsILocalFileWin); @@ -169,11 +169,11 @@ function test_update_notarget(tempDir) { let shortcutFile = tempDir.clone(); shortcutFile.append("createdShortcut.lnk"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let targetFile = tempDir.clone(); targetFile.append("shortcutTarget.exe"); - targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let win = shortcutFile.QueryInterface(Ci.nsILocalFileWin); @@ -195,11 +195,11 @@ function test_update_targetonly(tempDir) { let shortcutFile = tempDir.clone(); shortcutFile.append("createdShortcut.lnk"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let targetFile = tempDir.clone(); targetFile.append("shortcutTarget.exe"); - targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let win = shortcutFile.QueryInterface(Ci.nsILocalFileWin); @@ -210,7 +210,7 @@ function test_update_targetonly(tempDir) let newTargetFile = tempDir.clone(); newTargetFile.append("shortcutTarget.exe"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); win.setShortcut(newTargetFile); @@ -222,11 +222,11 @@ function test_update_normal(tempDir) { let shortcutFile = tempDir.clone(); shortcutFile.append("createdShortcut.lnk"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let targetFile = tempDir.clone(); targetFile.append("shortcutTarget.exe"); - targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let win = shortcutFile.QueryInterface(Ci.nsILocalFileWin); @@ -237,7 +237,7 @@ function test_update_normal(tempDir) let newTargetFile = tempDir.clone(); newTargetFile.append("shortcutTarget.exe"); - newTargetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + newTargetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); win.setShortcut(newTargetFile, do_get_profile(), @@ -252,11 +252,11 @@ function test_update_unicode(tempDir) { let shortcutFile = tempDir.clone(); shortcutFile.append("createdShortcut.lnk"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let targetFile = tempDir.clone(); targetFile.append("shortcutTarget.exe"); - targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + targetFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); let win = shortcutFile.QueryInterface(Ci.nsILocalFileWin); @@ -267,7 +267,7 @@ function test_update_unicode(tempDir) let newTargetFile = tempDir.clone(); newTargetFile.append("ṩhогТϾừ†Target.exe"); - shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0666); + shortcutFile.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o666); win.setShortcut(newTargetFile, do_get_profile(), // XXX: This should probably be unicode