Closed Bug 725468 Opened 12 years ago Closed 8 years ago

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

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: andres.pagella, Unassigned)

Details

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.
Component: Untriaged → Developer Tools: Console
QA Contact: untriaged → developer.tools.console
can we get someone to confirm this?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: qawanted
OS: Mac OS X → All
Priority: -- → P3
Hardware: x86 → All
Version: 11 Branch → Trunk
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
Closed: 8 years ago
Resolution: --- → WORKSFORME
Product: Firefox → DevTools
You need to log in before you can comment on or make changes to this bug.