W3C home > Mailing lists > Public > public-svg-wg@w3.org > October to December 2008

Proposed sentence for <handler> function

From: Cameron McCormack <cam@mcc.id.au>
Date: Sun, 26 Oct 2008 02:11:53 +1100
To: public-svg-wg@w3.org
Message-ID: <20081025151153.GA29976@arc.mcc.id.au>

Hello WG.

As discussed the other day, here is a proposed change to the Scripting
chapter to ensure that the equivalent Function object can not be broken
out of.  Change from:

  In ECMAScript, the contents of the 'handler' element behave
  conceptually as if they are the contents of a new Function object,
  created as shown:

    function(event) {
        var evt = event;
        // contents of handler
    }

  The 'event' parameter shown above is an Event object corresponding to
  the event that has triggered the 'handler'. An 'evt' variable can be
  used instead of 'event' ('evt' is an alias to 'event').
  
to:

  If a 'handler' element is declared to have ECMAScript contents, then
  the event listener that it represents is conceptually equivalent to a
  Function object created as shown:

    function(event) {
      var evt = event;
      // contents of handler
    }

  The 'event' parameter shown above is an Event object corresponding to
  the event that has triggered the 'handler'.  This object can also be
  referred to using the 'evt' identifier.  Note that to avoid the
  contents of the 'handler' being able to break out of the event
  listener function, it must match the FunctionBody production
  ([ECMA-262], section 13).

-- 
Cameron McCormack ≝ http://mcc.id.au/
Received on Saturday, 25 October 2008 15:12:41 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Saturday, 25 October 2008 15:12:44 GMT