edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/BuiltinsOps.cs;C1544575 File: BuiltinsOps.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/BuiltinsOps.cs;C1544575 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/BuiltinsOps.cs;bindingandyamlfxcop @@ -151,7 +151,7 @@ string name = self.ImmediateClass.GetNonSingletonClass().Name; if (name != null) { string structPrefix = "Struct::"; - if (name.StartsWith(structPrefix)) { + if (name.StartsWith(structPrefix, StringComparison.Ordinal)) { name = name.Substring(structPrefix.Length); } } @@ -239,7 +239,7 @@ string str = self.ToString(); ScalarQuotingStyle style = ScalarQuotingStyle.None; - if (str.StartsWith(":")) { + if (str.StartsWith(":", StringComparison.Ordinal)) { style = ScalarQuotingStyle.Double; } else { style = rep.GetYamlStyle(self); =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/IronRuby.Libraries.Yaml.csproj;C1496258 File: IronRuby.Libraries.Yaml.csproj =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/IronRuby.Libraries.Yaml.csproj;C1496258 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/IronRuby.Libraries.Yaml.csproj;bindingandyamlfxcop @@ -19,6 +19,18 @@ SIGNED true + + pdbonly + true + ..\..\..\..\..\Main\bin\FxCop\ + TRACE;$(SignedSym);CLR2 + prompt + 4 + true + true + -Microsoft.Usage#CA2209;+!Microsoft.Portability#CA1903;-!Microsoft.Design#CA1012;-!Microsoft.Design#CA2210;-!Microsoft.Design#CA1040;-!Microsoft.Design#CA1005;-!Microsoft.Design#CA1020;-!Microsoft.Design#CA1021;-!Microsoft.Design#CA1010;-!Microsoft.Design#CA1011;-!Microsoft.Design#CA1009;-!Microsoft.Design#CA1050;-!Microsoft.Design#CA1026;-!Microsoft.Design#CA1019;-!Microsoft.Design#CA1031;-!Microsoft.Design#CA1047;-!Microsoft.Design#CA1000;-!Microsoft.Design#CA1048;-!Microsoft.Design#CA1051;-!Microsoft.Design#CA1002;-!Microsoft.Design#CA1061;-!Microsoft.Design#CA1006;-!Microsoft.Design#CA1046;-!Microsoft.Design#CA1045;-!Microsoft.Design#CA1065;-!Microsoft.Design#CA1038;-!Microsoft.Design#CA1008;-!Microsoft.Design#CA1028;-!Microsoft.Design#CA1064;-!Microsoft.Design#CA1004;-!Microsoft.Design#CA1035;-!Microsoft.Design#CA1063;-!Microsoft.Design#CA1032;-!Microsoft.Design#CA1023;-!Microsoft.Design#CA1033;-!Microsoft.Design#CA1039;-!Microsoft.Design#CA1016;-!Microsoft.Design#CA1014;-!Microsoft.Design#CA1017;-!Microsoft.Design#CA1018;-!Microsoft.Design#CA1027;-!Microsoft.Design#CA1059;-!Microsoft.Design#CA1060;-!Microsoft.Design#CA1034;-!Microsoft.Design#CA1013;-!Microsoft.Design#CA1036;-!Microsoft.Design#CA1044;-!Microsoft.Design#CA1041;-!Microsoft.Design#CA1025;-!Microsoft.Design#CA1052;-!Microsoft.Design#CA1053;-!Microsoft.Design#CA1057;-!Microsoft.Design#CA1058;-!Microsoft.Design#CA1001;-!Microsoft.Design#CA1049;-!Microsoft.Design#CA1054;-!Microsoft.Design#CA1056;-!Microsoft.Design#CA1055;-!Microsoft.Design#CA1030;-!Microsoft.Design#CA1003;-!Microsoft.Design#CA1007;-!Microsoft.Design#CA1043;-!Microsoft.Design#CA1024;+!Microsoft.Globalization#CA1301;+!Microsoft.Globalization#CA1302;-!Microsoft.Globalization#CA1308;+!Microsoft.Globalization#CA1306;+!Microsoft.Globalization#CA1304;-!Microsoft.Globalization#CA1305;+!Microsoft.Globalization#CA2101;+!Microsoft.Globalization#CA1300;+!Microsoft.Globalization#CA1307;+!Microsoft.Globalization#CA1309;-!Microsoft.Interoperability#CA1403;-!Microsoft.Interoperability#CA1406;-!Microsoft.Interoperability#CA1413;-!Microsoft.Interoperability#CA1402;-!Microsoft.Interoperability#CA1407;-!Microsoft.Interoperability#CA1404;-!Microsoft.Interoperability#CA1410;-!Microsoft.Interoperability#CA1411;-!Microsoft.Interoperability#CA1405;-!Microsoft.Interoperability#CA1409;-!Microsoft.Interoperability#CA1415;-!Microsoft.Interoperability#CA1408;-!Microsoft.Interoperability#CA1414;-!Microsoft.Interoperability#CA1412;-!Microsoft.Interoperability#CA1400;-!Microsoft.Interoperability#CA1401;-!Microsoft.Maintainability#CA1506;-!Microsoft.Maintainability#CA1502;-!Microsoft.Maintainability#CA1501;-!Microsoft.Maintainability#CA1505;-!Microsoft.Maintainability#CA1504;-!Microsoft.Maintainability#CA1500;-!Microsoft.Mobility#CA1600;-!Microsoft.Mobility#CA1601;-!Microsoft.Naming#CA1702;-!Microsoft.Naming#CA1700;-!Microsoft.Naming#CA1712;-!Microsoft.Naming#CA1713;-!Microsoft.Naming#CA1714;-!Microsoft.Naming#CA1709;-!Microsoft.Naming#CA1704;-!Microsoft.Naming#CA1708;-!Microsoft.Naming#CA1715;-!Microsoft.Naming#CA1710;-!Microsoft.Naming#CA1720;-!Microsoft.Naming#CA1707;-!Microsoft.Naming#CA1722;-!Microsoft.Naming#CA1711;-!Microsoft.Naming#CA1716;-!Microsoft.Naming#CA1717;-!Microsoft.Naming#CA1725;-!Microsoft.Naming#CA1719;-!Microsoft.Naming#CA1721;-!Microsoft.Naming#CA1701;-!Microsoft.Naming#CA1703;-!Microsoft.Naming#CA1724;-!Microsoft.Naming#CA1726;-!Microsoft.Performance#CA1809;-!Microsoft.Performance#CA1811;-!Microsoft.Performance#CA1812;-!Microsoft.Performance#CA1813;+!Microsoft.Performance#CA1823;-!Microsoft.Performance#CA1800;-!Microsoft.Performance#CA1805;-!Microsoft.Performance#CA1810;+!Microsoft.Performance#CA1824;-!Microsoft.Performance#CA1822;-!Microsoft.Performance#CA1815;-!Microsoft.Performance#CA1814;-!Microsoft.Performance#CA1819;-!Microsoft.Performance#CA1821;-!Microsoft.Performance#CA1804;-!Microsoft.Performance#CA1820;-!Microsoft.Performance#CA1802;+!Microsoft.Portability#CA1901;+!Microsoft.Portability#CA1900;+!Microsoft.Reliability#CA2001;+!Microsoft.Reliability#CA2002;+!Microsoft.Reliability#CA2003;+!Microsoft.Reliability#CA2004;+!Microsoft.Reliability#CA2006;+!Microsoft.Security#CA2116;+!Microsoft.Security#CA2117;+!Microsoft.Security#CA2105;+!Microsoft.Security#CA2115;+!Microsoft.Security#CA2102;-!Microsoft.Security#CA2104;+!Microsoft.Security#CA2122;+!Microsoft.Security#CA2114;+!Microsoft.Security#CA2123;+!Microsoft.Security#CA2111;+!Microsoft.Security#CA2108;+!Microsoft.Security#CA2107;+!Microsoft.Security#CA2103;+!Microsoft.Security#CA2118;+!Microsoft.Security#CA2109;+!Microsoft.Security#CA2119;+!Microsoft.Security#CA2106;+!Microsoft.Security#CA2112;+!Microsoft.Security#CA2120;+!Microsoft.Security#CA2121;+!Microsoft.Security#CA2126;+!Microsoft.Security#CA2124;+!Microsoft.Security#CA2127;+!Microsoft.Security#CA2128;+!Microsoft.Security#CA2129;-!Microsoft.Usage#CA2243;-!Microsoft.Usage#CA2236;-!Microsoft.Usage#CA1816;-!Microsoft.Usage#CA2227;-!Microsoft.Usage#CA2213;-!Microsoft.Usage#CA2216;-!Microsoft.Usage#CA2214;-!Microsoft.Usage#CA2222;-!Microsoft.Usage#CA1806;-!Microsoft.Usage#CA2217;-!Microsoft.Usage#CA2212;-!Microsoft.Usage#CA2219;-!Microsoft.Usage#CA2201;-!Microsoft.Usage#CA2228;-!Microsoft.Usage#CA2221;-!Microsoft.Usage#CA2220;-!Microsoft.Usage#CA2240;-!Microsoft.Usage#CA2229;-!Microsoft.Usage#CA2238;-!Microsoft.Usage#CA2207;-!Microsoft.Usage#CA2208;-!Microsoft.Usage#CA2235;-!Microsoft.Usage#CA2237;-!Microsoft.Usage#CA2232;-!Microsoft.Usage#CA2223;-!Microsoft.Usage#CA2211;-!Microsoft.Usage#CA2233;-!Microsoft.Usage#CA2225;-!Microsoft.Usage#CA2226;-!Microsoft.Usage#CA2231;-!Microsoft.Usage#CA2224;-!Microsoft.Usage#CA2218;-!Microsoft.Usage#CA2234;-!Microsoft.Usage#CA2239;-!Microsoft.Usage#CA2200;-!Microsoft.Usage#CA1801;-!Microsoft.Usage#CA2242;-!Microsoft.Usage#CA2205;-!Microsoft.Usage#CA2230 + v2.0 + true full @@ -27,6 +39,7 @@ DEBUG;TRACE;$(SignedSym);CLR2 prompt 4 + v2.0 pdbonly @@ -35,6 +48,7 @@ TRACE;$(SignedSym);CLR2 prompt 4 + v2.0 true =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyConstructor.cs;C1496258 File: RubyConstructor.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyConstructor.cs;C1496258 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/RubyConstructor.cs;bindingandyamlfxcop @@ -186,11 +186,11 @@ if (scalar != null) { string value = scalar.Value; int dotsIdx; - if ((dotsIdx = value.IndexOf("...")) != -1) { + if ((dotsIdx = value.IndexOf("...", StringComparison.Ordinal)) != -1) { begin = ParseObject(ctor, value.Substring(0, dotsIdx)); end = ParseObject(ctor, value.Substring(dotsIdx + 3)); excludeEnd = true; - } else if ((dotsIdx = value.IndexOf("..")) != -1) { + } else if ((dotsIdx = value.IndexOf("..", StringComparison.Ordinal)) != -1) { begin = ParseObject(ctor, value.Substring(0, dotsIdx)); end = ParseObject(ctor, value.Substring(dotsIdx + 2)); } else { =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/BaseConstructor.cs;C1496258 File: BaseConstructor.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/BaseConstructor.cs;C1496258 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/BaseConstructor.cs;bindingandyamlfxcop @@ -560,13 +560,13 @@ int @base = 10; if (value == "0") { return 0; - } else if (value.StartsWith("0b")) { + } else if (value.StartsWith("0b", StringComparison.Ordinal)) { value = value.Substring(2); @base = 2; - } else if (value.StartsWith("0x")) { + } else if (value.StartsWith("0x", StringComparison.Ordinal)) { value = value.Substring(2); @base = 16; - } else if (value.StartsWith("0")) { + } else if (value.StartsWith("0", StringComparison.Ordinal)) { value = value.Substring(1); @base = 8; } else if (value.IndexOf(':') != -1) { @@ -598,9 +598,9 @@ } else if (first == '+') { value = value.Substring(1); } - string valLower = value.ToLower(); + string valLower = value.ToLowerInvariant(); if (valLower == ".inf") { - return sign == -1 ? double.NegativeInfinity : double.PositiveInfinity; + return sign == -1 ? Double.NegativeInfinity : Double.PositiveInfinity; } else if (valLower == ".nan") { return double.NaN; } else if (value.IndexOf(':') != -1) { @@ -658,7 +658,7 @@ foreach (KeyValuePair e in ctor.ConstructMapping(node)) { string name = e.Key.ToString(); - name = "" + char.ToUpper(name[0]) + name.Substring(1); + name = "" + name[0].ToUpperInvariant() + name.Substring(1); PropertyInfo prop = type.GetProperty(name); prop.SetValue(result, Convert.ChangeType(e.Value, prop.PropertyType), null); =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Emitter.cs;C1496258 File: Emitter.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Emitter.cs;C1496258 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Emitter.cs;bindingandyamlfxcop @@ -36,8 +36,6 @@ private int _flowLevel; private readonly Stack _indents = new Stack(); private int _indent = -1; - private bool _rootContext; - private bool _sequenceContext; private bool _mappingContext; private int _line; @@ -580,7 +578,7 @@ string handle = null; string suffix = tag; foreach (string prefix in _tagPrefixes.Keys) { - if (prefix.Length < tag.Length && tag.StartsWith(prefix)) { + if (prefix.Length < tag.Length && tag.StartsWith(prefix, StringComparison.Ordinal)) { handle = _tagPrefixes[prefix]; suffix = tag.Substring(prefix.Length); } @@ -589,7 +587,7 @@ // use short form if applicable ("tag:ruby.yaml.org,2002:foobar" -> "ruby/foobar") if (handle == null) { int colonIdx; - if (tag.StartsWith("tag:") && (colonIdx = tag.IndexOf(':', 4)) != -1) { + if (tag.StartsWith("tag:", StringComparison.Ordinal) && (colonIdx = tag.IndexOf(':', 4)) != -1) { string first = tag.Substring(4, tag.IndexOf('.', 4) - 4); string rest = tag.Substring(colonIdx + 1); handle = "!" + first + "/"; @@ -610,7 +608,6 @@ } private static Regex DOC_INDIC = new Regex("^(---|\\.\\.\\.)", RegexOptions.Compiled); - private static Regex FIRST_SPACE = new Regex("(^|\n) ", RegexOptions.Compiled); private static string NULL_BL_T_LINEBR = "\0 \t\r\n"; private static string SPECIAL_INDIC = "#,[]{}#&*!|>'\"%@"; private static string FLOW_INDIC = ",?[]{}"; @@ -1059,8 +1056,6 @@ } private void EmitNode(bool root, bool sequence, bool mapping, bool simpleKey) { - _rootContext = root; - _sequenceContext = sequence; _mappingContext = mapping; if (_event is AliasEvent) { EmitAlias(); =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Parser.cs;C1544575 File: Parser.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Parser.cs;C1544575 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Parser.cs;bindingandyamlfxcop @@ -555,7 +555,7 @@ string handle = tagToken.Handle; string suffix = tagToken.Suffix; int ix = -1; - if ((ix = suffix.IndexOf("^")) != -1) { + if ((ix = suffix.IndexOf('^')) != -1) { if (ix > 0) { _familyTypePrefix = suffix.Substring(0, ix); } @@ -565,13 +565,13 @@ if (!_tagHandles.ContainsKey(handle)) { ReportError("while parsing a node: found undefined tag handle: {0}", handle); } - if ((ix = suffix.IndexOf("/")) != -1) { + if ((ix = suffix.IndexOf('/')) != -1) { string before = suffix.Substring(0, ix); string after = suffix.Substring(ix + 1); if (ONLY_WORD.IsMatch(before)) { tag = "tag:" + before + ".yaml.org,2002:" + after; } else { - if (before.StartsWith("tag:")) { + if (before.StartsWith("tag:", StringComparison.Ordinal)) { tag = before + ":" + after; } else { tag = "tag:" + before + ":" + after; =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/ResolverScanner.cs;C1496258 File: ResolverScanner.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/ResolverScanner.cs;C1496258 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/ResolverScanner.cs;bindingandyamlfxcop @@ -288,32 +288,6 @@ private static byte[] _resolver_scanner_trans_targs_wi = create__resolver_scanner_trans_targs_wi(); - private static void init__resolver_scanner_trans_actions_wi_0(byte[] r) { - r[0] = 0; r[1] = 0; r[2] = 0; r[3] = 0; r[4] = 0; r[5] = 0; r[6] = 0; r[7] = 0; - r[8] = 0; r[9] = 0; r[10] = 0; r[11] = 0; r[12] = 0; r[13] = 0; r[14] = 0; r[15] = 0; - r[16] = 0; r[17] = 0; r[18] = 0; r[19] = 0; r[20] = 0; r[21] = 0; r[22] = 0; r[23] = 0; - r[24] = 0; r[25] = 0; r[26] = 0; r[27] = 0; r[28] = 0; r[29] = 0; r[30] = 0; r[31] = 0; - r[32] = 0; r[33] = 0; r[34] = 0; r[35] = 0; r[36] = 0; r[37] = 0; r[38] = 0; r[39] = 0; - r[40] = 0; r[41] = 0; r[42] = 0; r[43] = 0; r[44] = 0; r[45] = 0; r[46] = 0; r[47] = 0; - r[48] = 0; r[49] = 0; r[50] = 0; r[51] = 0; r[52] = 0; r[53] = 0; r[54] = 0; r[55] = 0; - r[56] = 0; r[57] = 0; r[58] = 0; r[59] = 0; r[60] = 0; r[61] = 0; r[62] = 0; r[63] = 0; - r[64] = 0; r[65] = 0; r[66] = 0; r[67] = 0; r[68] = 0; r[69] = 0; r[70] = 0; r[71] = 0; - r[72] = 0; r[73] = 0; r[74] = 0; r[75] = 0; r[76] = 0; r[77] = 0; r[78] = 0; r[79] = 0; - r[80] = 0; r[81] = 0; r[82] = 0; r[83] = 0; r[84] = 0; r[85] = 0; r[86] = 0; r[87] = 0; - r[88] = 0; r[89] = 0; r[90] = 0; r[91] = 0; r[92] = 0; r[93] = 0; r[94] = 0; r[95] = 0; - r[96] = 0; r[97] = 0; r[98] = 0; r[99] = 0; r[100] = 0; r[101] = 0; r[102] = 0; r[103] = 0; - r[104] = 0; r[105] = 0; r[106] = 0; - } - - private static byte[] create__resolver_scanner_trans_actions_wi() { - byte[] r = new byte[107]; - init__resolver_scanner_trans_actions_wi_0(r); - return r; - } - - private static byte[] _resolver_scanner_trans_actions_wi = create__resolver_scanner_trans_actions_wi(); - - private static void init__resolver_scanner_eof_actions_0(byte[] r) { r[0] = 0; r[1] = 0; r[2] = 0; r[3] = 0; r[4] = 0; r[5] = 0; r[6] = 0; r[7] = 0; r[8] = 0; r[9] = 0; r[10] = 0; r[11] = 0; r[12] = 0; r[13] = 0; r[14] = 0; r[15] = 0; =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Scanner.cs;C1544575 File: Scanner.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Scanner.cs;C1544575 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Scanner.cs;bindingandyamlfxcop @@ -580,7 +580,7 @@ try { Ensure(2, false); str.Append(int.Parse(new string(_buffer, _pointer, 2), NumberStyles.HexNumber)); - } catch (FormatException fe) { + } catch (FormatException) { ReportError( "while scanning a {0}: expected URI escape sequence of 2 hexadecimal numbers, but found `{0}' ({1}) and `{2}' ({3})", name, Peek(1), Peek(2) =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Serializer.cs;C1496258 File: Serializer.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Serializer.cs;C1496258 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/IronRuby/yaml/IronRuby.Libraries.Yaml/Engine/Serializer.cs;bindingandyamlfxcop @@ -28,7 +28,6 @@ private readonly bool _useExplicitStart; private readonly bool _useExplicitEnd; private readonly Version _useVersion; - private readonly bool _useTags; private readonly string _anchorTemplate; private readonly Dictionary/*!*/ _serializedNodes = new Dictionary(ReferenceEqualityComparer.Instance); @@ -49,7 +48,6 @@ if (opts.UseVersion) { _useVersion = opts.Version; } - _useTags = opts.UseHeader; _anchorTemplate = opts.AnchorFormat ?? "id{0:000}"; _emitter.Emit(StreamStartEvent.Instance); } @@ -160,7 +158,7 @@ } else { // omit the tag for non-string scalars whose type can be recognized from their value: string detectedTag = ResolverScanner.Recognize(scalar.Value); - if (detectedTag != null && tag.StartsWith(detectedTag)) { + if (detectedTag != null && tag.StartsWith(detectedTag, StringComparison.Ordinal)) { tag = null; } type = ScalarValueType.Other; =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/External.LCA_RESTRICTED/Languages/Ruby/ruby-1.8.6p368/lib/ruby/1.8/erb.rb;C1084571 edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby.sln;C1245485 File: Ruby.sln =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby.sln;C1245485 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby.sln;bindingandyamlfxcop @@ -168,8 +168,8 @@ {77323B06-15A2-4CF4-8A7A-86EAA2B66498}.V4 Release|Any CPU.Build.0 = V4 Release|Any CPU {AA18A245-E342-4368-A474-83178311A742}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {AA18A245-E342-4368-A474-83178311A742}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA18A245-E342-4368-A474-83178311A742}.FxCop|Any CPU.ActiveCfg = Release|Any CPU - {AA18A245-E342-4368-A474-83178311A742}.FxCop|Any CPU.Build.0 = Release|Any CPU + {AA18A245-E342-4368-A474-83178311A742}.FxCop|Any CPU.ActiveCfg = FxCop|Any CPU + {AA18A245-E342-4368-A474-83178311A742}.FxCop|Any CPU.Build.0 = FxCop|Any CPU {AA18A245-E342-4368-A474-83178311A742}.Release|Any CPU.ActiveCfg = Release|Any CPU {AA18A245-E342-4368-A474-83178311A742}.Release|Any CPU.Build.0 = Release|Any CPU {AA18A245-E342-4368-A474-83178311A742}.Silverlight Debug|Any CPU.ActiveCfg = Debug|Any CPU @@ -213,8 +213,8 @@ {6EE7A428-D803-41BC-8248-1297C3ACE369}.V4 Release|Any CPU.Build.0 = V4 Release|Any CPU {ED82A346-1CD9-4CB0-9C00-4CDD4CF577CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {ED82A346-1CD9-4CB0-9C00-4CDD4CF577CF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED82A346-1CD9-4CB0-9C00-4CDD4CF577CF}.FxCop|Any CPU.ActiveCfg = Release|Any CPU - {ED82A346-1CD9-4CB0-9C00-4CDD4CF577CF}.FxCop|Any CPU.Build.0 = Release|Any CPU + {ED82A346-1CD9-4CB0-9C00-4CDD4CF577CF}.FxCop|Any CPU.ActiveCfg = FxCop|Any CPU + {ED82A346-1CD9-4CB0-9C00-4CDD4CF577CF}.FxCop|Any CPU.Build.0 = FxCop|Any CPU {ED82A346-1CD9-4CB0-9C00-4CDD4CF577CF}.Release|Any CPU.ActiveCfg = Release|Any CPU {ED82A346-1CD9-4CB0-9C00-4CDD4CF577CF}.Release|Any CPU.Build.0 = Release|Any CPU {ED82A346-1CD9-4CB0-9C00-4CDD4CF577CF}.Silverlight Debug|Any CPU.ActiveCfg = Silverlight Debug|Any CPU =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C1544546 File: RubyTests.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;C1544546 (server) 1/30/2010 9:51 AM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/RubyTests.cs;bindingandyamlfxcop @@ -693,6 +693,8 @@ AliasInModuleEval1, MethodAliasInModuleEval1, SuperInModuleEval1, + SuperCallInEvalWithBinding18, + SuperCallInEvalWithBinding19, // TODO: SuperParameterlessEval1, // TODO: SuperParameterlessEval2, SuperInDefineMethodEval1, =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/SuperTests.cs;C1299354 File: SuperTests.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/SuperTests.cs;C1299354 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/IronRuby.Tests/Runtime/SuperTests.cs;bindingandyamlfxcop @@ -620,6 +620,73 @@ B::foo "); } + + /// + /// MRI 1.8: The self object captured by Kernel#binding is the receiver of the binding call. + /// Thus the self used in eval might be different from the one the scope holds on. + /// Super call uses the scope's self object. + /// + [Options(Compatibility = RubyCompatibility.Ruby18)] + public void SuperCallInEvalWithBinding18() { + TestOutput(@" +module Kernel + public :binding +end + +class A + def m + puts 'A::m' + end +end + +class D < A + def m + puts 'D::m' + p self.class + + cb = C.new.binding # binding captures C.new as self + eval(' + p self.class # self is different from RubyScope.SelfObject here + super # super picks up RubyScope.SelfObject + ', cb) + end +end + +class C +end + +D.new.m", @" +D::m +D +C +A::m +"); + } + + /// + /// MRI 1.9: The self object captured by Kernel#binding is the one captured by the scope, not the receiver of the binding call. + /// + [Options(Compatibility = RubyCompatibility.Ruby19)] + public void SuperCallInEvalWithBinding19() { + TestOutput(@" +class C + def foo + 123 + end +end + +b = C.new.send(:binding) +p self +eval(' + p self + p self.foo rescue p $! +', b) +", @" +main +main +# +"); + } } } =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;C1496258 File: KernelOps.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;C1496258 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Libraries.LCA_RESTRICTED/Builtins/KernelOps.cs;bindingandyamlfxcop @@ -143,7 +143,11 @@ [RubyMethod("binding", RubyMethodAttributes.PrivateInstance)] [RubyMethod("binding", RubyMethodAttributes.PublicSingleton)] public static Binding/*!*/ GetLocalScope(RubyScope/*!*/ scope, object self) { - return new Binding(scope); + if (scope.RubyContext.RubyOptions.Compatibility == RubyCompatibility.Ruby18) { + return new Binding(scope, self); + } else { + return new Binding(scope); + } } [RubyMethod("block_given?", RubyMethodAttributes.PrivateInstance)] @@ -612,8 +616,16 @@ public static object Evaluate(RubyScope/*!*/ scope, object self, [NotNull]MutableString/*!*/ code, [Optional]Binding binding, [Optional, NotNull]MutableString file, [DefaultParameterValue(1)]int line) { - RubyScope targetScope = (binding != null) ? binding.LocalScope : scope; - return RubyUtils.Evaluate(code, targetScope, targetScope.SelfObject, null, file, line); + RubyScope targetScope; + object targetSelf; + if (binding != null) { + targetScope = binding.LocalScope; + targetSelf = binding.SelfObject; + } else { + targetScope = scope; + targetSelf = self; + } + return RubyUtils.Evaluate(code, targetScope, targetSelf, null, file, line); } [RubyMethod("eval", RubyMethodAttributes.PrivateInstance)] =================================================================== edit: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/Binding.cs;C791094 File: Binding.cs =================================================================== --- $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/Binding.cs;C791094 (server) 1/31/2010 7:53 PM +++ Shelved Change: $/Dev10/feature/vs_langs01_s/Merlin/Main/Languages/Ruby/Ruby/Builtins/Binding.cs;bindingandyamlfxcop @@ -19,14 +19,30 @@ namespace IronRuby.Builtins { public sealed class Binding { private readonly RubyScope/*!*/ _localScope; + private readonly object _self; + /// + /// Local scope captured by the binding. + /// public RubyScope/*!*/ LocalScope { get { return _localScope; } } - public Binding(RubyScope/*!*/ localScope) { + /// + /// Self object captured by the binding. Can be different from LocalScope.SelfObject in MRI 1.8. + /// + public object SelfObject { + get { return _self; } + } + + public Binding(RubyScope/*!*/ localScope) + : this(localScope, localScope.SelfObject) { + } + + public Binding(RubyScope/*!*/ localScope, object self) { Assert.NotNull(localScope); _localScope = localScope; + _self = self; } } } ===================================================================