microsoft / node-api-dotnet

Advanced interoperability between .NET and JavaScript in the same process.
MIT License
426 stars 49 forks source link

JSExportAttribute issues #274

Closed alexeybut closed 2 months ago

alexeybut commented 2 months ago

@jasongin Thanks for quick #269 fix. But I have found several issues:

Wrong comment for JSExportAttribute. You didn't add JSExcludeAttribute. Misprint publci. /// When applied to an assembly, all public types in the assembly are exported, unless excluded /// by another . When applied to a publci type, all public members Some issues in IsExported(ISymbol symbol) method. Please test the code:

[assembly: JSExport]
namespace Aspose.Words
{
    // Raises an exception.
    internal class Class1
    {
    }

    public class Class2
    {
        // Is exported.
        [JSExport(false)]
        public void ExportFalse()
        {
        }
        [JSExport(true)]
        public void ExportTrue()
        {
        }
    }
}
alexeybut commented 2 months ago
    [JSExport]
    public class Class2
    {
        // Exported
        public string Data { get; set; }
        [JSExport(false)]
        // Exported also
        public string Text { get; set; }
    }
jasongin commented 2 months ago

Thanks, apparently I did not test thoroughly enough. #275 fixes these issues.