Skip to content

Commit 443c591

Browse files
committed
Fix assembly name passed from RT.TryLoadFromEmbeddedResrouce. Modify load of spec library so it does not contribute extra constants to compiled dll when loading spec lib for macro check during compilation
1 parent b2d3598 commit 443c591

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

Clojure/Clojure/Lib/RT.cs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ public static void LoadSpecCode()
478478
{
479479
try
480480
{
481-
Var.pushThreadBindings(RT.map(Compiler.CompileFilesVar, false));
481+
//Var.pushThreadBindings(RT.map(Compiler.CompileFilesVar, false));
482482
// We need to prevent loading more than once.
483483
IFn require = clojure.clr.api.Clojure.var("clojure.core", "require");
484484
require.invoke(clojure.clr.api.Clojure.read("clojure.spec.alpha"));
@@ -488,7 +488,7 @@ public static void LoadSpecCode()
488488
}
489489
finally
490490
{
491-
Var.popThreadBindings();
491+
//Var.popThreadBindings();
492492
}
493493
}
494494

@@ -3570,24 +3570,26 @@ private static bool TryLoadFromEmbeddedResource(string relativePath, string asse
35703570
}
35713571
}
35723572

3573-
3574-
var embeddedCljName = relativePath.Replace("/", ".") + ".cljr";
3573+
var extension = ".cljr";
3574+
var embeddedCljName = relativePath.Replace("/", ".") + extension;
35753575
var stream = GetEmbeddedResourceStream(embeddedCljName, out Assembly containingAssembly);
35763576
if (stream == null)
35773577
{
3578-
embeddedCljName = relativePath.Replace("/", ".") + ".cljc";
3578+
extension = ".cljc";
3579+
embeddedCljName = relativePath.Replace("/", ".") + extension;
35793580
stream = GetEmbeddedResourceStream(embeddedCljName, out containingAssembly);
35803581
}
35813582
if (stream == null)
35823583
{
3583-
embeddedCljName = relativePath.Replace("/", ".") + ".clj";
3584+
extension = ".clj";
3585+
embeddedCljName = relativePath.Replace("/", ".") + extension;
35843586
stream = GetEmbeddedResourceStream(embeddedCljName, out containingAssembly);
35853587
}
35863588
if (stream != null)
35873589
{
35883590
using var rdr = new StreamReader(stream);
35893591
if (booleanCast(Compiler.CompileFilesVar.deref()))
3590-
Compile(containingAssembly.FullName, embeddedCljName, rdr, relativePath);
3592+
Compile(containingAssembly.FullName, embeddedCljName, rdr, relativePath + extension);
35913593
else
35923594
LoadScript(containingAssembly.FullName, embeddedCljName, rdr, relativePath);
35933595
return true;

0 commit comments

Comments
 (0)