WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-102114-20121113133546.patch (text/plain), 33.79 KB, created by
Joshua Bell
on 2012-11-13 13:37:45 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Joshua Bell
Created:
2012-11-13 13:37:45 PST
Size:
33.79 KB
patch
obsolete
>Subversion Revision: 134475 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d23b0b3222a1337a34ad8b1ee8995b653233426f..acb51c7f60ded6c1ead5a8f3c0c1b1016e0389ba 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,74 @@ >+2012-11-13 Joshua Bell <jsbell@chromium.org> >+ >+ Rename NATIVE_TYPE_ERR to TypeError >+ https://bugs.webkit.org/show_bug.cgi?id=102114 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Defines names (mostly) matching WebIDL exception types for use by dom (etc) code. >+ V8 binding code had colliding enum members, which required prefixing. >+ >+ No new tests - just internal renames. >+ >+ * Modules/indexeddb/IDBCursor.cpp: s/NATIVE_TYPE_ERR/TypeError/g >+ (WebCore::IDBCursor::advance): >+ (WebCore::IDBCursor::stringToDirection): >+ (WebCore::IDBCursor::directionToString): >+ * Modules/indexeddb/IDBDatabase.cpp: Ditto. >+ (WebCore::IDBDatabase::setVersion): >+ * Modules/indexeddb/IDBFactory.cpp: Ditto. >+ (WebCore::IDBFactory::open): >+ (WebCore::IDBFactory::openInternal): >+ (WebCore::IDBFactory::deleteDatabase): >+ * Modules/indexeddb/IDBObjectStore.cpp: Ditto. >+ (WebCore::IDBObjectStore::createIndex): >+ * Modules/indexeddb/IDBTransaction.cpp: Ditto. >+ (WebCore::IDBTransaction::stringToMode): >+ (WebCore::IDBTransaction::modeToString): >+ * bindings/js/JSDOMBinding.cpp: Ditto. >+ (WebCore::setDOMException): >+ * bindings/v8/DateExtension.cpp: Prefix ErrorType enum/members w/ V8/v8. >+ (WebCore::DateExtension::OnSleepDetected): >+ * bindings/v8/NPV8Object.cpp: Ditto. >+ (_NPN_SetException): >+ * bindings/v8/V8Binding.cpp: Ditto. >+ (WebCore::throwError): >+ (WebCore::handleMaxRecursionDepthExceeded): >+ * bindings/v8/V8Binding.h: Ditto. >+ (WebCore): >+ * bindings/v8/V8NPObject.cpp: Ditto. >+ (WebCore::npObjectInvokeImpl): >+ (WebCore::npObjectGetProperty): >+ (WebCore::npObjectSetProperty): >+ (WebCore::npObjectPropertyEnumerator): >+ * bindings/v8/V8ThrowException.cpp: Rename ALL the errors! >+ (WebCore::V8ThrowException::setDOMException): >+ (WebCore::V8ThrowException::throwError): >+ (WebCore::V8ThrowException::throwTypeError): >+ (WebCore::V8ThrowException::throwNotEnoughArgumentsError): >+ * bindings/v8/V8ThrowException.h: >+ (V8ThrowException): >+ * bindings/v8/WorkerContextExecutionProxy.cpp: Prefixing (continued) >+ (WebCore::WorkerContextExecutionProxy::evaluate): >+ * bindings/v8/custom/V8ArrayBufferCustom.cpp: Ditto. >+ (WebCore::V8ArrayBuffer::constructorCallback): >+ * bindings/v8/custom/V8ArrayBufferViewCustom.h: Ditto. >+ (WebCore::constructWebGLArrayWithArrayBufferArgument): >+ (WebCore::constructWebGLArray): >+ (WebCore::setWebGLArrayHelper): >+ * bindings/v8/custom/V8AudioContextCustom.cpp: Ditto. >+ (WebCore::V8AudioContext::constructorCallback): >+ * bindings/v8/custom/V8BlobCustom.cpp: Ditto. >+ (WebCore::V8Blob::constructorCallback): >+ * bindings/v8/custom/V8ClipboardCustom.cpp: Ditto. >+ (WebCore::V8Clipboard::clearDataCallback): >+ (WebCore::V8Clipboard::setDragImageCallback): >+ * bindings/v8/custom/V8DOMFormDataCustom.cpp: Ditto. >+ (WebCore::V8DOMFormData::appendCallback): >+ * bindings/v8/custom/V8SQLResultSetRowListCustom.cpp: Ditto. >+ (WebCore::V8SQLResultSetRowList::itemCallback): >+ * dom/ExceptionCode.h: Add WebIDL exception types. >+ > 2012-11-13 Chris Fleizach <cfleizach@apple.com> > > WebKit exposes ARIA rowheader role as AXUnknown when not contained in table/grid >diff --git a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp >index beb01c46282a3e3f89ad4641d514c45b8be991fc..0f3a603fbf2b417a33f6ec9c72842a4df17f74f8 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBCursor.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBCursor.cpp >@@ -170,7 +170,7 @@ void IDBCursor::advance(long long count, ExceptionCode& ec) > > // FIXME: This should only need to check for 0 once webkit.org/b/96798 lands. > if (count < 1 || count > UINT_MAX) { >- ec = NATIVE_TYPE_ERR; >+ ec = TypeError; > return; > } > >@@ -310,7 +310,7 @@ IDBCursor::Direction IDBCursor::stringToDirection(const String& directionString, > return static_cast<IDBCursor::Direction>(IDBCursor::NEXT + (directionString[0] - '0')); > } > >- ec = NATIVE_TYPE_ERR; >+ ec = TypeError; > return IDBCursor::NEXT; > } > >@@ -330,7 +330,7 @@ const AtomicString& IDBCursor::directionToString(unsigned short direction, Excep > return IDBCursor::directionPrevUnique(); > > default: >- ec = NATIVE_TYPE_ERR; >+ ec = TypeError; > return IDBCursor::directionNext(); > } > } >diff --git a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp >index 84530521ab65d889affec04511d11714fd8df6f9..8ef6e240574140b8b7294879e8fb8230d89580b2 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBDatabase.cpp >@@ -211,7 +211,7 @@ PassRefPtr<IDBVersionChangeRequest> IDBDatabase::setVersion(ScriptExecutionConte > } > > if (version.isNull()) { >- ec = NATIVE_TYPE_ERR; >+ ec = TypeError; > return 0; > } > >diff --git a/Source/WebCore/Modules/indexeddb/IDBFactory.cpp b/Source/WebCore/Modules/indexeddb/IDBFactory.cpp >index e78913ba04cbbc7332283f05f4baaa5000b3e0be..cb485f504fbb26f9051f4fe94e8f9a048feeae3d 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBFactory.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBFactory.cpp >@@ -110,7 +110,7 @@ PassRefPtr<IDBOpenDBRequest> IDBFactory::open(ScriptExecutionContext* context, c > // FIXME: This should only need to check for 0 once webkit.org/b/96798 lands. > const int64_t maxECMAScriptInteger = 0x20000000000000LL - 1; > if (version < 1 || version > maxECMAScriptInteger) { >- ec = NATIVE_TYPE_ERR; >+ ec = TypeError; > return 0; > } > return openInternal(context, name, version, ec); >@@ -120,7 +120,7 @@ PassRefPtr<IDBOpenDBRequest> IDBFactory::openInternal(ScriptExecutionContext* co > { > ASSERT(version >= 1 || version == IDBDatabaseMetadata::NoIntVersion); > if (name.isNull()) { >- ec = NATIVE_TYPE_ERR; >+ ec = TypeError; > return 0; > } > if (!isContextValid(context)) >@@ -140,7 +140,7 @@ PassRefPtr<IDBOpenDBRequest> IDBFactory::open(ScriptExecutionContext* context, c > PassRefPtr<IDBVersionChangeRequest> IDBFactory::deleteDatabase(ScriptExecutionContext* context, const String& name, ExceptionCode& ec) > { > if (name.isNull()) { >- ec = NATIVE_TYPE_ERR; >+ ec = TypeError; > return 0; > } > if (!isContextValid(context)) >diff --git a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >index 7b175e6410ef5faf0e5773a190fa32d8482f5379..9ef3495d8e24fa5c2b1bf4116a5eadad983f9533 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBObjectStore.cpp >@@ -367,7 +367,7 @@ PassRefPtr<IDBIndex> IDBObjectStore::createIndex(ScriptExecutionContext* context > return 0; > } > if (name.isNull()) { >- ec = NATIVE_TYPE_ERR; >+ ec = TypeError; > return 0; > } > if (containsIndex(name)) { >diff --git a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >index 531f2f09158a2756965e513a36b6a12cdb66fcf8..9fe35c947c04e724af750faa4aa8c9edaf7e191d 100644 >--- a/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >+++ b/Source/WebCore/Modules/indexeddb/IDBTransaction.cpp >@@ -354,7 +354,7 @@ IDBTransaction::Mode IDBTransaction::stringToMode(const String& modeString, Scri > return static_cast<IDBTransaction::Mode>(IDBTransaction::READ_ONLY + (modeString[0] - '0')); > } > >- ec = NATIVE_TYPE_ERR; >+ ec = TypeError; > return IDBTransaction::READ_ONLY; > } > >@@ -374,7 +374,7 @@ const AtomicString& IDBTransaction::modeToString(IDBTransaction::Mode mode, Exce > break; > > default: >- ec = NATIVE_TYPE_ERR; >+ ec = TypeError; > return IDBTransaction::modeReadOnly(); > } > } >diff --git a/Source/WebCore/bindings/js/JSDOMBinding.cpp b/Source/WebCore/bindings/js/JSDOMBinding.cpp >index d76e0e1dc099733851266e81577787cbe45d4f8a..30eccec89a0d0425df0207bf06ec4f5bdb3111ea 100644 >--- a/Source/WebCore/bindings/js/JSDOMBinding.cpp >+++ b/Source/WebCore/bindings/js/JSDOMBinding.cpp >@@ -186,7 +186,8 @@ void setDOMException(ExecState* exec, ExceptionCode ec) > if (!ec || exec->hadException()) > return; > >- if (ec == NATIVE_TYPE_ERR) { >+ // FIXME: Handle other WebIDL exception types. >+ if (ec == TypeError) { > throwTypeError(exec); > return; > } >diff --git a/Source/WebCore/bindings/v8/DateExtension.cpp b/Source/WebCore/bindings/v8/DateExtension.cpp >index 11a3b09c05c26ef67cbddbd2c1a4e9e4fbc9f307..dce583a5652d969b6e334c078646cfb38f761179 100644 >--- a/Source/WebCore/bindings/v8/DateExtension.cpp >+++ b/Source/WebCore/bindings/v8/DateExtension.cpp >@@ -118,7 +118,7 @@ v8::Handle<v8::Value> DateExtension::Setup(const v8::Arguments& args) > > v8::Handle<v8::Value> DateExtension::OnSleepDetected(const v8::Arguments& args) > { >- return throwError(GeneralError, "Too much time spent in unload handler.", args.GetIsolate()); >+ return throwError(v8GeneralError, "Too much time spent in unload handler.", args.GetIsolate()); > } > > } // namespace WebCore >diff --git a/Source/WebCore/bindings/v8/NPV8Object.cpp b/Source/WebCore/bindings/v8/NPV8Object.cpp >index 2f273e12c5226db76f43bc633e07f41456105198..e941e631f9a014060166491dafd9d6031a161869 100644 >--- a/Source/WebCore/bindings/v8/NPV8Object.cpp >+++ b/Source/WebCore/bindings/v8/NPV8Object.cpp >@@ -475,7 +475,7 @@ void _NPN_SetException(NPObject* npObject, const NPUTF8 *message) > if (!npObject || npObject->_class != npScriptObjectClass) { > // We won't be able to find a proper scope for this exception, so just throw it. > // This is consistent with JSC, which throws a global exception all the time. >- throwError(GeneralError, message); >+ throwError(v8GeneralError, message); > return; > } > v8::HandleScope handleScope; >@@ -486,7 +486,7 @@ void _NPN_SetException(NPObject* npObject, const NPUTF8 *message) > v8::Context::Scope scope(context); > ExceptionCatcher exceptionCatcher; > >- throwError(GeneralError, message); >+ throwError(v8GeneralError, message); > } > > bool _NPN_Enumerate(NPP npp, NPObject* npObject, NPIdentifier** identifier, uint32_t* count) >diff --git a/Source/WebCore/bindings/v8/V8Binding.cpp b/Source/WebCore/bindings/v8/V8Binding.cpp >index ba31733f6cb5a8820f75e7d13c4289aeb0cee564..e50d464f05084b304a0071299307809db1260c65 100644 >--- a/Source/WebCore/bindings/v8/V8Binding.cpp >+++ b/Source/WebCore/bindings/v8/V8Binding.cpp >@@ -76,7 +76,7 @@ v8::Handle<v8::Value> setDOMException(int exceptionCode, v8::Isolate* isolate) > return V8ThrowException::setDOMException(exceptionCode, isolate); > } > >-v8::Handle<v8::Value> throwError(ErrorType errorType, const char* message, v8::Isolate* isolate) >+v8::Handle<v8::Value> throwError(V8ErrorType errorType, const char* message, v8::Isolate* isolate) > { > return V8ThrowException::throwError(errorType, message, isolate); > } >@@ -344,7 +344,7 @@ bool handleOutOfMemory() > > v8::Local<v8::Value> handleMaxRecursionDepthExceeded() > { >- throwError(RangeError, "Maximum call stack size exceeded."); >+ throwError(v8RangeError, "Maximum call stack size exceeded."); > return v8::Local<v8::Value>(); > } > >diff --git a/Source/WebCore/bindings/v8/V8Binding.h b/Source/WebCore/bindings/v8/V8Binding.h >index 38b9e329b1c77a253528c77a0434fe8bd5f72fcd..d9e376893cd1262ae2aea8558dd4818497079d63 100644 >--- a/Source/WebCore/bindings/v8/V8Binding.h >+++ b/Source/WebCore/bindings/v8/V8Binding.h >@@ -60,7 +60,7 @@ namespace WebCore { > v8::Handle<v8::Value> setDOMException(int, v8::Isolate*); > > // Schedule a JavaScript error to be thrown. >- v8::Handle<v8::Value> throwError(ErrorType, const char*, v8::Isolate* = 0); >+ v8::Handle<v8::Value> throwError(V8ErrorType, const char*, v8::Isolate* = 0); > > // Schedule a JavaScript error to be thrown. > v8::Handle<v8::Value> throwError(v8::Local<v8::Value>, v8::Isolate* = 0); >diff --git a/Source/WebCore/bindings/v8/V8NPObject.cpp b/Source/WebCore/bindings/v8/V8NPObject.cpp >index 19abd9e70f1bbb488d7193d75deae2bfae1b57d3..b5a21c0e8c92d8766886fc12d3155662bca3c179 100644 >--- a/Source/WebCore/bindings/v8/V8NPObject.cpp >+++ b/Source/WebCore/bindings/v8/V8NPObject.cpp >@@ -89,14 +89,14 @@ static v8::Handle<v8::Value> npObjectInvokeImpl(const v8::Arguments& args, Invok > // The holder object is not a subtype of HTMLPlugInElement, it must be an NPObject which has three > // internal fields. > if (args.Holder()->InternalFieldCount() != npObjectInternalFieldCount) >- return throwError(ReferenceError, "NPMethod called on non-NPObject", args.GetIsolate()); >+ return throwError(v8ReferenceError, "NPMethod called on non-NPObject", args.GetIsolate()); > > npObject = v8ObjectToNPObject(args.Holder()); > } > > // Verify that our wrapper wasn't using a NPObject which has already been deleted. > if (!npObject || !_NPN_IsAlive(npObject)) >- return throwError(ReferenceError, "NPObject deleted", args.GetIsolate()); >+ return throwError(v8ReferenceError, "NPObject deleted", args.GetIsolate()); > > // Wrap up parameters. > int numArgs = args.Length(); >@@ -130,7 +130,7 @@ static v8::Handle<v8::Value> npObjectInvokeImpl(const v8::Arguments& args, Invok > } > > if (!retval) >- throwError(GeneralError, "Error calling method on NPObject.", args.GetIsolate()); >+ throwError(v8GeneralError, "Error calling method on NPObject.", args.GetIsolate()); > > for (int i = 0; i < numArgs; i++) > _NPN_ReleaseVariantValue(&npArgs[i]); >@@ -209,12 +209,12 @@ static v8::Handle<v8::Value> npObjectGetProperty(v8::Local<v8::Object> self, NPI > // Verify that our wrapper wasn't using a NPObject which > // has already been deleted. > if (!npObject || !_NPN_IsAlive(npObject)) >- return throwError(ReferenceError, "NPObject deleted", isolate); >+ return throwError(v8ReferenceError, "NPObject deleted", isolate); > > > if (npObject->_class->hasProperty && npObject->_class->getProperty && npObject->_class->hasProperty(npObject, identifier)) { > if (!_NPN_IsAlive(npObject)) >- return throwError(ReferenceError, "NPObject deleted", isolate); >+ return throwError(v8ReferenceError, "NPObject deleted", isolate); > > NPVariant result; > VOID_TO_NPVARIANT(result); >@@ -230,11 +230,11 @@ static v8::Handle<v8::Value> npObjectGetProperty(v8::Local<v8::Object> self, NPI > } > > if (!_NPN_IsAlive(npObject)) >- return throwError(ReferenceError, "NPObject deleted", isolate); >+ return throwError(v8ReferenceError, "NPObject deleted", isolate); > > if (key->IsString() && npObject->_class->hasMethod && npObject->_class->hasMethod(npObject, identifier)) { > if (!_NPN_IsAlive(npObject)) >- return throwError(ReferenceError, "NPObject deleted", isolate); >+ return throwError(v8ReferenceError, "NPObject deleted", isolate); > > PrivateIdentifier* id = static_cast<PrivateIdentifier*>(identifier); > v8::Persistent<v8::FunctionTemplate> functionTemplate = V8NPTemplateMap::sharedInstance().get(id); >@@ -292,13 +292,13 @@ static v8::Handle<v8::Value> npObjectSetProperty(v8::Local<v8::Object> self, NPI > > // Verify that our wrapper wasn't using a NPObject which has already been deleted. > if (!npObject || !_NPN_IsAlive(npObject)) { >- throwError(ReferenceError, "NPObject deleted", isolate); >+ throwError(v8ReferenceError, "NPObject deleted", isolate); > return value; // Intercepted, but an exception was thrown. > } > > if (npObject->_class->hasProperty && npObject->_class->setProperty && npObject->_class->hasProperty(npObject, identifier)) { > if (!_NPN_IsAlive(npObject)) >- return throwError(ReferenceError, "NPObject deleted", isolate); >+ return throwError(v8ReferenceError, "NPObject deleted", isolate); > > NPVariant npValue; > VOID_TO_NPVARIANT(npValue); >@@ -344,7 +344,7 @@ v8::Handle<v8::Array> npObjectPropertyEnumerator(const v8::AccessorInfo& info, b > // Verify that our wrapper wasn't using a NPObject which > // has already been deleted. > if (!npObject || !_NPN_IsAlive(npObject)) >- throwError(ReferenceError, "NPObject deleted", info.GetIsolate()); >+ throwError(v8ReferenceError, "NPObject deleted", info.GetIsolate()); > > if (NP_CLASS_STRUCT_VERSION_HAS_ENUM(npObject->_class) && npObject->_class->enumerate) { > uint32_t count; >diff --git a/Source/WebCore/bindings/v8/V8ThrowException.cpp b/Source/WebCore/bindings/v8/V8ThrowException.cpp >index f0adc012f64ec376469ede34aed9ff899bbb1f79..0c156e35a8fac1384114ed20e8529f05dcf7fe07 100644 >--- a/Source/WebCore/bindings/v8/V8ThrowException.cpp >+++ b/Source/WebCore/bindings/v8/V8ThrowException.cpp >@@ -53,7 +53,8 @@ v8::Handle<v8::Value> V8ThrowException::setDOMException(int ec, v8::Isolate* iso > if (ec <= 0 || v8::V8::IsExecutionTerminating()) > return v8Undefined(); > >- if (ec == NATIVE_TYPE_ERR) >+ // FIXME: Handle other WebIDL exception types. >+ if (ec == TypeError) > return V8ThrowException::throwTypeError(0, isolate); > > ExceptionCodeDescription description(ec); >@@ -77,18 +78,18 @@ v8::Handle<v8::Value> V8ThrowException::setDOMException(int ec, v8::Isolate* iso > > #undef TRY_TO_CREATE_EXCEPTION > >-v8::Handle<v8::Value> V8ThrowException::throwError(ErrorType type, const char* message, v8::Isolate* isolate) >+v8::Handle<v8::Value> V8ThrowException::throwError(V8ErrorType type, const char* message, v8::Isolate* isolate) > { > switch (type) { >- case RangeError: >+ case v8RangeError: > return v8::ThrowException(v8::Exception::RangeError(v8String(message, isolate))); >- case ReferenceError: >+ case v8ReferenceError: > return v8::ThrowException(v8::Exception::ReferenceError(v8String(message, isolate))); >- case SyntaxError: >+ case v8SyntaxError: > return v8::ThrowException(v8::Exception::SyntaxError(v8String(message, isolate))); >- case TypeError: >+ case v8TypeError: > return v8::ThrowException(v8::Exception::TypeError(v8String(message, isolate))); >- case GeneralError: >+ case v8GeneralError: > return v8::ThrowException(v8::Exception::Error(v8String(message, isolate))); > default: > ASSERT_NOT_REACHED(); >@@ -98,12 +99,12 @@ v8::Handle<v8::Value> V8ThrowException::throwError(ErrorType type, const char* m > > v8::Handle<v8::Value> V8ThrowException::throwTypeError(const char* message, v8::Isolate* isolate) > { >- return V8ThrowException::throwError(TypeError, (message ? message : "Type error"), isolate); >+ return V8ThrowException::throwError(v8TypeError, (message ? message : "Type error"), isolate); > } > > v8::Handle<v8::Value> V8ThrowException::throwNotEnoughArgumentsError(v8::Isolate* isolate) > { >- return V8ThrowException::throwError(TypeError, "Not enough arguments", isolate); >+ return V8ThrowException::throwError(v8TypeError, "Not enough arguments", isolate); > } > > v8::Handle<v8::Value> V8ThrowException::throwError(v8::Local<v8::Value> exception, v8::Isolate* isolate) >diff --git a/Source/WebCore/bindings/v8/V8ThrowException.h b/Source/WebCore/bindings/v8/V8ThrowException.h >index 4f53d2282273988027df501f3e456a7a9dcedb58..2f46afa28c3447702a956d09917f0fb0f4267a20 100644 >--- a/Source/WebCore/bindings/v8/V8ThrowException.h >+++ b/Source/WebCore/bindings/v8/V8ThrowException.h >@@ -29,19 +29,19 @@ > > namespace WebCore { > >-enum ErrorType { >- RangeError, >- ReferenceError, >- SyntaxError, >- TypeError, >- GeneralError >+enum V8ErrorType { >+ v8RangeError, >+ v8ReferenceError, >+ v8SyntaxError, >+ v8TypeError, >+ v8GeneralError > }; > > class V8ThrowException { > public: > static v8::Handle<v8::Value> setDOMException(int, v8::Isolate*); > >- static v8::Handle<v8::Value> throwError(ErrorType, const char*, v8::Isolate* = 0); >+ static v8::Handle<v8::Value> throwError(V8ErrorType, const char*, v8::Isolate* = 0); > static v8::Handle<v8::Value> throwError(v8::Local<v8::Value>, v8::Isolate* = 0); > > static v8::Handle<v8::Value> throwTypeError(const char* = 0, v8::Isolate* = 0); >diff --git a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp >index 15c5e900bf5e4f6a799c92fbc2885a21613acef0..943c064c907865becf54704846f20a6e92eaa735 100644 >--- a/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp >+++ b/Source/WebCore/bindings/v8/WorkerContextExecutionProxy.cpp >@@ -216,7 +216,7 @@ ScriptValue WorkerContextExecutionProxy::evaluate(const String& script, const St > state->lineNumber = message->GetLineNumber(); > state->sourceURL = toWebCoreString(message->GetScriptResourceName()); > if (m_workerContext->sanitizeScriptError(state->errorMessage, state->lineNumber, state->sourceURL)) >- state->exception = throwError(GeneralError, state->errorMessage.utf8().data()); >+ state->exception = throwError(v8GeneralError, state->errorMessage.utf8().data()); > else > state->exception = ScriptValue(exceptionCatcher.Exception()); > >diff --git a/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp >index fb00a1ad79e46f0732b81fc991b02751dbbc45cb..87c25655fcd7433d3d3283bc677fad6086b09fc5 100644 >--- a/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8ArrayBufferCustom.cpp >@@ -79,7 +79,7 @@ v8::Handle<v8::Value> V8ArrayBuffer::constructorCallback(const v8::Arguments& ar > if (length >= 0) > buffer = ArrayBuffer::create(static_cast<unsigned>(length), 1); > if (!buffer.get()) >- return throwError(RangeError, "ArrayBuffer size is not a small enough positive integer.", args.GetIsolate()); >+ return throwError(v8RangeError, "ArrayBuffer size is not a small enough positive integer.", args.GetIsolate()); > buffer->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instance()); > v8::V8::AdjustAmountOfExternalAllocatedMemory(buffer->byteLength()); > // Transform the holder into a wrapper object for the array. >diff --git a/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h b/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h >index 4a71dffd4625f05687ec78d009260b3e80dd64e8..2f09cd4da16b061dac380d25c84781641f13ebff 100644 >--- a/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h >+++ b/Source/WebCore/bindings/v8/custom/V8ArrayBufferViewCustom.h >@@ -83,16 +83,16 @@ v8::Handle<v8::Value> constructWebGLArrayWithArrayBufferArgument(const v8::Argum > return throwTypeError("Could not convert argument 2 to a number", args.GetIsolate()); > } else { > if ((buf->byteLength() - offset) % sizeof(ElementType)) >- return throwError(RangeError, "ArrayBuffer length minus the byteOffset is not a multiple of the element size.", args.GetIsolate()); >+ return throwError(v8RangeError, "ArrayBuffer length minus the byteOffset is not a multiple of the element size.", args.GetIsolate()); > length = (buf->byteLength() - offset) / sizeof(ElementType); > } > > if (static_cast<int32_t>(length) < 0) >- return throwError(RangeError, tooLargeSize, args.GetIsolate()); >+ return throwError(v8RangeError, tooLargeSize, args.GetIsolate()); > > RefPtr<ArrayClass> array = ArrayClass::create(buf, offset, length); > if (!array) >- return throwError(RangeError, tooLargeSize, args.GetIsolate()); >+ return throwError(v8RangeError, tooLargeSize, args.GetIsolate()); > > return wrapArrayBufferView(args, type, array, arrayType, hasIndexer); > } >@@ -150,11 +150,11 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType > uint32_t length = source->length(); > > if (static_cast<int32_t>(length) < 0) >- return throwError(RangeError, tooLargeSize, args.GetIsolate()); >+ return throwError(v8RangeError, tooLargeSize, args.GetIsolate()); > > RefPtr<ArrayClass> array = ArrayClass::createUninitialized(length); > if (!array.get()) >- return throwError(RangeError, tooLargeSize, args.GetIsolate()); >+ return throwError(v8RangeError, tooLargeSize, args.GetIsolate()); > > array->buffer()->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instance()); > v8::V8::AdjustAmountOfExternalAllocatedMemory(array->byteLength()); >@@ -184,7 +184,7 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType > } > > if (static_cast<int32_t>(len) < 0) >- return throwError(RangeError, tooLargeSize, args.GetIsolate()); >+ return throwError(v8RangeError, tooLargeSize, args.GetIsolate()); > > RefPtr<ArrayClass> array; > if (doInstantiation) { >@@ -195,7 +195,7 @@ v8::Handle<v8::Value> constructWebGLArray(const v8::Arguments& args, WrapperType > } > > if (!array.get()) >- return throwError(RangeError, tooLargeSize, args.GetIsolate()); >+ return throwError(v8RangeError, tooLargeSize, args.GetIsolate()); > > if (doInstantiation) { > array->buffer()->setDeallocationObserver(V8ArrayBufferDeallocationObserver::instance()); >@@ -236,7 +236,7 @@ v8::Handle<v8::Value> setWebGLArrayHelper(const v8::Arguments& args) > if (args.Length() == 2) > offset = toUInt32(args[1]); > if (!impl->set(src, offset)) >- return throwError(RangeError, outOfRangeLengthAndOffset, args.GetIsolate()); >+ return throwError(v8RangeError, outOfRangeLengthAndOffset, args.GetIsolate()); > return v8::Undefined(); > } > >@@ -248,7 +248,7 @@ v8::Handle<v8::Value> setWebGLArrayHelper(const v8::Arguments& args) > offset = toUInt32(args[1]); > uint32_t length = toUInt32(array->Get(v8::String::New("length"))); > if (!impl->checkInboundData(offset, length)) >- return throwError(RangeError, outOfRangeLengthAndOffset, args.GetIsolate()); >+ return throwError(v8RangeError, outOfRangeLengthAndOffset, args.GetIsolate()); > bool copied = copyElements(args.Holder(), array, length, offset, args.GetIsolate()); > if (!copied) { > for (uint32_t i = 0; i < length; i++) >diff --git a/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp b/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp >index 01a8ca7bde143fc8120ff8e111b4d8f0250887f5..0f2b029335fe4657a0400bb842f8edd69a288827 100644 >--- a/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8AudioContextCustom.cpp >@@ -60,7 +60,7 @@ v8::Handle<v8::Value> V8AudioContext::constructorCallback(const v8::Arguments& a > if (ec) > return setDOMException(ec, args.GetIsolate()); > if (!audioContext.get()) >- return throwError(SyntaxError, "audio resources unavailable for AudioContext construction", args.GetIsolate()); >+ return throwError(v8SyntaxError, "audio resources unavailable for AudioContext construction", args.GetIsolate()); > } else { > // Constructor for offline (render-target) AudioContext which renders into an AudioBuffer. > // new AudioContext(in unsigned long numberOfChannels, in unsigned long numberOfFrames, in float sampleRate); >@@ -71,15 +71,15 @@ v8::Handle<v8::Value> V8AudioContext::constructorCallback(const v8::Arguments& a > > int32_t numberOfChannels = toInt32(args[0], ok); > if (!ok || numberOfChannels <= 0 || numberOfChannels > 10) >- return throwError(SyntaxError, "Invalid number of channels", args.GetIsolate()); >+ return throwError(v8SyntaxError, "Invalid number of channels", args.GetIsolate()); > > int32_t numberOfFrames = toInt32(args[1], ok); > if (!ok || numberOfFrames <= 0) >- return throwError(SyntaxError, "Invalid number of frames", args.GetIsolate()); >+ return throwError(v8SyntaxError, "Invalid number of frames", args.GetIsolate()); > > float sampleRate = toFloat(args[2]); > if (sampleRate <= 0) >- return throwError(SyntaxError, "Invalid sample rate", args.GetIsolate()); >+ return throwError(v8SyntaxError, "Invalid sample rate", args.GetIsolate()); > > ExceptionCode ec = 0; > audioContext = AudioContext::createOfflineContext(document, numberOfChannels, numberOfFrames, sampleRate, ec); >@@ -88,7 +88,7 @@ v8::Handle<v8::Value> V8AudioContext::constructorCallback(const v8::Arguments& a > } > > if (!audioContext.get()) >- return throwError(SyntaxError, "Error creating AudioContext", args.GetIsolate()); >+ return throwError(v8SyntaxError, "Error creating AudioContext", args.GetIsolate()); > > // Transform the holder into a wrapper object for the audio context. > V8DOMWrapper::setDOMWrapper(args.Holder(), &info, audioContext.get()); >diff --git a/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp b/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp >index 71f162aec805a2a7393b562ee009df6f04ffcf8d..8c2a9c4ebd3c46b65831928290b582585ae57a78 100644 >--- a/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8BlobCustom.cpp >@@ -96,7 +96,7 @@ v8::Handle<v8::Value> V8Blob::constructorCallback(const v8::Arguments& args) > if (tryCatchType.HasCaught()) > return throwError(tryCatchType.Exception(), args.GetIsolate()); > if (!type.containsOnlyASCII()) >- return throwError(SyntaxError, "type must consist of ASCII characters", args.GetIsolate()); >+ return throwError(v8SyntaxError, "type must consist of ASCII characters", args.GetIsolate()); > type.makeLower(); > } > >diff --git a/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp b/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp >index fca899111f8e6641fdbd2ae115f6b93da26ee7bb..4dcdd7e516a56c861d64e5d63cafa2606b49ce67 100644 >--- a/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8ClipboardCustom.cpp >@@ -72,7 +72,7 @@ v8::Handle<v8::Value> V8Clipboard::clearDataCallback(const v8::Arguments& args) > } > > if (args.Length() != 1) >- return throwError(SyntaxError, "clearData: Invalid number of arguments", args.GetIsolate()); >+ return throwError(v8SyntaxError, "clearData: Invalid number of arguments", args.GetIsolate()); > > String type = toWebCoreString(args[0]); > clipboard->clearData(type); >@@ -88,7 +88,7 @@ v8::Handle<v8::Value> V8Clipboard::setDragImageCallback(const v8::Arguments& arg > return v8::Undefined(); > > if (args.Length() != 3) >- return throwError(SyntaxError, "setDragImage: Invalid number of arguments", args.GetIsolate()); >+ return throwError(v8SyntaxError, "setDragImage: Invalid number of arguments", args.GetIsolate()); > > int x = toInt32(args[1]); > int y = toInt32(args[2]); >diff --git a/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp b/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp >index 33be7e99d539f1f6ec8c23c3b8e0117c31a4819d..9481ee32dc7d334553756e8be09ce6f203ff4cfe 100644 >--- a/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8DOMFormDataCustom.cpp >@@ -65,7 +65,7 @@ v8::Handle<v8::Value> V8DOMFormData::appendCallback(const v8::Arguments& args) > INC_STATS("DOM.FormData.append()"); > > if (args.Length() < 2) >- return throwError(SyntaxError, "Not enough arguments", args.GetIsolate()); >+ return throwError(v8SyntaxError, "Not enough arguments", args.GetIsolate()); > > DOMFormData* domFormData = V8DOMFormData::toNative(args.Holder()); > >diff --git a/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp b/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp >index 70911da12161c28a1cfa788b38fe79166cb7edee..589949410165f55023284e2bc579733b4ba0c080 100644 >--- a/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp >+++ b/Source/WebCore/bindings/v8/custom/V8SQLResultSetRowListCustom.cpp >@@ -43,7 +43,7 @@ v8::Handle<v8::Value> V8SQLResultSetRowList::itemCallback(const v8::Arguments& a > INC_STATS("DOM.SQLResultSetRowList.item()"); > > if (!args.Length()) >- return throwError(SyntaxError, "Item index is required.", args.GetIsolate()); >+ return throwError(v8SyntaxError, "Item index is required.", args.GetIsolate()); > > if (!args[0]->IsNumber()) > return throwTypeError("Item index must be a number.", args.GetIsolate()); >@@ -52,7 +52,7 @@ v8::Handle<v8::Value> V8SQLResultSetRowList::itemCallback(const v8::Arguments& a > > unsigned long index = args[0]->IntegerValue(); > if (index >= rowList->length()) >- return throwError(RangeError, "Item index is out of range.", args.GetIsolate()); >+ return throwError(v8RangeError, "Item index is out of range.", args.GetIsolate()); > > v8::Local<v8::Object> item = v8::Object::New(); > unsigned numColumns = rowList->columnNames().size(); >diff --git a/Source/WebCore/dom/ExceptionCode.h b/Source/WebCore/dom/ExceptionCode.h >index 51f8dc2d3f1249b83a5fdd84368e4cc933426499..8e01b6e415affc074ebb7ec4a7230f549b624d2f 100644 >--- a/Source/WebCore/dom/ExceptionCode.h >+++ b/Source/WebCore/dom/ExceptionCode.h >@@ -65,8 +65,14 @@ namespace WebCore { > INVALID_NODE_TYPE_ERR = 24, > DATA_CLONE_ERR = 25, > >- // Converted to a native TypeError by the script binding layer: >- NATIVE_TYPE_ERR = 99 >+ // WebIDL exception types, handled by the binding layer. >+ GeneralError = 100, >+ EvalError = 101, >+ RangeError = 102, >+ ReferenceError = 103, >+ SyntaxError = 104, >+ TypeError = 105, >+ URIError = 106, > }; > > } // namespace WebCore
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 102114
:
173945
|
173974
|
174215