Commit 5b17ac06 authored by Henrique Nakashima's avatar Henrique Nakashima Committed by Commit Bot

In the PDF Viewer .js, throw Error objects instead of strings.

As per the style guide.

Change-Id: Ie8519eba699a66c224fb669b782627af276d1872
Reviewed-on: https://chromium-review.googlesource.com/c/1265507Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
Cr-Commit-Position: refs/heads/master@{#597316}
parent 2a68a0f0
......@@ -818,7 +818,7 @@ PDFViewer.prototype = {
*/
setUserInitiated_: function(userInitiated) {
if (this.isUserInitiatedEvent_ == userInitiated) {
throw 'Trying to set user initiated to current value.';
throw new Error('Trying to set user initiated to current value.');
}
this.isUserInitiatedEvent_ = userInitiated;
},
......
......@@ -367,8 +367,9 @@ Viewport.prototype = {
*/
setZoomInternal_: function(newZoom) {
if (!this.allowedToChangeZoom_) {
throw 'Called Viewport.setZoomInternal_ without calling ' +
'Viewport.mightZoom_.';
throw new Error(
'Called Viewport.setZoomInternal_ without calling ' +
'Viewport.mightZoom_.');
}
// Record the scroll position (relative to the top-left of the window).
var currentScrollPos = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment