Last Comment Bug 297854 - Components.toSource() is broken
: Components.toSource() is broken
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: x86 Windows XP
-- normal (vote)
: ---
Assigned To: Blake Kaplan (:mrbkap)
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2005-06-15 16:35 PDT by timeless
Modified: 2011-08-04 05:43 PDT (History)
3 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image timeless 2005-06-15 16:35:56 PDT
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414
mrbkap confirms w/ trunk

1. run mozilla
2. open jsconsole
3. Components.toSource()

actual results:
({QueryInterface:function QueryInterface() {[native code]}, get interfacesnction
interfaces() {[native code]}, get interfacesByIDnction interfacesByID() {[native
code]}, get classesnction classes() {[native code]}, get classesByIDnction
classesByID() {[native code]}, get stacknction stack() {[native code]}, get
resultsnction results() {[native code]}, get managernction manager() {[native
code]}, get IDnction ID() {[native code]}, get Exceptionnction Exception()
{[native code]}, get Constructornction Constructor() {[native code]},
isSuccessCode:function isSuccessCode() {[native code]}, lookupMethod:function
lookupMethod() {[native code]}})

expected results:
no instances of three bare words next to eachother in the object.

({QueryInterface:function QueryInterface() {[native code]}, get interfaces()
{[native code]}, get interfacesByID() {[native code]}, get classes() {[native
code]}, get classesByID() {[native code]}, get stack() {[native code]}, get
results() {[native code]}, get manager() {[native code]}, get ID() {[native
code]}, get Exception() {[native code]}, get Constructor() {[native code]},
isSuccessCode:function isSuccessCode() {[native code]}, lookupMethod:function
lookupMethod() {[native code]}})

problem appears to be in js_obj_toSource especially near notdef
OLD_GETTER_SETTER, as well as interactions with JS_DecompileFunction and some
fixup code,901-908#830
Comment 1 User image Brendan Eich [:brendan] 2005-09-01 21:13:42 PDT
This will be fun.  I'll say this: js_DecompileFunction should not be emitting
"getter" and "setter" any longer if we can support the function get foo(){...}
and function set foo(bar){...} syntax from Edition 4.

Comment 2 User image Tom Schuster [:evilpie] 2011-08-04 05:43:23 PDT
This now produces, ({}), also we can decompile getters/setters to the ES5 syntax.

Note You need to log in before you can comment on or make changes to this bug.