lib/execjs/external_runtime.rb in execjs-2.4.0 vs lib/execjs/external_runtime.rb in execjs-2.5.0
- old
+ new
@@ -26,11 +26,18 @@
source = encode(source)
source = "#{@source}\n#{source}" if @source != ""
source = @runtime.compile_source(source)
tmpfile = write_to_tempfile(source)
+
+ if ExecJS.cygwin?
+ filepath = `cygpath -m #{tmpfile.path}`.rstrip
+ else
+ filepath = tmpfile.path
+ end
+
begin
- extract_result(@runtime.exec_runtime(tmpfile.path), tmpfile.path)
+ extract_result(@runtime.exec_runtime(filepath), filepath)
ensure
File.unlink(tmpfile)
end
end