[Webkit-unassigned] [Bug 47862] Web Inspector: js executed in the console doesn't trigger strict mode

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Feb 3 14:08:51 PST 2011


steve_sims7 at yahoo.co.uk changed:

           What    |Removed                     |Added
                 CC|                            |steve_sims7 at yahoo.co.uk

--- Comment #4 from steve_sims7 at yahoo.co.uk  2011-02-03 14:08:51 PST ---
This inspector console behaviour is infectious, affecting not only immediate calls but seemingly the entire call stack, and can lead to the mistaken belief that WebKit doesn't properly support strict mode.

To test this out I entered the following two function definitions into both the WebKit inspector, and Firebug on Firefox 4:

function test() { "use strict"; return this === undefined }
function test2() { "use strict"; return test() }

Executing both these functions returns false in WebKit, and true in Firefox 4.  Given the description given in other comments of how the WebKit inspector works I had thought that calling test2() would have returned true in WebKit.

I then attempted to simulate how the WebKit inspector operates by trying the following in Firefox 4:
with (window) { test(); }
with (window) { test2(); }

The first of these returned false, but the second (calling test2()) returns true, which is what I expected.  (Attempting these in WebKit returns false for both.)

Sadly, and frustratingly, this behaviour would seem to make the inspector console useless when it comes to attempting to test or use strict mode code.  :-(

Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

More information about the webkit-unassigned mailing list