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

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

Issue 232563003: API functions returning Promises should not throw exceptions. (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
Index: Source/bindings/v8/V8Binding.h
diff --git a/Source/bindings/v8/V8Binding.h b/Source/bindings/v8/V8Binding.h
index f7349bd84d866209371698d9c3b5aa27d26c791e..9df3459b72321a5246616c4f480e916c9c124d9b 100644
--- a/Source/bindings/v8/V8Binding.h
+++ b/Source/bindings/v8/V8Binding.h
@@ -449,7 +449,10 @@ template<>
struct NativeValueTraits<String> {
static inline String nativeValue(const v8::Handle<v8::Value>& value, v8::Isolate* isolate)
{
- TOSTRING_BOOL(V8StringResource<>, stringValue, value, String());
+ V8StringResource<> stringValue = value;
+ if (UNLIKELY(!stringValue.prepare())) {
+ return String();
+ }
return stringValue;
}
};

Powered by Google App Engine
This is Rietveld 408576698