Closed Bug 297854 Opened 20 years ago Closed 14 years ago

Components.toSource() is broken

Categories

(Core :: JavaScript Engine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: timeless, Assigned: mrbkap)

Details

Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.7) Gecko/20050414 mrbkap confirms w/ trunk steps: 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. probably: ({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 http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/js/src/jsobj.c&rev=3.197&mark=836-841,901-908#830
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. /be
Assignee: general → mrbkap
This now produces, ({}), also we can decompile getters/setters to the ES5 syntax.
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.