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

Unified Diff: chrome/renderer/module_system.cc

Issue 10736024: Revert 146038 as it might have broken chromeos browser_tests - Make eventArgumentMassagers asynchro… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 | « chrome/renderer/module_system.h ('k') | chrome/renderer/resources/extensions/event.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/module_system.cc
===================================================================
--- chrome/renderer/module_system.cc (revision 146077)
+++ chrome/renderer/module_system.cc (working copy)
@@ -60,15 +60,12 @@
}
// static
-void ModuleSystem::DumpException(const v8::TryCatch& try_catch) {
- v8::Handle<v8::Message> message(try_catch.Message());
-
+void ModuleSystem::DumpException(v8::Handle<v8::Message> message) {
LOG(ERROR) << "["
<< *v8::String::Utf8Value(
message->GetScriptResourceName()->ToString())
<< "(" << message->GetLineNumber() << ")] "
- << *v8::String::Utf8Value(message->Get())
- << "{" << *v8::String::Utf8Value(try_catch.StackTrace()) << "}";
+ << *v8::String::Utf8Value(message->Get());
}
void ModuleSystem::Require(const std::string& module_name) {
@@ -99,10 +96,8 @@
v8::Handle<v8::String>::Cast(source)));
v8::Handle<v8::Function> func =
v8::Handle<v8::Function>::Cast(RunString(wrapped_source, module_name));
- if (func.IsEmpty()) {
- return ThrowException(std::string(*v8::String::AsciiValue(module_name)) +
- ": Bad source");
- }
+ if (func.IsEmpty())
+ return handle_scope.Close(v8::Handle<v8::Value>());
exports = v8::Object::New();
v8::Handle<v8::Object> natives(NewInstance());
@@ -113,12 +108,7 @@
};
{
WebKit::WebScopedMicrotaskSuppression suppression;
- v8::TryCatch try_catch;
func->Call(global, 3, args);
- if (try_catch.HasCaught()) {
- DumpException(try_catch);
- return v8::Undefined();
- }
}
modules->Set(module_name, exports);
return handle_scope.Close(exports);
@@ -194,15 +184,16 @@
WebKit::WebScopedMicrotaskSuppression suppression;
v8::Handle<v8::Value> result;
v8::TryCatch try_catch;
+ try_catch.SetCaptureMessage(true);
v8::Handle<v8::Script> script(v8::Script::New(code, name));
if (try_catch.HasCaught()) {
- DumpException(try_catch);
+ DumpException(try_catch.Message());
return handle_scope.Close(result);
}
result = script->Run();
if (try_catch.HasCaught())
- DumpException(try_catch);
+ DumpException(try_catch.Message());
return handle_scope.Close(result);
}
« no previous file with comments | « chrome/renderer/module_system.h ('k') | chrome/renderer/resources/extensions/event.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698