Use const instead of var
This commit is contained in:
parent
f4717b34e9
commit
7564a9973b
1 changed files with 6 additions and 10 deletions
|
@ -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 {
|
||||
|
|
Loading…
Reference in a new issue