JavaScript Console reports exceptions as warnings when using "use strict"

RESOLVED WORKSFORME

Status

()

Firefox
Developer Tools: Console
P3
normal
RESOLVED WORKSFORME
5 years ago
8 months ago

People

(Reporter: Andres Pagella, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.77 Safari/535.7

Steps to reproduce:

Running the following test:

<html>
    <body>
        <script>
        "use strict";
        a=4;
        </script>
    </body> 
</html>

The js console reports the undeclared assignment as a warning instead of an exception on FF11-OSX.


Actual results:

The console reported an exception as a warning on the js console on FF11 - OSX when using "use strict".


Expected results:

It should have reported the undeclared assignment as an exception. If you surround the assignment inside a try-catch block it catches the exception, but the console is showing a warning instead. I've been told that the problem doesn't happen on FF11 - Windows (the console reports an exception), so it seems to be unique to OSX.
(Reporter)

Updated

5 years ago
Component: Untriaged → Developer Tools: Console

Updated

5 years ago
QA Contact: untriaged → developer.tools.console
can we get someone to confirm this?
Keywords: qawanted

Updated

4 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: qawanted
OS: Mac OS X → All
Priority: -- → P3
Hardware: x86 → All
Version: 11 Branch → Trunk

Comment 2

11 months ago
As of Firefox 46.0.1, "use strict"; seems to have no effect at all.
Shift+F4 to open Scratchpad >

// The following should report incorrect inner function definition, and missing semicolons. It should fail, but it doesn't.

"use strict";
function outer() {
  function innerShouldNotBeAllowedInStrict() {}
}

outer()

1+2
The bug as reported worksforme on mac.  Comment 2 doesn't look related to this bug; it's about putting things in scratchpad in strict mode, not how console reports strict mode failures from web pages (where putting things in strict mode works just fine).
Status: NEW → RESOLVED
Last Resolved: 8 months ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.