From 4373dd4e72a9bbc35db0192920288e2c1e975124 Mon Sep 17 00:00:00 2001 From: labriola Date: Thu, 14 Feb 2013 16:42:18 -0600 Subject: [PATCH 1/4] Integration of Ben's new resolution stuff --- loader/SynchronousClassLoader.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; From c4d15a8ddce147730929664134ff1fb572bed8cd Mon Sep 17 00:00:00 2001 From: labriola Date: Mon, 8 Apr 2013 13:36:52 -0500 Subject: [PATCH 2/4] Changed name to be inline with AS version --- Properties/AssemblyInfo.cs | 4 ++-- RandoriGuiceJS.csproj => RandoriGuice.csproj | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename RandoriGuiceJS.csproj => RandoriGuice.csproj (100%) 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 100% rename from RandoriGuiceJS.csproj rename to RandoriGuice.csproj From ce8ccbf1f3d27e49ce9702b6d63631f24d4dd905 Mon Sep 17 00:00:00 2001 From: bschmidtke Date: Mon, 8 Apr 2013 18:16:36 -0500 Subject: [PATCH 3/4] Updated csproj file to use the new compiler plugin namespace & name. --- RandoriGuice.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RandoriGuice.csproj b/RandoriGuice.csproj index 1c8811b..bf23d7c 100644 --- a/RandoriGuice.csproj +++ b/RandoriGuice.csproj @@ -37,7 +37,7 @@ - + false From 683b2f63cf039a3a5bfc2c4e782eda420a54051f Mon Sep 17 00:00:00 2001 From: bschmidtke Date: Wed, 10 Apr 2013 16:39:00 -0500 Subject: [PATCH 4/4] Removing the ignore hack now that new compiler visitor handles skipping inline js --- reflection/TypeDefinition.cs | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) 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; }