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

Unified Diff: extensions/renderer/resources/runtime_custom_bindings.js

Issue 482603002: Unify logic of stack trace generation for extension errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add $Error and $String.indexOf to safe builtins Created 6 years, 4 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: extensions/renderer/resources/runtime_custom_bindings.js
diff --git a/extensions/renderer/resources/runtime_custom_bindings.js b/extensions/renderer/resources/runtime_custom_bindings.js
index 2f0cb4940c4476d56ae4fe1969cb2533d2539d28..1864a86309d32a8253f176702de4433280f6aff1 100644
--- a/extensions/renderer/resources/runtime_custom_bindings.js
+++ b/extensions/renderer/resources/runtime_custom_bindings.js
@@ -139,14 +139,14 @@ binding.registerCustomHook(function(binding, id, contextType) {
connectInfo = arguments[nextArg++];
if (nextArg != arguments.length)
- throw new Error('Invalid arguments to connect.');
+ throw new $Error.self('Invalid arguments to connect.');
not at google - send to devlin 2014/08/19 16:45:56 new Error()
return [targetId, connectInfo];
});
apiFunctions.setUpdateArgumentsPreValidate('connectNative',
function(appName) {
if (typeof(appName) !== 'string') {
- throw new Error('Invalid arguments to connectNative.');
+ throw new $Error.self('Invalid arguments to connectNative.');
not at google - send to devlin 2014/08/19 16:45:56 new Error()
}
return [appName];
});
@@ -155,7 +155,7 @@ binding.registerCustomHook(function(binding, id, contextType) {
// Don't let orphaned content scripts communicate with their extension.
// http://crbug.com/168263
if (unloadEvent.wasDispatched)
- throw new Error('Error connecting to extension ' + targetId);
+ throw new $Error.self('Error connecting to extension ' + targetId);
not at google - send to devlin 2014/08/19 16:45:56 new Error()
if (!targetId)
targetId = runtime.id;
@@ -187,7 +187,7 @@ binding.registerCustomHook(function(binding, id, contextType) {
if (portId >= 0)
return messaging.createPort(portId, '');
}
- throw new Error('Error connecting to native app: ' + nativeAppName);
+ throw new $Error.self('Error connecting to native app: ' + nativeAppName);
not at google - send to devlin 2014/08/19 16:45:56 new Error() ... I think.
});
apiFunctions.setCustomCallback('getBackgroundPage',

Powered by Google App Engine
This is Rietveld 408576698