Remove unused $native.lastModified()

This commit is contained in:
Kevin Sawicki
2013-03-07 18:00:35 -08:00
parent fedf43ca0a
commit e7050b2083
3 changed files with 1 additions and 27 deletions

View File

@@ -26,7 +26,7 @@ namespace v8_extensions {
const char* methodNames[] = {
"read", "write", "absolute",
"remove", "writeToPasteboard", "readFromPasteboard", "quit", "watchPath", "unwatchPath",
"getWatchedPaths", "unwatchAllPaths", "makeDirectory", "move", "moveToTrash", "reload", "lastModified",
"getWatchedPaths", "unwatchAllPaths", "makeDirectory", "move", "moveToTrash", "reload",
"md5ForPath", "getPlatform", "setWindowState", "getWindowState", "isMisspelled",
"getCorrectionsForMisspelling"
};
@@ -246,21 +246,6 @@ namespace v8_extensions {
else if (name == "reload") {
CefV8Context::GetCurrentContext()->GetBrowser()->ReloadIgnoreCache();
}
else if (name == "lastModified") {
NSString *path = stringFromCefV8Value(arguments[0]);
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error = nil;
NSDictionary *attributes = [fm attributesOfItemAtPath:path error:&error];
if (error) {
exception = [[error localizedDescription] UTF8String];
}
NSDate *lastModified = [attributes objectForKey:NSFileModificationDate];
retval = CefV8Value::CreateDate(CefTime([lastModified timeIntervalSince1970]));
return true;
}
else if (name == "md5ForPath") {
NSString *path = stringFromCefV8Value(arguments[0]);
unsigned char outputData[CC_MD5_DIGEST_LENGTH];

View File

@@ -117,14 +117,6 @@ describe "fs", ->
expect(symlinkPaths).toEqual(paths)
describe ".lastModified(path)", ->
it "returns a Date object representing the time the file was last modified", ->
beforeWrite = new Date
fs.write('/tmp/foo', '')
lastModified = fs.lastModified('/tmp/foo')
expect(lastModified instanceof Date).toBeTruthy()
expect(lastModified.getTime()).toBeGreaterThan(beforeWrite.getTime() - 1000)
describe ".md5ForPath(path)", ->
it "returns the MD5 hash of the file at the given path", ->
expect(fs.md5ForPath(require.resolve('fixtures/sample.js'))).toBe 'dd38087d0d7e3e4802a6d3f9b9745f2b'

View File

@@ -131,9 +131,6 @@ module.exports =
traverse(rootPath, '', onFile, onDirectory)
lastModified: (path) ->
$native.lastModified(path)
md5ForPath: (path) ->
$native.md5ForPath(path)