Use const instead of var

This commit is contained in:
Kevin Sawicki 2017-02-22 14:15:59 -08:00
parent f4717b34e9
commit 7564a9973b

View file

@ -264,8 +264,7 @@ const registerBrowserPluginElement = function () {
this.style.flex = '1 1 auto'
}
proto.attributeChangedCallback = function (name, oldValue, newValue) {
var internal
internal = v8Util.getHiddenValue(this, 'internal')
const internal = v8Util.getHiddenValue(this, 'internal')
if (internal) {
internal.handleBrowserPluginAttributeMutation(name, oldValue, newValue)
}
@ -285,21 +284,19 @@ const registerBrowserPluginElement = function () {
}
// Registers <webview> custom element.
var registerWebViewElement = function () {
const registerWebViewElement = function () {
const proto = Object.create(HTMLObjectElement.prototype)
proto.createdCallback = function () {
return new WebViewImpl(this)
}
proto.attributeChangedCallback = function (name, oldValue, newValue) {
var internal
internal = v8Util.getHiddenValue(this, 'internal')
const internal = v8Util.getHiddenValue(this, 'internal')
if (internal) {
internal.handleWebviewAttributeMutation(name, oldValue, newValue)
}
}
proto.detachedCallback = function () {
var internal
internal = v8Util.getHiddenValue(this, 'internal')
const internal = v8Util.getHiddenValue(this, 'internal')
if (!internal) {
return
}
@ -309,8 +306,7 @@ var registerWebViewElement = function () {
internal.reset()
}
proto.attachedCallback = function () {
var internal, instance
internal = v8Util.getHiddenValue(this, 'internal')
const internal = v8Util.getHiddenValue(this, 'internal')
if (!internal) {
return
}
@ -318,7 +314,7 @@ var registerWebViewElement = function () {
ipcRenderer.on('ELECTRON_RENDERER_WINDOW_VISIBILITY_CHANGE', internal.onVisibilityChanged)
guestViewInternal.registerEvents(internal, internal.viewInstanceId)
internal.elementAttached = true
instance = internal.attributes[webViewConstants.ATTRIBUTE_GUESTINSTANCE].getValue()
const instance = internal.attributes[webViewConstants.ATTRIBUTE_GUESTINSTANCE].getValue()
if (instance) {
internal.attachGuestInstance(instance)
} else {