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

Unified Diff: Source/core/svg/properties/SVGListPropertyTearOffHelper.h

Issue 827373003: Drop redundant null checks in SVGListPropertyTearOffHelper (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix tests and expectations Created 5 years, 11 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 | « LayoutTests/svg/dom/SVGTransformList-basics-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/properties/SVGListPropertyTearOffHelper.h
diff --git a/Source/core/svg/properties/SVGListPropertyTearOffHelper.h b/Source/core/svg/properties/SVGListPropertyTearOffHelper.h
index 8e04cb065d26455f5f6e22d2943aeb62df6b7d9d..68fbc99b3544545b7e7f1eabca3f6eb51bf10f97 100644
--- a/Source/core/svg/properties/SVGListPropertyTearOffHelper.h
+++ b/Source/core/svg/properties/SVGListPropertyTearOffHelper.h
@@ -106,10 +106,7 @@ public:
return nullptr;
}
- if (!item) {
- exceptionState.throwTypeError("Lists must be initialized with a valid item.");
- return nullptr;
- }
+ ASSERT(item);
RefPtrWillBeRawPtr<ItemPropertyType> value = toDerived()->target()->initialize(getValueForInsertionFromTearOff(item));
toDerived()->commitChange();
@@ -132,10 +129,7 @@ public:
return nullptr;
}
- if (!item) {
- exceptionState.throwTypeError("An invalid item cannot be inserted to a list.");
- return nullptr;
- }
+ ASSERT(item);
RefPtrWillBeRawPtr<ItemPropertyType> value = toDerived()->target()->insertItemBefore(getValueForInsertionFromTearOff(item), index);
toDerived()->commitChange();
@@ -152,10 +146,7 @@ public:
return nullptr;
}
- if (!item) {
- exceptionState.throwTypeError("An invalid item cannot be replaced with an existing list item.");
- return nullptr;
- }
+ ASSERT(item);
RefPtrWillBeRawPtr<ItemPropertyType> value = toDerived()->target()->replaceItem(getValueForInsertionFromTearOff(item), index, exceptionState);
toDerived()->commitChange();
@@ -186,10 +177,7 @@ public:
return nullptr;
}
- if (!item) {
- exceptionState.throwTypeError("An invalid item cannot be appended to a list.");
- return nullptr;
- }
+ ASSERT(item);
RefPtrWillBeRawPtr<ItemPropertyType> value = toDerived()->target()->appendItem(getValueForInsertionFromTearOff(item));
toDerived()->commitChange();
« no previous file with comments | « LayoutTests/svg/dom/SVGTransformList-basics-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698