Contributions
Re: Support for prototypal inheritance in JScript broken in 7.52
Thanks, it does seem to work with dot notation. Though I still consider the editor to be broken as this is a regression from v5. I prefer subscript as it allows me to see my method names more easily in the editor and on the rare occasion that I actually need to parameterise them, it makes it trivial. And, yes, Crock is the man. Another question I meant to ask AQA was whether I can replace the creaky old JScript engine with something a bit more modern, such as SpiderMonkey or V8?1KViews0likes0CommentsSupport for prototypal inheritance in JScript broken in 7.52
I'd like to write a script in JScript that uses prototypal inheritance, such as: Object["create"] = function (o) { function F() {} F["prototype"] = o; return new F(); }; function BaseObject(name) { this["name"] = name; } BaseObject["prototype"] = { writeName: function () { Log["Message"](this["name"]); }, changeName: function (newName) { this["name"] = newName; } } function NobleObject(name) { BaseObject["call"](this, name); this["rank"] = "noble"; } NobleObject["prototype"] = Object["create"](BaseObject["prototype"]); NobleObject["prototype"]["changeRank"] = function (newRank) { this["rank"] = newRank; } NobleObject["prototype"]["writeRank"] = function () { Log["Message"](this["rank"]); } function testObjects() { myBase = new BaseObject("testBO"); myBase["writeName"](); myBase["changeName"]("newTestBO"); myBase["writeName"](); myNoble = new NobleObject("testNO"); myNoble["writeName"](); myNoble["writeRank"](); myNoble["changeName"]("newTestNO"); myNoble["writeName"](); myNoble["changeRank"]("tarnished"); myNoble["writeRank"](); } This is valid JScript and runs on TC 5 but TC 7.52 flags the changeRank method as being a duplicate method name (presumably it's confused by the "prototype" call). Could we please remove this check from JScript scripts as it is broken? In a similar vein, the Code Explorer only shows the "constructor" functions and not any of the prototype functions. Can this be fixed, too?15KViews0likes3Comments