Closed
Bug 352045
Opened 18 years ago
Closed 17 years ago
remove Object.prototype.eval
Categories
(Core :: JavaScript Engine, defect)
Tracking
()
RESOLVED
DUPLICATE
of bug 382509
People
(Reporter: geckobugs, Unassigned)
References
()
Details
User-Agent: Opera/9.01 (Windows NT 5.0; U; en)
Build Identifier: Minefield 3.0a1/20060908
Having eval() in scope of every object is officially deprecated. It should be removed.
Documentation:
http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Object:eval
Discussion regarding Opera bug report:
http://my.opera.com/hallvors/blog/show.dml/449976
Reproducible: Always
Reporter | ||
Updated•18 years ago
|
Reporter | ||
Updated•18 years ago
|
Updated•18 years ago
|
Status: UNCONFIRMED → NEW
Ever confirmed: true
Comment 1•18 years ago
|
||
We've talked about this in ECMA TG1. My colleague from Opera reports that it is necessary to support indirect eval of the form w.eval for any window object w. But cross-browser JS does not require o.eval for any object o. However, at least Venkman and probably many other XUL apps and extensions depend on this old SpiderMonkey feature (it goes back to the dawn of JS, 1995).
Object.prototype.eval is something we definitely want to remove, so this bug is good to have on file (is there an older one it dups, though? I have memories of another bug like this). The Mozilla milestone in which to do this is Mozilla 2, when we can make big API compatibility breaks (not break all API compatibility promises, just big/old/deep ones like this particular one). Mozilla 2 work should start soon; I'll have more to say about this within the next few weeks.
For ES4/JS2 we are considering support for eval(s, o) -- an optional second argument giving the scope chain (not an object to extend the scope chain, as SpiderMonkey does now via an internal translation to with(o)eval(s)) for the evaluation of s.
/be
Comment 2•18 years ago
|
||
(In reply to comment #1)
> Object.prototype.eval is something we definitely want to remove
The docs say it actually *was* removed in JS1.4. Was it removed and reinstated, or never removed?
Comment 3•18 years ago
|
||
(In reply to comment #2)
> (In reply to comment #1)
> > Object.prototype.eval is something we definitely want to remove
>
> The docs say it actually *was* removed in JS1.4. Was it removed and reinstated,
> or never removed?
The docs lie. There's no trace in jsobj.c's CVS history (cvs annotate -rN jsobj.c | grep obj_eval and back N up to one before each change) that did not define eval as an Object.prototype method. The incompatibility would have been as painful, or moreso, then than now.
/be
Comment 4•18 years ago
|
||
(In reply to comment #3)
> (In reply to comment #2)
> > (In reply to comment #1)
> > > Object.prototype.eval is something we definitely want to remove
> >
> > The docs say it actually *was* removed in JS1.4. Was it removed and reinstated,
> > or never removed?
>
> The docs lie. There's no trace in jsobj.c's CVS history (cvs annotate -rN
> jsobj.c | grep obj_eval and back N up to one before each change) that did not
> define eval as an Object.prototype method. The incompatibility would have been
> as painful, or moreso, then than now.
>
> /be
>
I've fixed the docs.
Comment 5•17 years ago
|
||
Isn't this a duplicate of bug 382509?
Comment 6•17 years ago
|
||
Yeah, duping forward.
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•