Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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("")]
Expand Down
2 changes: 1 addition & 1 deletion RandoriGuiceJS.csproj → RandoriGuice.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
<ItemGroup>
<SkcPlugin Include="net.digitalPrimates.GuiceMetadataPlugin, RandoriSharpKitExtensions">
<SkcPlugin Include="randori.compiler.RandoriCompilerPlugin, RandoriCompilerPlugin">
<InProject>false</InProject>
</SkcPlugin>
</ItemGroup>
Expand Down
4 changes: 2 additions & 2 deletions loader/SynchronousClassLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
27 changes: 12 additions & 15 deletions reflection/TypeDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,22 +101,19 @@ public object constructorApply(JsArray<object> 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;
}
Expand Down