-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoScriptAccess for constructor #444
Comments
Hi @CrosRoad95,
That's an oversight, and we'll fix it in the next release. Thanks for reporting it! Regarding your code sample above, the JavaScript syntax If you must expose public class MyAttributeLoader : CustomAttributeLoader {
public override T[] LoadCustomAttributes<T>(ICustomAttributeProvider resource, bool inherit) {
if (typeof(ScriptUsageAttribute).IsAssignableFrom(typeof(T)) && typeof(Foo).GetConstructors().Contains(resource)) {
return new[] { new NoScriptAccessAttribute() } as T[];
}
return base.LoadCustomAttributes<T>(resource, inherit);
}
} Good luck! |
Fixed in Version 7.3.6. |
Using EDIT: This seems to only be true for the parameter-less constructor. Blocking for example |
Hi @handerss-tibco,
.NET value types don't have default constructors. C# allows you to use UPDATE: It appears that default constructors for value types were added in .NET 6 and C# 10. ClearScript will support this scenario in the next release. Thanks! |
Hello again! i would like to disallow user to use class constrator and force to use method, how can i do this?
NoScriptAccess is not allowed for constructor
The text was updated successfully, but these errors were encountered: