Closed
Bug 21303
Opened 25 years ago
Closed 25 years ago
eval() function causes error when used inside another function
Categories
(Core :: JavaScript Engine, defect, P3)
Tracking
()
RESOLVED
FIXED
People
(Reporter: luke, Assigned: rogerl)
References
()
Details
(Whiteboard: [js1.2])
Attachments
(2 files)
When a SCRIPT tag specifies the language as "JavaScript1.1" or higher, Mozilla
ignores the contents, as if it did not support that version of JavaScript, even
though it does in fact.
Some Web sites use this attribute to determine whether a browser supports image
replacement or arrays (neither of which is supported in JavaScript 1.0) for example.
Updated•25 years ago
|
Assignee: mccabe → nisheeth
Component: Javascript Engine → Parser
Comment 1•25 years ago
|
||
Reassiging to Nisheeth; this looks like an HTML parser issue.
Updated•25 years ago
|
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → INVALID
Comment 2•25 years ago
|
||
I tested the attached javascript snippet with the language attribute set to
"JavaScript1.3" and "JavaScript1.2". Both worked and "hello world" printed out
properly. Marking this bug invalid.
Comment 3•25 years ago
|
||
Reporter | ||
Comment 4•25 years ago
|
||
Reporter | ||
Updated•25 years ago
|
Status: RESOLVED → REOPENED
Component: Parser → Javascript Engine
Summary: Does not recognize "language=..." attribute of script tags → eval() function causes error when used inside another function
Reporter | ||
Comment 5•25 years ago
|
||
My mistake... this bug had little to do with the "language=" tag; it was a
problem with the eval() statement I was using to replace the images.
Nevertheless, it still seems to be a bug!
When eval() is used on its own, it seems to work fine, but when I use it in a
function I have created (as shown in the attachment I've uploaded), it causes
an error: "JavaScript Error: EvalError: function eval must be called directly,
and not by way of a function of another name."
This bug only occurs when the language= attribute of the SCRIPT tag is set to
JavaScript1.1 or higher. When set to just "JavaScript" or left blank, eval()
works properly.
Reporter | ||
Updated•25 years ago
|
Resolution: INVALID → ---
Updated•25 years ago
|
Assignee: nisheeth → mccabe
Status: REOPENED → NEW
Comment 6•25 years ago
|
||
Mike, I've verified that the language attribute does not make the parser ignore
the script. Please take a look at the new problem that is being reported in
this bug. This one seems unrelated to layout. Thanks.
Updated•25 years ago
|
Assignee: mccabe → rogerl
Comment 7•25 years ago
|
||
Roger, can you look at this?
Assignee | ||
Updated•25 years ago
|
Status: NEW → ASSIGNED
Assignee | ||
Comment 8•25 years ago
|
||
I'm not seeing a problem with eval on the current tip build (M12 as of
12/13/99). I vaguely recall we had problems earlier with eval getting scrunched
by version checking - it changed because of the ECMA 3 spec. - but that seems
like 2 to 3 months old now. Are you seeing this with current(ish) builds?
Reporter | ||
Comment 9•25 years ago
|
||
This bug showed up on the seamonkey M11 build; I haven't tried anything more
current.
Assignee | ||
Updated•25 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 10•25 years ago
|
||
I can't find the original bug number, but what was happening is that the script
was compiled under the specified version (non-ECMA) and then executed in a
context with a different version (ECMA) so the error popped out. This was fixed
a little while ago. I verified the test case is running fine against current
builds.
Updated•20 years ago
|
Whiteboard: [js1.2]
You need to log in
before you can comment on or make changes to this bug.
Description
•