8000 Remove unused VirtualFile#exists · scala-js/scala-js@2909529 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2909529

Browse files
committed
Remove unused VirtualFile#exists
1 parent 841fd60 commit 2909529

File tree

6 files changed

+0
-15
lines changed

6 files changed

+0
-15
lines changed

io/js/src/main/scala/org/scalajs/io/NodeVirtualFiles.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ class NodeVirtualFile(override val path: String) extends VirtualFile {
1717
Some(stat.mtime.asInstanceOf[js.Date].getTime.toString)
1818
}
1919

20-
override def exists: Boolean =
21-
fs.existsSync(path).asInstanceOf[Boolean]
22-
2320
override def toURI: URI = {
2421
val abspath = fs.realpathSync(path).asInstanceOf[String]
2522
new URI("file", abspath, null)

io/jvm/src/main/scala/org/scalajs/io/FileVirtualFiles.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ class FileVirtualFile(val file: File) extends VirtualFile {
1616
else Some(file.lastModified.toString)
1717
}
1818

19-
override def exists: Boolean = file.exists
20-
2119
override def toURI: URI = file.toURI
2220
}
2321

io/shared/src/main/scala/org/scalajs/io/MemFiles.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ class MemVirtualFile(val path: String) extends VirtualFile {
2222
version = v
2323
this
2424
}
25-
26-
override def exists: Boolean = true
2725
}
2826

2927
/** A simple in-memory mutable virtual text file. */

io/shared/src/main/scala/org/scalajs/io/VirtualFiles.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ trait VirtualFile {
2424
*/
2525
def version: Option[String] = None
2626

27-
/** Whether this file exists. Reading a non-existent file may fail */
28-
def exists: Boolean
29-
3027
/** URI for this virtual file */
3128
def toURI: URI = {
3229
new URI(

linker/shared/src/main/scala/org/scalajs/linker/backend/emitter/CoreJSLibs.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,6 @@ private[emitter] object CoreJSLibs {
130130
private class ScalaJSEnvVirtualJSFile(override val content: String) extends VirtualJSFile {
131131
override def path: String = "scalajsenv.js"
132132
override def version: Option[String] = Some("")
133-
override def exists: Boolean = true
134133

135134
override def toURI: URI = {
136135
if (!ScalaJSVersions.currentIsSnapshot)

linker/shared/src/main/scala/org/scalajs/linker/irio/IRFileCache.scala

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -237,10 +237,6 @@ final class IRFileCache {
237237
override val entryPointsInfo: EntryPointsInfo = _irFile.entryPointsInfo
238238
override val relativePath: String = _irFile.relativePath
239239

240-
override def exists: Boolean = {
241-
_tree != null || _irFile.exists
242-
}
243-
244240
override def tree: ClassDef = {
245241
if (_tree == null) {
246242
synchronized {

0 commit comments

Comments
 (0)
0