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

Unified Diff: extensions/renderer/resources/set_icon.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/set_icon.js
diff --git a/extensions/renderer/resources/set_icon.js b/extensions/renderer/resources/set_icon.js
index 883fd673997f849eaef0dc3514f6291131dadfb6..7c02842d9ae7c5e554d6e9dbc721e3e869d29544 100644
--- a/extensions/renderer/resources/set_icon.js
+++ b/extensions/renderer/resources/set_icon.js
@@ -36,14 +36,14 @@ function verifyImageData(imageData, iconSize) {
if (!('width' in imageData) ||
!('height' in imageData) ||
!('data' in imageData)) {
- throw new Error(
+ throw new $Error.self(
'The imageData property must contain an ImageData object or' +
' dictionary of ImageData objects.');
}
if (imageData.width > iconSize ||
imageData.height > iconSize) {
- throw new Error(
+ throw new $Error.self(
'The imageData property must contain an ImageData object that ' +
'is no larger than ' + iconSize + ' pixels square.');
}
@@ -79,7 +79,7 @@ function setIcon(details, callback, name, parameters, actionType) {
{nativeFunction: SetIconCommon});
}
} else {
- throw new Error('imageData property has unexpected type.');
+ throw new $Error.self('imageData property has unexpected type.');
}
} else if ('path' in details) {
if (typeof details.path == 'object') {
@@ -89,7 +89,7 @@ function setIcon(details, callback, name, parameters, actionType) {
if (index == iconSizes.length) {
delete details.path;
if (isEmpty)
- throw new Error('The path property must not be empty.');
+ throw new $Error.self('The path property must not be empty.');
sendRequest(name, [details, callback], parameters,
{nativeFunction: SetIconCommon});
return;
@@ -119,11 +119,11 @@ function setIcon(details, callback, name, parameters, actionType) {
{nativeFunction: SetIconCommon});
});
} else {
- throw new Error('The path property should contain either string or ' +
- 'dictionary of strings.');
+ throw new $Error.self('The path property should contain either string ' +
+ 'or dictionary of strings.');
}
} else {
- throw new Error(
+ throw new $Error.self(
not at google - send to devlin 2014/08/19 16:45:56 new Error() for this whole file (which is horribl
'Either the path or imageData property must be specified.');
}
}

Powered by Google App Engine
This is Rietveld 408576698