Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-18574

Confusing error message if the user omits the semicolon at the end of a CSS @namespace declaration

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Later
    • Adobe Flex SDK Previous
    • None
    • Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

    Description

      SDK revision 5789

      Steps to reproduce:
      1. Compile this program, which is missing the semicolon at the end of the @namespace line:

      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768">

      <fx:Style>
      @namespace "library://ns.adobe.com/flex/spark"
      Button

      { color: red }

      </fx:Style>

      <s:Button id="mybutton" label="hi" />
      </s:Application>

      Actual Results:
      Error messages:

      /Users/mmoreart/Documents/runtime-gumbo.mac.product/f1/src/f1.mxml(6): Error: Namespace URI String expected.

      Button

      { color: red }

      /Users/mmoreart/Documents/runtime-gumbo.mac.product/f1/src/f1.mxml(4): Error: Error parsing stylesheet: /Users/mmoreart/Documents/runtime-gumbo.mac.product/f1/src/f1.mxml

      <fx:Style>

      Expected Results:
      The error messages are confusing, because they give no indication of the actual problem. I realize it is sometimes hard for a compiler to know for sure that a semicolon is missing, but sometimes they give helpful messages such as "missing ';'?" Also, the error is being observed on line 6 (the "Button" line), which is the line after the one that is missing the semicolon. Again, I realize this can be tricky for a compiler to deal with, because by the time it has discovered the syntax error, the compiler really is on line 6; but if there is anything you can do to help with this, that would be great. Maybe instead of "missing ';'?" you could say "missing ';' on @namespace declaration?" or whatever.

      Also, is the second message, about an error parsing the stylesheet, really necessary? When viewing these errors in Flex Builder, the first highlighted error you see is the one on line 4, which is the <fx:Style> line; it almost makes it look like something is wrong with that line.

      I'd be okay with a less-than-perfect resolution to this, but I do think we should do something to improve it, because I think omitting the semicolon will be a common error, and currently it's just too hard to figure out what the real error is.

      Attachments

        Activity

          People

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: