Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(932)

Unified Diff: Source/core/dom/Range.cpp

Issue 405083003: Range.compareBoundaryPoints should throw a NotSupportedError when how has not expected value (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Take review comment into consideration Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/Range.h ('k') | Source/core/dom/Range.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Range.cpp
diff --git a/Source/core/dom/Range.cpp b/Source/core/dom/Range.cpp
index 4bc3f5f8cbceff87ce8e2b33f29a03eea3d37a0a..6434ed8ecb4fafe77cb9454317bf3740ad270454 100644
--- a/Source/core/dom/Range.cpp
+++ b/Source/core/dom/Range.cpp
@@ -321,10 +321,10 @@ Range::CompareResults Range::compareNode(Node* refNode, ExceptionState& exceptio
return NODE_INSIDE; // ends inside the range
}
-short Range::compareBoundaryPoints(CompareHow how, const Range* sourceRange, ExceptionState& exceptionState) const
+short Range::compareBoundaryPoints(CompareHow how, const PassRefPtrWillBeRawPtr<Range> sourceRange, ExceptionState& exceptionState) const
Yuta Kitamura 2014/07/22 06:03:39 nit: const seems unnecessary. Just curious, TypeC
kangil_ 2014/07/22 08:41:49 IMHO, const is generally good since it protects us
Yuta Kitamura 2014/07/22 09:22:43 I'm not opposing to the use of const in general. I
{
- if (!sourceRange) {
- exceptionState.throwDOMException(NotFoundError, "The source range provided was null.");
+ if (!(how == START_TO_START || how == START_TO_END || how == END_TO_END || how == END_TO_START)) {
+ exceptionState.throwDOMException(NotSupportedError, "The comparison method provided must be one of 'START_TO_START', 'START_TO_END', 'END_TO_END', or 'END_TO_START'.");
return 0;
}
@@ -357,7 +357,7 @@ short Range::compareBoundaryPoints(CompareHow how, const Range* sourceRange, Exc
return compareBoundaryPoints(m_start, sourceRange->m_end, exceptionState);
}
- exceptionState.throwDOMException(SyntaxError, "The comparison method provided must be one of 'START_TO_START', 'START_TO_END', 'END_TO_END', or 'END_TO_START'.");
+ ASSERT_NOT_REACHED();
return 0;
}
« no previous file with comments | « Source/core/dom/Range.h ('k') | Source/core/dom/Range.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698