diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index d8f341b..b849ce5 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -5,11 +5,11 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("RandoriGuiceJS")] +[assembly: AssemblyTitle("RandoriGuice")] [assembly: AssemblyDescription("JavaScript implemention of the Google Guice project to work with Randori metadata")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("LTN Consulting, Inc. /dba Digital Primates®")] -[assembly: AssemblyProduct("RandoriGuiceJS")] +[assembly: AssemblyProduct("RandoriGuice")] [assembly: AssemblyCopyright("Copyright © 2012 LTN Consulting dba/ Digital Primates® 2012")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/RandoriGuiceJS.csproj b/RandoriGuice.csproj similarity index 97% rename from RandoriGuiceJS.csproj rename to RandoriGuice.csproj index 1c8811b..bf23d7c 100644 --- a/RandoriGuiceJS.csproj +++ b/RandoriGuice.csproj @@ -37,7 +37,7 @@ - + false diff --git a/loader/SynchronousClassLoader.cs b/loader/SynchronousClassLoader.cs index 2daa18b..bc82c6c 100644 --- a/loader/SynchronousClassLoader.cs +++ b/loader/SynchronousClassLoader.cs @@ -23,10 +23,10 @@ namespace guice.loader { public class SynchronousClassLoader { - readonly XMLHttpRequest xmlHttpRequest; + readonly protected XMLHttpRequest xmlHttpRequest; readonly JsString dynamicClassBaseUrl; - public string loadClass( JsString qualifiedClassName ) { + public virtual string loadClass( JsString qualifiedClassName ) { JsRegExp classNameRegex = new JsRegExp("\\.", "g"); var potentialURL = qualifiedClassName.replace(classNameRegex, "/"); potentialURL = dynamicClassBaseUrl + potentialURL; diff --git a/reflection/TypeDefinition.cs b/reflection/TypeDefinition.cs index a0c57b4..e526d70 100644 --- a/reflection/TypeDefinition.cs +++ b/reflection/TypeDefinition.cs @@ -101,22 +101,19 @@ public object constructorApply(JsArray args) { object instance = null; - - JsContext.JsCode("void('#RANDORI_IGNORE_BEGIN')"); JsContext.JsCode(@" -if ( this._builtIn ) { - instance = new this.type(); -} else { - var f, c; - c = this.type; // reference to class constructor function - f = function(){}; // dummy function - f.prototype = c.prototype; // reference same prototype - instance = new f(); // instantiate dummy function to copy prototype properties - c.apply(instance, args); // call class constructor, supplying new object as context - instance.constructor = c; // assign correct constructor (not f) -} -"); - JsContext.JsCode("void('#RANDORI_IGNORE_END')"); + if ( this._builtIn ) { + instance = new this.type(); + } else { + var f, c; + c = this.type; // reference to class constructor function + f = function(){}; // dummy function + f.prototype = c.prototype; // reference same prototype + instance = new f(); // instantiate dummy function to copy prototype properties + c.apply(instance, args); // call class constructor, supplying new object as context + instance.constructor = c; // assign correct constructor (not f) + } + "); return instance; }