From 2ea5eda553e5da9900dd75d2423cea4c37c93e67 Mon Sep 17 00:00:00 2001 From: Doug Kearns Date: Mon, 14 Sep 2009 15:41:58 +1000 Subject: [PATCH] Remove silly type checking from io.{read,write}File. --- common/content/io.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/common/content/io.js b/common/content/io.js index 4ab4af6a..d666ca0e 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -725,8 +725,6 @@ function IO() //{{{ { if (typeof dir == "string") dir = self.getFile(dir); - else if (!(dir instanceof Ci.nsILocalFile)) - throw Cr.NS_ERROR_INVALID_ARG; // FIXME: does not work as expected, just shows undefined: undefined if (dir.isDirectory()) { @@ -762,9 +760,6 @@ function IO() //{{{ encoding = options["fileencoding"]; if (typeof file == "string") file = self.getFile(file); - else if (!(file instanceof Ci.nsILocalFile)) - throw Cr.NS_ERROR_INVALID_ARG; // FIXME: does not work as expected, just shows undefined: undefined - // How would you expect it to work? It's an integer. --Kris ifstream.init(file, -1, 0, 0); icstream.init(ifstream, encoding, 4096, Ci.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); // 4096 bytes buffering @@ -818,8 +813,6 @@ function IO() //{{{ encoding = options["fileencoding"]; if (typeof file == "string") file = self.getFile(file); - else if (!(file instanceof Ci.nsILocalFile)) - throw Cr.NS_ERROR_INVALID_ARG; // FIXME: does not work as expected, just shows undefined: undefined if (mode == ">>") mode = self.MODE_WRONLY | self.MODE_CREATE | self.MODE_APPEND;