I'm working on a servlet that runs javascript using Rhino.
I added MooTools into the scope I'm using so I could use its useful helpers
classes and functions.
But I stumbled into a problem that I've been unable to solve. When
retrieving a record from the database I use a switch to automatically find
what kind of data was retrieved and add it to an object.
When a java.sql.Date is retrieved and added to this object, calling
JSON.encode will throw the following exception:
org.mozilla.javascript.EcmaError: TypeError: Cannot find function
hasOwnProperty in object 1975-01-01.
That would happen when MooTools try to access the hasOwnProperty method of
the java.sql.Date object. In the following method:
forEach: function(fn, bind){
for (var key in this){
if (this.hasOwnProperty(key)) fn.call(bind, this[key], key, this);
// <- Here
}
},
Has any one had the same problem or knows how I could avoid or correct that?
Thanks.
Vinicius
_______________________________________________
dev-tech-js-engine-rhino mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-js-engine-rhino