Closed Bug 638998 Opened 14 years ago Closed 14 years ago

Need a way to specify that classes can't be constructed from AS3, only C++

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: stejohns, Assigned: stejohns)

Details

Attachments

(1 file)

It's another common use case in Flash/AIR; we should support it directly in nativegen, rather than continue to use the convoluted constructRestrictedObject() call.
Attached patch PatchSplinter Review
This allows construct="native" to mean "cannot be instantiated from AS3, ever"; the only way to construct such an object is via its classes constructObject() method, called from C++.
Assignee: nobody → stejohns
Attachment #517058 - Flags: superreview?(edwsmith)
Attachment #517058 - Flags: review?(rreitmai)
Would an alternative be to fast-track the "private/namespaced constructor" language change that's slated for this year, or is that too wrenching / too long to wait? I'm asking because what's going on here is that you have a constructor that's in a namespace that only the C++ code has access to. (At least let's make sure the two mechanisms will be compatible. I'll inspect this patch further tomorrow.)
Too long to wait, IMHO; rationalizing all the construction paths in C++ is a gating factor for ANI. Additionally, the current implementation of constructRestrictedObject() in Flash is too horrible for words (or for sharing in public).
Comment on attachment 517058 [details] [diff] [review] Patch Adding Lars, to get feedback on whether this mechanism will likely work well with the future restricted-ctor language work.
Attachment #517058 - Flags: feedback?(lhansen)
Attachment #517058 - Flags: review?(rreitmai) → review+
Comment on attachment 517058 [details] [diff] [review] Patch Seems reasonable.
Attachment #517058 - Flags: feedback?(lhansen) → feedback+
changeset: 6063:f4943b15ab15 user: Steven Johnson <stejohns@adobe.com> summary: Bug 638998 - Need a way to specify that classes can't be constructed from AS3, only C++ (r=rreitmai) http://hg.mozilla.org/tamarin-redux/rev/f4943b15ab15
changeset: 6066:2c605c7887fa user: Steven Johnson <stejohns@adobe.com> summary: Bug 638998 followup: NativeBaseClass construction needs to be skipped in -Dverifyonly mode (r=me) http://hg.mozilla.org/tamarin-redux/rev/2c605c7887fa
changeset: 6071:ba14945d29db user: Steven Johnson <stejohns@adobe.com> summary: Bug 638998 followup: NativeBaseClass construction needs to be skipped in -Dverifyonly mode; applying for the second time as change 6067:4bd8f4b4fa01 accidentally reverted this change, sigh (r=me again) http://hg.mozilla.org/tamarin-redux/rev/ba14945d29db
Comment on attachment 517058 [details] [diff] [review] Patch ClassClosure.cpp:190 > // tbhis typo, caps, please fix in TR.
Attachment #517058 - Flags: superreview?(edwsmith) → superreview+
changeset: 6076:9758cb0c4682 user: Steven Johnson <stejohns@adobe.com> summary: Bug 638998 followup: fix type in comment (r=edwsmith) http://hg.mozilla.org/tamarin-redux/rev/9758cb0c4682
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: