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

Unified Diff: Source/bindings/core/v8/Iterable.h

Issue 1100223003: bindings: Add empty checks for toV8() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebase Created 5 years, 7 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/core/v8/ScriptController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/core/v8/Iterable.h
diff --git a/Source/bindings/core/v8/Iterable.h b/Source/bindings/core/v8/Iterable.h
index 43125b418db3b641bbe4eb1adcf768055dea30a5..75adecc53b3241c160a32d5db1e589711e3a0bba 100644
--- a/Source/bindings/core/v8/Iterable.h
+++ b/Source/bindings/core/v8/Iterable.h
@@ -64,6 +64,11 @@ public:
args[0] = toV8(value, creationContext, isolate);
args[1] = toV8(key, creationContext, isolate);
+ if (args[0].IsEmpty() || args[1].IsEmpty()) {
+ if (tryCatch.HasCaught())
+ exceptionState.rethrowV8Exception(tryCatch.Exception());
+ return;
+ }
v8::Local<v8::Value> result;
if (!V8ScriptRunner::callFunction(v8Callback, scriptState->executionContext(), v8ThisArg, 3, args, isolate).ToLocal(&result)) {
« no previous file with comments | « no previous file | Source/bindings/core/v8/ScriptController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698