Error:
TypeError: Date.valueOf is not generic
Code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace CARemObjects
{
public class RemObjectsConsole
{
public RemObjectsConsole()
{ }
public void write(object v)
{
Console.WriteLine(v.ToString());
}
}
class Program
{
static void Main(string[] args)
{
using (var cmp = new RemObjects.Script.EcmaScriptComponent())
{
object o = null;
cmp.Include("aaa", @"Date.prototype.toString = function () {
return 'full year -> ' + this.getFullYear();
}");
cmp.Include(“test1”, @"
function GlobalFunction(cc, tt) {
cc.write(tt);
return null;
}
");
RemObjectsConsole d = new RemObjectsConsole();
o = cmp.RunFunction("GlobalFunction", d, cmp.GlobalObject.CreateDateObject(new DateTime(1977, 3, 4)));
Console.WriteLine(o);
}
}
}
}