Loading ...
Sorry, an error occurred while loading the content.

89Re: [caplet] Re: Javascript mystery

Expand Messages
  • Mike Samuel
    Oct 10, 2007
    • 0 Attachment
      To make sure I'm clear, you're using the square free bookmarklet (the first entry, [shell], at http://www.squarefree.com/bookmarklets/webdevel.html ) not http://www.squarefree.com/shell/shell.html.

      And then you do
        function foo() { print(this); print(this === window); }
        foo.call(undefined)
      and you get the output
        [Window]
        false
      ?

      I can repeat using the squarefree bookmarklet, but not the shell webpage.






      On 10/10/2007, Mark S. Miller <erights@...> wrote:

      On 10/9/07, Mike Samuel <mikesamuel@...> wrote:
      > I can't repeat your example under the squarefree shell on FF2.0.0.7 on Linux.
      > And I can't reproduce by playing around with 'with' blocks, window subclasses, or eval.call.

      I've just repeated it on FF2.0.0.7 on Linux. For all the tests I've
      done on both, I haven't yet seen any difference between FF on Linux
      vs. Mac. Ben's msg led to some more experiments:

      When I try this using the standalone squarefree shell page at
      http://www.squarefree.com/shell/shell.html I don't get the peculiar
      behavior. It only happens when I use the squarefree shell bookmarklet
      available from http://www.squarefree.com/bookmarklets/webdevel.html .
      When using the bookmarklet, it does open the shell up in a different
      window from the one it's examining. The mystery window from my example
      is the bookmarklet's new window. Typing

      function foo() {return this;}
      foo.call(null).close()

      into the bookmarklet's shell does cause it to close itself.

      --
      Cheers,
      --MarkM


    • Show all 13 messages in this topic