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 ab10930bf62ed71c7789c94a111dd555097dd4e6..98f91dfc19b50a755b207c0e7f441a64513eadcf 100644 |
--- a/Source/bindings/core/v8/custom/V8NodeCustom.cpp |
+++ b/Source/bindings/core/v8/custom/V8NodeCustom.cpp |
@@ -107,12 +107,18 @@ 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 (info.Length() > 0 && !info[0]->IsObject()) { |
+ exceptionState.throwTypeError("parameter 1 ('newChild') is not an object."); |
+ exceptionState.throwIfNeeded(); |
+ return; |
haraken
2014/07/08 14:59:01
Can you refer to the generated code for [TypeCheck
kangil_
2014/07/09 01:34:17
Done.
|
+ } |
+ |
v8::Handle<v8::Object> holder = info.Holder(); |
Node* impl = V8Node::toNative(holder); |
CustomElementCallbackDispatcher::CallbackDeliveryScope deliveryScope; |
- ExceptionState exceptionState(ExceptionState::ExecutionContext, "appendChild", "Node", info.Holder(), info.GetIsolate()); |
Node* newChild = V8Node::toNativeWithTypeCheck(info.GetIsolate(), info[0]); |
impl->appendChild(newChild, exceptionState); |
if (exceptionState.throwIfNeeded()) |