Skip to content
Browse files

remove works JavaScript code EVER!!

  • Loading branch information...
1 parent 7fc5b36 commit 6b5957ba95b3203d3a3ad96688d48d549b21bbe9 @fjakobs fjakobs committed
Showing with 2 additions and 38 deletions.
  1. +2 −38 lib/DAV/tree/ftp.js
View
40 lib/DAV/tree/ftp.js
@@ -190,8 +190,8 @@ exports.jsDAV_Tree_Ftp = jsDAV_Tree_Ftp;
var node = this.ftp.$cache[source];
var ftp = this.ftp;
- if (!node) // This should only happen if the server crashed.
- return this.$getParentNodeRecall(source);
+ if (!node)
+ return next(new Error("Node not found for path " + source));
node.setName(destination, function(err) {
if (err)
@@ -231,41 +231,5 @@ exports.jsDAV_Tree_Ftp = jsDAV_Tree_Ftp;
this.ftp = null;
}
};
-
- /**
- * Caches a path's parent path and its children, then goes back to the caller function with the
- * same previous arguments.
- *
- * @param string path
- * @return void
- */
- this.$getParentNodeRecall = function(path) {
- var caller = arguments.callee.caller;
- var callerArgs = caller.arguments;
- var next = callerArgs[callerArgs.length-1];
- var callback = next;
- var parentPath = Util.splitPath(path)[0];
- var self = this;
-
- this.getNodeForPath(parentPath.substring(this.basePath.length), function(err, node) {
- if (err)
- return next(err);
-
- node.getChildren(function(err, nodes) {
- if (err)
- return next(err);
-
- if (nodes.length && typeof caller === 'function') {
- nodes.forEach(function(child) {
- if (child.path === path)
- callback = caller.bind.apply(caller, [self].concat([].slice.call(callerArgs)));
- });
- callback();
- } else {
- next();
- }
- });
- });
- };
}).call(jsDAV_Tree_Ftp.prototype = new jsDAV_Tree());

0 comments on commit 6b5957b

Please sign in to comment.
Something went wrong with that request. Please try again.