| using System; |
| using System.Windows.Forms; |
| using Microsoft.JScript; |
| using Microsoft.JScript.Vsa; |
| |
| namespace Jscript_Net_Test; |
| |
| [Serializable] |
| public class ES1ToES3 : INeedEngine |
| { |
| public object a; |
| |
| [NonSerialized] |
| private VsaEngine vsa_0020Engine; |
| |
| static ES1ToES3() |
| { |
| } |
| |
| |
| private void _002Einit() |
| { |
| |
| a = "Windows Script Host||IE-Jscript"; |
| } |
| |
| public virtual void A() |
| { |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| LateBinding val = new LateBinding("tan"); |
| FunctionObject val2 = FunctionExpression.JScriptFunctionExpression(typeof(ES1ToES3).TypeHandle, "anonymous 0", "A.anonymous 0", new string[0], (JSLocalField[])(object)new JSLocalField[1] |
| { |
| new JSLocalField("return value", typeof(bool).TypeHandle, 0) |
| }, false, false, "function(){\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}", ((INeedEngine)this).GetEngine()); |
| FunctionObject val3 = FunctionExpression.JScriptFunctionExpression(typeof(ES1ToES3).TypeHandle, "anonymous 2", "A.anonymous 2", new string[0], (JSLocalField[])(object)new JSLocalField[2] |
| { |
| new JSLocalField("i", typeof(double).TypeHandle, 0), |
| new JSLocalField("return value", typeof(ScriptFunction).TypeHandle, 1) |
| }, true, false, "function(){\r\n\t\t\t\tvar i=0\r\n\t\t\t\treturn function(){\r\n\t\t\t\t\treturn i++;\r\n\t\t\t\t}\r\n\t\t\t}", ((INeedEngine)this).GetEngine()); |
| string text = "Jscript"; |
| double num = 5.6; |
| double num2 = 7.0; |
| object value = DBNull.Value; |
| object obj = null; |
| StringObject val4 = GlobalObject.String.CreateInstance(new object[1] { "hello" }); |
| num = GlobalObject.parseFloat((object)num); |
| num2 = GlobalObject.parseInt((object)num2, (object)Missing.Value); |
| MessageBox.Show(BooleanPrototype.toString((object)(StrictEquality.JScriptStrictEquals((object)"hello", (object)val4) ? true : false))); |
| MessageBox.Show(BooleanPrototype.toString((object)(Equality.JScriptEquals((object)"hello", (object)val4) ? true : false))); |
| JSObject obj2 = ((INeedEngine)this).GetEngine().GetOriginalObjectConstructor().ConstructObject(); |
| object[] obj3 = new object[7] |
| { |
| "a", |
| 1, |
| GlobalObject.Array.CreateInstance(new object[1] { 1 }), |
| GlobalObject.Function.CreateInstance(new object[1] { "return 1" }), |
| null, |
| null, |
| null |
| }; |
| val.obj = GlobalObject.Math; |
| obj3[4] = val.GetNonMissingValue(); |
| obj3[5] = GlobalObject.Date.CreateInstance(new object[0]); |
| obj3[6] = (object)new Closure(val2); |
| obj2.SetMemberValue2("array", (object)Globals.ConstructArrayLiteral(obj3)); |
| object obj4 = obj2; |
| object obj5 = LateBinding.CallValue((object)((IActivationObject)((INeedEngine)this).GetEngine().ScriptObjectStackTop()).GetGlobalScope(), (object)new Closure(val3), new object[0], false, false, ((INeedEngine)this).GetEngine()); |
| With.JScriptWith((object)GlobalObject.Math, ((INeedEngine)this).GetEngine()); |
| try |
| { |
| double num3 = MathObject.tan(1.0); |
| } |
| finally |
| { |
| ((INeedEngine)this).GetEngine().PopScriptObject(); |
| } |
| } |
| |
| [JSFunction(/*Could not decode attribute arguments.*/)] |
| public static bool A_002Eanonymous_00200(object @this, VsaEngine vsa_0020Engine) |
| { |
| return true; |
| } |
| |
| [JSFunction(/*Could not decode attribute arguments.*/)] |
| public static ScriptFunction A_002Eanonymous_00202(object @this, VsaEngine vsa_0020Engine) |
| { |
| |
| |
| |
| |
| |
| |
| |
| FunctionObject val = FunctionExpression.JScriptFunctionExpression(typeof(ES1ToES3).TypeHandle, "anonymous 1", "A.anonymous 2.anonymous 1", new string[0], (JSLocalField[])(object)new JSLocalField[2] |
| { |
| new JSLocalField("return value", typeof(double).TypeHandle, 0), |
| new JSLocalField("i", typeof(double).TypeHandle, 1) |
| }, false, false, "function(){\r\n\t\t\t\t\treturn i++;\r\n\t\t\t\t}", vsa_0020Engine); |
| double num = 0.0; |
| ScriptFunction val2 = (ScriptFunction)new Closure(val); |
| object[] localVars = ((StackFrame)vsa_0020Engine.ScriptObjectStackTop()).localVars; |
| localVars[0] = num; |
| localVars[1] = val2; |
| return val2; |
| } |
| |
| [JSFunction(/*Could not decode attribute arguments.*/)] |
| public static double A_002Eanonymous_00202_002Eanonymous_00201(object @this, VsaEngine vsa_0020Engine) |
| { |
| |
| |
| ScriptObject parent = vsa_0020Engine.ScriptObjectStackTop().GetParent(); |
| double num = Convert.ToNumber(((StackFrame)parent).localVars[0]); |
| parent.GetParent().GetParent(); |
| double num2; |
| num = (num2 = num) + 1.0; |
| double result = num2; |
| ScriptObject parent2 = vsa_0020Engine.ScriptObjectStackTop().GetParent(); |
| ((StackFrame)parent2).localVars[0] = num; |
| parent2.GetParent().GetParent(); |
| return result; |
| } |
| |
| public ES1ToES3() |
| { |
| |
| _002Einit(); |
| } |
| |
| private override VsaEngine GetEngine() |
| { |
| |
| if (vsa_0020Engine == null) |
| { |
| vsa_0020Engine = VsaEngine.CreateEngineWithType(typeof(ES1ToES3).TypeHandle); |
| } |
| |
| return vsa_0020Engine; |
| } |
| |
| private override void SetEngine(VsaEngine P_0) |
| { |
| |
| vsa_0020Engine = P_0; |
| } |
| }COPY |