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

Unified Diff: Source/bindings/core/v8/ScriptPromise.cpp

Issue 460923002: Decouple arity errors creation from throwing. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
« no previous file with comments | « Source/bindings/core/v8/ScriptPromise.h ('k') | Source/bindings/core/v8/V8Binding.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/ScriptPromise.cpp
diff --git a/Source/bindings/core/v8/ScriptPromise.cpp b/Source/bindings/core/v8/ScriptPromise.cpp
index 6400b7b203ba911afe8175cfdf78147bf4f61d27..f2799a39d7b6c03b241d18b0502123103c81292f 100644
--- a/Source/bindings/core/v8/ScriptPromise.cpp
+++ b/Source/bindings/core/v8/ScriptPromise.cpp
@@ -167,50 +167,6 @@ ScriptPromise ScriptPromise::rejectWithDOMException(ScriptState* scriptState, Pa
return reject(scriptState, V8ValueTraits<PassRefPtrWillBeRawPtr<DOMException> >::toV8Value(exception, scriptState->context()->Global(), scriptState->isolate()));
}
-ScriptPromise ScriptPromise::rejectWithTypeError(ScriptState* scriptState, const String& message)
-{
- v8::Isolate* isolate = scriptState->isolate();
- return reject(scriptState, V8ThrowException::createTypeError(message, isolate));
-}
-
-ScriptPromise ScriptPromise::rejectWithArityTypeErrorForMethod(ScriptState* scriptState, const char* method, const char* type, const char* valid, unsigned provided)
-{
- String message = ExceptionMessages::failedToExecute(method, type, ExceptionMessages::invalidArity(valid, provided));
- return rejectWithTypeError(scriptState, message);
-}
-
-ScriptPromise ScriptPromise::rejectWithArityTypeErrorForConstructor(ScriptState* scriptState, const char* type, const char* valid, unsigned provided)
-{
- String message = ExceptionMessages::failedToConstruct(type, ExceptionMessages::invalidArity(valid, provided));
- return rejectWithTypeError(scriptState, message);
-}
-
-ScriptPromise ScriptPromise::rejectWithArityTypeError(ScriptState* scriptState, ExceptionState& exceptionState, const char* valid, unsigned provided)
-{
- exceptionState.throwTypeError(ExceptionMessages::invalidArity(valid, provided));
- return exceptionState.reject(scriptState);
-}
-
-ScriptPromise ScriptPromise::rejectWithMinimumArityTypeErrorForMethod(
- ScriptState* scriptState, const char* method, const char* type, unsigned expected, unsigned providedLeastNumMandatoryParams)
-{
- String message = ExceptionMessages::failedToExecute(method, type, ExceptionMessages::notEnoughArguments(expected, providedLeastNumMandatoryParams));
- return rejectWithTypeError(scriptState, message);
-}
-
-ScriptPromise ScriptPromise::rejectWithMinimumArityTypeErrorForConstructor(
- ScriptState* scriptState, const char* type, unsigned expected, unsigned providedLeastNumMandatoryParams)
-{
- String message = ExceptionMessages::failedToConstruct(type, ExceptionMessages::notEnoughArguments(expected, providedLeastNumMandatoryParams));
- return rejectWithTypeError(scriptState, message);
-}
-
-ScriptPromise ScriptPromise::rejectWithMinimumArityTypeError(ScriptState* scriptState, ExceptionState& exceptionState, unsigned expected, unsigned providedLeastNumMandatoryParams)
-{
- exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(expected, providedLeastNumMandatoryParams));
- return exceptionState.reject(scriptState);
-}
-
v8::Local<v8::Promise> ScriptPromise::rejectRaw(v8::Isolate* isolate, v8::Handle<v8::Value> value)
{
if (value.IsEmpty())
« no previous file with comments | « Source/bindings/core/v8/ScriptPromise.h ('k') | Source/bindings/core/v8/V8Binding.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698