You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ah...@apache.org on 2019/06/17 18:02:16 UTC

[royale-asjs] 04/04: suppress implicit coercions because we cheat and use JSON objects instead of actual instances

This is an automated email from the ASF dual-hosted git repository.

aharui pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git

commit a09ea1e3a835226ea880ca2bfa7161e11ece22a5
Author: Alex Harui <ah...@apache.org>
AuthorDate: Mon Jun 17 11:01:52 2019 -0700

    suppress implicit coercions because we cheat and use JSON objects instead of actual instances
---
 examples/royale/ASDoc/src/main/royale/models/ASDocModel.as | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as b/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
index bb530d7..493b46e 100644
--- a/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
+++ b/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
@@ -493,6 +493,9 @@ package models
             }
         }
         
+        /**
+         * @royalesuppresscompleximplicitcoercion false
+         */
         private function addIfNeededAndMakeAttributes(arr:Array, data:ASDocClassEvents):void
         {
         	var n:int = arr.length;
@@ -528,6 +531,9 @@ package models
         	arr.push(data);
         }
 
+        /**
+         * @royalesuppresscompleximplicitcoercion false
+         */
 		private function addAttributes(dest:ASDocClassEvents, src:ASDocClassEvents):void
 		{
 			if (!src.tags) return;
@@ -884,6 +890,9 @@ package models
             filterPackageList();
         }
 
+        /**
+         * @royalesuppresscompleximplicitcoercion false
+         */
         public function filterByTags(className:String):Boolean
         {
             var classData:ASDocClass = masterData["filterData"][className];


Re: [royale-asjs] 04/04: suppress implicit coercions because we cheat and use JSON objects instead of actual instances

Posted by Greg Dove <gr...@gmail.com>.
Hi Alex,

My apologies, but I may have messed this directive up a bit with the
earlier change from 'negative' to 'positive' semantics in the config
settings. I just added compiler tests for the output variations and
adjusted the logic for these checks to make them pass, so now the following
should work properly:

@royalesuppresscompleximplicitcoercion false
means 'don't suppress the coercion' (the coercion is on by default). This
would be unusual to use, but could be to used to locally override a
compilation config setting which suppresses it everywhere, so that it is
still output inside a particular method, for example. It sounds like it is
the opposite of the intent in your commit comment, but I guess you tried
this because the boolean toggles were not working correctly/intuitively.


if you want it suppressed locally, you should be able to use 'true' or use
it with no additional specifier, otherwise you can also use it in a similar
way to @royaleignorecoercion with specific types. This should work
correctly now after my fix.

for example:
 var classData:ASDocClass = masterData["filterData"][className];

you can use:
@royalesuppresscompleximplicitcoercion ASDocClass

but the following should (after the fix) suppress all implicit coercions in
the annotated method scope  :
@royalesuppresscompleximplicitcoercion
@royalesuppresscompleximplicitcoercion true

If you want it off completely for the current build, it is best done via
the config setting for the compilation, and then you need no annotations
anywhere.
I did provide some information about the config settings recently in a
post, but I'm going to write this stuff up this week and add it to the
docs. Sorry I should have done that already. I will get it done this week.

Greg


On Tue, Jun 18, 2019 at 6:02 AM <ah...@apache.org> wrote:

> This is an automated email from the ASF dual-hosted git repository.
>
> aharui pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
>
> commit a09ea1e3a835226ea880ca2bfa7161e11ece22a5
> Author: Alex Harui <ah...@apache.org>
> AuthorDate: Mon Jun 17 11:01:52 2019 -0700
>
>     suppress implicit coercions because we cheat and use JSON objects
> instead of actual instances
> ---
>  examples/royale/ASDoc/src/main/royale/models/ASDocModel.as | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
> b/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
> index bb530d7..493b46e 100644
> --- a/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
> +++ b/examples/royale/ASDoc/src/main/royale/models/ASDocModel.as
> @@ -493,6 +493,9 @@ package models
>              }
>          }
>
> +        /**
> +         * @royalesuppresscompleximplicitcoercion false
> +         */
>          private function addIfNeededAndMakeAttributes(arr:Array,
> data:ASDocClassEvents):void
>          {
>                 var n:int = arr.length;
> @@ -528,6 +531,9 @@ package models
>                 arr.push(data);
>          }
>
> +        /**
> +         * @royalesuppresscompleximplicitcoercion false
> +         */
>                 private function addAttributes(dest:ASDocClassEvents,
> src:ASDocClassEvents):void
>                 {
>                         if (!src.tags) return;
> @@ -884,6 +890,9 @@ package models
>              filterPackageList();
>          }
>
> +        /**
> +         * @royalesuppresscompleximplicitcoercion false
> +         */
>          public function filterByTags(className:String):Boolean
>          {
>              var classData:ASDocClass =
> masterData["filterData"][className];
>
>