If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

eval() function causes error when used inside another function

RESOLVED FIXED

Status

()

Core
JavaScript Engine
P3
normal
RESOLVED FIXED
18 years ago
13 years ago

People

(Reporter: Luke Andrews, Assigned: rogerl (gone))

Tracking

Trunk
PowerPC
Mac System 8.6
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [js1.2], URL)

Attachments

(2 attachments)

(Reporter)

Description

18 years ago
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

18 years ago
Assignee: mccabe → nisheeth
Component: Javascript Engine → Parser

Comment 1

18 years ago
Reassiging to Nisheeth; this looks like an HTML parser issue.

Updated

18 years ago
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → INVALID

Comment 2

18 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

18 years ago
Created attachment 3413 [details]
bug21303.html
(Reporter)

Comment 4

18 years ago
Created attachment 3417 [details]
Test of use of eval() in a function
(Reporter)

Updated

18 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

18 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

18 years ago
Resolution: INVALID → ---

Updated

18 years ago
Assignee: nisheeth → mccabe
Status: REOPENED → NEW

Comment 6

18 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

18 years ago
Assignee: mccabe → rogerl

Comment 7

18 years ago
Roger, can you look at this?
(Assignee)

Updated

18 years ago
Status: NEW → ASSIGNED
(Assignee)

Comment 8

18 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

18 years ago
This bug showed up on the seamonkey M11 build; I haven't tried anything more
current.
(Assignee)

Updated

18 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 18 years ago18 years ago
Resolution: --- → FIXED
(Assignee)

Comment 10

18 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

13 years ago
Whiteboard: [js1.2]
You need to log in before you can comment on or make changes to this bug.