The default bug view has changed. See this FAQ.

Components.toSource() is broken

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
12 years ago
6 years ago

People

(Reporter: timeless, Assigned: mrbkap)

Tracking

Trunk
x86
Windows XP
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

12 years ago
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
Last Resolved: 6 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.