ClassClosure needs a "constructObject" method with no args

NEW
Unassigned

Status

Tamarin
Virtual Machine
7 years ago
7 years ago

People

(Reporter: Steven Johnson, Unassigned)

Tracking

Details

(Reporter)

Description

7 years ago
There are use cases in Flash (eg AMF handling) that use a ClassClosure to construct a plain ScriptObject, by calling into construct() with 0 args (all such usage assumes that the class being constructed has a compatible ctor, of course).

IMHO it's preferable to deprecate non-VM code calling the construct(argc,argv) method directly, and add a new method ("constructPlainObject()") for this purpose.

I'm unsure on a good name, though; "constructObject" is problematic: if we were returning naked pointers, then a covariant return type would be OK:

    ClassClosure:
        ScriptObject* constructObject();
    SomeSubclass:
        SomeSubclass* constructObject(); 

But we really want to return GCRef<>s, so I suspect this would be an illegal override:


    ClassClosure:
        GCRef<ScriptObject> constructObject();
    SomeSubclass:
        GCRef<SomeSubclass> constructObject(); 

Any votes for a name? constructAnonObject? constructPlainObject?

Comment 1

7 years ago
instantiate()?
You need to log in before you can comment on or make changes to this bug.