Subj : Re: [Rhino] can you add default getters/setters? To : netscape.public.mozilla.jseng From : Mike C. Date : Sun May 09 2004 01:20 am "Igor Bukanov" wrote > > This syntax works too in JScript: > > function object.prototype.method() {...} > > so you might want to add it if you touch that area. > > Rhino supports that as well. In fact, instead of function name you can > use arbitrary lvalue. > This syntax didn't work for me, I have compiled with rhino1_5R5. function foo.prototype.bar(arg) {} js: "G:\_tests\rhinoTest2.js", line 1: missing ( before function parameters js: function foo.prototype.bar(arg) js: .............^ > Ok, I suggest to file a bug for this. And note that createAssignment is > not the only place to patch since I assume Session("foo") += "bar" and > Session("foo")-- also works in JScript, right? Right, and I have filled a report at http://bugzilla.mozilla.org/show_bug.cgi?id=243057 > But couould you use > Session["foo"] = "bar" > or even > Session.foo = "bar" > in ASP pages as well? > > If yes, then at least you have a workaround. No :-(, it looks like JScript doesn't let you use COM objects as JavaScript objects, or at least not for this particular host. However note that in the IE host, you can write var obj = document.all["foo"]; It is possible that they use a convention, such as if a property is a collection, then you can use square brackets instead of call operator, but I'm not sure. Regards, Mike .