edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/ClassInitGenerator/Program.cs;C444795 File: Program.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/ClassInitGenerator/Program.cs;C444795 (server) 5/28/2008 11:13 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/ClassInitGenerator/Program.cs;Kernel @@ -158,10 +158,10 @@ public bool IsPrimitive { get { return !IsExtension && ( - QualifiedName == RubyClass.KernelName - || QualifiedName == RubyClass.MainSingletonName + QualifiedName == RubyClass.MainSingletonName || QualifiedName == RubyClass.ClassSingletonName || QualifiedName == RubyClass.ClassSingletonSingletonName + || Extends == typeof(Kernel) || Extends == typeof(Object) || Extends == typeof(RubyClass) || Extends == typeof(RubyModule) @@ -187,10 +187,9 @@ internal string GetReference(ref int defVariableId) { if (DefVariable == null) { - // Object and Kernel are hardcoded: if (Extends == typeof(Object)) { DefVariable = ObjectClassRef; - } else if (QualifiedName == RubyClass.KernelName) { + } else if (Extends == typeof(Kernel)) { DefVariable = KernelModuleRef; } else if (Extends == typeof(RubyModule)) { DefVariable = ModuleClassRef; =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C450310 File: Initializers.Generated.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;C450310 (server) 5/28/2008 10:52 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Initializers.Generated.cs;Kernel @@ -56,9 +56,9 @@ #endif // Skipped primitive: Object ExtendModule(typeof(System.Collections.Generic.IDictionary), new System.Action(LoadSystem__Collections__Generic__IDictionary_Instance), null, new Ruby.Builtins.RubyModule[] {def18, }); - ExtendModule(typeof(System.Collections.IEnumerable), new System.Action(LoadSystem__Collections__IEnumerable_Instance), null, new Ruby.Builtins.RubyModule[] {def18, }); + Ruby.Builtins.RubyModule def31 = ExtendModule(typeof(System.Collections.IEnumerable), new System.Action(LoadSystem__Collections__IEnumerable_Instance), null, new Ruby.Builtins.RubyModule[] {def18, }); ExtendModule(typeof(System.Collections.IList), new System.Action(LoadSystem__Collections__IList_Instance), null, new Ruby.Builtins.RubyModule[] {def18, }); - Ruby.Builtins.RubyModule def31 = ExtendModule(typeof(System.IComparable), new System.Action(LoadSystem__IComparable_Instance), null, new Ruby.Builtins.RubyModule[] {def27, }); + ExtendModule(typeof(System.IComparable), new System.Action(LoadSystem__IComparable_Instance), null, new Ruby.Builtins.RubyModule[] {def27, }); DefineGlobalClass("Array", typeof(Ruby.Builtins.RubyArray), Context.ObjectClass, new System.Action(LoadArray_Instance), new System.Action(LoadArray_Class), new Ruby.Builtins.RubyModule[] {def18, }, new System.Delegate[] { new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ArrayOps.CreateArray), new Microsoft.Scripting.Utils.Function(Ruby.Builtins.ArrayOps.CreateArray), @@ -2180,347 +2180,347 @@ private void LoadKernel_Instance(Ruby.Builtins.RubyModule/*!*/ module) { module.DefineLibraryMethod("__id__", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetObjectId), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetObjectId), }); module.DefineLibraryMethod("__send__", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.SendMessage), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.SendMessage), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.SendMessage), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.SendMessage), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.SendMessage), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.SendMessage), }); module.DefineLibraryMethod("=~", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Match), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Match), }); module.DefineLibraryMethod("==", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ValueEquals), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ValueEquals), }); module.DefineLibraryMethod("===", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.HashEquals), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.HashEquals), }); module.DefineLibraryMethod("Array", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ToArray), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ToArray), }); module.DefineLibraryMethod("at_exit", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.AtExit), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.AtExit), }); module.DefineLibraryMethod("binding", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetLocalScope), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetLocalScope), }); module.DefineLibraryMethod("block_given?", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.HasBlock), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.HasBlock), }); module.DefineLibraryMethod("caller", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetStackTrace), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetStackTrace), }); module.DefineLibraryMethod("catch", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Catch), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Catch), }); module.DefineLibraryMethod("class", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetClass), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetClass), }); module.DefineLibraryMethod("clone", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Clone), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Clone), }); module.DefineLibraryMethod("dup", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Duplicate), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Duplicate), }); module.DefineLibraryMethod("eql?", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ValueEquals), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ValueEquals), }); module.DefineLibraryMethod("equal?", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Equal), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Equal), }); module.DefineLibraryMethod("eval", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Evaluate), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Evaluate), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Evaluate), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Evaluate), }); module.DefineLibraryMethod("exit", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Exit), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Exit), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Exit), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Exit), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Exit), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Exit), }); module.DefineLibraryMethod("exit!", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.TerminateExecution), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.TerminateExecution), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.TerminateExecution), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.TerminateExecution), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.TerminateExecution), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.TerminateExecution), }); module.DefineLibraryMethod("extend", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Extend), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Extend), }); module.DefineLibraryMethod("fail", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action>(Ruby.Builtins.Kernel.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action>(Ruby.Builtins.KernelOps.RaiseException), }); module.DefineLibraryMethod("Float", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ToFloat), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ToFloat), }); module.DefineLibraryMethod("format", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Sprintf), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Sprintf), }); module.DefineLibraryMethod("freeze", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Freeze), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Freeze), }); module.DefineLibraryMethod("frozen?", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Frozen), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Frozen), }); module.DefineLibraryMethod("gets", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ReadInputLine), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ReadInputLine), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ReadInputLine), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ReadInputLine), }); module.DefineLibraryMethod("global_variables", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetGlobalVariableNames), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetGlobalVariableNames), }); module.DefineLibraryMethod("hash", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Hash), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Hash), }); module.DefineLibraryMethod("id", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetId), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetId), }); module.DefineLibraryMethod("inspect", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Inspect), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Inspect), }); module.DefineLibraryMethod("instance_eval", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Evaluate), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.InstanceEval), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Evaluate), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.InstanceEval), }); module.DefineLibraryMethod("instance_of?", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.IsOfClass), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.IsOfClass), }); module.DefineLibraryMethod("instance_variable_defined?", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.InstanceVariableDefined), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.InstanceVariableDefined), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.InstanceVariableDefined), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.InstanceVariableDefined), }); module.DefineLibraryMethod("instance_variable_get", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.InstanceVariableGet), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.InstanceVariableGet), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.InstanceVariableGet), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.InstanceVariableGet), }); module.DefineLibraryMethod("instance_variable_set", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.InstanceVariableSet), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.InstanceVariableSet), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.InstanceVariableSet), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.InstanceVariableSet), }); module.DefineLibraryMethod("instance_variables", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.InstanceVariables), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.InstanceVariables), }); module.DefineLibraryMethod("Integer", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ToInteger), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ToInteger), }); module.DefineLibraryMethod("is_a?", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.IsKindOf), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.IsKindOf), }); module.DefineLibraryMethod("iterator?", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.HasBlock), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.HasBlock), }); module.DefineLibraryMethod("kind_of?", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.IsKindOf), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.IsKindOf), }); module.DefineLibraryMethod("lambda", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.CreateLambda), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.CreateLambda), }); module.DefineLibraryMethod("load", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Load), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Load), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Load), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Load), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Load), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Load), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Load), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Load), }); module.DefineLibraryMethod("load_assembly", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.LoadAssembly), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.LoadAssembly), }); module.DefineLibraryMethod("local_variables", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetLocalVariableNames), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetLocalVariableNames), }); module.DefineLibraryMethod("loop", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Loop), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Loop), }); module.DefineLibraryMethod("method", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetMethod), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetMethod), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetMethod), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetMethod), }); module.DefineLibraryMethod("method_missing", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.MethodMissing), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.MethodMissing), }); module.DefineLibraryMethod("methods", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetMethods), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetMethods), }); module.DefineLibraryMethod("nil?", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.IsNil), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.IsNil), }); module.DefineLibraryMethod("object_id", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetObjectId), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetObjectId), }); module.DefineLibraryMethod("open", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), }); module.DefineLibraryMethod("p", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.PrintInspect), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.PrintInspect), }); module.DefineLibraryMethod("print", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Print), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Print), }); module.DefineLibraryMethod("proc", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.CreateLambda), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.CreateLambda), }); module.DefineLibraryMethod("putc", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Putc), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Putc), }); module.DefineLibraryMethod("puts", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.PutString), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.PutString), }); module.DefineLibraryMethod("raise", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action>(Ruby.Builtins.Kernel.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action>(Ruby.Builtins.KernelOps.RaiseException), }); module.DefineLibraryMethod("rand", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Rand), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Rand), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Rand), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Rand), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Rand), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Rand), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Rand), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Rand), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Rand), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Rand), }); module.DefineLibraryMethod("require", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Require), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Require), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Require), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Require), }); module.DefineLibraryMethod("respond_to?", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.RespondTo), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.RespondTo), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.RespondTo), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.RespondTo), }); module.DefineLibraryMethod("select", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Select), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Select), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Select), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Select), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Select), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Select), }); module.DefineLibraryMethod("send", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.SendMessage), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.SendMessage), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.SendMessage), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.SendMessage), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.SendMessage), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.SendMessage), }); module.DefineLibraryMethod("singleton_method_added", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.MethodAdded), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.MethodAdded), }); module.DefineLibraryMethod("singleton_method_removed", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.MethodRemoved), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.MethodRemoved), }); module.DefineLibraryMethod("singleton_method_undefined", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.MethodUndefined), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.MethodUndefined), }); module.DefineLibraryMethod("singleton_methods", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetSingletonMethods), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetSingletonMethods), }); module.DefineLibraryMethod("sleep", 0x2a, new System.Delegate[] { - new System.Action(Ruby.Builtins.Kernel.Sleep), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Sleep), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Sleep), + new System.Action(Ruby.Builtins.KernelOps.Sleep), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Sleep), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Sleep), }); module.DefineLibraryMethod("sprintf", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Sprintf), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Sprintf), }); module.DefineLibraryMethod("String", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ToString), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ToString), }); module.DefineLibraryMethod("taint", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Taint), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Taint), }); module.DefineLibraryMethod("tainted?", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Tainted), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Tainted), }); module.DefineLibraryMethod("throw", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Throw), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Throw), }); module.DefineLibraryMethod("to_s", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ToString), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ToString), }); #if !SILVERLIGHT module.DefineLibraryMethod("trap", 0x2a, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Trap), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Trap), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Trap), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Trap), }); #endif module.DefineLibraryMethod("untaint", 0x29, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Untaint), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Untaint), }); } @@ -2528,172 +2528,172 @@ private void LoadKernel_Class(Ruby.Builtins.RubyModule/*!*/ module) { module.DefineLibraryMethod("Array", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ToArray), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ToArray), }); module.DefineLibraryMethod("at_exit", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.AtExit), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.AtExit), }); module.DefineLibraryMethod("caller", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetStackTrace), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetStackTrace), }); module.DefineLibraryMethod("catch", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Catch), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Catch), }); module.DefineLibraryMethod("eval", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Evaluate), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Evaluate), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Evaluate), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Evaluate), }); module.DefineLibraryMethod("exit", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Exit), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Exit), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Exit), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Exit), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Exit), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Exit), }); module.DefineLibraryMethod("exit!", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.TerminateExecution), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.TerminateExecution), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.TerminateExecution), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.TerminateExecution), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.TerminateExecution), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.TerminateExecution), }); module.DefineLibraryMethod("fail", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action>(Ruby.Builtins.Kernel.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action>(Ruby.Builtins.KernelOps.RaiseException), }); module.DefineLibraryMethod("Float", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ToFloat), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ToFloat), }); module.DefineLibraryMethod("format", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Sprintf), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Sprintf), }); module.DefineLibraryMethod("gets", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ReadInputLine), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ReadInputLine), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ReadInputLine), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ReadInputLine), }); module.DefineLibraryMethod("global_variables", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetGlobalVariableNames), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetGlobalVariableNames), }); module.DefineLibraryMethod("Integer", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ToInteger), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ToInteger), }); module.DefineLibraryMethod("lambda", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.CreateLambda), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.CreateLambda), }); module.DefineLibraryMethod("load", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Load), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Load), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Load), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Load), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Load), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Load), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Load), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Load), }); module.DefineLibraryMethod("load_assembly", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.LoadAssembly), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.LoadAssembly), }); module.DefineLibraryMethod("local_variables", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.GetLocalVariableNames), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.GetLocalVariableNames), }); module.DefineLibraryMethod("loop", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Loop), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Loop), }); module.DefineLibraryMethod("method_missing", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.MethodMissing), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.MethodMissing), }); module.DefineLibraryMethod("open", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Open), }); module.DefineLibraryMethod("p", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.PrintInspect), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.PrintInspect), }); module.DefineLibraryMethod("print", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Print), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Print), }); module.DefineLibraryMethod("proc", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.CreateLambda), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.CreateLambda), }); module.DefineLibraryMethod("putc", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Putc), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Putc), }); module.DefineLibraryMethod("puts", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.PutString), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.PutString), }); module.DefineLibraryMethod("raise", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.RaiseException), - new Microsoft.Scripting.Utils.Action>(Ruby.Builtins.Kernel.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.RaiseException), + new Microsoft.Scripting.Utils.Action>(Ruby.Builtins.KernelOps.RaiseException), }); module.DefineLibraryMethod("rand", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Rand), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Rand), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Rand), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Rand), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Rand), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Rand), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Rand), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Rand), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Rand), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Rand), }); module.DefineLibraryMethod("require", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Require), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Require), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Require), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Require), }); module.DefineLibraryMethod("select", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Select), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Select), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Select), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Select), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Select), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Select), }); module.DefineLibraryMethod("sleep", 0x31, new System.Delegate[] { - new System.Action(Ruby.Builtins.Kernel.Sleep), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Sleep), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Sleep), + new System.Action(Ruby.Builtins.KernelOps.Sleep), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Sleep), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Sleep), }); module.DefineLibraryMethod("sprintf", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Sprintf), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Sprintf), }); module.DefineLibraryMethod("String", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.ToString), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.ToString), }); module.DefineLibraryMethod("throw", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Action(Ruby.Builtins.Kernel.Throw), + new Microsoft.Scripting.Utils.Action(Ruby.Builtins.KernelOps.Throw), }); #if !SILVERLIGHT module.DefineLibraryMethod("trap", 0x31, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Trap), - new Microsoft.Scripting.Utils.Function(Ruby.Builtins.Kernel.Trap), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Trap), + new Microsoft.Scripting.Utils.Function(Ruby.Builtins.KernelOps.Trap), }); #endif @@ -6424,8 +6424,8 @@ DefineGlobalClass("BigDecimal", typeof(System.Decimal), classRef0, new System.Action(LoadBigDecimal_Instance), null, Ruby.Builtins.RubyModule.EmptyArray, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.BigDecimal.BigDecimalOps.Create), - new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.BigDecimal.BigDecimalOps.Create), + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.BigDecimal.BigDecimalOps.Create), + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.BigDecimal.BigDecimalOps.Create), }); ExtendModule(typeof(Ruby.Builtins.Kernel), new System.Action(LoadRuby__Builtins__Kernel_Instance), new System.Action(LoadRuby__Builtins__Kernel_Class), Ruby.Builtins.RubyModule.EmptyArray); } @@ -6433,9 +6433,9 @@ private void LoadBigDecimal_Instance(Ruby.Builtins.RubyModule/*!*/ module) { module.DefineLibraryMethod("to_s", 0x9, new System.Delegate[] { - new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.BigDecimal.BigDecimalOps.ToString), - new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.BigDecimal.BigDecimalOps.ToString), - new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.BigDecimal.BigDecimalOps.ToString), + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.BigDecimal.BigDecimalOps.ToString), + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.BigDecimal.BigDecimalOps.ToString), + new Microsoft.Scripting.Utils.Function(Ruby.StandardLibrary.BigDecimal.BigDecimalOps.ToString), }); } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.csproj;C450310 File: IronRuby.Libraries.csproj =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.csproj;C450310 (server) 5/28/2008 10:48 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.csproj;Kernel @@ -72,6 +72,7 @@ Properties\SilverlightVersion.cs + @@ -93,7 +94,7 @@ - + =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/IronRuby.Libraries.csproj.vspscc;C390406 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Protocols.cs;C448922 File: Protocols.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Protocols.cs;C448922 (server) 5/28/2008 11:07 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Protocols.cs;Kernel @@ -125,7 +125,7 @@ } // fallback to Kernel#to_s if to_s returned a non-string - return Kernel.ToString(context, obj); + return KernelOps.ToString(context, obj); } #endregion =================================================================== branch, edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/BigDecimal/BigDecimalKernelOps.cs File: BigDecimalKernelOps.cs =================================================================== --- BigDecimalOps.cs (server) 5/28/2008 10:47 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/BigDecimal/BigDecimalKernelOps.cs;Kernel @@ -13,50 +13,12 @@ * * ***************************************************************************/ -using System; -using System.Runtime.InteropServices; - -using Microsoft.Scripting.Actions; -using Microsoft.Scripting.Runtime; - using Ruby.Runtime; using Ruby.Builtins; +using Microsoft.Scripting.Runtime; namespace Ruby.StandardLibrary.BigDecimal { - [RubyClass("BigDecimal", Extends = typeof(decimal), Inherits = typeof(Numeric))] - public static class BigDecimalOps { - - [RubyConstructor] - public static object Create(CodeContext/*!*/ context, [NotNull]MutableString/*!*/ value) { - decimal result; - if (!Decimal.TryParse(value.ToString(), out result)) { - return (decimal)0.0; - } - return result; - } - - [RubyConstructor] - public static object Create(CodeContext/*!*/ context, object value) { - return Create(context, Protocols.CastToString(context, value)); - } - - [RubyMethod("to_s")] - public static object ToString(decimal/*!*/ self) { - return MutableString.Create(self.ToString()); - } - - [RubyMethod("to_s")] - public static object ToString(decimal/*!*/ self, [NotNull]MutableString/*!*/ format) { - return ToString(self); - } - - [RubyMethod("to_s")] - public static object ToString(CodeContext/*!*/ context, decimal/*!*/ self, object format) { - return ToString(self, Protocols.CastToString(context, format)); - } - } - [RubyModule(Extends = typeof(Kernel))] public static class KernelOps { [RubyMethod("BigDecimal", RubyMethodAttributes.PrivateInstance)] =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/BigDecimal/BigDecimalOps.cs;C450310 File: BigDecimalOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/BigDecimal/BigDecimalOps.cs;C450310 (server) 5/28/2008 10:49 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/BigDecimal/BigDecimalOps.cs;Kernel @@ -28,7 +28,7 @@ public static class BigDecimalOps { [RubyConstructor] - public static object Create(CodeContext/*!*/ context, [NotNull]MutableString/*!*/ value) { + public static decimal Create(CodeContext/*!*/ context, [NotNull]MutableString/*!*/ value) { decimal result; if (!Decimal.TryParse(value.ToString(), out result)) { return (decimal)0.0; @@ -37,38 +37,23 @@ } [RubyConstructor] - public static object Create(CodeContext/*!*/ context, object value) { + public static decimal Create(CodeContext/*!*/ context, object value) { return Create(context, Protocols.CastToString(context, value)); } [RubyMethod("to_s")] - public static object ToString(decimal/*!*/ self) { + public static MutableString/*!*/ ToString(decimal self) { return MutableString.Create(self.ToString()); } [RubyMethod("to_s")] - public static object ToString(decimal/*!*/ self, [NotNull]MutableString/*!*/ format) { + public static MutableString/*!*/ ToString(decimal self, [NotNull]MutableString/*!*/ format) { return ToString(self); } [RubyMethod("to_s")] - public static object ToString(CodeContext/*!*/ context, decimal/*!*/ self, object format) { + public static MutableString/*!*/ ToString(CodeContext/*!*/ context, decimal self, object format) { return ToString(self, Protocols.CastToString(context, format)); } } - - [RubyModule(Extends = typeof(Kernel))] - public static class KernelOps { - [RubyMethod("BigDecimal", RubyMethodAttributes.PrivateInstance)] - [RubyMethod("BigDecimal", RubyMethodAttributes.PublicSingleton)] - public static object CreateBigDecimal(CodeContext/*!*/ context, object self, [NotNull]MutableString/*!*/ value) { - return BigDecimalOps.Create(context, value); - } - - [RubyMethod("BigDecimal", RubyMethodAttributes.PrivateInstance)] - [RubyMethod("BigDecimal", RubyMethodAttributes.PublicSingleton)] - public static object CreateBigDecimal(CodeContext/*!*/ context, object self, object value) { - return BigDecimalOps.Create(context, value); - } - } } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ArrayOps.cs;C448922 File: ArrayOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ArrayOps.cs;C448922 (server) 5/28/2008 11:18 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/ArrayOps.cs;Kernel @@ -185,7 +185,7 @@ [RubyMethod("reverse!")] public static RubyArray/*!*/ InPlaceReverse(CodeContext/*!*/ context, RubyArray/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.Reverse(); return self; } @@ -523,7 +523,7 @@ [RubyMethod("sort!")] public static RubyArray/*!*/ SortInPlace(CodeContext/*!*/ context, RubyArray/*!*/ self, BlockParam block) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); // TODO: this does more comparisons (and in a different order) than // Ruby's sort. Also, control flow won't work because List.Sort wraps =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/Dir.cs;C450310 File: Dir.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/Dir.cs;C450310 (server) 5/28/2008 11:17 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/Dir.cs;Kernel @@ -556,7 +556,7 @@ foreach (string group in groups) { foreach (string filename in DoGlob(context, group, flags)) { MutableString result = MutableString.Create(filename); - Kernel.FlowTaint(context, pattern, result); + RubyUtils.FlowTaint(context, pattern, result); yield return result; } } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/FileOps.cs;C450310 File: FileOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/FileOps.cs;C450310 (server) 5/28/2008 11:17 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/FileOps.cs;Kernel @@ -99,7 +99,7 @@ // Special cases of drive letters C:\\ or C:/ if (trimmedPath.Length == 2) if (Char.IsLetter(trimmedPath.GetChar(0)) && trimmedPath.GetChar(1) == ':') - return Kernel.FlowTaint(context, path, (path.Length > 2 ? MutableString.Create(path.GetChar(2).ToString()) : MutableString.Create(String.Empty))); + return RubyUtils.FlowTaint(context, path, (path.Length > 2 ? MutableString.Create(path.GetChar(2).ToString()) : MutableString.Create(String.Empty))); string trimmedPathAsString = trimmedPath.ConvertToString(); if (trimmedPathAsString == "/") @@ -116,7 +116,7 @@ string basename = System.IO.Path.GetFileNameWithoutExtension(filename); string result = WildcardExtensionMatch(fileExtension, extensionFilter.ConvertToString()) ? basename : filename; - return CanonicalizePath(context, Kernel.FlowTaint(context, self, (result.Equals(root) ? MutableString.Create(root) : MutableString.Create(result)))); + return CanonicalizePath(context, RubyUtils.FlowTaint(context, self, (result.Equals(root) ? MutableString.Create(root) : MutableString.Create(result)))); } [RubyMethod("basename", RubyMethodAttributes.PublicSingleton)] =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/HashOps.cs;C445173 File: HashOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/HashOps.cs;C445173 (server) 5/28/2008 11:18 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/HashOps.cs;Kernel @@ -115,7 +115,7 @@ [RubyMethod("default=")] public static object SetDefaultValue(CodeContext/*!*/ context, Hash/*!*/ self, object value) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.DefaultProc = null; return self.DefaultValue = value; } @@ -156,7 +156,7 @@ if (Object.ReferenceEquals(self, other)) return self; - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); // If we are copying from another Hash, copy the default value/block, otherwise set to nil Hash otherHash = other as Hash; @@ -167,7 +167,7 @@ [RubyMethod("shift")] public static object Shift(CodeContext/*!*/ context, Hash/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); if (self.Count == 0) { return LookupDefaultValue(context, self, null); =================================================================== rename, edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;C448811 File: KernelOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;C448811 (server) 5/26/2008 6:09 PM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;Kernel @@ -31,8 +31,8 @@ namespace Ruby.Builtins { - [RubyModule(RubyClass.KernelName)] - public static class Kernel { + [RubyModule("Kernel", Extends = typeof(Kernel))] + public static class KernelOps { #region Private Instance Methods @@ -786,7 +786,7 @@ if (!RubyUtils.TryCopyObject(context, self, true, out result)) { throw RubyExceptions.CreateTypeError(String.Format("can't clone {0}", RubyUtils.GetClassName(context, self))); } - return Kernel.FlowTaint(context, self, result); + return RubyUtils.FlowTaint(context, self, result); } [RubyMethod("dup")] @@ -795,7 +795,7 @@ if (!RubyUtils.TryCopyObject(context, self, false, out result)) { throw RubyExceptions.CreateTypeError(String.Format("can't dup {0}", RubyUtils.GetClassName(context, self))); } - return Kernel.FlowTaint(context, self, result); + return RubyUtils.FlowTaint(context, self, result); } #endregion @@ -1106,41 +1106,10 @@ [RubyMethod("to_s")] public static MutableString/*!*/ ToString(CodeContext/*!*/ context, object self) { - return Kernel.FlowTaint(context, self, RubyUtils.ObjectToMutableString(context, self)); + return RubyUtils.FlowTaint(context, self, RubyUtils.ObjectToMutableString(context, self)); } #endregion - - #region Taint - - public static T FlowTaint(CodeContext/*!*/ context, object/*!*/ from, T/*!*/ to) { - if (Kernel.Tainted(context, from)) - Kernel.Taint(context, to); - return to; - } - - public static T FlowTaint(CodeContext/*!*/ context, object/*!*/ from1, object/*!*/ from2, T/*!*/ to) { - if (Kernel.Tainted(context, from1) || Kernel.Tainted(context, from2)) - Kernel.Taint(context, to); - return to; - } - - #endregion - - #region Frozen - - public static void RequiresNotFrozen(CodeContext/*!*/ context, object/*!*/ obj) { - if (Kernel.Frozen(context, obj)) { - throw RubyExceptions.CreateTypeError("can't modify frozen object"); - } - } - - public static void RequiresNotFrozenRuntimeError(CodeContext/*!*/ context, object/*!*/ obj) { - if (Kernel.Frozen(context, obj)) - throw new RuntimeError("string frozen"); - } - - #endregion } } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/MatchDataOps.cs;C448505 File: MatchDataOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/MatchDataOps.cs;C448505 (server) 5/28/2008 11:09 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/MatchDataOps.cs;Kernel @@ -54,7 +54,7 @@ RubyArray result = new RubyArray(); for (int i = 0; i < length; i++) { - result.Add(Kernel.FlowTaint(context, self, MatchData.GetGroupValue(self.Groups[start + i]))); + result.Add(RubyUtils.FlowTaint(context, self, MatchData.GetGroupValue(self.Groups[start + i]))); } return result; @@ -123,12 +123,12 @@ [RubyMethod("pre_match")] public static MutableString/*!*/ PreMatch(CodeContext/*!*/ context, MatchData/*!*/ self) { - return Kernel.FlowTaint(context, self, MutableString.Create(self.OriginalString.GetSlice(0, self.Index))); + return RubyUtils.FlowTaint(context, self, MutableString.Create(self.OriginalString.GetSlice(0, self.Index))); } [RubyMethod("post_match")] public static MutableString/*!*/ PostMatch(CodeContext/*!*/ context, MatchData/*!*/ self) { - return Kernel.FlowTaint(context, self, MutableString.Create(self.OriginalString.GetSlice(self.Index + self.Length))); + return RubyUtils.FlowTaint(context, self, MutableString.Create(self.OriginalString.GetSlice(self.Index + self.Length))); } private static RubyArray/*!*/ ReturnMatchingGroups(CodeContext/*!*/ context, MatchData/*!*/ self, int group) { @@ -139,7 +139,7 @@ RubyArray result = new RubyArray(self.Groups.Count - group); for (int i = group; i < self.Groups.Count; i++) { - result.Add(Kernel.FlowTaint(context, self, MatchData.GetGroupValue(self.Groups[i]))); + result.Add(RubyUtils.FlowTaint(context, self, MatchData.GetGroupValue(self.Groups[i]))); } return result; } @@ -156,14 +156,14 @@ [RubyMethod("string")] public static MutableString/*!*/ ReturnFrozenString(CodeContext/*!*/ context, MatchData/*!*/ self) { - MutableString/*!*/ result = Kernel.FlowTaint(context, self, MutableString.Create(self.OriginalString)); - Kernel.Freeze(context, result); + MutableString/*!*/ result = RubyUtils.FlowTaint(context, self, MutableString.Create(self.OriginalString)); + KernelOps.Freeze(context, result); return result; } [RubyMethod("to_s")] public static MutableString/*!*/ ToString(CodeContext/*!*/ context, MatchData/*!*/ self) { - return Kernel.FlowTaint(context, self, MatchData.GetGroupValue(self.Match)); + return RubyUtils.FlowTaint(context, self, MatchData.GetGroupValue(self.Match)); } private static readonly DynamicSite/*!*/ _MatchDataSelectSite = @@ -175,7 +175,7 @@ RubyArray result = new RubyArray(); for (int i = 0; i < self.Groups.Count; i++) { - MutableString value = Kernel.FlowTaint(context, self, MatchData.GetGroupValue(self.Groups[i])); + MutableString value = RubyUtils.FlowTaint(context, self, MatchData.GetGroupValue(self.Groups[i])); if (_MatchDataSelectSite.Invoke(context, block, value)) result.Add(value); } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/MutableStringOps.cs;C449929 File: MutableStringOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/MutableStringOps.cs;C449929 (server) 5/28/2008 11:06 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/MutableStringOps.cs;Kernel @@ -56,12 +56,12 @@ [RubyConstructor] public static MutableString/*!*/ Create(CodeContext/*!*/ context, [NotNull]MutableString/*!*/ str) { - return Kernel.FlowTaint(context, str, MutableString.Create(str)); + return RubyUtils.FlowTaint(context, str, MutableString.Create(str)); } [RubyConstructor] public static MutableString/*!*/ Create(CodeContext/*!*/ context, [NotNull]object/*!*/ value) { - return Kernel.FlowTaint(context, value, MutableString.Create(Protocols.CastToString(context, value))); + return RubyUtils.FlowTaint(context, value, MutableString.Create(Protocols.CastToString(context, value))); } #region Helpers @@ -385,7 +385,7 @@ args = new object[] { arg }; } StringFormatter formatter = new StringFormatter(context, self.ConvertToString(), args); - return Kernel.FlowTaint(context, self, formatter.Format()); + return RubyUtils.FlowTaint(context, self, formatter.Format()); } #endregion @@ -403,7 +403,7 @@ result.Append(self); } - return Kernel.FlowTaint(context, self, CreateSubClass(context, self, result)); + return RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, result)); } [RubyMethod("*")] @@ -425,7 +425,7 @@ [RubyMethod("+")] public static MutableString Concatenate(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]MutableString/*!*/ other) { - return Kernel.FlowTaint(context, self, other, MutableString.Create(self).Append(other)); + return RubyUtils.FlowTaint(context, self, other, MutableString.Create(self).Append(other)); } [RubyMethod("+")] @@ -450,9 +450,9 @@ [RubyMethod("<<")] [RubyMethod("concat")] public static MutableString Append(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]MutableString/*!*/ other) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.Append(other); - return Kernel.FlowTaint(context, other, self); + return RubyUtils.FlowTaint(context, other, self); } [RubyMethod("<<")] @@ -464,7 +464,7 @@ [RubyMethod("<<")] [RubyMethod("concat")] public static MutableString Append(CodeContext/*!*/ context, MutableString/*!*/ self, int c) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); if (c < 0 || c > 255) { throw RubyExceptions.CreateTypeConversionError("Fixnum", "String"); @@ -589,7 +589,7 @@ return null; } - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); // TODO: optimize if the value is not read: int result = self.PeekByte(index); @@ -610,7 +610,7 @@ if (!InRangeNormalized(self, ref start)) return null; - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); if (start + length > self.Length) { length = self.Length - start; @@ -618,7 +618,7 @@ MutableString result = CreateSubClass(context, self, self.GetSlice(start, length)); self.Remove(start, length); - return Kernel.FlowTaint(context, self, result); + return RubyUtils.FlowTaint(context, self, result); } [RubyMethod("slice!")] @@ -653,7 +653,7 @@ [RubyMethod("slice!")] public static MutableString RemoveCharInPlace(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]RubyRegex/*!*/ regex) { if (regex.IsEmpty) { - return Kernel.FlowTaint(context, self, regex, CreateSubClass(context, self)); + return RubyUtils.FlowTaint(context, self, regex, CreateSubClass(context, self)); } MatchData match = RegexpOps.Match(context, regex, self); @@ -661,17 +661,17 @@ return null; } - return Kernel.FlowTaint(context, regex, RemoveCharInPlace(context, self, match.Index, match.Length)); + return RubyUtils.FlowTaint(context, regex, RemoveCharInPlace(context, self, match.Index, match.Length)); } [RubyMethod("slice!")] public static MutableString RemoveCharInPlace(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]RubyRegex/*!*/ regex, int occurrance) { if (regex.IsEmpty) { - return Kernel.FlowTaint(context, self, regex, CreateSubClass(context, self)); + return RubyUtils.FlowTaint(context, self, regex, CreateSubClass(context, self)); } Group group = MatchRegexp(context, self, regex, occurrance); - return group == null ? null : Kernel.FlowTaint(context, regex, RemoveCharInPlace(context, self, group.Index, group.Length)); + return group == null ? null : RubyUtils.FlowTaint(context, regex, RemoveCharInPlace(context, self, group.Index, group.Length)); } [RubyMethod("slice!")] @@ -683,7 +683,7 @@ public static MutableString RemoveCharInPlace(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]MutableString/*!*/ searchStr) { // Odd behavior: taint only flows from searchStr and *not* self. Seems like a bug in Ruby to me. if (searchStr.Length == 0) { - return Kernel.FlowTaint(context, searchStr, CreateSubClass(context, self)); + return RubyUtils.FlowTaint(context, searchStr, CreateSubClass(context, self)); } int index = self.IndexOf(searchStr); @@ -692,7 +692,7 @@ } RemoveCharInPlace(context, self, index, searchStr.Length); - return Kernel.FlowTaint(context, searchStr, CreateSubClass(context, searchStr, searchStr)); + return RubyUtils.FlowTaint(context, searchStr, CreateSubClass(context, searchStr, searchStr)); } #endregion @@ -725,7 +725,7 @@ if (start + length > self.Length) length = self.Length - start; - return Kernel.FlowTaint(context, self, CreateSubClass(context, self, self.GetSlice(start, length))); + return RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, self.GetSlice(start, length))); } [RubyMethod("[]")] @@ -758,14 +758,14 @@ end = NormalizeIndex(self, end); int count = RubySites.RangeExcludeEnd(context, range) ? end - begin : end - begin + 1; - return count < 0 ? Kernel.FlowTaint(context, self, CreateSubClass(context, self)) : GetChars(context, self, begin, count); + return count < 0 ? RubyUtils.FlowTaint(context, self, CreateSubClass(context, self)) : GetChars(context, self, begin, count); } [RubyMethod("[]")] [RubyMethod("slice")] public static MutableString GetChars(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]MutableString/*!*/ searchStr) { if (self.IndexOf(searchStr) != -1) { - return Kernel.FlowTaint(context, self, searchStr, CreateSubClass(context, searchStr, searchStr)); + return RubyUtils.FlowTaint(context, self, searchStr, CreateSubClass(context, searchStr, searchStr)); } else { return null; } @@ -775,7 +775,7 @@ [RubyMethod("slice")] public static MutableString GetChars(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]RubyRegex/*!*/ regex) { if (regex.IsEmpty) { - return Kernel.FlowTaint(context, self, regex, CreateSubClass(context, self)); + return RubyUtils.FlowTaint(context, self, regex, CreateSubClass(context, self)); } MatchData match = RegexpOps.Match(context, regex, self); @@ -784,18 +784,18 @@ } string result = match.Value; - return result == String.Empty ? null : Kernel.FlowTaint(context, self, regex, CreateSubClass(context, self, MutableString.Create(result))); + return result == String.Empty ? null : RubyUtils.FlowTaint(context, self, regex, CreateSubClass(context, self, MutableString.Create(result))); } [RubyMethod("[]")] [RubyMethod("slice")] public static MutableString GetChars(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]RubyRegex/*!*/ regex, int occurrance) { if (regex.IsEmpty) { - return Kernel.FlowTaint(context, self, regex, CreateSubClass(context, self)); + return RubyUtils.FlowTaint(context, self, regex, CreateSubClass(context, self)); } Group group = MatchRegexp(context, self, regex, occurrance); - return group == null ? null : Kernel.FlowTaint(context, self, regex, CreateSubClass(context, self, MatchData.GetGroupValue(group))); + return group == null ? null : RubyUtils.FlowTaint(context, self, regex, CreateSubClass(context, self, MatchData.GetGroupValue(group))); } [RubyMethod("[]")] @@ -815,26 +815,26 @@ [RubyMethod("[]=")] public static MutableString SetChar(CodeContext/*!*/ context, MutableString/*!*/ self, int index, [NotNull]MutableString/*!*/ value) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); index = index < 0 ? index + self.Length : index; if (index < 0 || index >= self.Length) throw RubyExceptions.CreateIndexError(String.Format("index {0} out of string", index)); if (value.Length == 0) { - Kernel.FlowTaint(context, value, self); + RubyUtils.FlowTaint(context, value, self); return RemoveChar(self, index); } self.Replace(index, 1, value); - Kernel.FlowTaint(context, value, self); + RubyUtils.FlowTaint(context, value, self); return value; } [RubyMethod("[]=")] public static int SetChar(CodeContext/*!*/ context, MutableString/*!*/ self, int index, int value) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); index = index < 0 ? index + self.Length : index; if (index < 0 || index >= self.Length) { @@ -867,7 +867,7 @@ [RubyMethod("[]=")] public static MutableString SetChar(CodeContext/*!*/ context, MutableString/*!*/ self, int start, int charsToOverwrite, [NotNull]MutableString/*!*/ value) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); if (charsToOverwrite < 0) throw RubyExceptions.CreateIndexError(String.Format("negative length {0}", charsToOverwrite)); @@ -901,7 +901,7 @@ self.Remove(pos, System.Math.Min(charsToRemove, charsLeftInString)); } - Kernel.FlowTaint(context, value, self); + RubyUtils.FlowTaint(context, value, self); return value; } @@ -1024,12 +1024,12 @@ public static MutableString/*!*/ Capitalize(CodeContext/*!*/ context, MutableString/*!*/ self) { MutableString result = MutableString.Create(self); CapitalizeMutableString(result); - return Kernel.FlowTaint(context, self, CreateSubClass(context, self, result)); + return RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, result)); } [RubyMethod("capitalize!")] public static MutableString CapitalizeInPlace(CodeContext/*!*/ context, MutableString/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); return CapitalizeMutableString(self) ? self : null; } @@ -1046,12 +1046,12 @@ public static MutableString/*!*/ DownCase(CodeContext/*!*/ context, MutableString/*!*/ self) { MutableString result = MutableString.Create(self); DownCaseMutableString(result); - return Kernel.FlowTaint(context, self, CreateSubClass(context, self, result)); + return RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, result)); } [RubyMethod("downcase!")] public static MutableString DownCaseInPlace(CodeContext/*!*/ context, MutableString/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); return DownCaseMutableString(self) ? self : null; } @@ -1069,12 +1069,12 @@ public static MutableString/*!*/ SwapCase(CodeContext/*!*/ context, MutableString/*!*/ self) { MutableString result = MutableString.Create(self); SwapCaseMutableString(result); - return Kernel.FlowTaint(context, self, CreateSubClass(context, self, result)); + return RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, result)); } [RubyMethod("swapcase!")] public static MutableString SwapCaseInPlace(CodeContext/*!*/ context, MutableString/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); return SwapCaseMutableString(self) ? self : null; } @@ -1091,12 +1091,12 @@ public static MutableString/*!*/ UpCase(CodeContext/*!*/ context, MutableString/*!*/ self) { MutableString result = MutableString.Create(self); UpCaseMutableString(result); - return Kernel.FlowTaint(context, self, CreateSubClass(context, self, result)); + return RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, result)); } [RubyMethod("upcase!")] public static MutableString UpCaseInPlace(CodeContext/*!*/ context, MutableString/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); return UpCaseMutableString(self) ? self : null; } @@ -1204,10 +1204,10 @@ // Remove multiple trailing CR/LFs if (separator.Length == 0) - return Kernel.FlowTaint(context, self, ChompTrailingCarriageReturns(self, false)); + return RubyUtils.FlowTaint(context, self, ChompTrailingCarriageReturns(self, false)); // Remove single trailing CR/LFs - MutableString result = Kernel.FlowTaint(context, self, CreateSubClass(context, self, MutableString.Create(self))); + MutableString result = RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, MutableString.Create(self))); int length = result.Length; if (separator.Length == 1 && separator.GetChar(0) == '\n') { if (length > 1 && result.GetChar(length - 2) == '\r' && result.GetChar(length - 1) == '\n') { @@ -1249,7 +1249,7 @@ if (result.Equals(self) || result == null) return null; - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.Clear(); self.Append(result); return self; @@ -1290,14 +1290,14 @@ [RubyMethod("chop!")] public static MutableString ChopInPlace(CodeContext/*!*/ context, MutableString/*!*/ self) { if (self.Length == 0) return null; - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); return Chop(self); } [RubyMethod("chop")] public static MutableString Chop(CodeContext/*!*/ context, MutableString/*!*/ self) { MutableString result = self.Length == 0 ? MutableString.CreateMutable() : Chop(MutableString.Create(self)); - return Kernel.FlowTaint(context, self, CreateSubClass(context, self, result)); + return RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, result)); } #endregion @@ -1357,7 +1357,7 @@ } result.Append('"'); - return Kernel.FlowTaint(context, self, CreateSubClass(context, self, MutableString.Create(result.ToString()))); + return RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, MutableString.Create(result.ToString()))); } #endregion @@ -1466,7 +1466,7 @@ // Yield the current line MutableString line = MutableString.Create(str.GetSlice(start, end - start)); - if (block.BlockJumped(_EachBlockSite.Invoke(context, block, Kernel.FlowTaint(context, self, CreateSubClass(context, self, line))))) + if (block.BlockJumped(_EachBlockSite.Invoke(context, block, RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, line))))) return self; start = end; @@ -1581,7 +1581,7 @@ return true; } - Kernel.FlowTaint(localScope, self, blockResult, result); + RubyUtils.FlowTaint(localScope, self, blockResult, result); result.Append(self.GetSlice(offset, match.Index - offset)); result.Append(Protocols.ConvertToString(localScope, blockResult)); @@ -1684,7 +1684,7 @@ localScope.CurrentMatch = match; result.Append(input.GetSlice(offset, input.Length - offset)); - return Kernel.FlowTaint(context, input, replacement, result); + return RubyUtils.FlowTaint(context, input, replacement, result); } [RubyMethod("sub")] @@ -1778,10 +1778,13 @@ return null; } - Kernel.RequiresNotFrozenRuntimeError(context, self); + RubyExecutionContext ec = RubyUtils.GetExecutionContext(context); + if (ec.IsObjectFrozen(self)) { + throw new RuntimeError("string frozen"); + } self.Replace(0, self.Length, builder); - return Kernel.FlowTaint(context, builder, self); + return RubyUtils.FlowTaint(context, builder, self); } private static MutableString ReplaceInPlaceN(CodeContext/*!*/ context, MutableString/*!*/ self, RubyRegex/*!*/ pattern, MutableString/*!*/ replacement, int count) { @@ -1792,10 +1795,10 @@ return null; } - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.Replace(0, self.Length, builder); - return Kernel.FlowTaint(context, builder, self); + return RubyUtils.FlowTaint(context, builder, self); } [RubyMethod("sub!")] @@ -2064,7 +2067,7 @@ result.Append(self.GetChar(i)); } } - return Kernel.FlowTaint(context, self, result); + return RubyUtils.FlowTaint(context, self, result); } [RubyMethod("delete")] @@ -2085,7 +2088,7 @@ } private static MutableString/*!*/ InternalDeleteInPlace(CodeContext/*!*/ context, MutableString/*!*/ self, params object[]/*!*/ str) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); MutableString result = InternalDelete(context, self, str); if (self.Equals(result)) @@ -2206,8 +2209,8 @@ if (offset > self.Length || offset < 0) throw RubyExceptions.CreateIndexError(String.Format("index {0} out of string", start)); - Kernel.RequiresNotFrozen(context, self); - Kernel.FlowTaint(context, value, self); + RubyUtils.RequiresNotFrozen(context, self); + RubyUtils.FlowTaint(context, value, self); return self.Insert(offset, value); } @@ -2308,11 +2311,11 @@ } else { foreach (Match match in matches) { if (match.Groups.Count == 1) { - result.Add(Kernel.FlowTaint(context, self, regex, MutableString.Create(match.Value))); + result.Add(RubyUtils.FlowTaint(context, self, regex, MutableString.Create(match.Value))); } else { RubyArray m = new RubyArray(match.Groups.Count - 1); for (int i = 1; i < match.Groups.Count; i++) { - m.Add(Kernel.FlowTaint(context, self, regex, MatchData.GetGroupValue(match.Groups[i]))); + m.Add(RubyUtils.FlowTaint(context, self, regex, MatchData.GetGroupValue(match.Groups[i]))); } result.Add(m); } @@ -2324,12 +2327,12 @@ [RubyMethod("scan")] public static RubyArray/*!*/ Scan(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]MutableString/*!*/ search) { - return Scan(context, self, Kernel.FlowTaint(context, search, new RubyRegex(RubyRegex.Escape(search), RubyRegexOptions.NONE))); + return Scan(context, self, RubyUtils.FlowTaint(context, search, new RubyRegex(RubyRegex.Escape(search), RubyRegexOptions.NONE))); } [RubyMethod("scan")] public static RubyArray/*!*/ Scan(CodeContext/*!*/ context, MutableString/*!*/ self, object/*!*/ search) { - return Scan(context, self, Kernel.FlowTaint(context, search, Protocols.CastToString(context, search))); + return Scan(context, self, RubyUtils.FlowTaint(context, search, Protocols.CastToString(context, search))); } private static readonly DynamicSite/*!*/ ScanStringSharedSite = @@ -2347,14 +2350,14 @@ foreach (Match match in matches) { if (match.Groups.Count == 1) { if (block.BlockJumped(ScanStringSharedSite.Invoke(context, block, - Kernel.FlowTaint(context, self, regex, MatchData.GetGroupValue(match)) + RubyUtils.FlowTaint(context, self, regex, MatchData.GetGroupValue(match)) ))) { return self; } } else { RubyArray args = new RubyArray(match.Groups.Count - 1); for (int i = 1; i < match.Groups.Count; i++) { - args.Add(Kernel.FlowTaint(context, self, regex, MatchData.GetGroupValue(match.Groups[i]))); + args.Add(RubyUtils.FlowTaint(context, self, regex, MatchData.GetGroupValue(match.Groups[i]))); } if (block.BlockJumped(ScanRegexSharedSite.Invoke(context, block, args))) { return self; @@ -2368,12 +2371,12 @@ [RubyMethod("scan")] public static object/*!*/ Scan(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]BlockParam/*!*/ block, [NotNull]MutableString/*!*/ search) { - return Scan(context, self, block, Kernel.FlowTaint(context, search, new RubyRegex(RubyRegex.Escape(search), RubyRegexOptions.NONE))); + return Scan(context, self, block, RubyUtils.FlowTaint(context, search, new RubyRegex(RubyRegex.Escape(search), RubyRegexOptions.NONE))); } [RubyMethod("scan")] public static object/*!*/ Scan(CodeContext/*!*/ context, MutableString/*!*/ self, [NotNull]BlockParam/*!*/ block, object/*!*/ search) { - return Scan(context, self, block, Kernel.FlowTaint(context, search, Protocols.CastToString(context, search))); + return Scan(context, self, block, RubyUtils.FlowTaint(context, search, Protocols.CastToString(context, search))); } #endregion @@ -2457,7 +2460,7 @@ [RubyMethod("succ!")] public static MutableString/*!*/ SuccInPlace(CodeContext/*!*/ context, MutableString/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); if (self.Length == 0) return self; @@ -2473,7 +2476,7 @@ [RubyMethod("succ")] public static MutableString/*!*/ Succ(CodeContext/*!*/ context, MutableString/*!*/ self) { - return Kernel.FlowTaint(context, self, SuccInPlace(context, MutableString.Create(self))); + return RubyUtils.FlowTaint(context, self, SuccInPlace(context, MutableString.Create(self))); } #endregion @@ -2522,7 +2525,7 @@ private static RubyArray/*!*/ MakeRubyArray(CodeContext/*!*/ context, MutableString/*!*/ self, MutableString[]/*!*/ elements) { RubyArray result = new RubyArray(elements.Length); foreach (MutableString element in elements) { - result.Add(Kernel.FlowTaint(context, self, CreateSubClass(context, self, element))); + result.Add(RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, element))); } return result; } @@ -2544,12 +2547,12 @@ RubyArray result = new RubyArray(); foreach (MutableString element in elements) { - result.Add(Kernel.FlowTaint(context, self, CreateSubClass(context, self, element))); + result.Add(RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, element))); } // Strange behavior to match Ruby semantics if (maxComponents < 0) { - result.Add(Kernel.FlowTaint(context, self, CreateSubClass(context, self))); + result.Add(RubyUtils.FlowTaint(context, self, CreateSubClass(context, self))); } return result; @@ -2572,7 +2575,7 @@ while (maxComponents > 1 && i < self.Length && (next = IndexOf(self, separator, i)) != -1) { if (next > i || keep_empty) { - result.Add(Kernel.FlowTaint(context, self, CreateSubClass(context, self, self.GetSlice(i, next - i)))); + result.Add(RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, self.GetSlice(i, next - i)))); maxComponents--; } @@ -2580,7 +2583,7 @@ } if (i < self.Length || keep_empty) { - result.Add(Kernel.FlowTaint(context, self, CreateSubClass(context, self, self.GetSlice(i)))); + result.Add(RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, self.GetSlice(i)))); } return result; @@ -2688,7 +2691,7 @@ [RubyMethod("strip")] public static object Strip(CodeContext/*!*/ context, MutableString/*!*/ self) { - return Kernel.FlowTaint(context, self, MutableString.Create(self.ConvertToString().Trim())); + return RubyUtils.FlowTaint(context, self, MutableString.Create(self.ConvertToString().Trim())); } [RubyMethod("strip!")] @@ -2699,7 +2702,7 @@ if (original == stripped) return null; - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.Clear(); self.Append(stripped); return self; @@ -2819,7 +2822,7 @@ [RubyMethod("to_str")] public static MutableString/*!*/ ToS(CodeContext/*!*/ context, MutableString/*!*/ self) { RubyClass cls = RubyUtils.GetExecutionContext(context).GetClassOf(self); - return cls.Name.ToString() == "String" ? self : Kernel.FlowTaint(context, self, MutableString.Create(self)); + return cls.Name.ToString() == "String" ? self : RubyUtils.FlowTaint(context, self, MutableString.Create(self)); } [RubyMethod("to_clr_string")] @@ -2915,10 +2918,10 @@ if (Object.ReferenceEquals(self, other)) return self; - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.Clear(); self.Append(other); - return Kernel.FlowTaint(context, other, self); + return RubyUtils.FlowTaint(context, other, self); } [RubyMethod("replace")] @@ -2974,7 +2977,7 @@ } } - return Kernel.FlowTaint(context, self, CreateSubClass(context, self, result)); + return RubyUtils.FlowTaint(context, self, CreateSubClass(context, self, result)); } [RubyMethod("tr")] @@ -2984,7 +2987,7 @@ [RubyMethod("tr!")] public static MutableString/*!*/ TrInPlace(CodeContext/*!*/ context, MutableString/*!*/ self, MutableString/*!*/ from, MutableString/*!*/ to) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); MutableString result = Tr(context, self, from, to); if (self.Equals(result)) @@ -3033,7 +3036,7 @@ result.Append(padding.GetSlice(0, remainder)); - return Kernel.FlowTaint(context, self, padding, result); + return RubyUtils.FlowTaint(context, self, padding, result); } [RubyMethod("ljust")] @@ -3092,7 +3095,7 @@ result.Append(padding.GetSlice(0, remainder)); result.Append(self); - return Kernel.FlowTaint(context, self, padding, result); + return RubyUtils.FlowTaint(context, self, padding, result); } [RubyMethod("rjust")] @@ -3126,7 +3129,7 @@ [RubyMethod("reverse!")] public static MutableString/*!*/ Reverse(CodeContext/*!*/ context, MutableString/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); return self.Reverse(); } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RubyRegexOps.cs;C449929 File: RubyRegexOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RubyRegexOps.cs;C449929 (server) 5/28/2008 11:17 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/RubyRegexOps.cs;Kernel @@ -307,7 +307,7 @@ public static MatchData Match(CodeContext/*!*/ context, RubyRegex/*!*/ self, MutableString/*!*/ str, int startAt) { MatchData match = new MatchData(self.Match(str, startAt), str); RubyUtils.GetScope(context).CurrentMatch = match.Success ? match : null; - return match.Success? Kernel.FlowTaint(context, str, match) : null; + return match.Success? RubyUtils.FlowTaint(context, str, match) : null; } [RubyMethod("match")] @@ -426,7 +426,7 @@ [RubyMethod("escape", RubyMethodAttributes.PublicSingleton)] [RubyMethod("quote", RubyMethodAttributes.PublicSingleton)] public static MutableString/*!*/ Escape(CodeContext/*!*/ context, object/*!*/ self, [NotNull]MutableString/*!*/ str) { - return Kernel.FlowTaint(context, str, MutableString.Create(RubyRegex.Escape(str))); + return RubyUtils.FlowTaint(context, str, MutableString.Create(RubyRegex.Escape(str))); } [RubyMethod("escape", RubyMethodAttributes.PublicSingleton)] =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/StringFormatter.cs;C435539 File: StringFormatter.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/StringFormatter.cs;C435539 (server) 5/28/2008 11:07 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/StringFormatter.cs;Kernel @@ -114,16 +114,19 @@ } _buf.Append(_format, _index, _format.Length - _index); - if (_tainted) - Kernel.Taint(_context, _buf); + if (_tainted) { + KernelOps.Taint(_context, _buf); + } + return _buf; } public bool IsTainted() { bool tainted = false; foreach (object/*!*/ obj in _data) { - if (Kernel.Tainted(_context, obj)) + if (KernelOps.Tainted(_context, obj)) { tainted = true; + } } return tainted; } @@ -866,15 +869,19 @@ private void AppendInspect() { MutableString/*!*/ inspect = RubySites.Inspect(_context, _opts.Value); - if (Kernel.Tainted(_context, inspect)) + if (KernelOps.Tainted(_context, inspect)) { _tainted = true; + } + AppendString(inspect); } private void AppendString() { MutableString/*!*/ str = Protocols.ConvertToString(_context, _opts.Value); - if (Kernel.Tainted(_context, str)) + if (KernelOps.Tainted(_context, str)) { _tainted = true; + } + AppendString(str); } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IDictionaryOps.cs;C448443 File: IDictionaryOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IDictionaryOps.cs;C448443 (server) 5/28/2008 11:08 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IDictionaryOps.cs;Kernel @@ -135,13 +135,13 @@ [RubyMethod("[]=")] [RubyMethod("store")] public static object SetElement(CodeContext/*!*/ context, IDictionary/*!*/ self, object key, object value) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); return RubyUtils.SetHashElement(context, self, key, value); } [RubyMethod("clear")] public static IDictionary Clear(CodeContext/*!*/ context, IDictionary/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.Clear(); return self; } @@ -150,7 +150,7 @@ // (Kernel#dup just works for these types) private static IDictionary/*!*/ Duplicate(CodeContext/*!*/ context, IDictionary/*!*/ self) { // Call Kernel#dup, then copy items - IDictionary copy = (IDictionary)Kernel.Duplicate(context, self); + IDictionary copy = (IDictionary)KernelOps.Duplicate(context, self); return ReplaceData(copy, self); } @@ -166,7 +166,7 @@ [RubyMethod("delete")] public static object Delete(CodeContext/*!*/ context, IDictionary/*!*/ self, BlockParam block, object key) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); object value; if (!self.TryGetValue(BaseSymbolDictionary.NullToObj(key), out value)) { @@ -184,7 +184,7 @@ [RubyMethod("delete_if")] public static object DeleteIf(CodeContext/*!*/ context, IDictionary/*!*/ self, BlockParam block) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); // Make a copy of the keys to delete, so we don't modify the collection // while iterating over it @@ -410,7 +410,7 @@ public static object Update(CodeContext/*!*/ context, IDictionary/*!*/ self, BlockParam block, object otherHash) { IDictionary hash = ConvertToHash(context, otherHash); if (hash != null && hash.Count > 0) - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); if (block == null) { foreach (KeyValuePair pair in CopyKeyValuePairs(hash)) { @@ -433,7 +433,7 @@ [RubyMethod("rehash")] public static IDictionary Rehash(CodeContext/*!*/ context, IDictionary/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); return ReplaceData(self, CopyKeyValuePairs(self)); } @@ -447,7 +447,7 @@ // This works like delete_if, but returns nil if no elements were removed [RubyMethod("reject!")] public static object RejectMutate(CodeContext/*!*/ context, IDictionary/*!*/ self, BlockParam block) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); // Make a copy of the keys to delete, so we don't modify the collection // while iterating over it @@ -477,7 +477,7 @@ // Do nothing if identities are the same if (Object.ReferenceEquals(self, other)) return self; - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); return ReplaceData(self, ConvertToHash(context, other)); } @@ -502,7 +502,7 @@ [RubyMethod("shift")] public static object Shift(CodeContext/*!*/ context, IDictionary/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); if (self.Count == 0) { return null; =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IListOps.cs;C448465 File: IListOps.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IListOps.cs;C448465 (server) 5/28/2008 11:18 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Extensions/IListOps.cs;Kernel @@ -212,7 +212,7 @@ [RubyMethod("<<")] public static IList/*!*/ Append(CodeContext/*!*/ context, IList/*!*/ self, object value) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.Add(value); return self; } @@ -365,7 +365,7 @@ [RubyMethod("[]=")] public static object SetElement(CodeContext/*!*/ context, IList list, int index, object value) { - Kernel.RequiresNotFrozen(context, list); + RubyUtils.RequiresNotFrozen(context, list); index = NormalizeIndex(list, index); @@ -388,7 +388,7 @@ [RubyMethod("[]=")] public static object SetElement(CodeContext/*!*/ context, IList/*!*/ list, int index, int length, object value) { - Kernel.RequiresNotFrozen(context, list); + RubyUtils.RequiresNotFrozen(context, list); if (length < 0) { throw RubyExceptions.CreateIndexError(String.Format("negative length ({0})", length)); @@ -443,7 +443,7 @@ [RubyMethod("[]=")] public static object SetElement(CodeContext/*!*/ context, IList list, Range range, object value) { - Kernel.RequiresNotFrozen(context, list); + RubyUtils.RequiresNotFrozen(context, list); int begin = Protocols.CastToFixnum(context, RubySites.RangeBegin(context, range)); int end = Protocols.CastToFixnum(context, RubySites.RangeEnd(context, range)); @@ -550,7 +550,7 @@ [RubyMethod("clear")] public static IList Clear(CodeContext/*!*/ context, IList/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.Clear(); return self; } @@ -567,7 +567,7 @@ throw new LocalJumpError("no block given"); } - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); int i = 0; while (i < self.Count) { @@ -595,7 +595,7 @@ [RubyMethod("compact!")] public static IList CompactInPlace(CodeContext/*!*/ context, IList/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); bool changed = false; int i = 0; @@ -612,7 +612,7 @@ [RubyMethod("concat")] public static IList/*!*/ Concat(CodeContext/*!*/ context, IList/*!*/ self, [NotNull]IList/*!*/ other) { if (other.Count > 0) - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); AddRange(self, other); return self; } @@ -629,7 +629,7 @@ #region delete, delete_at public static bool Remove(CodeContext/*!*/ context, IList/*!*/ self, object item) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); int i = 0; bool removed = false; @@ -666,7 +666,7 @@ [RubyMethod("delete_at")] public static object DeleteAt(CodeContext/*!*/ context, IList/*!*/ self, object indexValue) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); int index = Protocols.CastToFixnum(context, indexValue); index = index < 0 ? index + self.Count : index; @@ -683,7 +683,7 @@ [RubyMethod("delete_if")] public static object DeleteIf(CodeContext/*!*/ context, IList/*!*/ self, BlockParam block) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); if (block == null && self.Count > 0) { throw new LocalJumpError("no block given"); @@ -792,7 +792,7 @@ #region fill [RubyMethod("fill")] public static IList/*!*/ Fill(CodeContext/*!*/ context, IList/*!*/ self, object obj, [DefaultParameterValue(0)]int start) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); // Note: Array#fill(obj, start) is not equivalent to Array#fill(obj, start, 0) // (as per MRI behavior, the latter can expand the array if start > length, but the former doesn't) @@ -806,7 +806,7 @@ [RubyMethod("fill")] public static IList/*!*/ Fill(CodeContext/*!*/ context, IList/*!*/ self, object obj, int start, int length) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); // Note: Array#fill(obj, start) is not equivalent to Array#fill(obj, start, 0) // (as per MRI behavior, the latter can expand the array if start > length, but the former doesn't) @@ -846,7 +846,7 @@ [RubyMethod("fill")] public static object Fill(CodeContext/*!*/ context, IList/*!*/ self, BlockParam/*!*/ block, [DefaultParameterValue(0)]int start) { Assert.NotNull(context, self, block); - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); start = Math.Max(0, NormalizeIndex(self, start)); @@ -861,7 +861,7 @@ [RubyMethod("fill")] public static object Fill(CodeContext/*!*/ context, IList/*!*/ self, BlockParam/*!*/ block, int start, int length) { Assert.NotNull(context, self, block); - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); start = Math.Max(0, NormalizeIndex(self, start)); @@ -1017,7 +1017,7 @@ [RubyMethod("insert")] public static IList/*!*/ Insert(CodeContext/*!*/ context, IList/*!*/ self, int index, [NotNull]params object[] args) { if (args.Length > 0) - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); if (args.Length == 0) { return self; @@ -1167,7 +1167,7 @@ if (self.Count == 0) return null; - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); object result = self[self.Count - 1]; self.RemoveAt(self.Count - 1); return result; @@ -1176,7 +1176,7 @@ [RubyMethod("push")] public static IList/*!*/ Push(CodeContext/*!*/ context, IList/*!*/ self, [NotNull] params object[] values) { if (values.Length > 0) - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); AddRange(self, values); return self; } @@ -1192,7 +1192,7 @@ [RubyMethod("reverse!")] public static IList InPlaceReverse(CodeContext/*!*/ context, IList/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); int stop = self.Count / 2; int last = self.Count - 1; @@ -1212,7 +1212,7 @@ [RubyMethod("replace")] public static IList Replace(CodeContext/*!*/ context, IList/*!*/ self, IList other) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); self.Clear(); AddRange(self, other); @@ -1235,7 +1235,7 @@ [RubyMethod("shift")] public static object Shift(CodeContext/*!*/ context, IList/*!*/ self) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); if (self.Count == 0) return null; @@ -1247,7 +1247,7 @@ [RubyMethod("slice!")] public static object SliceInPlace(CodeContext/*!*/ context, IList/*!*/ self, int index) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); index = index < 0 ? index + self.Count : index; if (index >= 0 && index < self.Count) { object result = self[index]; @@ -1265,7 +1265,7 @@ [RubyMethod("slice!")] public static object SliceInPlace(CodeContext/*!*/ context, IList/*!*/ self, Range/*!*/ range) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); object result = GetElement(context, self, range); SetElement(context, self, range, null); return result; @@ -1273,7 +1273,7 @@ [RubyMethod("slice!")] public static IList/*!*/ SliceInPlace(CodeContext/*!*/ context, IList/*!*/ self, int start, int length) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); IList result = GetElements(context, self, start, length); SetElement(context, self, start, length, null); return result; @@ -1297,7 +1297,7 @@ [RubyMethod("sort!")] public static IList/*!*/ SortInPlace(CodeContext/*!*/ context, IList/*!*/ self, BlockParam block) { - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); // this should always call ArrayOps.SortInPlace instead Debug.Assert(!(self is RubyArray)); @@ -1386,7 +1386,7 @@ [RubyMethod("unshift")] public static IList Unshift(CodeContext/*!*/ context, IList/*!*/ self, [NotNull] params object[] args) { if (args.Length > 0) - Kernel.RequiresNotFrozen(context, self); + RubyUtils.RequiresNotFrozen(context, self); InsertRange(self, 0, args); return self; } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/StringScanner/StringScanner.cs;C449929 File: StringScanner.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/StringScanner/StringScanner.cs;C449929 (server) 5/28/2008 11:09 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/StringScanner/StringScanner.cs;Kernel @@ -320,7 +320,7 @@ [RubyMethod("string=")] public static MutableString SetString(CodeContext/*!*/ context, StringScanner/*!*/ self, [NotNull]MutableString/*!*/ str) { - self.ScanString = (MutableString)Kernel.Freeze(context, MutableString.Create(str)); + self.ScanString = (MutableString)KernelOps.Freeze(context, MutableString.Create(str)); self.Reset(); return str; } =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libs/bigdecimal.rb;C450310 File: bigdecimal.rb =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libs/bigdecimal.rb;C450310 (server) 5/28/2008 10:52 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Libs/bigdecimal.rb;Kernel @@ -1,7 +1,1 @@ -load_assembly 'IronRuby.Libraries', 'Ruby.StandardLibrary.BigDecimal' - -module Kernel - def BigDecimal s - BigDecimal.new(s) - end -end +load_assembly 'IronRuby.Libraries', 'Ruby.StandardLibrary.BigDecimal' \ No newline at end of file =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj;C449929 File: Ruby.csproj =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj;C449929 (server) 5/28/2008 10:59 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj;Kernel @@ -92,6 +92,7 @@ + =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj.vspscc;C390406 add: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Kernel.cs File: Kernel.cs =================================================================== --- [no source file] +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/Kernel.cs;Kernel @@ -1,0 +1,20 @@ +?/* **************************************************************************** + * + * Copyright (c) Microsoft Corporation. + * + * This source code is subject to terms and conditions of the Microsoft Public License. A + * copy of the license can be found in the License.html file at the root of this distribution. If + * you cannot locate the Microsoft Public License, please send an email to + * ironruby@microsoft.com. By using this source code in any fashion, you are agreeing to be bound + * by the terms of the Microsoft Public License. + * + * You must not remove this notice, or any other, from this software. + * + * + * ***************************************************************************/ + +namespace Ruby.Builtins { + public static class Kernel { + // stub + } +} =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C447029 File: RubyClass.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;C447029 (server) 5/28/2008 11:13 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyClass.cs;Kernel @@ -35,7 +35,6 @@ using AstFactory = Ruby.Compiler.Ast.AstFactory; public sealed class RubyClass : RubyModule, IDynamicObject { - public const string/*!*/ KernelName = "Kernel"; public const string/*!*/ ClassSingletonName = "__ClassSingleton"; public const string/*!*/ ClassSingletonSingletonName = "__ClassSingletonSingleton"; public const string/*!*/ MainSingletonName = "__MainSingleton"; =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/AstGenerator.cs;C448766 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/BlockDefinition.cs;C448766 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Body.cs;C448766 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/SourceUnitTree.cs;C448766 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Declarations/MethodDeclaration.cs;C448766 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Statements/ExpressionStatement.cs;C448766 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Compiler/Ast/Statements/Statement.cs;C448766 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyContext.cs;C448766 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExceptionData.cs;C448766 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExceptions.cs;C443395 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExecutionContext.cs;C449971 File: RubyExecutionContext.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExecutionContext.cs;C449971 (server) 5/28/2008 10:55 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyExecutionContext.cs;Kernel @@ -417,6 +417,7 @@ _objectClass.SetMixins(new RubyModule[] { _kernelModule }); + AddModuleToCacheNoLock(typeof(Kernel), _kernelModule); AddModuleToCacheNoLock(objectTracker.Type, _objectClass); AddModuleToCacheNoLock(_moduleClass.GetUnderlyingSystemType(), _moduleClass); AddModuleToCacheNoLock(_classClass.GetUnderlyingSystemType(), _classClass); =================================================================== edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyOps.cs;C449929 edit: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;C449929 File: RubyUtils.cs =================================================================== --- $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;C449929 (server) 5/28/2008 11:17 AM +++ Shelved Change: $/Dev10/feature/vs_langs01/Merlin/Main/Languages/Ruby/Ruby/Runtime/RubyUtils.cs;Kernel @@ -67,6 +67,32 @@ return (obj == null || (obj is ValueType) && !(obj is float || obj is double || obj is decimal)); } + public static T/*!*/ FlowTaint(CodeContext/*!*/ context, object/*!*/ from, T/*!*/ to) where T : class { + RubyExecutionContext ec = RubyUtils.GetExecutionContext(context); + + if (ec.IsObjectTainted(from)) { + ec.TaintObject(to); + } + return to; + } + + public static T/*!*/ FlowTaint(CodeContext/*!*/ context, object/*!*/ from1, object/*!*/ from2, T/*!*/ to) where T : class { + RubyExecutionContext ec = RubyUtils.GetExecutionContext(context); + + if (ec.IsObjectTainted(from1) || ec.IsObjectTainted(from2)) { + ec.TaintObject(to); + } + return to; + } + + public static void RequiresNotFrozen(CodeContext/*!*/ context, object/*!*/ obj) { + RubyExecutionContext ec = RubyUtils.GetExecutionContext(context); + + if (ec.IsObjectFrozen(obj)) { + throw RubyExceptions.CreateTypeError("can't modify frozen object"); + } + } + /// /// True for Fixnum & Symbol, false otherwise /// This is used in checking whether a singleton class can be created =================================================================== edit: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/BuiltinsOps.cs;C443395 File: BuiltinsOps.cs =================================================================== --- $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/BuiltinsOps.cs;C443395 (server) 5/28/2008 11:09 AM +++ Shelved Change: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/BuiltinsOps.cs;Kernel @@ -37,7 +37,7 @@ [RubyMethod("to_yaml_properties")] public static RubyArray/*!*/ ToYamlProperties(CodeContext/*!*/ context, object self) { - return ArrayOps.SortInPlace(context, Kernel.InstanceVariables(context, self), null); + return ArrayOps.SortInPlace(context, KernelOps.InstanceVariables(context, self), null); } [RubyMethod("to_yaml_style")] =================================================================== edit: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyRepresenter.cs;C443395 File: RubyRepresenter.cs =================================================================== --- $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyRepresenter.cs;C443395 (server) 5/28/2008 11:09 AM +++ Shelved Change: $/Merlin_External/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyRepresenter.cs;Kernel @@ -119,7 +119,7 @@ internal static void AddYamlProperties(CodeContext context, object self, Hash map, RubyArray props) { foreach (object prop in props) { string p = prop.ToString(); - IDictionaryOps.SetElement(context, map, MutableString.Create(p.Substring(1)), Kernel.InstanceVariableGet(context, self, SymbolTable.StringToId(p))); + IDictionaryOps.SetElement(context, map, MutableString.Create(p.Substring(1)), KernelOps.InstanceVariableGet(context, self, SymbolTable.StringToId(p))); } } } ===================================================================