This is more or less intended: According to ECMAScript, calling the "Function" constructor is the same as calling "new Function", snip: --- The Function Constructor Called as a Function
When Function is called as a function rather than as a constructor, it creates and initialises a new Function object. Thus the function call Function(…) is equivalent to the object creation expression new Function(…) with the same arguments. --- And the ActionScript3 docs for EvalError explain when this error occurs: --- The EvalError class represents an error that occurs when user code calls the eval() function or attempts to use the new operator with the Function object. Calling eval() and calling new with the Function object are not supported. --- So the lesson learned: don't use 'Type( expression )' if you want to cast to a ES global object! On 10/5/2009 2:27 PM, Henry Minsky wrote: > I suppose we ought to file a flex bug about that. > > On Mon, Oct 5, 2009 at 6:02 AM, André Bargull <[email protected] > <mailto:[email protected]>> wrote: > > Approved! > > > I've never seen this error before, and I'm not sure what it is > complaining about. Something in the body > of the "_trace" getter method if the swf9 debugger stubs is unhappy. > > > Apparently, you can't use "Function(...)" as a cast operator in AS3, > instead you must use "as Function" in this case. > > > > On 10/5/2009 2:43 AM, Henry Minsky wrote: > > Change 20091004-hqm-K by [email protected] on 2009-10-04 > 20:39:42 EDT > in /Users/hqm/openlaszlo/trunk6 > for http://svn.openlaszlo.org/openlaszlo/trunk > > Summary: fix call to trace() in swf9stubs > > New Features: > > Bugs Fixed: LPP-8528 > > Technical Reviewer: andre > QA Reviewer: ptw > Doc Reviewer: (pending) > > Documentation: > > Release Notes: > > Details: > > Call the system 'trace' global function from a static method, > so the scope isn't shadowed by > the local 'trace' method name. > > Tests: > run this case in swf10, nondebug mode. No runtime Flash player > error alert should display > > <canvas height="600"> > <handler name="oninit"> > Debug.debug('view init'); > </handler> > <text>foobar</text> > > </canvas> > > Files: > M WEB-INF/lps/lfc/debugger/swf9stubs.lzs > > Changeset: > http://svn.openlaszlo.org/openlaszlo/patches/20091004-hqm-K.tar > > > > > -- > Henry Minsky > Software Architect > [email protected] <mailto:[email protected]> > > _______________________________________________ Laszlo-reviews mailing list [email protected] http://www.openlaszlo.org/mailman/listinfo/laszlo-reviews
