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

Unified Diff: Source/bindings/v8/V8BindingMacros.h

Issue 242913002: [ABANDONED] Add exception handling options to V8StringResource<T>::prepare. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 8 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 | « no previous file | Source/bindings/v8/V8StringResource.h » ('j') | Source/bindings/v8/V8StringResource.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/v8/V8BindingMacros.h
diff --git a/Source/bindings/v8/V8BindingMacros.h b/Source/bindings/v8/V8BindingMacros.h
index e5841c9beda84810daf9ed7ea80f01cb7aca48cd..0985221fc5cd8d83da4fc613d6ff86696c048e82 100644
--- a/Source/bindings/v8/V8BindingMacros.h
+++ b/Source/bindings/v8/V8BindingMacros.h
@@ -80,28 +80,40 @@ namespace WebCore {
}
#define TONATIVE_DEFAULT_EXCEPTIONSTATE(type, var, value, exceptionState, retVal) \
- type var; \
- { \
- v8::TryCatch block; \
- var = (value); \
- if (UNLIKELY(block.HasCaught())) \
- exceptionState.rethrowV8Exception(block.Exception()); \
- if (UNLIKELY(exceptionState.throwIfNeeded())) \
- return retVal; \
+ type var; \
+ { \
+ v8::TryCatch block; \
+ var = (value); \
+ if (UNLIKELY(block.HasCaught())) \
+ exceptionState.rethrowV8Exception(block.Exception()); \
+ if (UNLIKELY(exceptionState.throwIfNeeded())) \
+ return retVal; \
}
// type is an instance of class template V8StringResource<>,
// but Mode argument varies; using type (not Mode) for consistency
// with other macros and ease of code generation
-#define TOSTRING_VOID(type, var, value) \
- type var(value); \
- if (UNLIKELY(!var.prepare())) \
- return;
+#define TOSTRING_VOID(type, var, value) \
+ type var(value); \
+ if (UNLIKELY(!var.setStringAsPrimitive())) { \
haraken 2014/04/21 03:57:02 Shall we rename as follows? setStringAsPrimitive
yhirano 2014/04/21 04:08:06 Done.
+ v8::TryCatch block; \
+ var.setStringWithToString(); \
+ if (UNLIKELY(block.HasCaught())) { \
+ block.ReThrow(); \
+ return; \
+ } \
+ }
#define TOSTRING_DEFAULT(type, var, value, retVal) \
type var(value); \
- if (UNLIKELY(!var.prepare())) \
- return retVal;
+ if (UNLIKELY(!var.setStringAsPrimitive())) { \
+ v8::TryCatch block; \
+ var.setStringWithToString(); \
+ if (UNLIKELY(block.HasCaught())) { \
+ block.ReThrow(); \
+ return retVal; \
+ } \
+ }
} // namespace WebCore
« no previous file with comments | « no previous file | Source/bindings/v8/V8StringResource.h » ('j') | Source/bindings/v8/V8StringResource.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698