Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit d8a574f

Browse files
committed
RTC:Code cleanup, static inti, etc...
1 parent 8ff4739 commit d8a574f

2 files changed

Lines changed: 7 additions & 12 deletions

File tree

src/filesystem/FileSystemError.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,12 @@ define(function (require, exports, module) {
3939
INVALID_PARAMS : "InvalidParams",
4040
NOT_FOUND : "NotFound",
4141
NOT_READABLE : "NotReadable",
42+
NOT_SUPPORTED : "NotSupported",
4243
NOT_WRITABLE : "NotWritable",
4344
OUT_OF_SPACE : "OutOfSpace",
4445
TOO_MANY_ENTRIES : "TooManyEntries",
4546
ALREADY_EXISTS : "AlreadyExists",
4647
CONTENTS_MODIFIED : "ContentsModified",
47-
PATH_WATCHING_NOT_SUPPORTED : "PathWatchingNotSupported",
4848
ROOT_NOT_WATCHED : "RootNotBeingWatched"
4949

5050
// FUTURE: Add remote connection errors: timeout, not logged in, connection err, etc.

src/filesystem/impls/appshell/AppshellFileSystem.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ define(function (require, exports, module) {
4646
_domainPath = [_bracketsPath, _modulePath, _nodePath].join("/"),
4747
_nodeDomain = new NodeDomain("fileWatcher", _domainPath);
4848

49+
var _isRunningOnWindowsXP = navigator.userAgent.indexOf("Windows NT 5.") >= 0;
50+
4951
// If the connection closes, notify the FileSystem that watchers have gone offline.
5052
$(_nodeDomain.connection).on("close", function (event, promise) {
5153
if (_offlineCallback) {
@@ -148,13 +150,6 @@ define(function (require, exports, module) {
148150
return FileSystemError.UNKNOWN;
149151
}
150152

151-
/**
152-
* Determines if we're running on Windows XP
153-
*/
154-
function _isRunningOnWindowsXP() {
155-
return (navigator.userAgent.indexOf("Windows NT 5.") >= 0);
156-
}
157-
158153
/**
159154
* Convert a callback to one that transforms its first parameter from an
160155
* appshell error code to a FileSystemError string.
@@ -492,13 +487,13 @@ define(function (require, exports, module) {
492487
* cleared when the offlineCallback is called.
493488
*
494489
* @param {function(?string, FileSystemStats=)} changeCallback
495-
* @param {function()=} callback
490+
* @param {function()=} offlineCallback
496491
*/
497492
function initWatchers(changeCallback, offlineCallback) {
498493
_changeCallback = changeCallback;
499494
_offlineCallback = offlineCallback;
500495

501-
if (_isRunningOnWindowsXP() && _offlineCallback) {
496+
if (_isRunningOnWindowsXP && _offlineCallback) {
502497
_offlineCallback();
503498
}
504499
}
@@ -515,8 +510,8 @@ define(function (require, exports, module) {
515510
* @param {function(?string)=} callback
516511
*/
517512
function watchPath(path, callback) {
518-
if (_isRunningOnWindowsXP()) {
519-
callback(FileSystemError.PATH_WATCHING_NOT_SUPPORTED);
513+
if (_isRunningOnWindowsXP) {
514+
callback(FileSystemError.NOT_SUPPORTED);
520515
return;
521516
}
522517
appshell.fs.isNetworkDrive(path, function (err, isNetworkDrive) {

0 commit comments

Comments
 (0)