nikhilk / scriptsharp

Script# Project - a C# to JavaScript compiler, to power your HTML5 and Node.js web development.
http://scriptsharp.com
Other
658 stars 182 forks source link

ScriptIgnoreNamespaceAttribute Don't work :( #402

Closed Unvilon closed 11 years ago

Unvilon commented 11 years ago

For example:

namespace Villain512JSTools { [ScriptIgnoreNamespace] internal static class TextE { static RegExp IsUrlRegex = new RegExp(@"/^(https?:\/\/)?([\da-z.-]+).([a-z.]{2,6})([\/\w .-])\/?$/"); public static bool IsUrl(string s) { return IsUrlRegex.Test(s); } } }

compiled as

function Villain512JSTools$TextE() { } Villain512JSTools$TextE.isUrl = function(s) { return Villain512JSTools$TextE._isUrlRegex.test(s); } var Villain512JSTools$TextE$ = {

};

It is in every class

why?

andekande commented 11 years ago

strange, can't reproduce this in cc branch

nikhilk commented 11 years ago

In the current code, namespace-qualified names are only generated if you have similarly named classes within different namespaces in the same assembly, which should hopefully be quite rare.

ScriptIgnoreNamespace is only useful when defining imported types - it has no effect for script# generated scripts.