2009-08-26 Marek Habersack <mhabersack@novell.com>
authorMarek Habersack <grendel@twistedcode.net>
Wed, 26 Aug 2009 11:02:17 +0000 (11:02 -0000)
committerMarek Habersack <grendel@twistedcode.net>
Wed, 26 Aug 2009 11:02:17 +0000 (11:02 -0000)
* AspTokenizer.cs: when there's put back record and we're in
verbatim mode, get_token must be careful with what it returns - it
can't return Token.* values, instead it should look at Value and
retrieve the next token from it. Fixes bug #400807

2009-08-26  Marek Habersack  <mhabersack@novell.com>

* TemplateControlCompilerTest.cs: added test for bug #400807

2009-08-26  Marek Habersack  <mhabersack@novell.com>

* Makefile (TEST_RESOURCE_FILES): added
Test/mainsoft/NunitWebResources/OneLetterIdentifierInCodeRender.aspx

svn path=/trunk/mcs/; revision=140703

mcs/class/System.Web/ChangeLog
mcs/class/System.Web/Makefile
mcs/class/System.Web/System.Web.Compilation/AspTokenizer.cs
mcs/class/System.Web/System.Web.Compilation/ChangeLog
mcs/class/System.Web/Test/System.Web.Compilation/ChangeLog
mcs/class/System.Web/Test/System.Web.Compilation/TemplateControlCompilerTest.cs
mcs/class/System.Web/Test/mainsoft/NunitWebResources/OneLetterIdentifierInCodeRender.aspx [new file with mode: 0644]

index 4b29a1dd4a2acb3baf195155b74eb13e7ba5dd47..9a926848170bab41d571cf34633366c663a22e80 100644 (file)
@@ -1,3 +1,8 @@
+2009-08-26  Marek Habersack  <mhabersack@novell.com>
+
+       * Makefile (TEST_RESOURCE_FILES): added
+       Test/mainsoft/NunitWebResources/OneLetterIdentifierInCodeRender.aspx
+
 2009-08-25  Marek Habersack  <mhabersack@novell.com>
 
        * Makefile (TEST_RESOURCE_FILES): added
index 38f0c560e6c917676d16c65fceb92a001dfa276f..93b8116cbea03cf95ed177dd3c1bd7df1ad224c3 100644 (file)
@@ -177,7 +177,8 @@ TEST_RESOURCE_FILES = \
        Test/mainsoft/NunitWebResources/NewlineInCodeExpression.aspx \
        Test/mainsoft/NunitWebResources/DuplicateControlsInClientComment.aspx \
        Test/mainsoft/NunitWebResources/TagsNestedInClientTag.aspx \
-       Test/mainsoft/NunitWebResources/ConditionalClientComments.aspx
+       Test/mainsoft/NunitWebResources/ConditionalClientComments.aspx \
+       Test/mainsoft/NunitWebResources/OneLetterIdentifierInCodeRender.aspx
 
 RESX_DIST =  resources/TranslationResources.resx
 ifneq (1, $(FRAMEWORK_VERSION_MAJOR))
index 1d37324653f50534b69e13a45018f2976ed8f2c2..ace6ab9c2ba6b99598909f57b8fce95534905548 100644 (file)
@@ -127,7 +127,26 @@ namespace System.Web.Compilation
                public int get_token ()
                {
                        if (hasPutBack) {
-                               PutBackItem pbi = putBackBuffer.Pop () as PutBackItem;
+                               PutBackItem pbi;
+                               if (verbatim) {
+                                       pbi = putBackBuffer.Pop () as PutBackItem;
+                                       string value = pbi.Value;
+                                       switch (value.Length) {
+                                               case 0:
+                                                       // do nothing, CurrentToken will be used
+                                                       break;
+
+                                               case 1:
+                                                       pbi = new PutBackItem (String.Empty, pbi.Position, (int)value [0], false);
+                                                       break;
+
+                                               default:
+                                                       pbi = new PutBackItem (value, pbi.Position, (int)value [0], false);
+                                                       break;
+                                       }               
+                               } else
+                                       pbi = putBackBuffer.Pop () as PutBackItem;
+                               
                                hasPutBack = putBackBuffer.Count > 0;
                                position = pbi.Position;
                                have_value = false;
index 0ac48d86754579bc3e28404bc9204b289ac669d6..3c864988db86cdc6e15ba5b23f09d29aed82d15a 100644 (file)
@@ -1,3 +1,10 @@
+2009-08-26  Marek Habersack  <mhabersack@novell.com>
+
+       * AspTokenizer.cs: when there's put back record and we're in
+       verbatim mode, get_token must be careful with what it returns - it
+       can't return Token.* values, instead it should look at Value and
+       retrieve the next token from it. Fixes bug #400807
+
 2009-08-25  Marek Habersack  <mhabersack@novell.com>
 
        * AspGenerator.cs: correctly parse server-side tags nested in
index d4e447ab2dd808f2321b463c29aeecbd6d4edc6e..ffc517f9ae647ededdc5ac22f495d817e1687930 100644 (file)
@@ -1,3 +1,7 @@
+2009-08-26  Marek Habersack  <mhabersack@novell.com>
+
+       * TemplateControlCompilerTest.cs: added test for bug #400807
+
 2009-08-25  Marek Habersack  <mhabersack@novell.com>
 
        * TemplateControlCompilerTest.cs: added test for bug #323719
index 95178ff6e4634916420673493cd09502101f3470..2f5f8121bbf003eb163e0947f4b873f06058b433 100644 (file)
@@ -79,6 +79,7 @@ namespace MonoTests.System.Web.Compilation {
                        WebTest.CopyResource (GetType (), "LinkInHeadWithEmbeddedExpression.aspx", "LinkInHeadWithEmbeddedExpression.aspx");
                        WebTest.CopyResource (GetType (), "ExpressionInListControl.aspx", "ExpressionInListControl.aspx");
                        WebTest.CopyResource (GetType (), "PreprocessorDirectivesInMarkup.aspx", "PreprocessorDirectivesInMarkup.aspx");
+                       WebTest.CopyResource (GetType (), "OneLetterIdentifierInCodeRender.aspx", "OneLetterIdentifierInCodeRender.aspx");
 #endif
                }
                
@@ -235,8 +236,17 @@ namespace MonoTests.System.Web.Compilation {
        <![endif]-->";
                        HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
                }
-#endif
+               
+               [Test (Description="Bug #400807")]
+               public void OneLetterIdentifierInCodeRender ()
+               {
+                       string pageHtml = new WebTest ("OneLetterIdentifierInCodeRender.aspx").Run ();
+                       string renderedHtml = HtmlDiff.GetControlFromPageHtml (pageHtml);
+                       string originalHtml = @"bDoR called";
 
+                       HtmlDiff.AssertAreEqual (originalHtml, renderedHtml, "#A1");
+               }
+#endif         
                [Test (Description="Bug #323719")]
                public void TagsNestedInClientTag ()
                {
diff --git a/mcs/class/System.Web/Test/mainsoft/NunitWebResources/OneLetterIdentifierInCodeRender.aspx b/mcs/class/System.Web/Test/mainsoft/NunitWebResources/OneLetterIdentifierInCodeRender.aspx
new file mode 100644 (file)
index 0000000..c38770c
--- /dev/null
@@ -0,0 +1,23 @@
+<%@ Page Language="C#"  %>
+<script runat="server">
+    void DoR ()
+    {
+               Response.Write ("DoR called");
+    }
+</script>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+       <title>Bug #400807</title>
+</head>
+<body>
+       
+       <form id="form1" runat="server">
+       <%= MonoTests.stand_alone.WebHarness.HtmlDiff.BEGIN_TAG %><% 
+       System.Action r = new Action (DoR);%>
+       <% Response.Write("b");%> 
+       
+        <% r(); %><%= MonoTests.stand_alone.WebHarness.HtmlDiff.END_TAG %>
+       </form>
+</body>
+</html>