// Edit And Continue, while on pause, can add a new type to the assembly. public virtual __Type[] GetTypes() { // how would it help if we were to add a new type during debug? // the server would need to notify the client of a new type! // X:\jsc.svn\examples\javascript\test\TestEditAndContinueWithColor\TestEditAndContinueWithColor\Application.cs // would a sub application, running in an iframe // be able to merge with the host applicationa and switch to it? // only if the corelib is the same? // its like downloading a secondary app from the server // like chrome extension tab injection? var t = this.__Value.Types; var x = new __Type[t.Length]; for (int i = 0; i < t.Length; i++) { var constructor = global::ScriptCoreLib.JavaScript.Runtime.Expando.Of(t[i]); var p = new __RuntimeTypeHandle { Value = (IntPtr)(object)constructor.prototype }; x[i] = new __Type { TypeHandle = p }; } return(x); }
new public Type GetType() { var x = new __RuntimeTypeHandle( GetPrototype(this) //(IntPtr) new DOM.IFunction("i", "return i.constructor.prototype;").apply(null, this) ); return Type.GetTypeFromHandle(x); }
public virtual __Type[] GetTypes() { var t = this.__Value.Types; var x = new __Type[t.Length]; for (int i = 0; i < t.Length; i++) { var constructor = global::ScriptCoreLibAppJet.JavaScript.Runtime.Expando.Of(t[i]); var p = new __RuntimeTypeHandle { Value = (IntPtr)(object)constructor.prototype }; x[i] = new __Type { TypeHandle = p }; } return(x); }
/// <summary> /// This is a javascript application. /// </summary> /// <param name="page">HTML document rendered by the web server which can now be enhanced.</param> public Application(IApp page) { var t = typeof(Application); var h = t.TypeHandle; // i.constructor.prototype var i = h.Value; // function LFTSZNW_bajmpg67CwzN3Xw() { } // LFTSZNW_bajmpg67CwzN3Xw.TypeName = "IDbDataParameter"; // LFTSZNW_bajmpg67CwzN3Xw.Assembly = di7d9h5asU2PTUWT6s85lQ; // LFTSZNW_bajmpg67CwzN3Xw.Interfaces = //{ // IzkeSBiD_aTGMsWPjgYVYEg: // 1 // , f7G82WqfyzOLoZ_b8v0KVxw: // 1 //}; // var type$LFTSZNW_bajmpg67CwzN3Xw = LFTSZNW_bajmpg67CwzN3Xw.prototype; // type$LFTSZNW_bajmpg67CwzN3Xw.constructor = LFTSZNW_bajmpg67CwzN3Xw; // 0:28ms {{ i = [object Object] }} Console.WriteLine( new { i } ); // whats the name of the typeHandle? var scope = Expando.Of(Native.self).GetMemberNames(); Console.WriteLine(new { scope.Length }); //0:53ms { { i = [object Object] } } //0:75ms { { Length = 4634 } } //0:104ms { { item = type$MHnq0rsJXjG69YnNoGDJfQ } } //0:105ms { { xt = < Namespace >.Application } } foreach (var item in scope) { dynamic s = Native.self; object value = s[item]; if (value == (object)i) { Console.WriteLine(new { item }); IntPtr ii = s[item]; RuntimeTypeHandle xh = new __RuntimeTypeHandle(ii); var xt = Type.GetTypeFromHandle(xh); //stateTypeHandleIndex = type$XjKww8iSKT_aFTpY_bSs5vBQ, stateType = < Namespace >., Console.WriteLine(new { xt }); break; } } }