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 {
|
||||
if(!Object.create)
|
||||
Object.create = function(proto)
|
||||
{
|
||||
function f(){}
|
||||
f.prototype = proto;
|
||||
return new f;
|
||||
}
|
||||
|
||||
var js = CoffeeScript.compile(coffee);
|
||||
|
||||
if (!output) {
|
||||
|
@ -70,34 +78,34 @@ function convert(input, output) {
|
|||
}
|
||||
|
||||
function readUtf8(filename) {
|
||||
var stream = new ActiveXObject("ADODB.Stream");
|
||||
stream.Open();
|
||||
stream.Type = 2; // Text
|
||||
stream.Charset = 'utf-8';
|
||||
stream.LoadFromFile(filename);
|
||||
var text = stream.ReadText();
|
||||
stream.Close();
|
||||
return text;
|
||||
var stream = new ActiveXObject("ADODB.Stream");
|
||||
stream.Open();
|
||||
stream.Type = 2; // Text
|
||||
stream.Charset = 'utf-8';
|
||||
stream.LoadFromFile(filename);
|
||||
var text = stream.ReadText();
|
||||
stream.Close();
|
||||
return text;
|
||||
}
|
||||
|
||||
function writeUtf8(filename, text) {
|
||||
var stream = new ActiveXObject("ADODB.Stream");
|
||||
stream.Type = 2; // Text
|
||||
stream.Charset = "utf-8";
|
||||
stream.Open();
|
||||
stream.WriteText(text);
|
||||
var stream = new ActiveXObject("ADODB.Stream");
|
||||
stream.Type = 2; // Text
|
||||
stream.Charset = "utf-8";
|
||||
stream.Open();
|
||||
stream.WriteText(text);
|
||||
|
||||
stream.Position = 0;
|
||||
stream.Type = 1; // Binary
|
||||
stream.Position = 3;
|
||||
var binary = stream.Read();
|
||||
stream.Close();
|
||||
stream.Position = 0;
|
||||
stream.Type = 1; // Binary
|
||||
stream.Position = 3;
|
||||
var binary = stream.Read();
|
||||
stream.Close();
|
||||
|
||||
stream.Open();
|
||||
stream.Type = 1; // Binary
|
||||
stream.Write(binary);
|
||||
stream.SaveToFile(filename, 2);
|
||||
stream.Close();
|
||||
stream.Open();
|
||||
stream.Type = 1; // Binary
|
||||
stream.Write(binary);
|
||||
stream.SaveToFile(filename, 2);
|
||||
stream.Close();
|
||||
}
|
||||
</script>
|
||||
</job>
|
||||
|
|
Loading…
Reference in a new issue