Subj : Re: Help To : Pradip Singh From : Brendan Eich Date : Fri Jan 30 2004 10:24 am Pradip Singh wrote: > Hi, > > Can anyone tell me what is the utility of Decompilation (like > js_DecompileFunction(), etc)functions provided in spiderMonkey. 1. Function.prototype.toString, per ECMA-262, must return a string representation of its |this| parameter. In SpiderMonkey, this is done via bytecode decompilation. 2. Error messages, e.g. for the ReferenceError in "var o = 42; alert(o[f(1,2,a[3])].q);", say "o[f(1, 2, a[3])] has no properties" by calling the decompiler to show the bytecode sequence (possibly with a few fixups) that generated the null or undefined value being incorrectly dereferenced via the .q operator and operand. Other engines lamely say "undefined has no properties" or "reference error". If you don't want the decompiler, then you can suffer lousy errors (2), but if you want to conform to ECMA, you need to do something else for (1), such as source recovery. /be .