SVGT 1.2: event handler function equivalent code is invalid ECMAScript syntax

The spec says, in section 15.5, that ECMAScript event handlers are  
equivalent to:

Function(evt) {
     // contents of handler
}

This is not syntactically valid JavaScript. "function" with a lower  
case f is the function expression keyword and would work in this  
context. "Function" with a capital "F" is the name of the Function  
constructor, but it can't take a bare identifierl as an argument, nor  
can it be followed by a block to provide the body. This needs to be  
either:

function(evt) {
     // contents of handler
}

OR

new Function("evt", " // contents of handler ");

Regards,
Maciej

Received on Wednesday, 28 December 2005 10:17:05 UTC