Merge pull request #192 from TheNain38/patch-2
Update CoffeeScript version and add compatibility for CoffeeScript version >= 1.9.0
This commit is contained in:
commit
5bfb38e7d3
2 changed files with 37 additions and 29 deletions
File diff suppressed because one or more lines are too long
|
@ -54,6 +54,14 @@ function convert(input, output) {
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if(!Object.create)
|
||||||
|
Object.create = function(proto)
|
||||||
|
{
|
||||||
|
function f(){}
|
||||||
|
f.prototype = proto;
|
||||||
|
return new f;
|
||||||
|
}
|
||||||
|
|
||||||
var js = CoffeeScript.compile(coffee);
|
var js = CoffeeScript.compile(coffee);
|
||||||
|
|
||||||
if (!output) {
|
if (!output) {
|
||||||
|
@ -70,34 +78,34 @@ function convert(input, output) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function readUtf8(filename) {
|
function readUtf8(filename) {
|
||||||
var stream = new ActiveXObject("ADODB.Stream");
|
var stream = new ActiveXObject("ADODB.Stream");
|
||||||
stream.Open();
|
stream.Open();
|
||||||
stream.Type = 2; // Text
|
stream.Type = 2; // Text
|
||||||
stream.Charset = 'utf-8';
|
stream.Charset = 'utf-8';
|
||||||
stream.LoadFromFile(filename);
|
stream.LoadFromFile(filename);
|
||||||
var text = stream.ReadText();
|
var text = stream.ReadText();
|
||||||
stream.Close();
|
stream.Close();
|
||||||
return text;
|
return text;
|
||||||
}
|
}
|
||||||
|
|
||||||
function writeUtf8(filename, text) {
|
function writeUtf8(filename, text) {
|
||||||
var stream = new ActiveXObject("ADODB.Stream");
|
var stream = new ActiveXObject("ADODB.Stream");
|
||||||
stream.Type = 2; // Text
|
stream.Type = 2; // Text
|
||||||
stream.Charset = "utf-8";
|
stream.Charset = "utf-8";
|
||||||
stream.Open();
|
stream.Open();
|
||||||
stream.WriteText(text);
|
stream.WriteText(text);
|
||||||
|
|
||||||
stream.Position = 0;
|
stream.Position = 0;
|
||||||
stream.Type = 1; // Binary
|
stream.Type = 1; // Binary
|
||||||
stream.Position = 3;
|
stream.Position = 3;
|
||||||
var binary = stream.Read();
|
var binary = stream.Read();
|
||||||
stream.Close();
|
stream.Close();
|
||||||
|
|
||||||
stream.Open();
|
stream.Open();
|
||||||
stream.Type = 1; // Binary
|
stream.Type = 1; // Binary
|
||||||
stream.Write(binary);
|
stream.Write(binary);
|
||||||
stream.SaveToFile(filename, 2);
|
stream.SaveToFile(filename, 2);
|
||||||
stream.Close();
|
stream.Close();
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</job>
|
</job>
|
||||||
|
|
Loading…
Reference in a new issue