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

Side by Side Diff: Source/bindings/v8/custom/V8InjectedScriptHostCustom.cpp

Issue 289423002: DevTools: added injectedScript.evaluateWithDetails, that return exception details if it occured (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | Source/core/inspector/InjectedScriptSource.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007-2011 Google Inc. All rights reserved. 2 * Copyright (C) 2007-2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 return; 326 return;
327 } 327 }
328 328
329 v8::Handle<v8::String> expression = info[0]->ToString(); 329 v8::Handle<v8::String> expression = info[0]->ToString();
330 if (expression.IsEmpty()) { 330 if (expression.IsEmpty()) {
331 isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(iso late, "The argument must be a string."))); 331 isolate->ThrowException(v8::Exception::Error(v8::String::NewFromUtf8(iso late, "The argument must be a string.")));
332 return; 332 return;
333 } 333 }
334 334
335 ASSERT(!isolate->GetCurrentContext().IsEmpty()); 335 ASSERT(!isolate->GetCurrentContext().IsEmpty());
336 v8::TryCatch tryCatch;
337 v8::Handle<v8::Value> result = V8ScriptRunner::compileAndRunInternalScript(e xpression, info.GetIsolate()); 336 v8::Handle<v8::Value> result = V8ScriptRunner::compileAndRunInternalScript(e xpression, info.GetIsolate());
338 if (tryCatch.HasCaught()) {
339 v8SetReturnValue(info, tryCatch.ReThrow());
vsevik 2014/05/20 08:23:10 Let's move on with SetVerbose instead.
340 return;
341 }
342 v8SetReturnValue(info, result); 337 v8SetReturnValue(info, result);
343 } 338 }
344 339
345 void V8InjectedScriptHost::setFunctionVariableValueMethodCustom(const v8::Functi onCallbackInfo<v8::Value>& info) 340 void V8InjectedScriptHost::setFunctionVariableValueMethodCustom(const v8::Functi onCallbackInfo<v8::Value>& info)
346 { 341 {
347 v8::Handle<v8::Value> functionValue = info[0]; 342 v8::Handle<v8::Value> functionValue = info[0];
348 int scopeIndex = info[1]->Int32Value(); 343 int scopeIndex = info[1]->Int32Value();
349 String variableName = toCoreStringWithUndefinedOrNullCheck(info[2]); 344 String variableName = toCoreStringWithUndefinedOrNullCheck(info[2]);
350 v8::Handle<v8::Value> newValue = info[3]; 345 v8::Handle<v8::Value> newValue = info[3];
351 346
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
441 OwnPtr<v8::Handle<v8::Value>[]> argv = adoptArrayPtr(new v8::Handle<v8::Valu e>[argc]); 436 OwnPtr<v8::Handle<v8::Value>[]> argv = adoptArrayPtr(new v8::Handle<v8::Valu e>[argc]);
442 for (size_t i = 0; i < argc; ++i) 437 for (size_t i = 0; i < argc; ++i)
443 argv[i] = info[i + 2]; 438 argv[i] = info[i + 2];
444 439
445 v8::Local<v8::Value> result = function->Call(receiver, argc, argv.get()); 440 v8::Local<v8::Value> result = function->Call(receiver, argc, argv.get());
446 debugServer.unmuteWarningsAndDeprecations(); 441 debugServer.unmuteWarningsAndDeprecations();
447 v8SetReturnValue(info, result); 442 v8SetReturnValue(info, result);
448 } 443 }
449 444
450 } // namespace WebCore 445 } // namespace WebCore
OLDNEW
« no previous file with comments | « no previous file | Source/core/inspector/InjectedScriptSource.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698