aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJukka Jylänki <jujjyl@gmail.com>2014-04-30 11:58:32 +0300
committerJukka Jylänki <jujjyl@gmail.com>2014-04-30 11:58:32 +0300
commita395d0e4e3027c9facef4450149bbdd0f8520145 (patch)
treef101931c606e436427a3e92e8e703d9f6501db15
parent7ff1046c01ba8b4586576a6c5f29cdf5ab878bc4 (diff)
Rename FS tracking delegate did* to on* as suggested in https://github.com/kripken/emscripten/pull/1673 .
-rw-r--r--src/library_fs.js36
1 files changed, 15 insertions, 21 deletions
diff --git a/src/library_fs.js b/src/library_fs.js
index e0b73db8..5f7f1dea 100644
--- a/src/library_fs.js
+++ b/src/library_fs.js
@@ -739,11 +739,9 @@ mergeInto(LibraryManager.library, {
FS.hashAddNode(old_node);
}
try {
- if (FS.trackingDelegate['didMovePath']) {
- FS.trackingDelegate['didMovePath'](old_path, new_path);
- }
+ if (FS.trackingDelegate['onMovePath']) FS.trackingDelegate['onMovePath'](old_path, new_path);
} catch(e) {
- console.log("FS.trackingDelegate['didMovePath']('"+old_path+"', '"+new_path+"') threw an exception: " + e.message);
+ console.log("FS.trackingDelegate['onMovePath']('"+old_path+"', '"+new_path+"') threw an exception: " + e.message);
}
},
rmdir: function(path) {
@@ -771,11 +769,9 @@ mergeInto(LibraryManager.library, {
parent.node_ops.rmdir(parent, name);
FS.destroyNode(node);
try {
- if (FS.trackingDelegate['didDeletePath']) {
- FS.trackingDelegate['didDeletePath'](path);
- }
+ if (FS.trackingDelegate['onDeletePath']) FS.trackingDelegate['onDeletePath'](path);
} catch(e) {
- console.log("FS.trackingDelegate['didDeletePath']('"+path+"') threw an exception: " + e.message);
+ console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: " + e.message);
}
},
readdir: function(path) {
@@ -813,11 +809,9 @@ mergeInto(LibraryManager.library, {
parent.node_ops.unlink(parent, name);
FS.destroyNode(node);
try {
- if (FS.trackingDelegate['didDeletePath']) {
- FS.trackingDelegate['didDeletePath'](path);
- }
+ if (FS.trackingDelegate['onDeletePath']) FS.trackingDelegate['onDeletePath'](path);
} catch(e) {
- console.log("FS.trackingDelegate['didDeletePath']('"+path+"') threw an exception: " + e.message);
+ console.log("FS.trackingDelegate['onDeletePath']('"+path+"') threw an exception: " + e.message);
}
},
readlink: function(path) {
@@ -1014,16 +1008,18 @@ mergeInto(LibraryManager.library, {
}
}
try {
- if (FS.trackingDelegate['didOpenFile']) {
+ if (FS.trackingDelegate['onOpenFile']) {
var trackingFlags = 0;
- if ((flags & {{{ cDefine('O_ACCMODE') }}}) !== {{{ cDefine('O_WRONLY') }}})
+ if ((flags & {{{ cDefine('O_ACCMODE') }}}) !== {{{ cDefine('O_WRONLY') }}}) {
trackingFlags |= FS.tracking.openFlags.READ;
- if ((flags & {{{ cDefine('O_ACCMODE') }}}) !== {{{ cDefine('O_RDONLY') }}})
+ }
+ if ((flags & {{{ cDefine('O_ACCMODE') }}}) !== {{{ cDefine('O_RDONLY') }}}) {
trackingFlags |= FS.tracking.openFlags.WRITE;
- FS.trackingDelegate['didOpenFile'](path, trackingFlags);
+ }
+ FS.trackingDelegate['onOpenFile'](path, trackingFlags);
}
} catch(e) {
- console.log("FS.trackingDelegate['didOpenFile']('"+path+"', flags) threw an exception: " + e.message);
+ console.log("FS.trackingDelegate['onOpenFile']('"+path+"', flags) threw an exception: " + e.message);
}
return stream;
},
@@ -1095,11 +1091,9 @@ mergeInto(LibraryManager.library, {
var bytesWritten = stream.stream_ops.write(stream, buffer, offset, length, position, canOwn);
if (!seeking) stream.position += bytesWritten;
try {
- if (stream.path && FS.trackingDelegate['didWriteToFile']) {
- FS.trackingDelegate['didWriteToFile'](stream.path);
- }
+ if (stream.path && FS.trackingDelegate['onWriteToFile']) FS.trackingDelegate['onWriteToFile'](stream.path);
} catch(e) {
- console.log("FS.trackingDelegate['didWriteToFile']('"+path+"') threw an exception: " + e.message);
+ console.log("FS.trackingDelegate['onWriteToFile']('"+path+"') threw an exception: " + e.message);
}
return bytesWritten;
},