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

Unified Diff: Source/bindings/dart/custom/DartNodeCustom.cpp

Issue 450053002: Throw exception on null pointers in raw toNative (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Created 6 years, 4 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
Index: Source/bindings/dart/custom/DartNodeCustom.cpp
diff --git a/Source/bindings/dart/custom/DartNodeCustom.cpp b/Source/bindings/dart/custom/DartNodeCustom.cpp
index f1f6d4cb3ec0421f1666fe4397da83bd338ae14d..ef513444ec788401e9305beed6e98eb4def80e48 100644
--- a/Source/bindings/dart/custom/DartNodeCustom.cpp
+++ b/Source/bindings/dart/custom/DartNodeCustom.cpp
@@ -54,11 +54,11 @@ void insertBeforeCallback(Dart_NativeArguments args)
{
Node* receiver = DartDOMWrapper::receiver<Node>(args);
- Node* newChild = DartNode::toNative(args, 1, exception);
+ Node* newChild = DartNode::toNativeWithNullCheck(args, 1, exception);
if (exception)
goto fail;
- Node* refChild = DartNode::toNative(args, 2, exception);
+ Node* refChild = DartNode::toNativeWithNullCheck(args, 2, exception);
if (exception)
goto fail;
@@ -87,11 +87,11 @@ void replaceChildCallback(Dart_NativeArguments args)
{
Node* receiver = DartDOMWrapper::receiver<Node>(args);
- Node* newChild = DartNode::toNative(args, 1, exception);
+ Node* newChild = DartNode::toNativeWithNullCheck(args, 1, exception);
if (exception)
goto fail;
- Node* oldChild = DartNode::toNative(args, 2, exception);
+ Node* oldChild = DartNode::toNativeWithNullCheck(args, 2, exception);
if (exception)
goto fail;
@@ -120,7 +120,7 @@ void removeChildCallback(Dart_NativeArguments args)
{
Node* receiver = DartDOMWrapper::receiver<Node>(args);
- Node* child = DartNode::toNative(args, 1, exception);
+ Node* child = DartNode::toNativeWithNullCheck(args, 1, exception);
if (exception)
goto fail;
@@ -149,7 +149,7 @@ void appendChildCallback(Dart_NativeArguments args)
{
Node* receiver = DartDOMWrapper::receiver<Node>(args);
- Node* child = DartNode::toNative(args, 1, exception);
+ Node* child = DartNode::toNativeWithNullCheck(args, 1, exception);
if (exception)
goto fail;

Powered by Google App Engine
This is Rietveld 408576698