bugzilla.mozilla.org has resumed normal operation. Attachments prior to 2014 will be unavailable for a few days. This is tracked in Bug 1475801.
Please report any other irregularities here.

strict JS is warning 15 times for each error in page

VERIFIED DUPLICATE of bug 104549

Status

()

Core
JavaScript Engine
VERIFIED DUPLICATE of bug 104549
17 years ago
17 years ago

People

(Reporter: John Morrison, Assigned: rogerl (gone))

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

17 years ago
This is in the head of the document (but it does the same thing in the <body>).

<html>
<head>
<script>
  var foo;
  if (document.blarf)
    foo = 1;
  foo = document.snarf ? 2 : 3;
</script>
</head>
</html>

When you load this page, and you have enabled JS strict warnings, there are 15 
separate warning messages printed to the JS console for each of the two 
different warnings (30 in total). Why is this warning more than once per error?
Tested in current trunk build on win2k.

Warning: reference to undefined property document.blarf
    Source File: file:///h:/foo.html
    Line: 5

    Warning: reference to undefined property document.snarf
    Source File: file:///h:/foo.html
    Line: 8
(Reporter)

Comment 1

17 years ago
Created attachment 59023 [details]
simple test case; check output in JS console for multiple duplicate warnings.
Sounds very similar to bug 104549
(Reporter)

Comment 3

17 years ago
it's a dup (although I think this is JS engine issue, not DOM).

*** This bug has been marked as a duplicate of 104549 ***
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → DUPLICATE
I didn't look at the code closely enough and thought you were doing something
different at first.  And the counts (14 vs 15) threw me off.

It could very well be an error in the engine.  rginda and fabian both thought it
was in the DOM though which is why I filed there.  I just tried this with a home
brewed object instead of a DOM object  [var foo = new Object(); if (foo.bar)
...]  and I got the errors too so it is likely.

Very ugly nonetheless. VERIFIED dupe.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.