Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id ECF28200BD3 for ; Tue, 6 Dec 2016 08:41:38 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id EB858160B1B; Tue, 6 Dec 2016 07:41:38 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1821D160B0C for ; Tue, 6 Dec 2016 08:41:37 +0100 (CET) Received: (qmail 34218 invoked by uid 500); 6 Dec 2016 07:41:37 -0000 Mailing-List: contact dev-help@flex.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@flex.apache.org Delivered-To: mailing list dev@flex.apache.org Received: (qmail 34202 invoked by uid 99); 6 Dec 2016 07:41:36 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Dec 2016 07:41:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 5FA7CC0FA0 for ; Tue, 6 Dec 2016 07:41:36 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.82 X-Spam-Level: X-Spam-Status: No, score=-1.82 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.999, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=hotmail.com Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 3SWt17hyukt2 for ; Tue, 6 Dec 2016 07:41:34 +0000 (UTC) Received: from SNT004-OMC4S43.hotmail.com (snt004-omc4s43.hotmail.com [65.54.51.94]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id 03EEA5F4A7 for ; Tue, 6 Dec 2016 07:41:33 +0000 (UTC) Received: from NAM02-CY1-obe.outbound.protection.outlook.com ([65.55.90.199]) by SNT004-OMC4S43.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.23008); Mon, 5 Dec 2016 23:41:28 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hotmail.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=H/fFd44fRjeICnZKZMWwp45EJZj+MD31sbujxMY5kx4=; b=BGaSu8ZTmX5gPxyAG+jXOLueT0n6snToUG2DrafSq0KVILCT/+bk/hA8CrdjBQyRg4BXT0kUE77nAOE0ff3mEb+P6c1gjmgNM72Dn5LweiKNL3f9Y7aQ3BnYH1ppaB8HVh+aHFqMLFjWhqyOg0hvbRr+CxmuO7nsRHUcSIvSoW8hNbRhwENBOF3cKP0ZOJiI706bTLm263g3ZSGqv3Uy4aLc2YDjwtbTe8gabXYnHEWb2cg/TAp/OIP0I2nM/48NvcsWMBxe67RU9zWd69cBYrfuYVLEnkHxV9HJesEJU/4iBWnVVNEn6rknXHWALyA6glcKWdDKl58082aqoGCFJw== Received: from CY1NAM02FT041.eop-nam02.prod.protection.outlook.com (10.152.74.53) by CY1NAM02HT057.eop-nam02.prod.protection.outlook.com (10.152.74.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.734.4; Tue, 6 Dec 2016 07:41:26 +0000 Received: from BY2PR12MB0582.namprd12.prod.outlook.com (10.152.74.58) by CY1NAM02FT041.mail.protection.outlook.com (10.152.74.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.6 via Frontend Transport; Tue, 6 Dec 2016 07:41:26 +0000 Received: from BY2PR12MB0582.namprd12.prod.outlook.com ([10.163.112.28]) by BY2PR12MB0582.namprd12.prod.outlook.com ([10.163.112.28]) with mapi id 15.01.0747.020; Tue, 6 Dec 2016 07:41:26 +0000 From: Yishay Weiss To: "dev@flex.apache.org" Subject: RE: [FALCONJX][FLEXJS} SWF Subclass (and other) Overrides Thread-Topic: [FALCONJX][FLEXJS} SWF Subclass (and other) Overrides Thread-Index: AQHSTyhKLGh+QcHmxECSHc68CWVJNKD6ifpv Date: Tue, 6 Dec 2016 07:41:26 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: flex.apache.org; dkim=none (message not signed) header.d=none;flex.apache.org; dmarc=none action=none header.from=hotmail.com; x-incomingtopheadermarker: OriginalChecksum:72895EA912D3FE58A241001ACCCDF5F40A159D02102B27EBD396D98C9BE19B4D;UpperCasedChecksum:EF16FAB7019B95C9482351489FA02D390B5B2E9AF507CC5A4497328D61D6B931;SizeAsReceived:7373;Count:39 x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [MPQ/w1JQpdod9PIL4O8OexHozvP5TTzB] x-incomingheadercount: 39 x-eopattributedmessage: 0 x-microsoft-exchange-diagnostics: 1;CY1NAM02HT057;5:PBqp071bK4cez1Es7pc4Izkg88sqYxU+DhvSDtESUe5C1CB0KjQ7rOQvGg7IoOhKlr1+t4mfu4HbvR9cdxRKX8C/QlGXbe+nxaGnU6Bpa63mwVxGgjqFVy+TaIdl+x/ela3Px+FzQ3ymyuBl43TKRg==;24:yI4mWUSmHGd9/vt4eLqtsi2z7TCFA2I2CfXgBCBbc7alBr4NBI/Mx44vwqQkeLM7zIyb3C68klzPjY8GQ8e3xxYScxrQzIDK9RikmKd1HOk=;7:bBZkyQ3xJC35dwrXuUPc4GyGWnmfUB1IlXxf6bNKhR/AQu1hg0Ty6ADfEVjUzO/cJ1boHjV5qaBu1kD7WAAbCD/OZNeoXALgl4H6fWtajoIzjNQ4lTUqL1WYvc5JT/Cf9aVF9qahmhHTdWb+OmnttkrA8JU3JNZ/z6Na4fKqUpqz4Vxh68qNLjGBZfPg42mYM5nmGRG92KwwNVPiyfmtRbu/hAC6FvR21N8wLvoLhtXRs98Mv1A5KsVoOkcVazToviERbMdapZZSQ58mo9Iq9omc3ER3QefaFNM4FJWtJIcTq5HqmnVLj4QTqEZ1nFbjdeog9H2EJjMJgOba4GMpn2qzN43jnnzSMJtdQgYLNYg= x-forefront-antispam-report: EFV:NLI;SFV:NSPM;SFS:(10019020)(98900003);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1NAM02HT057;H:BY2PR12MB0582.namprd12.prod.outlook.com;FPR:;SPF:None;LANG:en; x-ms-office365-filtering-correlation-id: 7d97fe51-401b-4aad-936e-08d41dab48c8 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(1601124038)(1603103113)(1601125047)(1603101340);SRVR:CY1NAM02HT057; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(432015012)(82015046);SRVR:CY1NAM02HT057;BCL:0;PCL:0;RULEID:;SRVR:CY1NAM02HT057; x-forefront-prvs: 01480965DA spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: multipart/alternative; boundary="_000_BY2PR12MB0582926EBB09DB26178A4FE8C8820BY2PR12MB0582namp_" MIME-Version: 1.0 X-OriginatorOrg: hotmail.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Dec 2016 07:41:26.3049 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Internet X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1NAM02HT057 X-OriginalArrivalTime: 06 Dec 2016 07:41:28.0141 (UTC) FILETIME=[275E47D0:01D24F94] archived-at: Tue, 06 Dec 2016 07:41:39 -0000 --_000_BY2PR12MB0582926EBB09DB26178A4FE8C8820BY2PR12MB0582namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Sounds good. Will you be addressing code-hinting issues? From: Alex Harui Sent: Monday, December 5, 2016 8:50 PM To: dev@flex.apache.org Subject: [FALCONJX][FLEXJS} SWF Subclass (and other) Overrides Hi, I just pushed changes to allow certain kinds of overrides in SWF that normally aren't possible. The reasoning behind doing this is to allow us to have a library that extends SWF classes like Sprite but hide the flash APIs. For example, in Sprite, the parent property is defined as a flash.display.DisplayObjectContainer. In FlexJS, we would much rather use a non-Flash API like org.apache.flex.core.IParent, so a parent can be platform-agnostic. Similarly, the dispatchEvent API takes a flash.events.Event and it would be better to have it take an org.apache.flex.events.Event, or maybe an org.apache.flex.events.IFlexJSEvent. So, in our base classes, we would want to write: override public function get parent():IParent And override public function dispatchEvent(event:org.apache.flex.events.Event):Boolean But not only would the SWF compiler not allow that, the Flash runtime checks the type of any override at runtime and reports an error if there isn't a match (and such an issue would not be caught by the JS runtime). So to get this all to work, the compiler needs to know that certain type-mismatches are allowed, and also to restore the type to the original type in the SWF. To do so, I taught the compiler to look for a SWFOverride metadata that provides the original types for parameters or return values. When the compiler sees a mismatch, it checks for metadata allowing the mismatch. And when writing out the SWF, it also checks for the metadata and replaces the types in the ABC traits. So far, in minimal testing, it seems to work. Next up, after fixing a bunch of bugs in the queue, is to work on having the compiler generate both SWF and JS output in a single run. Then with proper overriding of various Flash APIs, we should be able to provide a more efficient way for FlexJS developers to see any conflicts with underlying platform implementations without having to wrap every implementation. Later, -Alex --_000_BY2PR12MB0582926EBB09DB26178A4FE8C8820BY2PR12MB0582namp_--