⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 203313 in webkit


Ignore:
Timestamp:
Jul 15, 2016, 5:46:23 PM (10 years ago)
Author:
beidson@apple.com
Message:

Update XPathException to use the description in toString().
https://bugs.webkit.org/show_bug.cgi?id=159848

Reviewed by Alex Christensen.

Source/WebCore:

No new tests (Covered by changes to existing tests).

  • bindings/js/JSDOMBinding.cpp:

(WebCore::createDOMException):

  • xml/XPathException.h:

(WebCore::XPathException::XPathException):

LayoutTests:

  • fast/dom/DOMException/XPathException-expected.txt:
  • fast/dom/DOMException/resources/XPathException.js:
  • fast/xpath/4XPath/Core/test_parser-expected.txt:
  • fast/xpath/invalid-functions-expected.txt:
  • fast/xpath/py-dom-xpath/expressions-expected.txt:
Location:
trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r203311 r203313  
     12016-07-15  Brady Eidson  <beidson@apple.com>
     2
     3        Update XPathException to use the description in toString().
     4        https://bugs.webkit.org/show_bug.cgi?id=159848
     5
     6        Reviewed by Alex Christensen.
     7
     8        * fast/dom/DOMException/XPathException-expected.txt:
     9        * fast/dom/DOMException/resources/XPathException.js:
     10        * fast/xpath/4XPath/Core/test_parser-expected.txt:
     11        * fast/xpath/invalid-functions-expected.txt:
     12        * fast/xpath/py-dom-xpath/expressions-expected.txt:
     13
    1142016-07-15  Brady Eidson  <beidson@apple.com>
    215
  • trunk/LayoutTests/fast/dom/DOMException/XPathException-expected.txt

    r196392 r203313  
    44
    55
    6 PASS e.toString() is "Error: TYPE_ERR: DOM XPath Exception 52"
     6PASS e.toString() is "TYPE_ERR (DOM XPath Exception 52): The expression could not be converted to return the specified type."
    77PASS Object.prototype.toString.call(e) is "[object XPathException]"
    88PASS Object.prototype.toString.call(e.__proto__) is "[object XPathExceptionPrototype]"
  • trunk/LayoutTests/fast/dom/DOMException/resources/XPathException.js

    r196392 r203313  
    1212}
    1313
    14 shouldBeEqualToString("e.toString()", "Error: TYPE_ERR: DOM XPath Exception 52");
     14shouldBeEqualToString("e.toString()", "TYPE_ERR (DOM XPath Exception 52): The expression could not be converted to return the specified type.");
    1515shouldBeEqualToString("Object.prototype.toString.call(e)", "[object XPathException]");
    1616shouldBeEqualToString("Object.prototype.toString.call(e.__proto__)", "[object XPathExceptionPrototype]");
  • trunk/LayoutTests/fast/xpath/4XPath/Core/test_parser-expected.txt

    r20102 r203313  
    3939PASS DOM.evaluate("CHILD2/@CODE * 0", ROOT, null, XPathResult.NUMBER_TYPE, null).numberValue is 0
    4040PASS föø
    41 PASS DOM.evaluate("\\", ROOT, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
     41PASS DOM.evaluate("\\", ROOT, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
    4242PASS successfullyParsed is true
    4343
  • trunk/LayoutTests/fast/xpath/invalid-functions-expected.txt

    r20338 r203313  
    1 PASS document.createExpression("foobar()", null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    2 PASS document.evaluate("foobar()", document, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    3 PASS document.createExpression("position(//div)", null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    4 PASS document.evaluate("position(//div)", document, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    5 PASS document.createExpression("ceiling(1,2)", null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    6 PASS document.evaluate("ceiling(1,2)", document, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    7 PASS document.createExpression("ceiling(1,2)", null).evaluate(document, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    8 PASS document.createExpression("boolean()", null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    9 PASS document.evaluate("boolean()", document, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
     1PASS document.createExpression("foobar()", null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     2PASS document.evaluate("foobar()", document, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     3PASS document.createExpression("position(//div)", null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     4PASS document.evaluate("position(//div)", document, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     5PASS document.createExpression("ceiling(1,2)", null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     6PASS document.evaluate("ceiling(1,2)", document, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     7PASS document.createExpression("ceiling(1,2)", null).evaluate(document, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     8PASS document.createExpression("boolean()", null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     9PASS document.evaluate("boolean()", document, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
    1010PASS successfullyParsed is true
    1111
  • trunk/LayoutTests/fast/xpath/py-dom-xpath/expressions-expected.txt

    r44372 r203313  
    11PASS //item[@id >= 2 and @id <= "4"]
    22PASS //item[@id >= 2 and @id <= 3]
    3 PASS doc.evaluate("position(1)", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    4 PASS doc.evaluate("not()", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
     3PASS doc.evaluate("position(1)", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     4PASS doc.evaluate("not()", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
    55PASS string-length(100)
    6 PASS doc.evaluate("count(100)", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    7 PASS doc.evaluate("adumbrate()", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
     6PASS doc.evaluate("count(100)", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     7PASS doc.evaluate("adumbrate()", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
    88PASS //item[@id mod 2 = 0] | //item[@id mod 3 = 0]
    9 PASS doc.evaluate("//item | 42", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    10 PASS doc.evaluate("/doc/(item[@id = 2] | item[@id = 6])/@id", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    11 PASS doc.evaluate('"monty"/anaconda', doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    12 PASS doc.evaluate('/doc/string(item[@id = 2])/@id', doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
    13 PASS doc.evaluate('(1)[1]', doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception Error: INVALID_EXPRESSION_ERR: DOM XPath Exception 51.
     9PASS doc.evaluate("//item | 42", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     10PASS doc.evaluate("/doc/(item[@id = 2] | item[@id = 6])/@id", doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     11PASS doc.evaluate('"monty"/anaconda', doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     12PASS doc.evaluate('/doc/string(item[@id = 2])/@id', doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
     13PASS doc.evaluate('(1)[1]', doc.documentElement, null, XPathResult.ANY_TYPE, null) threw exception INVALID_EXPRESSION_ERR (DOM XPath Exception 51): The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator..
    1414PASS (1)
    1515PASS ((1 + 1))
  • trunk/Source/WebCore/ChangeLog

    r203311 r203313  
     12016-07-15  Brady Eidson  <beidson@apple.com>
     2
     3        Update XPathException to use the description in toString().
     4        https://bugs.webkit.org/show_bug.cgi?id=159848
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests (Covered by changes to existing tests).
     9
     10        * bindings/js/JSDOMBinding.cpp:
     11        (WebCore::createDOMException):
     12        * xml/XPathException.h:
     13        (WebCore::XPathException::XPathException):
     14
    1152016-07-15  Brady Eidson  <beidson@apple.com>
    216
  • trunk/Source/WebCore/bindings/js/JSDOMBinding.cpp

    r202890 r203313  
    274274    JSValue errorObject;
    275275    switch (description.type) {
    276         DOM_EXCEPTION_INTERFACES_FOR_EACH(TRY_TO_CREATE_EXCEPTION)
     276    case DOMCoreExceptionType:
     277        errorObject = toJS(exec, globalObject, DOMCoreException::create(description));
     278        break;
     279    case FileExceptionType:
     280        errorObject = toJS(exec, globalObject, FileException::create(description));
     281        break;
     282    case SQLExceptionType:
     283        errorObject = toJS(exec, globalObject, SQLException::create(description));
     284        break;
     285    case SVGExceptionType:
     286        errorObject = toJS(exec, globalObject, SVGException::create(description));
     287        break;
     288    case XPathExceptionType:
     289        errorObject = toJS(exec, globalObject, XPathException::create(description));
     290        break;
    277291#if ENABLE(INDEXED_DATABASE)
    278292    case IDBDatabaseExceptionType:
  • trunk/Source/WebCore/xml/XPathException.h

    r177744 r203313  
    5353private:
    5454    explicit XPathException(const ExceptionCodeDescription& description)
    55         : ExceptionBase(description)
     55        : ExceptionBase(description, ExceptionBase::MessageSource::UseDescription)
    5656    {
    5757    }
Note: See TracChangeset for help on using the changeset viewer.