royale-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <harbs.li...@gmail.com>
Subject Re: [royale-compiler] branch develop updated: Fixed #50
Date Wed, 12 Sep 2018 09:42:09 GMT
Is there a better way of finding whether a function is a top level function than checking whether
its parent is null?

Thanks,
Harbs

> On Sep 12, 2018, at 12:34 PM, harbs@apache.org wrote:
> 
> This is an automated email from the ASF dual-hosted git repository.
> 
> harbs pushed a commit to branch develop
> in repository https://gitbox.apache.org/repos/asf/royale-compiler.git
> 
> 
> The following commit(s) were added to refs/heads/develop by this push:
>     new 634bd37  Fixed #50
> 634bd37 is described below
> 
> commit 634bd370616029dcac40acc45eea4a36815ab25f
> Author: Harbs <harbs@in-tools.com>
> AuthorDate: Wed Sep 12 12:34:26 2018 +0300
> 
>    Fixed #50
> ---
> .../royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java    | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
> index 0dd6769..e7488fc 100644
> --- a/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
> +++ b/compiler-jx/src/main/java/org/apache/royale/compiler/internal/codegen/js/jx/FunctionCallEmitter.java
> @@ -185,7 +185,8 @@ public class FunctionCallEmitter extends JSSubEmitter implements
ISubEmitter<IFu
>                 if (def != null)
>                 {
>                     boolean isInt = def.getBaseName().equals(IASGlobalFunctionConstants._int);
> -                    if (isInt || def.getBaseName().equals(IASGlobalFunctionConstants.trace)
> +                    boolean isTrace = def.getParent() == null && def.getBaseName().equals(IASGlobalFunctionConstants.trace);
> +                    if (isInt || isTrace
>                             || def.getBaseName().equals(IASGlobalFunctionConstants.uint))
>                     {
>                         ICompilerProject project = this.getProject();
> 


Mime
View raw message