edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/mspec/lib/mspec/helpers/ruby_exe.rb;C1473028 File: ruby_exe.rb =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/mspec/lib/mspec/helpers/ruby_exe.rb;C1473028 (server) 2/15/2010 3:33 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/mspec/mspec/lib/mspec/helpers/ruby_exe.rb;V4bugs @@ -94,12 +94,11 @@ def resolve_ruby_exe [:env, :engine, :name, :install_name].each do |option| next unless cmd = ruby_exe_options(option) - exe = cmd.split.first # It has been reported that File.executable is not reliable # on Windows platforms (see commit 56bc555c). So, we check the # platform. - if File.exists?(exe) and (SpecGuard.windows? or File.executable?(exe)) + if File.exists?(cmd) and (SpecGuard.windows? or File.executable?(cmd)) return cmd end end =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p368/lib/ruby/gems/1.8/gems/rubygems-update-1.3.5/lib/rubygems.rb;C1084571 File: rubygems.rb =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p368/lib/ruby/gems/1.8/gems/rubygems-update-1.3.5/lib/rubygems.rb;C1084571 (server) 2/15/2010 6:30 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p368/lib/ruby/gems/1.8/gems/rubygems-update-1.3.5/lib/rubygems.rb;V4bugs @@ -860,6 +860,8 @@ # escape string in case path to ruby executable contain spaces. @ruby.sub!(/.*\s.*/m, '"\&"') + + @ruby = '"' + @ruby + '"' if @ruby.include?(' ') end @ruby =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p368/lib/ruby/gems/1.8/gems/rubygems-update-1.3.5/test/gemutilities.rb;C1084571 File: gemutilities.rb =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p368/lib/ruby/gems/1.8/gems/rubygems-update-1.3.5/test/gemutilities.rb;C1084571 (server) 2/15/2010 6:30 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p368/lib/ruby/gems/1.8/gems/rubygems-update-1.3.5/test/gemutilities.rb;V4bugs @@ -552,10 +552,14 @@ end begin require "rbconfig" - File.join( + + path = File.join( RbConfig::CONFIG["bindir"], - RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"] + RbConfig::CONFIG["ruby_install_name"] + RbConfig::CONFIG["EXEEXT"] ) + path = '"' + path + '"' if path.include?(' ') + + path rescue LoadError "ruby" end =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p368/lib/ruby/site_ruby/1.8/rubygems.rb;C1084571 File: rubygems.rb =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p368/lib/ruby/site_ruby/1.8/rubygems.rb;C1084571 (server) 2/15/2010 6:30 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p368/lib/ruby/site_ruby/1.8/rubygems.rb;V4bugs @@ -860,6 +860,8 @@ # escape string in case path to ruby executable contain spaces. @ruby.sub!(/.*\s.*/m, '"\&"') + + @ruby = '"' + @ruby + '"' if @ruby.include?(' ') end @ruby =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Driver.cs;C1429753 File: Driver.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Driver.cs;C1429753 (server) 2/16/2010 9:34 AM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Driver.cs;V4bugs @@ -265,7 +265,7 @@ if (args.Contains("/partial")) { Console.WriteLine("Running in partial trust"); - PermissionSet ps = CreatePermissionSetByName(); + PermissionSet ps = CreatePermissionSet(); AppDomainSetup setup = new AppDomainSetup(); setup.ApplicationBase = Environment.CurrentDirectory; @@ -296,7 +296,8 @@ } } - private static PermissionSet/*!*/ CreatePermissionSetByName() { + private static PermissionSet/*!*/ CreatePermissionSet() { +#if CLR2 string name = "Internet"; bool foundName = false; PermissionSet setIntersection = new PermissionSet(PermissionState.Unrestricted); @@ -319,6 +320,11 @@ } return setIntersection; +#else + Evidence e = new Evidence(); + e.AddHostEvidence(new Zone(SecurityZone.Internet)); + return SecurityManager.GetStandardSandbox(e); +#endif } public static int Run(List/*!*/ args) { =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Helpers.cs;C1290543 File: Helpers.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Helpers.cs;C1290543 (server) 2/16/2010 10:36 AM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Helpers.cs;V4bugs @@ -306,12 +306,12 @@ } [DebuggerHiddenAttribute] - internal void AssertExceptionThrown(Action f) where T : Exception { + public void AssertExceptionThrown(Action f) where T : Exception { AssertExceptionThrown(f, null); } [DebuggerHiddenAttribute] - internal void AssertExceptionThrown(Action f, Predicate condition) where T : Exception { + public void AssertExceptionThrown(Action f, Predicate condition) where T : Exception { try { RedirectOutput(TextWriter.Null, f); } catch (T e) { @@ -330,7 +330,7 @@ /// Asserts two values are equal /// [DebuggerHiddenAttribute] - internal void AreEqual(object x, object y) { + public void AreEqual(object x, object y) { if (x == null && y == null) return; Assert(x != null && x.Equals(y), String.Format("values aren't equal: {0} and {1}", x, y)); @@ -340,7 +340,7 @@ /// Asserts an condition it true /// [DebuggerHiddenAttribute] - internal void Assert(bool condition, string msg) { + public void Assert(bool condition, string msg) { if (!condition) { AssertBreak(); _driver.AssertionFailed(msg); @@ -348,7 +348,7 @@ } [DebuggerHiddenAttribute] - internal void Assert(bool condition) { + public void Assert(bool condition) { Assert(condition, "Assertion failed"); } =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Parser/ParserTests.cs;C1496258 File: ParserTests.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Parser/ParserTests.cs;C1496258 (server) 2/16/2010 10:15 AM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Parser/ParserTests.cs;V4bugs @@ -722,12 +722,12 @@ var sjisEngine = Ruby.CreateEngine((setup) => { setup.Options["KCode"] = RubyEncoding.KCodeSJIS; }); - Assert(sjisEngine.Execute("$KCODE").ToString() == "SJIS"); + Assert(sjisEngine.Execute("$KCODE").ToString() == "SJIS"); var utf8Engine = Ruby.CreateEngine((setup) => { setup.Options["KCode"] = RubyEncoding.KCodeUTF8; }); - Assert(utf8Engine.Execute("$KCODE").ToString() == "UTF8"); + Assert(utf8Engine.Execute("$KCODE").ToString() == "UTF8"); // using default encoding (UTF8) for Unicode string source (ignoring KCODE): var str = sjisEngine.Execute("S = 'S'"); =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;C1589426 File: ClrTests.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;C1589426 (server) 2/16/2010 10:29 AM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/ClrTests.cs;V4bugs @@ -435,9 +435,9 @@ } // singletons: - AssertNoClrNames(Engine.Execute(@"class << self; instance_methods + private_instance_methods; end"), null); - AssertNoClrNames(Engine.Execute(@"class << self; class << self; instance_methods + private_instance_methods; end; end"), null); - AssertNoClrNames(Engine.Execute(@"class << Class; instance_methods + private_instance_methods; end"), null); + AssertNoClrNames(Engine.Execute(@"class << self; instance_methods + private_instance_methods; end"), null); + AssertNoClrNames(Engine.Execute(@"class << self; class << self; instance_methods + private_instance_methods; end; end"), null); + AssertNoClrNames(Engine.Execute(@"class << Class; instance_methods + private_instance_methods; end"), null); } public void ClrMethodEnumeration2() { @@ -1777,7 +1777,7 @@ "); Assert(e.Data is IDictionary); - var obj = Engine.Execute(@" + object obj = Engine.Execute(@" class C < Object def equals(other); raise; end new =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/DlrInteropTests.cs;C1240182 File: DlrInteropTests.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/DlrInteropTests.cs;C1240182 (server) 2/16/2010 10:30 AM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/DlrInteropTests.cs;V4bugs @@ -636,7 +636,7 @@ object misc_object = scope.GetVariable("misc"); object misc_class = MyInvokeMemberBinder.Invoke(misc_object, "class"); - AreEqual(Engine.Runtime.Globals.GetVariable("Miscellaneous"), misc_class); + AreEqual(Engine.Runtime.Globals.GetVariable("Miscellaneous"), misc_class); // singleton methods are only invokable on the class object, not the instance: AreEqual(MyInvokeMemberBinder.Invoke(misc_class, "static_method"), "static_method"); @@ -669,8 +669,8 @@ end end "); - var classC = Runtime.Globals.GetVariable("C"); - var c = Engine.Operations.CreateInstance(classC); + object classC = Runtime.Globals.GetVariable("C"); + object c = Engine.Operations.CreateInstance(classC); AreEqual(MyConvertBinder.Convert(c, 10), (sbyte)1); AreEqual(MyConvertBinder.Convert(c, 10), (byte)1); =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/HostingTests.cs;C1594104 File: HostingTests.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/HostingTests.cs;C1594104 (server) 2/16/2010 10:17 AM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/HostingTests.cs;V4bugs @@ -29,16 +29,16 @@ using System.Runtime.CompilerServices; namespace IronRuby.Tests { - public partial class Tests { + public partial class Tests { public void RubyHosting_DelegateConversions() { - var lambda = Engine.Execute(@"lambda { |a| a + 1 }"); + object lambda = Engine.Execute(@"lambda { |a| a + 1 }"); var result = Engine.Operations.Invoke(lambda, 5); Assert((int)result == 6); var func = Engine.Operations.ConvertTo>(lambda); Assert(func(10) == 11); - var method = Engine.Execute(@"def foo(a,b); a + b; end; method(:foo)"); + object method = Engine.Execute(@"def foo(a,b); a + b; end; method(:foo)"); var func2 = Engine.Operations.ConvertTo>(method); Assert(func2(1, 2) == 3); @@ -172,7 +172,7 @@ var scope = Engine.CreateScope(); Engine.Execute("def bar; 1; end", scope); Assert(Context.ObjectClass.GetMethod("bar") == null); - Assert(scope.GetVariable("bar") != null); + Assert(scope.GetVariable("bar") != null); // we can invoke the method on a scope: Assert((int)Engine.Operations.InvokeMember(scope, "bar") == 1); @@ -449,20 +449,20 @@ var str = Engine.Operations.ConvertTo(MutableString.CreateAscii("foo")); Assert(str == "foo"); - str = Engine.Operations.ConvertTo(Engine.Execute("class C; def to_str; 'bar'; end; new; end")); + str = Engine.Operations.ConvertTo(Engine.Execute("class C; def to_str; 'bar'; end; new; end")); Assert(str == "bar"); - var b = Engine.Operations.ConvertTo(Engine.Execute("class C; def to_int; 123; end; new; end")); + var b = Engine.Operations.ConvertTo(Engine.Execute("class C; def to_int; 123; end; new; end")); Assert(b == 123); - var lambda = Engine.Operations.ConvertTo>(Engine.Execute("lambda { |x| x * 2 }")); + var lambda = Engine.Operations.ConvertTo>(Engine.Execute("lambda { |x| x * 2 }")); Assert(lambda(10) == 20); Assert((int)Engine.CreateOperations().InvokeMember(null, "to_i") == 0); } public void ObjectOperations2() { - var cls = Engine.Execute(@" + object cls = Engine.Execute(@" class C def foo *a p a @@ -478,7 +478,7 @@ Assert(names.Contains("taint")); Assert(names.Contains("bar")); - var obj = Engine.Operations.CreateInstance(cls); + object obj = Engine.Operations.CreateInstance(cls); names = Engine.Operations.GetMemberNames(obj); Assert(names.Contains("foo")); Assert(names.Contains("taint")); @@ -814,7 +814,7 @@ } public void CustomTypeDescriptor1() { - var cls = Engine.Execute(@" + object cls = Engine.Execute(@" class C attr_accessor :a def b @@ -838,7 +838,7 @@ self end "); - var obj = Engine.Operations.CreateInstance(cls); + object obj = Engine.Operations.CreateInstance(cls); Assert(obj != null); var ictd = Engine.Operations.CreateInstance(cls) as ICustomTypeDescriptor; Assert(ictd != null); @@ -847,8 +847,8 @@ Assert(props.Count == 2); props[0].SetValue(obj, "abc"); props[1].SetValue(obj, "abc"); - Assert(Engine.Operations.InvokeMember(obj, "a").Equals("abc")); - Assert(Engine.Operations.InvokeMember(obj, "c").Equals(true)); + Assert((string)Engine.Operations.InvokeMember(obj, "a") == "abc"); + Assert((bool)Engine.Operations.InvokeMember(obj, "c")); } public void CustomTypeDescriptor2() { =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj;C1594104 File: Ruby.csproj =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj;C1594104 (server) 2/15/2010 4:42 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Ruby.csproj;V4bugs @@ -198,6 +198,7 @@ + =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyIO.cs;C1290543 File: RubyIO.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyIO.cs;C1290543 (server) 2/15/2010 4:44 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyIO.cs;V4bugs @@ -23,7 +23,7 @@ /// /// IO builtin class. Wraps a BCL Stream object. Implementation of Ruby methods is in IoOps.cs in IronRuby.Libraries assembly. /// - public class RubyIO : IDisposable { + public partial class RubyIO : IDisposable { private RubyContext/*!*/ _context; private RubyEncoding/*!*/ _externalEncoding; private RubyEncoding _internalEncoding; =================================================================== add: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyIO.Subclass.cs File: RubyIO.Subclass.cs =================================================================== --- [no source file] +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyIO.Subclass.cs;V4bugs @@ -1,0 +1,33 @@ +/* **************************************************************************** + * + * 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. + * + * + * ***************************************************************************/ + +using IronRuby.Runtime; +using Microsoft.Scripting.Utils; +using IronRuby.Compiler.Generation; +using System.Diagnostics; + +namespace IronRuby.Builtins { + public partial class RubyIO { + public sealed partial class Subclass : RubyIO, IRubyObject { + // called by Class#new rule when creating a Ruby subclass of IO: + public Subclass(RubyClass/*!*/ rubyClass) + : base(rubyClass.Context) { + Assert.NotNull(rubyClass); + Debug.Assert(!rubyClass.IsSingletonClass); + ImmediateClass = rubyClass; + } + } + } +} =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyRegex.Subclass.cs;C966724 File: RubyRegex.Subclass.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyRegex.Subclass.cs;C966724 (server) 2/15/2010 4:45 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/RubyRegex.Subclass.cs;V4bugs @@ -21,7 +21,7 @@ namespace IronRuby.Builtins { public partial class RubyRegex { public sealed partial class Subclass : RubyRegex, IRubyObject { - // called by Class#new rule when creating a Ruby subclass of String: + // called by Class#new rule when creating a Ruby subclass of Regexp: public Subclass(RubyClass/*!*/ rubyClass) { Assert.NotNull(rubyClass); Debug.Assert(!rubyClass.IsSingletonClass); =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/Subclasses.Generated.cs;C1200585 File: Subclasses.Generated.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/Subclasses.Generated.cs;C1200585 (server) 2/15/2010 4:41 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/Subclasses.Generated.cs;V4bugs @@ -20,7 +20,7 @@ namespace IronRuby.Builtins { #if GENERATOR - Stateless = ['Proc', 'Range', 'RubyRegex'] + Stateless = ['Proc', 'Range', 'RubyRegex', 'RubyIO'] def generate Stateless.each do |cls| @@ -88,10 +88,11 @@ } #endif #region Generated by Subclasses.Generator.rb - public partial class MatchData { + + public partial class Proc { [DebuggerTypeProxy(typeof(RubyObjectDebugView))] [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)] - public sealed partial class Subclass : MatchData, IRubyObject { + public sealed partial class Subclass : Proc, IRubyObject { private RubyInstanceData _instanceData; private RubyClass/*!*/ _immediateClass; @@ -115,6 +116,19 @@ return _instanceData; } + public bool IsFrozen { + get { return _instanceData != null && _instanceData.Frozen; } + } + + public bool IsTainted { + get { return _instanceData != null && _instanceData.Tainted; } + set { GetInstanceData().Tainted = value; } + } + + public void Freeze() { + GetInstanceData().Freeze(); + } + public int BaseGetHashCode() { return base.GetHashCode(); } @@ -128,10 +142,10 @@ } } } - public partial class Proc { + public partial class Range { [DebuggerTypeProxy(typeof(RubyObjectDebugView))] [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)] - public sealed partial class Subclass : Proc, IRubyObject { + public sealed partial class Subclass : Range, IRubyObject { private RubyInstanceData _instanceData; private RubyClass/*!*/ _immediateClass; @@ -181,10 +195,10 @@ } } } - public partial class Range { + public partial class RubyRegex { [DebuggerTypeProxy(typeof(RubyObjectDebugView))] [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)] - public sealed partial class Subclass : Range, IRubyObject { + public sealed partial class Subclass : RubyRegex, IRubyObject { private RubyInstanceData _instanceData; private RubyClass/*!*/ _immediateClass; @@ -234,10 +248,10 @@ } } } - public partial class RubyRegex { + public partial class RubyIO { [DebuggerTypeProxy(typeof(RubyObjectDebugView))] [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)] - public sealed partial class Subclass : RubyRegex, IRubyObject { + public sealed partial class Subclass : RubyIO, IRubyObject { private RubyInstanceData _instanceData; private RubyClass/*!*/ _immediateClass; @@ -287,6 +301,7 @@ } } } + #endregion #if GENERATOR @@ -345,6 +360,7 @@ } #endif #region Generated by Subclasses.Generator.rb + public partial class RubyArray { [DebuggerTypeProxy(typeof(RubyObjectDebugView))] [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)] @@ -385,5 +401,46 @@ } } } + public partial class MatchData { + [DebuggerTypeProxy(typeof(RubyObjectDebugView))] + [DebuggerDisplay(RubyObject.DebuggerDisplayValue, Type = RubyObject.DebuggerDisplayType)] + public sealed partial class Subclass : MatchData, IRubyObject { + private RubyInstanceData _instanceData; + private RubyClass/*!*/ _immediateClass; + + [Emitted] + public RubyClass/*!*/ ImmediateClass { + get { + return _immediateClass; + } + set { + // once a singleton immediate class is set it can't be changed: + Debug.Assert((_immediateClass == null || !_immediateClass.IsSingletonClass) && value != null); + _immediateClass = value; + } + } + + public RubyInstanceData/*!*/ GetInstanceData() { + return RubyOps.GetInstanceData(ref _instanceData); + } + + public RubyInstanceData TryGetInstanceData() { + return _instanceData; + } + + public int BaseGetHashCode() { + return base.GetHashCode(); + } + + public bool BaseEquals(object other) { + return base.Equals(other); + } + + public string/*!*/ BaseToString() { + return base.ToString(); + } + } + } + #endregion } =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Compiler/Generation/RubyTypeDispenser.cs;C1240182 File: RubyTypeDispenser.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Compiler/Generation/RubyTypeDispenser.cs;C1240182 (server) 2/15/2010 4:35 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Compiler/Generation/RubyTypeDispenser.cs;V4bugs @@ -42,9 +42,11 @@ AddBuiltinType(typeof(MutableString), typeof(MutableString.Subclass), true); AddBuiltinType(typeof(Proc), typeof(Proc.Subclass), true); AddBuiltinType(typeof(RubyRegex), typeof(RubyRegex.Subclass), true); + AddBuiltinType(typeof(Range), typeof(Range.Subclass), true); AddBuiltinType(typeof(Hash), typeof(Hash.Subclass), true); AddBuiltinType(typeof(RubyArray), typeof(RubyArray.Subclass), true); AddBuiltinType(typeof(MatchData), typeof(MatchData.Subclass), true); + AddBuiltinType(typeof(RubyIO), typeof(RubyIO.Subclass), true); } internal static Type/*!*/ GetOrCreateType(Type/*!*/ baseType, IList/*!*/ interfaces, bool noOverrides) { =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Runtime/Loader.cs;C1429753 File: Loader.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Runtime/Loader.cs;C1429753 (server) 2/16/2010 9:39 AM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Runtime/Loader.cs;V4bugs @@ -411,12 +411,16 @@ internal void HookAssemblyResolve() { try { - AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolveEvent; + HookAssemblyResolveInternal(); } catch (System.Security.SecurityException) { // We may not have SecurityPermissionFlag.ControlAppDomain. } } + private void HookAssemblyResolveInternal() { + AppDomain.CurrentDomain.AssemblyResolve += AssemblyResolveEvent; + } + private Assembly AssemblyResolveEvent(object sender, ResolveEventArgs args) { Loader loader = (Loader)_loader.Target; if (loader != null) { =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Tests/Scripts/utr.bat;C1366657 File: utr.bat =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Tests/Scripts/utr.bat;C1366657 (server) 2/15/2010 3:36 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Tests/Scripts/utr.bat;V4bugs @@ -1,1 +1,1 @@ -@"%MERLIN_ROOT%\Test\Scripts\ir.cmd" "%~dpn0.rb" "%*" +@"%MERLIN_ROOT%\Test\Scripts\ir.cmd" -v "%~dpn0.rb" "%*" =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Tests/Syntax/run_syntax.rb;C400043 File: run_syntax.rb =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Tests/Syntax/run_syntax.rb;C400043 (server) 2/15/2010 3:38 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Tests/Syntax/run_syntax.rb;V4bugs @@ -38,7 +38,7 @@ raise "Invalid target" else handler = target.method(newState) - end + end end end end @@ -65,7 +65,7 @@ end def process - prepare + prepare @stateMachine.run(self, "no effect") end end @@ -197,7 +197,7 @@ csp.patched_code_handler = proc { |snippet| puts "+" * 50; snippet.each { |l| printf("P |%s", l) } } csp.unpatched_code_handler = proc { |snippet| puts "-" * 50; snippet.each { |l| printf("U |%s", l) } } csp.process - end + end end def test_SnippetShow @@ -411,9 +411,9 @@ raise "Can not find the expected behavior: %s\n" % @generated end else - expected = h[@name.downcase] + expected = h[@name.downcase] end - if $?.exitstatus == 0 # success + if $?.exitstatus == 0 # success if expected != "pass" @failure += 1 printf "expected pass, but not. %s\n", @generated @@ -421,13 +421,13 @@ printf "+" end else # fail - if output.include?(expected) == false # but can not find the expected string + if output.include?(expected) == false # but can not find the expected string @failure += 1 printf "expected fail, but not. %s\n", @generated else printf "-" end - end + end end def test_unpatched_code(snippet) @@ -471,7 +471,7 @@ elsif arg =~ /-snap/ else test_files << arg - end + end end if test_files.empty? @@ -497,7 +497,7 @@ } csp.unpatched_code_handler = proc { |snippet| raise "unexpected" } csp.process - end + end end gendir = File.join(TestPath::TEST_DIR, "syntax/generated") @@ -510,7 +510,7 @@ cs.run(f) end - cmd = "#{TestPath::IPYTHON_EXE} parseonly.py #{TestPath::TEST_DIR}/syntax/generated > parsing.log" + cmd = "\"#{TestPath::IPYTHON_EXE}\" parseonly.py \"#{TestPath::TEST_DIR}/syntax/generated\" > parsing.log" print "\n\nRunning #{cmd} ... \n" system(cmd) exit($?.exitstatus) ===================================================================