From e7050b2083bc9a77ee75e3557f2a128abafe9288 Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Thu, 7 Mar 2013 18:00:35 -0800 Subject: [PATCH] Remove unused $native.lastModified() --- native/v8_extensions/native.mm | 17 +---------------- spec/stdlib/fs-spec.coffee | 8 -------- src/stdlib/fs.coffee | 3 --- 3 files changed, 1 insertion(+), 27 deletions(-) diff --git a/native/v8_extensions/native.mm b/native/v8_extensions/native.mm index 63f520d1f..13c29f5cd 100644 --- a/native/v8_extensions/native.mm +++ b/native/v8_extensions/native.mm @@ -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]; diff --git a/spec/stdlib/fs-spec.coffee b/spec/stdlib/fs-spec.coffee index b0a6fae5f..3c74f0b33 100644 --- a/spec/stdlib/fs-spec.coffee +++ b/spec/stdlib/fs-spec.coffee @@ -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' diff --git a/src/stdlib/fs.coffee b/src/stdlib/fs.coffee index 657193d76..3dee17bac 100644 --- a/src/stdlib/fs.coffee +++ b/src/stdlib/fs.coffee @@ -131,9 +131,6 @@ module.exports = traverse(rootPath, '', onFile, onDirectory) - lastModified: (path) -> - $native.lastModified(path) - md5ForPath: (path) -> $native.md5ForPath(path)