Use const

This commit is contained in:
Jessica Lord 2016-01-14 14:20:06 -08:00
parent ab8908a4af
commit 5412ecdcc1
7 changed files with 87 additions and 100 deletions

View file

@ -1,15 +1,14 @@
var EventEmitter, deprecate, ipc, ipcRenderer, method, ref, const ipcRenderer = require('electron').ipcRenderer;
slice = [].slice; const deprecate = require('electron').deprecate;
const EventEmitter = require('events').EventEmitter;
ref = require('electron'), ipcRenderer = ref.ipcRenderer, deprecate = ref.deprecate; var slice = [].slice;
EventEmitter = require('events').EventEmitter;
// This module is deprecated, we mirror everything from ipcRenderer. // This module is deprecated, we mirror everything from ipcRenderer.
deprecate.warn('ipc module', 'require("electron").ipcRenderer'); deprecate.warn('ipc module', 'require("electron").ipcRenderer');
// Routes events of ipcRenderer. // Routes events of ipcRenderer.
ipc = new EventEmitter; var ipc = new EventEmitter;
ipcRenderer.emit = function() { ipcRenderer.emit = function() {
var args, channel, event; var args, channel, event;
@ -19,7 +18,7 @@ ipcRenderer.emit = function() {
}; };
// Deprecated. // Deprecated.
for (method in ipcRenderer) { for (var method in ipcRenderer) {
if (method.startsWith('send')) { if (method.startsWith('send')) {
ipc[method] = ipcRenderer[method]; ipc[method] = ipcRenderer[method];
} }

View file

@ -1,14 +1,13 @@
var CallbacksRegistry, browserModules, builtinCache, callbacksRegistry, createRemoteMemberFunction, createRemoteMemberProperty, fn, ipcRenderer, isCircular, metaToPlainObject, metaToValue, moduleCache, name, processCache, ref, v8Util, webContentsCache, windowCache, wrapArgs, const ipcRenderer = require('electron').ipcRenderer;
indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; }; const CallbacksRegistry = require('electron').CallbacksRegistry;
const v8Util = process.atomBinding('v8_util');
ref = require('electron'), ipcRenderer = ref.ipcRenderer, CallbacksRegistry = ref.CallbacksRegistry; const callbacksRegistry = new CallbacksRegistry;
v8Util = process.atomBinding('v8_util'); var indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
callbacksRegistry = new CallbacksRegistry;
// Check for circular reference. // Check for circular reference.
isCircular = function(field, visited) { var isCircular = function(field, visited) {
if (typeof field === 'object') { if (typeof field === 'object') {
if (indexOf.call(visited, field) >= 0) { if (indexOf.call(visited, field) >= 0) {
return true; return true;
@ -19,7 +18,7 @@ isCircular = function(field, visited) {
}; };
// Convert the arguments object into an array of meta data. // Convert the arguments object into an array of meta data.
wrapArgs = function(args, visited) { var wrapArgs = function(args, visited) {
var valueToMeta; var valueToMeta;
if (visited == null) { if (visited == null) {
visited = []; visited = [];
@ -87,7 +86,7 @@ wrapArgs = function(args, visited) {
}; };
// Convert meta data from browser into real value. // Convert meta data from browser into real value.
metaToValue = function(meta) { var metaToValue = function(meta) {
var RemoteFunction, el, i, j, len, len1, member, ref1, ref2, results, ret; var RemoteFunction, el, i, j, len, len1, member, ref1, ref2, results, ret;
switch (meta.type) { switch (meta.type) {
case 'value': case 'value':
@ -169,7 +168,7 @@ metaToValue = function(meta) {
}; };
// Construct a plain object from the meta. // Construct a plain object from the meta.
metaToPlainObject = function(meta) { var metaToPlainObject = function(meta) {
var i, len, name, obj, ref1, ref2, value; var i, len, name, obj, ref1, ref2, value;
obj = (function() { obj = (function() {
switch (meta.type) { switch (meta.type) {
@ -190,7 +189,7 @@ metaToPlainObject = function(meta) {
// Create a RemoteMemberFunction instance. // Create a RemoteMemberFunction instance.
// This function's content should not be inlined into metaToValue, otherwise V8 // This function's content should not be inlined into metaToValue, otherwise V8
// may consider it circular reference. // may consider it circular reference.
createRemoteMemberFunction = function(metaId, name) { var createRemoteMemberFunction = function(metaId, name) {
var RemoteMemberFunction; var RemoteMemberFunction;
return RemoteMemberFunction = (function() { return RemoteMemberFunction = (function() {
function RemoteMemberFunction() { function RemoteMemberFunction() {
@ -216,7 +215,7 @@ createRemoteMemberFunction = function(metaId, name) {
// Create configuration for defineProperty. // Create configuration for defineProperty.
// This function's content should not be inlined into metaToValue, otherwise V8 // This function's content should not be inlined into metaToValue, otherwise V8
// may consider it circular reference. // may consider it circular reference.
createRemoteMemberProperty = function(metaId, name) { var createRemoteMemberProperty = function(metaId, name) {
return { return {
enumerable: true, enumerable: true,
configurable: false, configurable: false,
@ -245,25 +244,24 @@ ipcRenderer.on('ATOM_RENDERER_RELEASE_CALLBACK', function(event, id) {
}); });
// List all built-in modules in browser process. // List all built-in modules in browser process.
browserModules = require('../../../browser/api/lib/exports/electron'); const browserModules = require('../../../browser/api/lib/exports/electron');
// And add a helper receiver for each one. // And add a helper receiver for each one.
fn = function(name) { var fn = function(name) {
return Object.defineProperty(exports, name, { return Object.defineProperty(exports, name, {
get: function() { get: function() {
return exports.getBuiltin(name); return exports.getBuiltin(name);
} }
}); });
}; };
for (name in browserModules) { for (var name in browserModules) {
fn(name); fn(name);
} }
// Get remote module. // Get remote module.
// (Just like node's require, the modules are cached permanently, note that this // (Just like node's require, the modules are cached permanently, note that this
// is safe leak since the object is not expected to get freed in browser) // is safe leak since the object is not expected to get freed in browser)
moduleCache = {}; var moduleCache = {};
exports.require = function(module) { exports.require = function(module) {
var meta; var meta;
@ -274,13 +272,11 @@ exports.require = function(module) {
return moduleCache[module] = metaToValue(meta); return moduleCache[module] = metaToValue(meta);
}; };
// Optimize require('electron'). // Optimize require('electron').
moduleCache.electron = exports; moduleCache.electron = exports;
// Alias to remote.require('electron').xxx. // Alias to remote.require('electron').xxx.
builtinCache = {}; var builtinCache = {};
exports.getBuiltin = function(module) { exports.getBuiltin = function(module) {
var meta; var meta;
@ -292,7 +288,7 @@ exports.getBuiltin = function(module) {
}; };
// Get current BrowserWindow object. // Get current BrowserWindow object.
windowCache = null; var windowCache = null;
exports.getCurrentWindow = function() { exports.getCurrentWindow = function() {
var meta; var meta;
@ -304,7 +300,7 @@ exports.getCurrentWindow = function() {
}; };
// Get current WebContents object. // Get current WebContents object.
webContentsCache = null; var webContentsCache = null;
exports.getCurrentWebContents = function() { exports.getCurrentWebContents = function() {
var meta; var meta;
@ -323,7 +319,7 @@ exports.getGlobal = function(name) {
}; };
// Get the process object in browser. // Get the process object in browser.
processCache = null; var processCache = null;
exports.__defineGetter__('process', function() { exports.__defineGetter__('process', function() {
if (processCache == null) { if (processCache == null) {

View file

@ -1,14 +1,9 @@
'user strict'; 'user strict';
var Module, arg, error, error1, events, globalPaths, i, len, nodeIntegration, path, pathname, preloadScript, ref, url, v8Util; const events = require('events');
const path = require('path');
events = require('events'); const url = require('url');
const Module = require('module');
path = require('path');
url = require('url');
Module = require('module');
// We modified the original process.argv to let node.js load the // We modified the original process.argv to let node.js load the
@ -23,7 +18,7 @@ require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'reset-search-paths
// Import common settings. // Import common settings.
require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'init')); require(path.resolve(__dirname, '..', '..', 'common', 'lib', 'init'));
globalPaths = Module.globalPaths; var globalPaths = Module.globalPaths;
if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) { if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib')); globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib'));
@ -33,7 +28,7 @@ if (!process.env.ELECTRON_HIDE_INTERNAL_MODULES) {
globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib', 'exports')); globalPaths.push(path.resolve(__dirname, '..', 'api', 'lib', 'exports'));
// The global variable will be used by ipc for event dispatching // The global variable will be used by ipc for event dispatching
v8Util = process.atomBinding('v8_util'); var v8Util = process.atomBinding('v8_util');
v8Util.setHiddenValue(global, 'ipc', new events.EventEmitter); v8Util.setHiddenValue(global, 'ipc', new events.EventEmitter);
@ -46,11 +41,13 @@ electron.ipcRenderer.on('ELECTRON_INTERNAL_RENDERER_WEB_FRAME_METHOD', (event, m
}); });
// Process command line arguments. // Process command line arguments.
nodeIntegration = 'false'; var nodeIntegration = 'false';
var preloadScript = null;
ref = process.argv; var ref = process.argv;
var i, len;
for (i = 0, len = ref.length; i < len; i++) { for (i = 0, len = ref.length; i < len; i++) {
arg = ref[i]; var arg = ref[i];
if (arg.indexOf('--guest-instance-id=') === 0) { if (arg.indexOf('--guest-instance-id=') === 0) {
// This is a guest web view. // This is a guest web view.
process.guestInstanceId = parseInt(arg.substr(arg.indexOf('=') + 1)); process.guestInstanceId = parseInt(arg.substr(arg.indexOf('=') + 1));
@ -90,7 +87,7 @@ if (nodeIntegration === 'true' || nodeIntegration === 'all' || nodeIntegration =
// Set the __filename to the path of html file if it is file: protocol. // Set the __filename to the path of html file if it is file: protocol.
if (window.location.protocol === 'file:') { if (window.location.protocol === 'file:') {
pathname = process.platform === 'win32' && window.location.pathname[0] === '/' ? window.location.pathname.substr(1) : window.location.pathname; var pathname = process.platform === 'win32' && window.location.pathname[0] === '/' ? window.location.pathname.substr(1) : window.location.pathname;
global.__filename = path.normalize(decodeURIComponent(pathname)); global.__filename = path.normalize(decodeURIComponent(pathname));
global.__dirname = path.dirname(global.__filename); global.__dirname = path.dirname(global.__filename);
@ -132,8 +129,7 @@ if (nodeIntegration === 'true' || nodeIntegration === 'all' || nodeIntegration =
if (preloadScript) { if (preloadScript) {
try { try {
require(preloadScript); require(preloadScript);
} catch (error1) { } catch (error) {
error = error1;
if (error.code === 'MODULE_NOT_FOUND') { if (error.code === 'MODULE_NOT_FOUND') {
console.error("Unable to load preload script " + preloadScript); console.error("Unable to load preload script " + preloadScript);
} else { } else {

View file

@ -1,18 +1,18 @@
var BrowserWindowProxy, a, getHistoryOperation, ipcRenderer, ref, remote, resolveURL, sendHistoryOperation, const ipcRenderer = require('electron').ipcRenderer;
slice = [].slice; const remote = require('electron').remote;
ref = require('electron'), ipcRenderer = ref.ipcRenderer, remote = ref.remote; var slice = [].slice;
// Helper function to resolve relative url. // Helper function to resolve relative url.
a = window.top.document.createElement('a'); var a = window.top.document.createElement('a');
resolveURL = function(url) { var resolveURL = function(url) {
a.href = url; a.href = url;
return a.href; return a.href;
}; };
// Window object returned by "window.open". // Window object returned by "window.open".
BrowserWindowProxy = (function() { var BrowserWindowProxy = (function() {
BrowserWindowProxy.proxies = {}; BrowserWindowProxy.proxies = {};
BrowserWindowProxy.getOrCreate = function(guestId) { BrowserWindowProxy.getOrCreate = function(guestId) {
@ -180,13 +180,13 @@ ipcRenderer.on('ATOM_SHELL_GUEST_WINDOW_POSTMESSAGE', function(event, sourceId,
}); });
// Forward history operations to browser. // Forward history operations to browser.
sendHistoryOperation = function() { var sendHistoryOperation = function() {
var args; var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : []; args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
return ipcRenderer.send.apply(ipcRenderer, ['ATOM_SHELL_NAVIGATION_CONTROLLER'].concat(slice.call(args))); return ipcRenderer.send.apply(ipcRenderer, ['ATOM_SHELL_NAVIGATION_CONTROLLER'].concat(slice.call(args)));
}; };
getHistoryOperation = function() { var getHistoryOperation = function() {
var args; var args;
args = 1 <= arguments.length ? slice.call(arguments, 0) : []; args = 1 <= arguments.length ? slice.call(arguments, 0) : [];
return ipcRenderer.sendSync.apply(ipcRenderer, ['ATOM_SHELL_SYNC_NAVIGATION_CONTROLLER'].concat(slice.call(args))); return ipcRenderer.sendSync.apply(ipcRenderer, ['ATOM_SHELL_SYNC_NAVIGATION_CONTROLLER'].concat(slice.call(args)));

View file

@ -1,11 +1,10 @@
var DEPRECATED_EVENTS, WEB_VIEW_EVENTS, dispatchEvent, ipcRenderer, ref, requestId, webFrame, const ipcRenderer = require('electron').ipcRenderer;
slice = [].slice; const webFrame = require('electron').webFrame;
ref = require('electron'), ipcRenderer = ref.ipcRenderer, webFrame = ref.webFrame; var slice = [].slice;
var requestId = 0;
requestId = 0; var WEB_VIEW_EVENTS = {
WEB_VIEW_EVENTS = {
'load-commit': ['url', 'isMainFrame'], 'load-commit': ['url', 'isMainFrame'],
'did-finish-load': [], 'did-finish-load': [],
'did-fail-load': ['errorCode', 'errorDescription', 'validatedURL'], 'did-fail-load': ['errorCode', 'errorDescription', 'validatedURL'],
@ -38,11 +37,11 @@ WEB_VIEW_EVENTS = {
'found-in-page': ['result'] 'found-in-page': ['result']
}; };
DEPRECATED_EVENTS = { var DEPRECATED_EVENTS = {
'page-title-updated': 'page-title-set' 'page-title-updated': 'page-title-set'
}; };
dispatchEvent = function() { var dispatchEvent = function() {
var args, domEvent, eventKey, eventName, f, i, j, len, ref1, webView; var args, domEvent, eventKey, eventName, f, i, j, len, ref1, webView;
webView = arguments[0], eventName = arguments[1], eventKey = arguments[2], args = 4 <= arguments.length ? slice.call(arguments, 3) : []; webView = arguments[0], eventName = arguments[1], eventKey = arguments[2], args = 4 <= arguments.length ? slice.call(arguments, 3) : [];
if (DEPRECATED_EVENTS[eventName] != null) { if (DEPRECATED_EVENTS[eventName] != null) {

View file

@ -1,26 +1,23 @@
var AllowTransparencyAttribute, AutosizeAttribute, AutosizeDimensionAttribute, BooleanAttribute, HttpReferrerAttribute, PartitionAttribute, PreloadAttribute, SrcAttribute, UserAgentAttribute, WebViewAttribute, WebViewImpl, a, guestViewInternal, remote, resolveURL, webViewConstants, const WebViewImpl = require('./web-view');
extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, const guestViewInternal = require('./guest-view-internal');
hasProp = {}.hasOwnProperty; const webViewConstants = require('./web-view-constants');
const remote = require('electron').remote;
WebViewImpl = require('./web-view'); var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
guestViewInternal = require('./guest-view-internal'); var hasProp = {}.hasOwnProperty;
webViewConstants = require('./web-view-constants');
remote = require('electron').remote;
// Helper function to resolve url set in attribute. // Helper function to resolve url set in attribute.
a = document.createElement('a'); var a = document.createElement('a');
resolveURL = function(url) { var resolveURL = function(url) {
a.href = url; a.href = url;
return a.href; return a.href;
}; };
// Attribute objects. // Attribute objects.
// Default implementation of a WebView attribute. // Default implementation of a WebView attribute.
WebViewAttribute = (function() { var WebViewAttribute = (function() {
function WebViewAttribute(name, webViewImpl) { function WebViewAttribute(name, webViewImpl) {
this.name = name; this.name = name;
this.value = webViewImpl.webviewNode[name] || ''; this.value = webViewImpl.webviewNode[name] || '';
@ -71,7 +68,7 @@ WebViewAttribute = (function() {
})(); })();
// An attribute that is treated as a Boolean. // An attribute that is treated as a Boolean.
BooleanAttribute = (function(superClass) { var BooleanAttribute = (function(superClass) {
extend(BooleanAttribute, superClass); extend(BooleanAttribute, superClass);
function BooleanAttribute(name, webViewImpl) { function BooleanAttribute(name, webViewImpl) {
@ -95,7 +92,7 @@ BooleanAttribute = (function(superClass) {
})(WebViewAttribute); })(WebViewAttribute);
// Attribute that specifies whether transparency is allowed in the webview. // Attribute that specifies whether transparency is allowed in the webview.
AllowTransparencyAttribute = (function(superClass) { var AllowTransparencyAttribute = (function(superClass) {
extend(AllowTransparencyAttribute, superClass); extend(AllowTransparencyAttribute, superClass);
function AllowTransparencyAttribute(webViewImpl) { function AllowTransparencyAttribute(webViewImpl) {
@ -114,7 +111,7 @@ AllowTransparencyAttribute = (function(superClass) {
})(BooleanAttribute); })(BooleanAttribute);
// Attribute used to define the demension limits of autosizing. // Attribute used to define the demension limits of autosizing.
AutosizeDimensionAttribute = (function(superClass) { var AutosizeDimensionAttribute = (function(superClass) {
extend(AutosizeDimensionAttribute, superClass); extend(AutosizeDimensionAttribute, superClass);
function AutosizeDimensionAttribute(name, webViewImpl) { function AutosizeDimensionAttribute(name, webViewImpl) {
@ -147,7 +144,7 @@ AutosizeDimensionAttribute = (function(superClass) {
})(WebViewAttribute); })(WebViewAttribute);
// Attribute that specifies whether the webview should be autosized. // Attribute that specifies whether the webview should be autosized.
AutosizeAttribute = (function(superClass) { var AutosizeAttribute = (function(superClass) {
extend(AutosizeAttribute, superClass); extend(AutosizeAttribute, superClass);
function AutosizeAttribute(webViewImpl) { function AutosizeAttribute(webViewImpl) {
@ -161,7 +158,7 @@ AutosizeAttribute = (function(superClass) {
})(BooleanAttribute); })(BooleanAttribute);
// Attribute representing the state of the storage partition. // Attribute representing the state of the storage partition.
PartitionAttribute = (function(superClass) { var PartitionAttribute = (function(superClass) {
extend(PartitionAttribute, superClass); extend(PartitionAttribute, superClass);
function PartitionAttribute(webViewImpl) { function PartitionAttribute(webViewImpl) {
@ -189,7 +186,7 @@ PartitionAttribute = (function(superClass) {
})(WebViewAttribute); })(WebViewAttribute);
// Attribute that handles the location and navigation of the webview. // Attribute that handles the location and navigation of the webview.
SrcAttribute = (function(superClass) { var SrcAttribute = (function(superClass) {
extend(SrcAttribute, superClass); extend(SrcAttribute, superClass);
function SrcAttribute(webViewImpl) { function SrcAttribute(webViewImpl) {
@ -292,7 +289,7 @@ SrcAttribute = (function(superClass) {
})(WebViewAttribute); })(WebViewAttribute);
// Attribute specifies HTTP referrer. // Attribute specifies HTTP referrer.
HttpReferrerAttribute = (function(superClass) { var HttpReferrerAttribute = (function(superClass) {
extend(HttpReferrerAttribute, superClass); extend(HttpReferrerAttribute, superClass);
function HttpReferrerAttribute(webViewImpl) { function HttpReferrerAttribute(webViewImpl) {
@ -304,7 +301,7 @@ HttpReferrerAttribute = (function(superClass) {
})(WebViewAttribute); })(WebViewAttribute);
// Attribute specifies user agent // Attribute specifies user agent
UserAgentAttribute = (function(superClass) { var UserAgentAttribute = (function(superClass) {
extend(UserAgentAttribute, superClass); extend(UserAgentAttribute, superClass);
function UserAgentAttribute(webViewImpl) { function UserAgentAttribute(webViewImpl) {
@ -316,7 +313,7 @@ UserAgentAttribute = (function(superClass) {
})(WebViewAttribute); })(WebViewAttribute);
// Attribute that set preload script. // Attribute that set preload script.
PreloadAttribute = (function(superClass) { var PreloadAttribute = (function(superClass) {
extend(PreloadAttribute, superClass); extend(PreloadAttribute, superClass);
function PreloadAttribute(webViewImpl) { function PreloadAttribute(webViewImpl) {

View file

@ -1,26 +1,26 @@
'user strict'; 'user strict';
var WebViewImpl, deprecate, getNextId, guestViewInternal, ipcRenderer, listener, nextId, ref, registerBrowserPluginElement, registerWebViewElement, remote, useCapture, v8Util, webFrame, webViewConstants, const deprecate = require('electron').deprecate;
hasProp = {}.hasOwnProperty, const webFrame = require('electron').webFrame;
slice = [].slice; const remote = require('electron').remote;
const ipcRenderer = require('electron').ipcRenderer;
ref = require('electron'), deprecate = ref.deprecate, webFrame = ref.webFrame, remote = ref.remote, ipcRenderer = ref.ipcRenderer; const v8Util = process.atomBinding('v8_util');
const guestViewInternal = require('./guest-view-internal');
const webViewConstants = require('./web-view-constants');
v8Util = process.atomBinding('v8_util'); var hasProp = {}.hasOwnProperty;
var slice = [].slice;
guestViewInternal = require('./guest-view-internal');
webViewConstants = require('./web-view-constants');
// ID generator. // ID generator.
nextId = 0; var nextId = 0;
getNextId = function() { var getNextId = function() {
return ++nextId; return ++nextId;
}; };
// Represents the internal state of the WebView node. // Represents the internal state of the WebView node.
WebViewImpl = (function() { var WebViewImpl = (function() {
function WebViewImpl(webviewNode) { function WebViewImpl(webviewNode) {
var shadowRoot; var shadowRoot;
this.webviewNode = webviewNode; this.webviewNode = webviewNode;
@ -274,7 +274,7 @@ WebViewImpl = (function() {
})(); })();
// Registers browser plugin <object> custom element. // Registers browser plugin <object> custom element.
registerBrowserPluginElement = function() { var registerBrowserPluginElement = function() {
var proto; var proto;
proto = Object.create(HTMLObjectElement.prototype); proto = Object.create(HTMLObjectElement.prototype);
proto.createdCallback = function() { proto.createdCallback = function() {
@ -310,7 +310,7 @@ registerBrowserPluginElement = function() {
}; };
// Registers <webview> custom element. // Registers <webview> custom element.
registerWebViewElement = function() { var registerWebViewElement = function() {
var createBlockHandler, createNonBlockHandler, i, j, len, len1, m, methods, nonblockMethods, proto; var createBlockHandler, createNonBlockHandler, i, j, len, len1, m, methods, nonblockMethods, proto;
proto = Object.create(HTMLObjectElement.prototype); proto = Object.create(HTMLObjectElement.prototype);
proto.createdCallback = function() { proto.createdCallback = function() {
@ -444,9 +444,9 @@ registerWebViewElement = function() {
return delete proto.attributeChangedCallback; return delete proto.attributeChangedCallback;
}; };
useCapture = true; var useCapture = true;
listener = function(event) { var listener = function(event) {
if (document.readyState === 'loading') { if (document.readyState === 'loading') {
return; return;
} }