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

Unified Diff: Source/bindings/core/v8/custom/V8NodeCustom.cpp

Issue 375213003: Node.appendChild should throw TypeError when newChild is omitted (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 | « LayoutTests/fast/js/script-tests/dot-node-base-exception.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/custom/V8NodeCustom.cpp
diff --git a/Source/bindings/core/v8/custom/V8NodeCustom.cpp b/Source/bindings/core/v8/custom/V8NodeCustom.cpp
index cdd3cab222ab30541d81aa14281e3f8c3ebf974c..80ad75a95086a945f167ca65eb3e56db4ba1d230 100644
--- a/Source/bindings/core/v8/custom/V8NodeCustom.cpp
+++ b/Source/bindings/core/v8/custom/V8NodeCustom.cpp
@@ -108,6 +108,10 @@ void V8Node::removeChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&
void V8Node::appendChildMethodCustom(const v8::FunctionCallbackInfo<v8::Value>& info)
{
ExceptionState exceptionState(ExceptionState::ExecutionContext, "appendChild", "Node", info.Holder(), info.GetIsolate());
+ if (UNLIKELY(info.Length() < 1)) {
+ throwMinimumArityTypeErrorForMethod("appendChild", "Node", 1, info.Length(), info.GetIsolate());
+ return;
+ }
Node* impl = V8Node::toNative(info.Holder());
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope;
Node* newChild;
« no previous file with comments | « LayoutTests/fast/js/script-tests/dot-node-base-exception.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698