[V8] Pass Isolate to throwTypeError()
authorharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 May 2012 22:47:12 +0000 (22:47 +0000)
committerharaken@chromium.org <haraken@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 May 2012 22:47:12 +0000 (22:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=87111

Reviewed by Adam Barth.

The objective is to pass Isolate around in V8 bindings.
This patch passes Isolate to throwTypeError() in custom bindings.

No tests. No change in behavior.

* bindings/v8/custom/V8ArrayBufferCustom.cpp:
(WebCore::V8ArrayBuffer::constructorCallback):
* bindings/v8/custom/V8ArrayBufferViewCustom.h:
(WebCore::constructWebGLArrayWithArrayBufferArgument):
(WebCore::constructWebGLArray):
* bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:
(WebCore::V8AudioBufferSourceNode::bufferAccessorSetter):
* bindings/v8/custom/V8AudioContextCustom.cpp:
(WebCore::V8AudioContext::constructorCallback):
* bindings/v8/custom/V8BlobCustom.cpp:
(WebCore::V8Blob::constructorCallback):
* bindings/v8/custom/V8ClipboardCustom.cpp:
(WebCore::V8Clipboard::setDragImageCallback):
* bindings/v8/custom/V8DOMFormDataCustom.cpp:
(WebCore::V8DOMFormData::constructorCallback):
* bindings/v8/custom/V8DataViewCustom.cpp:
(WebCore::V8DataView::constructorCallback):
* bindings/v8/custom/V8HTMLDocumentCustom.cpp:
(WebCore::V8HTMLDocument::openCallback):
* bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
(WebCore::v8HTMLImageElementConstructorCallback):
* bindings/v8/custom/V8HTMLInputElementCustom.cpp:
(WebCore::V8HTMLInputElement::selectionStartAccessorGetter):
(WebCore::V8HTMLInputElement::selectionStartAccessorSetter):
(WebCore::V8HTMLInputElement::selectionEndAccessorGetter):
(WebCore::V8HTMLInputElement::selectionEndAccessorSetter):
(WebCore::V8HTMLInputElement::selectionDirectionAccessorGetter):
(WebCore::V8HTMLInputElement::selectionDirectionAccessorSetter):
(WebCore::V8HTMLInputElement::setSelectionRangeCallback):
* bindings/v8/custom/V8HTMLMediaElementCustom.cpp:
(WebCore::V8HTMLMediaElement::controllerAccessorSetter):
* bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
(WebCore::V8InjectedScriptHost::inspectedObjectCallback):
* bindings/v8/custom/V8IntentConstructor.cpp:
(WebCore::V8Intent::constructorCallback):
* bindings/v8/custom/V8MessageChannelConstructor.cpp:
(WebCore::V8MessageChannel::constructorCallback):
* bindings/v8/custom/V8NotificationCenterCustom.cpp:
(WebCore::V8NotificationCenter::requestPermissionCallback):
* bindings/v8/custom/V8SQLResultSetRowListCustom.cpp:
(WebCore::V8SQLResultSetRowList::itemCallback):
* bindings/v8/custom/V8WebKitMutationObserverCustom.cpp:
(WebCore::V8WebKitMutationObserver::constructorCallback):
* bindings/v8/custom/V8WebKitPointConstructor.cpp:
(WebCore::V8WebKitPoint::constructorCallback):
* bindings/v8/custom/V8WebSocketCustom.cpp:
(WebCore::V8WebSocket::constructorCallback):
* bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:
(WebCore::V8XMLHttpRequest::constructorCallback):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@118071 268f45cc-cd09-0410-ab3c-d52691b4dbfc

22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp
Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h
Source/WebCore/bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp
Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp
Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp
Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp
Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp
Source/WebCore/bindings/v8/custom/V8DataViewCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLDocumentCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLImageElementConstructor.cpp
Source/WebCore/bindings/v8/custom/V8HTMLInputElementCustom.cpp
Source/WebCore/bindings/v8/custom/V8HTMLMediaElementCustom.cpp
Source/WebCore/bindings/v8/custom/V8InjectedScriptHostCustom.cpp
Source/WebCore/bindings/v8/custom/V8IntentConstructor.cpp
Source/WebCore/bindings/v8/custom/V8MessageChannelConstructor.cpp
Source/WebCore/bindings/v8/custom/V8NotificationCenterCustom.cpp
Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp
Source/WebCore/bindings/v8/custom/V8WebKitMutationObserverCustom.cpp
Source/WebCore/bindings/v8/custom/V8WebKitPointConstructor.cpp
Source/WebCore/bindings/v8/custom/V8WebSocketCustom.cpp
Source/WebCore/bindings/v8/custom/V8XMLHttpRequestConstructor.cpp

index b0a27e6..a216ccc 100644 (file)
@@ -1,5 +1,67 @@
 2012-05-22  Kentaro Hara  <haraken@chromium.org>
 
+        [V8] Pass Isolate to throwTypeError()
+        https://bugs.webkit.org/show_bug.cgi?id=87111
+
+        Reviewed by Adam Barth.
+
+        The objective is to pass Isolate around in V8 bindings.
+        This patch passes Isolate to throwTypeError() in custom bindings.
+
+        No tests. No change in behavior.
+
+        * bindings/v8/custom/V8ArrayBufferCustom.cpp:
+        (WebCore::V8ArrayBuffer::constructorCallback):
+        * bindings/v8/custom/V8ArrayBufferViewCustom.h:
+        (WebCore::constructWebGLArrayWithArrayBufferArgument):
+        (WebCore::constructWebGLArray):
+        * bindings/v8/custom/V8AudioBufferSourceNodeCustom.cpp:
+        (WebCore::V8AudioBufferSourceNode::bufferAccessorSetter):
+        * bindings/v8/custom/V8AudioContextCustom.cpp:
+        (WebCore::V8AudioContext::constructorCallback):
+        * bindings/v8/custom/V8BlobCustom.cpp:
+        (WebCore::V8Blob::constructorCallback):
+        * bindings/v8/custom/V8ClipboardCustom.cpp:
+        (WebCore::V8Clipboard::setDragImageCallback):
+        * bindings/v8/custom/V8DOMFormDataCustom.cpp:
+        (WebCore::V8DOMFormData::constructorCallback):
+        * bindings/v8/custom/V8DataViewCustom.cpp:
+        (WebCore::V8DataView::constructorCallback):
+        * bindings/v8/custom/V8HTMLDocumentCustom.cpp:
+        (WebCore::V8HTMLDocument::openCallback):
+        * bindings/v8/custom/V8HTMLImageElementConstructor.cpp:
+        (WebCore::v8HTMLImageElementConstructorCallback):
+        * bindings/v8/custom/V8HTMLInputElementCustom.cpp:
+        (WebCore::V8HTMLInputElement::selectionStartAccessorGetter):
+        (WebCore::V8HTMLInputElement::selectionStartAccessorSetter):
+        (WebCore::V8HTMLInputElement::selectionEndAccessorGetter):
+        (WebCore::V8HTMLInputElement::selectionEndAccessorSetter):
+        (WebCore::V8HTMLInputElement::selectionDirectionAccessorGetter):
+        (WebCore::V8HTMLInputElement::selectionDirectionAccessorSetter):
+        (WebCore::V8HTMLInputElement::setSelectionRangeCallback):
+        * bindings/v8/custom/V8HTMLMediaElementCustom.cpp:
+        (WebCore::V8HTMLMediaElement::controllerAccessorSetter):
+        * bindings/v8/custom/V8InjectedScriptHostCustom.cpp:
+        (WebCore::V8InjectedScriptHost::inspectedObjectCallback):
+        * bindings/v8/custom/V8IntentConstructor.cpp:
+        (WebCore::V8Intent::constructorCallback):
+        * bindings/v8/custom/V8MessageChannelConstructor.cpp:
+        (WebCore::V8MessageChannel::constructorCallback):
+        * bindings/v8/custom/V8NotificationCenterCustom.cpp:
+        (WebCore::V8NotificationCenter::requestPermissionCallback):
+        * bindings/v8/custom/V8SQLResultSetRowListCustom.cpp:
+        (WebCore::V8SQLResultSetRowList::itemCallback):
+        * bindings/v8/custom/V8WebKitMutationObserverCustom.cpp:
+        (WebCore::V8WebKitMutationObserver::constructorCallback):
+        * bindings/v8/custom/V8WebKitPointConstructor.cpp:
+        (WebCore::V8WebKitPoint::constructorCallback):
+        * bindings/v8/custom/V8WebSocketCustom.cpp:
+        (WebCore::V8WebSocket::constructorCallback):
+        * bindings/v8/custom/V8XMLHttpRequestConstructor.cpp:
+        (WebCore::V8XMLHttpRequest::constructorCallback):
+
+2012-05-22  Kentaro Hara  <haraken@chromium.org>
+
         [V8] Replace 'setDOMException(); return Undefined();' with 'return setDOMException();'
         https://bugs.webkit.org/show_bug.cgi?id=87102
 
index e119b87..3196dd8 100644 (file)
@@ -43,7 +43,7 @@ v8::Handle<v8::Value> V8ArrayBuffer::constructorCallback(const v8::Arguments& ar
     INC_STATS("DOM.ArrayBuffer.Constructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
index 7f45f57..712d036 100644 (file)
@@ -60,20 +60,20 @@ v8::Handle<v8::Value> constructWebGLArrayWithArrayBufferArgument(const v8::Argum
 {
     ArrayBuffer* buf = V8ArrayBuffer::toNative(args[0]->ToObject());
     if (!buf)
-        return V8Proxy::throwTypeError("Could not convert argument 0 to a ArrayBuffer");
+        return V8Proxy::throwTypeError("Could not convert argument 0 to a ArrayBuffer", args.GetIsolate());
     bool ok;
     uint32_t offset = 0;
     int argLen = args.Length();
     if (argLen > 1) {
         offset = toUInt32(args[1], ok);
         if (!ok)
-            return V8Proxy::throwTypeError("Could not convert argument 1 to a number");
+            return V8Proxy::throwTypeError("Could not convert argument 1 to a number", args.GetIsolate());
     }
     uint32_t length = 0;
     if (argLen > 2) {
         length = toUInt32(args[2], ok);
         if (!ok)
-            return V8Proxy::throwTypeError("Could not convert argument 2 to a number");
+            return V8Proxy::throwTypeError("Could not convert argument 2 to a number", args.GetIsolate());
     } else {
         if ((buf->byteLength() - offset) % sizeof(ElementType))
             return V8Proxy::throwError(V8Proxy::RangeError, "ArrayBuffer length minus the byteOffset is not a multiple of the element size.", args.GetIsolate());
@@ -97,7 +97,7 @@ template<class ArrayClass, class ElementType>
 v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperTypeInfo* type, v8::ExternalArrayType arrayType)
 {
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
@@ -150,7 +150,7 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType
     if (args[0]->IsObject()) {
         srcArray = args[0]->ToObject();
         if (srcArray.IsEmpty())
-            return V8Proxy::throwTypeError("Could not convert argument 0 to an array");
+            return V8Proxy::throwTypeError("Could not convert argument 0 to an array", args.GetIsolate());
         len = toUInt32(srcArray->Get(v8::String::New("length")));
         doInstantiation = true;
     } else {
index 79e02e8..cf212d3 100644 (file)
@@ -47,13 +47,13 @@ void V8AudioBufferSourceNode::bufferAccessorSetter(v8::Local<v8::String> name, v
     if (V8AudioBuffer::HasInstance(value)) {
         buffer = V8AudioBuffer::toNative(value->ToObject());
         if (buffer && !imp->setBuffer(buffer)) {
-            V8Proxy::throwTypeError("AudioBuffer unsupported number of channels");
+            V8Proxy::throwTypeError("AudioBuffer unsupported number of channels", info.GetIsolate());
             return;
         }
     }
     
     if (!buffer) {
-        V8Proxy::throwTypeError("Value is not of type AudioBuffer");
+        V8Proxy::throwTypeError("Value is not of type AudioBuffer", info.GetIsolate());
         return;
     }
 }
index 771abdd..9ce2e1a 100644 (file)
@@ -44,7 +44,7 @@ v8::Handle<v8::Value> V8AudioContext::constructorCallback(const v8::Arguments& a
     INC_STATS("DOM.AudioContext.Contructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("AudioContext constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("AudioContext constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
index 5912c24..ae072da 100644 (file)
@@ -60,7 +60,7 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args)
     INC_STATS("DOM.Blob.Constructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
@@ -77,14 +77,14 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args)
 
     v8::Local<v8::Value> firstArg = args[0];
     if (!firstArg->IsArray())
-        return V8Proxy::throwTypeError("First argument of the constructor is not of type Array");
+        return V8Proxy::throwTypeError("First argument of the constructor is not of type Array", args.GetIsolate());
 
     String type;
     String endings = "transparent";
 
     if (args.Length() > 1) {
         if (!args[1]->IsObject())
-            return V8Proxy::throwTypeError("Second argument of the constructor is not of type Object");
+            return V8Proxy::throwTypeError("Second argument of the constructor is not of type Object", args.GetIsolate());
 
         Dictionary dictionary(args[1]);
 
@@ -95,7 +95,7 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args)
 
         if (containsEndings) {
             if (endings != "transparent" && endings != "native")
-                return V8Proxy::throwTypeError("The endings property must be either \"transparent\" or \"native\"");
+                return V8Proxy::throwTypeError("The endings property must be either \"transparent\" or \"native\"", args.GetIsolate());
         }
 
         v8::TryCatch tryCatchType;
index c568f89..cea10af 100644 (file)
@@ -99,7 +99,7 @@ v8::Handle<v8::Value> V8Clipboard::setDragImageCallback(const v8::Arguments& arg
         node = V8Node::toNative(v8::Handle<v8::Object>::Cast(args[0]));
 
     if (!node || !node->isElementNode())
-        return V8Proxy::throwTypeError("setDragImageFromElement: Invalid first argument");
+        return V8Proxy::throwTypeError("setDragImageFromElement: Invalid first argument", args.GetIsolate());
 
     if (static_cast<Element*>(node)->hasLocalName(HTMLNames::imgTag) && !node->inDocument())
         clipboard->setDragImage(static_cast<HTMLImageElement*>(node)->cachedImage(), IntPoint(x, y));
index 8969863..8f75c0e 100644 (file)
@@ -45,7 +45,7 @@ v8::Handle<v8::Value> V8DOMFormData::constructorCallback(const v8::Arguments& ar
     INC_STATS("DOM.FormData.Constructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
index d2270e8..4c73293 100755 (executable)
@@ -39,7 +39,7 @@ v8::Handle<v8::Value> V8DataView::constructorCallback(const v8::Arguments& args)
     INC_STATS("DOM.DataView.Constructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
index 1bd97d6..b1a7b2b 100644 (file)
@@ -149,7 +149,7 @@ v8::Handle<v8::Value> V8HTMLDocument::openCallback(const v8::Arguments& args)
             v8::Local<v8::Value> function = global->Get(v8::String::New("open"));
             // If the open property is not a function throw a type error.
             if (!function->IsFunction())
-                return V8Proxy::throwTypeError("open is not a function");
+                return V8Proxy::throwTypeError("open is not a function", args.GetIsolate());
             // Wrap up the arguments and call the function.
             OwnArrayPtr<v8::Local<v8::Value> > params = adoptArrayPtr(new v8::Local<v8::Value>[args.Length()]);
             for (int i = 0; i < args.Length(); i++)
index 571e443..c1f559c 100644 (file)
@@ -51,7 +51,7 @@ static v8::Handle<v8::Value> v8HTMLImageElementConstructorCallback(const v8::Arg
     INC_STATS("DOM.HTMLImageElement.Contructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
index 6568654..e1bb594 100644 (file)
@@ -45,7 +45,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::selectionStartAccessorGetter(v8::Local
     HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
 
     if (!imp->canHaveSelection())
-        return V8Proxy::throwTypeError("Accessing selectionStart on an input element that cannot have a selection.");
+        return V8Proxy::throwTypeError("Accessing selectionStart on an input element that cannot have a selection.", info.GetIsolate());
 
     int v = imp->selectionStart();
     return v8::Integer::New(v);
@@ -58,7 +58,7 @@ void V8HTMLInputElement::selectionStartAccessorSetter(v8::Local<v8::String> name
     HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
 
     if (!imp->canHaveSelection()) {
-        V8Proxy::throwTypeError("Accessing selectionStart on an input element that cannot have a selection.");
+        V8Proxy::throwTypeError("Accessing selectionStart on an input element that cannot have a selection.", info.GetIsolate());
         return;
     }
     imp->setSelectionStart(value->Int32Value());
@@ -71,7 +71,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::selectionEndAccessorGetter(v8::Local<v
     HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
 
     if (!imp->canHaveSelection())
-        return V8Proxy::throwTypeError("Accessing selectionEnd on an input element that cannot have a selection.");
+        return V8Proxy::throwTypeError("Accessing selectionEnd on an input element that cannot have a selection.", info.GetIsolate());
 
     int v = imp->selectionEnd();
     return v8::Integer::New(v);
@@ -84,7 +84,7 @@ void V8HTMLInputElement::selectionEndAccessorSetter(v8::Local<v8::String> name,
     HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
 
     if (!imp->canHaveSelection()) {
-        V8Proxy::throwTypeError("Accessing selectionEnd on an input element that cannot have a selection.");
+        V8Proxy::throwTypeError("Accessing selectionEnd on an input element that cannot have a selection.", info.GetIsolate());
         return;
     }
 
@@ -98,7 +98,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::selectionDirectionAccessorGetter(v8::L
     HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
 
     if (!imp->canHaveSelection())
-        return V8Proxy::throwTypeError("Accessing selectionDirection on an input element that cannot have a selection.");
+        return V8Proxy::throwTypeError("Accessing selectionDirection on an input element that cannot have a selection.", info.GetIsolate());
 
     return v8String(imp->selectionDirection());
 }
@@ -110,7 +110,7 @@ void V8HTMLInputElement::selectionDirectionAccessorSetter(v8::Local<v8::String>
     HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
 
     if (!imp->canHaveSelection()) {
-        V8Proxy::throwTypeError("Accessing selectionDirection on an input element that cannot have a selection.");
+        V8Proxy::throwTypeError("Accessing selectionDirection on an input element that cannot have a selection.", info.GetIsolate());
         return;
     }
 
@@ -124,7 +124,7 @@ v8::Handle<v8::Value> V8HTMLInputElement::setSelectionRangeCallback(const v8::Ar
     HTMLInputElement* imp = V8HTMLInputElement::toNative(holder);
 
     if (!imp->canHaveSelection())
-        return V8Proxy::throwTypeError("Calling setSelectionRange on an input element that cannot have a selection.");
+        return V8Proxy::throwTypeError("Calling setSelectionRange on an input element that cannot have a selection.", args.GetIsolate());
 
     int start = args[0]->Int32Value();
     int end = args[1]->Int32Value();
index 7cb2276..327feff 100644 (file)
@@ -43,7 +43,7 @@ void V8HTMLMediaElement::controllerAccessorSetter(v8::Local<v8::String> name, v8
         controller = V8MediaController::toNative(value->ToObject());
     
     if (!controller) {
-        V8Proxy::throwTypeError("Value is not of type MediaController");
+        V8Proxy::throwTypeError("Value is not of type MediaController", info.GetIsolate());
         return;
     }
 
index 2a08dd1..898a0f4 100644 (file)
@@ -83,7 +83,7 @@ v8::Handle<v8::Value> V8InjectedScriptHost::inspectedObjectCallback(const v8::Ar
         return v8::Undefined();
 
     if (!args[0]->IsInt32())
-        return V8Proxy::throwTypeError("argument has to be an integer");
+        return V8Proxy::throwTypeError("argument has to be an integer", args.GetIsolate());
 
     InjectedScriptHost* host = V8InjectedScriptHost::toNative(args.Holder());
     InjectedScriptHost::InspectableObject* object = host->inspectedObject(args[0]->ToInt32()->Value());
index 5c6c0a0..79d4d24 100644 (file)
@@ -48,7 +48,7 @@ v8::Handle<v8::Value> V8Intent::constructorCallback(const v8::Arguments& args)
     INC_STATS("DOM.Intent.Constructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
@@ -76,7 +76,7 @@ v8::Handle<v8::Value> V8Intent::constructorCallback(const v8::Arguments& args)
     ArrayBufferArray arrayBufferArrayTransferList;
     if (args.Length() > 3) {
         if (!extractTransferables(args[3], messagePortArrayTransferList, arrayBufferArrayTransferList))
-            return V8Proxy::throwTypeError("Could not extract transferables");
+            return V8Proxy::throwTypeError("Could not extract transferables", args.GetIsolate());
     }
     bool dataDidThrow = false;
     RefPtr<SerializedScriptValue> data = SerializedScriptValue::create(args[2], &messagePortArrayTransferList, &arrayBufferArrayTransferList, dataDidThrow);
index 9bb9c55..019a030 100644 (file)
@@ -51,7 +51,7 @@ v8::Handle<v8::Value> V8MessageChannel::constructorCallback(const v8::Arguments&
     // FIXME: The logic here is almost exact duplicate of V8::constructDOMObject.
     // Consider refactoring to reduce duplication.
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
index 109aaf9..e5b1ecd 100644 (file)
@@ -95,7 +95,7 @@ v8::Handle<v8::Value> V8NotificationCenter::requestPermissionCallback(const v8::
     RefPtr<V8CustomVoidCallback> callback;
     if (args.Length() > 0) {
         if (!args[0]->IsObject())
-            return V8Proxy::throwTypeError("Callback must be of valid type.");
+            return V8Proxy::throwTypeError("Callback must be of valid type.", args.GetIsolate());
  
         callback = V8CustomVoidCallback::create(args[0], context);
     }
index e8a763b..a4f80d0 100644 (file)
@@ -47,7 +47,7 @@ v8::Handle<v8::Value> V8SQLResultSetRowList::itemCallback(const v8::Arguments& a
         return V8Proxy::throwError(V8Proxy::SyntaxError, "Item index is required.", args.GetIsolate());
 
     if (!args[0]->IsNumber())
-        return V8Proxy::throwTypeError("Item index must be a number.");
+        return V8Proxy::throwTypeError("Item index must be a number.", args.GetIsolate());
 
     SQLResultSetRowList* rowList = V8SQLResultSetRowList::toNative(args.Holder());
 
index e861e4a..b4ef5f2 100644 (file)
@@ -55,7 +55,7 @@ v8::Handle<v8::Value> V8WebKitMutationObserver::constructorCallback(const v8::Ar
     INC_STATS("DOM.WebKitMutationObserver.Constructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
index da12472..b6f9f07 100644 (file)
@@ -45,7 +45,7 @@ v8::Handle<v8::Value> V8WebKitPoint::constructorCallback(const v8::Arguments& ar
     INC_STATS("DOM.WebKitPoint.Constructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
index 0be956f..81a4cdc 100644 (file)
@@ -56,7 +56,7 @@ v8::Handle<v8::Value> V8WebSocket::constructorCallback(const v8::Arguments& args
     INC_STATS("DOM.WebSocket.Constructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();
index 435db80..8ea9ebc 100644 (file)
@@ -48,7 +48,7 @@ v8::Handle<v8::Value> V8XMLHttpRequest::constructorCallback(const v8::Arguments&
     INC_STATS("DOM.XMLHttpRequest.Constructor");
 
     if (!args.IsConstructCall())
-        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.");
+        return V8Proxy::throwTypeError("DOM object constructor cannot be called as a function.", args.GetIsolate());
 
     if (ConstructorMode::current() == ConstructorMode::WrapExistingObject)
         return args.Holder();