AS3 Test case #4 fails 0.71

Bug #1115770 reported by zahurdias
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Lightspark
Confirmed
Medium
Unassigned

Bug Description

package
{
    import flash.display.*;

    public class test4 extends MovieClip
    {
        private var AS1StyleClass:Function;
        private var as1Instance:*;

        public function test4()
        {
        AS1StyleClass= function():*{}
        AS1StyleClass.prototype = new MovieClip();
        as1Instance= new AS1StyleClass();

        trace(as1Instance instanceof MovieClip); // true
        trace(as1Instance is MovieClip); // false - cant see prototype chain

        trace(as1Instance instanceof AS1StyleClass); // true
        trace(as1Instance is AS1StyleClass); // true

        return;
        }// end function

    }
}

Revision history for this message
zahurdias (zahurdias) wrote :

the last 2 traces output:

ERROR: Unhandled ActionScript exception in VM TypeError: Error #1040: instanceOf expects a class of function as second parameter!

with mxmlc compiler

or

ERROR: Unhandled ActionScript exception in VM TypeError: Error #1041

with Adobe FLash CS3 compiler

Revision history for this message
zahurdias (zahurdias) wrote :
zahurdias (zahurdias)
description: updated
zahurdias (zahurdias)
description: updated
Revision history for this message
Antti Ajanki (aajanki) wrote :

Confirmed, the instanceOf implementation does not check the prototype set by the user. I added a test case about this.

Changed in lightspark:
importance: Undecided → Medium
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.