Remove unneeded returns
This commit is contained in:
parent
8e834e9047
commit
3053be345b
4 changed files with 39 additions and 44 deletions
|
@ -32,7 +32,7 @@ class WebViewAttribute {
|
|||
|
||||
// Sets the attribute's value.
|
||||
setValue (value) {
|
||||
return this.webViewImpl.webviewNode.setAttribute(this.name, value || '')
|
||||
this.webViewImpl.webviewNode.setAttribute(this.name, value || '')
|
||||
}
|
||||
|
||||
// Changes the attribute's value without triggering its mutation handler.
|
||||
|
@ -67,9 +67,9 @@ class BooleanAttribute extends WebViewAttribute {
|
|||
|
||||
setValue (value) {
|
||||
if (!value) {
|
||||
return this.webViewImpl.webviewNode.removeAttribute(this.name)
|
||||
this.webViewImpl.webviewNode.removeAttribute(this.name)
|
||||
} else {
|
||||
return this.webViewImpl.webviewNode.setAttribute(this.name, '')
|
||||
this.webViewImpl.webviewNode.setAttribute(this.name, '')
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ class AutosizeDimensionAttribute extends WebViewAttribute {
|
|||
if (!this.webViewImpl.guestInstanceId) {
|
||||
return
|
||||
}
|
||||
return guestViewInternal.setSize(this.webViewImpl.guestInstanceId, {
|
||||
guestViewInternal.setSize(this.webViewImpl.guestInstanceId, {
|
||||
enableAutoSize: this.webViewImpl.attributes[webViewConstants.ATTRIBUTE_AUTOSIZE].getValue(),
|
||||
min: {
|
||||
width: parseInt(this.webViewImpl.attributes[webViewConstants.ATTRIBUTE_MINWIDTH].getValue() || 0),
|
||||
|
@ -125,7 +125,7 @@ class PartitionAttribute extends WebViewAttribute {
|
|||
}
|
||||
if (newValue === 'persist:') {
|
||||
this.validPartitionId = false
|
||||
return window.console.error(webViewConstants.ERROR_MSG_INVALID_PARTITION_ATTRIBUTE)
|
||||
window.console.error(webViewConstants.ERROR_MSG_INVALID_PARTITION_ATTRIBUTE)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -141,18 +141,15 @@ class GuestInstanceAttribute extends WebViewAttribute {
|
|||
if (this.webViewImpl.webviewNode.hasAttribute(this.name)) {
|
||||
return parseInt(this.webViewImpl.webviewNode.getAttribute(this.name))
|
||||
}
|
||||
return undefined
|
||||
}
|
||||
|
||||
// Sets the attribute's value.
|
||||
setValue (value) {
|
||||
if (!value) {
|
||||
return this.webViewImpl.webviewNode.removeAttribute(this.name)
|
||||
this.webViewImpl.webviewNode.removeAttribute(this.name)
|
||||
} else if (!isNaN(value)) {
|
||||
this.webViewImpl.webviewNode.setAttribute(this.name, value)
|
||||
}
|
||||
if (isNaN(value)) {
|
||||
return
|
||||
}
|
||||
return this.webViewImpl.webviewNode.setAttribute(this.name, value)
|
||||
}
|
||||
|
||||
handleMutation (oldValue, newValue) {
|
||||
|
@ -192,7 +189,7 @@ class SrcAttribute extends WebViewAttribute {
|
|||
// is possible for this change to get picked up asyncronously by src's
|
||||
// mutation observer |observer|, and then get handled even though we do not
|
||||
// want to handle this mutation.
|
||||
return this.observer.takeRecords()
|
||||
this.observer.takeRecords()
|
||||
}
|
||||
|
||||
handleMutation (oldValue, newValue) {
|
||||
|
@ -206,7 +203,7 @@ class SrcAttribute extends WebViewAttribute {
|
|||
this.setValueIgnoreMutation(oldValue)
|
||||
return
|
||||
}
|
||||
return this.parse()
|
||||
this.parse()
|
||||
}
|
||||
|
||||
// The purpose of this mutation observer is to catch assignment to the src
|
||||
|
@ -232,7 +229,7 @@ class SrcAttribute extends WebViewAttribute {
|
|||
attributeOldValue: true,
|
||||
attributeFilter: [this.name]
|
||||
}
|
||||
return this.observer.observe(this.webViewImpl.webviewNode, params)
|
||||
this.observer.observe(this.webViewImpl.webviewNode, params)
|
||||
}
|
||||
|
||||
parse () {
|
||||
|
@ -259,7 +256,7 @@ class SrcAttribute extends WebViewAttribute {
|
|||
opts.userAgent = useragent
|
||||
}
|
||||
guestContents = remote.getGuestWebContents(this.webViewImpl.guestInstanceId)
|
||||
return guestContents.loadURL(this.getValue(), opts)
|
||||
guestContents.loadURL(this.getValue(), opts)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue