# HG changeset patch # User Michael Van De Vanter # Date 1442360469 25200 # Node ID f47b601edbc626dcfe8b3636933b4834c89f7779 # Parent 7c8c03389f0f5d4a40606d7f50ac6541e2f4b29c Truffle/Source: add the ".js" and ".JS" extensions to the hard-wired getMimeType() implementations diff -r 7c8c03389f0f -r f47b601edbc6 truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java --- a/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Tue Sep 15 14:49:24 2015 -0700 +++ b/truffle/com.oracle.truffle.api/src/com/oracle/truffle/api/source/Source.java Tue Sep 15 16:41:09 2015 -0700 @@ -409,7 +409,7 @@ /** * The URL if the source is retrieved via URL. - * + * * @return URL or null */ public abstract URL getURL(); @@ -893,6 +893,8 @@ return "text/x-c"; } else if (file.getName().endsWith(".R") || file.getName().endsWith(".r")) { return "application/x-r"; + } else if (file.getName().endsWith(".js") || file.getName().endsWith(".JS")) { + return "application/javascript"; } else { try { return Files.probeContentType(file.toPath()); @@ -981,6 +983,8 @@ return "text/x-c"; } else if (file.getName().endsWith(".R") || file.getName().endsWith(".r")) { return "application/x-r"; + } else if (file.getName().endsWith(".js") || file.getName().endsWith(".JS")) { + return "application/javascript"; } else { try { return Files.probeContentType(file.toPath());