WIP: Fix electron freezing #2478
base: develop
Are you sure you want to change the base?
Conversation
ipcRenderer.sendToHost("browser-raise", [meta.obj, meta.ev, {result: final, meta: meta}]); | ||
return exp; | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
meta["no-inspect"] = true; | ||
var final = safeStringify(exp); | ||
} | ||
ipcRenderer.sendToHost("browser-raise", [meta.obj, meta.ev, {result: final, meta: meta}]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'final' used out of scope.
var final = cljs.core.pr_str(exp); | ||
} else { | ||
meta["no-inspect"] = true; | ||
var final = safeStringify(exp); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'final' is already defined.
var nodeName = args.name.replace(/\./, "-"); | ||
var code = args.code; | ||
var styleElem = document.createElement("style"); | ||
styleElem.type = "text/css" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
@@ -0,0 +1,110 @@ | |||
(function(window) { | |||
|
|||
const ipcRenderer = require("electron"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).
_send(m.obj, "connect"); | ||
break; | ||
case "register": | ||
eval("funcs['" + m.name + "'] = " + m.func); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eval can be harmful.
if(state.level === 2) { | ||
curEntry.tokens.push({start: stream.start, end: stream.pos, value: stream.current(), type: "atom"}); | ||
} else if(state.level === 3) { | ||
var lastToken = curEntry.tokens[curEntry.tokens.length - 1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'lastToken' is already defined.
stream.start = stream.pos; | ||
} else if(ch.match(chars)) { | ||
stream.start = stream.pos - 1; | ||
var pos = stream.pos; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'pos' is already defined.
if(state.level === 2) { | ||
curEntry.tokens.push({start: stream.start, end: stream.pos, value: stream.current(), type: "keyword"}); | ||
} else if(state.level === 3) { | ||
var lastToken = curEntry.tokens[curEntry.tokens.length - 1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'lastToken' is already defined.
} else { | ||
var expected = "the end of the file"; | ||
if(state.stack[state.stack.length - 1]) { | ||
var expected = opposites[state.stack[state.stack.length - 1].type]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'expected' is already defined.
This pull request introduces 1104 alerts when merging 6b37d26 into 3760844 - view on LGTM.com new alerts:
|
// a stack trace is added to var message above. With this, a stack trace is | ||
// not added until this line (it causes the extra garbage to be added after | ||
// the assertion message instead of in the middle of it). | ||
var e = new goog.asserts.AssertionError('' + message, args || []); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'args' used out of scope.
var args = givenArgs; | ||
} else if (defaultMessage) { | ||
message += ': ' + defaultMessage; | ||
args = defaultArgs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'args' used out of scope.
minLen = arguments[i].length; | ||
} | ||
} | ||
for (var i = 0; i < minLen; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'i' is already defined.
array.push(i); | ||
} | ||
} else { | ||
for (var i = start; i > end; i += step) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'i' is already defined.
return valueCompareFn(obj1.value, obj2.value) || obj1.index - obj2.index; | ||
} | ||
goog.array.sort(compArr, stableCompareFn); | ||
for (var i = 0; i < arr.length; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'i' is already defined.
crate.binding.notifier.prototype.cljs$core$IWatchable$_add_watch$arity$3 = (function (this$,key,f){ | ||
var self__ = this; | ||
var this$__$1 = this; | ||
return this$__$1.watches = cljs.core.assoc.call(null,self__.watches,key,f); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to return a conditional instead of an assignment?
} else { | ||
var vec__12443 = cljs.core.first.call(null,seq__12436__$1); | ||
var key = cljs.core.nth.call(null,vec__12443,(0),null); | ||
var f = cljs.core.nth.call(null,vec__12443,(1),null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'f' is already defined.
continue; | ||
} else { | ||
var vec__12443 = cljs.core.first.call(null,seq__12436__$1); | ||
var key = cljs.core.nth.call(null,vec__12443,(0),null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'key' is already defined.
this.watches = watches; | ||
this.cljs$lang$protocol_mask$partition1$ = 2; | ||
this.cljs$lang$protocol_mask$partition0$ = 0; | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
crate.binding.atom_binding = (function (atm,value_func){ | ||
this.atm = atm; | ||
this.value_func = value_func; | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
goog.async.run.processWorkQueue = function() { | ||
// NOTE: additional work queue items may be added while processing. | ||
var item = null; | ||
while (item = goog.async.run.workQueue_.remove()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected a conditional expression and instead saw an assignment.
* The function used to schedule work asynchronousely. | ||
* @private {function()} | ||
*/ | ||
goog.async.run.schedule_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
return function(cb) { | ||
tail.next = {cb: cb}; | ||
tail = tail.next; | ||
channel['port2'].postMessage(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['port2'] is better written in dot notation.
// Use a fifo linked list to call callbacks in the right order. | ||
var head = {}; | ||
var tail = head; | ||
channel['port1'].onmessage = function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['port1'] is better written in dot notation.
}, this); | ||
win.addEventListener('message', onmessage, false); | ||
this['port1'] = {}; | ||
this['port2'] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['port2'] is better written in dot notation.
var tag_attrs = cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,cljs.core.filter.call(null,((function (vec__12734,_,tag__$1,id,class$,vec__12737,nsp,tag__$2,vec__12731,seq__12732,first__12733,seq__12732__$1,tag,content){ | ||
return (function (p1__12717_SHARP_){ | ||
return !((cljs.core.second.call(null,p1__12717_SHARP_) == null)); | ||
});})(vec__12734,_,tag__$1,id,class$,vec__12737,nsp,tag__$2,vec__12731,seq__12732,first__12733,seq__12732__$1,tag,content)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before ','; readers may interpret this as an expression boundary.
var tag__$2 = cljs.core.nth.call(null,vec__12737,(1),null); | ||
var tag_attrs = cljs.core.into.call(null,cljs.core.PersistentArrayMap.EMPTY,cljs.core.filter.call(null,((function (vec__12734,_,tag__$1,id,class$,vec__12737,nsp,tag__$2,vec__12731,seq__12732,first__12733,seq__12732__$1,tag,content){ | ||
return (function (p1__12717_SHARP_){ | ||
return !((cljs.core.second.call(null,p1__12717_SHARP_) == null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confusing use of '!'.
case 3: | ||
return crate.compiler.dom_attr.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)])); | ||
|
||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreachable 'break' after 'return'.
case 2: | ||
return crate.compiler.dom_attr.cljs$core$IFn$_invoke$arity$2((arguments[(0)]),(arguments[(1)])); | ||
|
||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreachable 'break' after 'return'.
case 3: | ||
return crate.compiler.dom_style.cljs$core$IFn$_invoke$arity$3((arguments[(0)]),(arguments[(1)]),(arguments[(2)])); | ||
|
||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreachable 'break' after 'return'.
*/ | ||
goog.json.serialize = goog.json.USE_NATIVE_JSON ? | ||
/** @type {function(*, ?goog.json.Replacer=):string} */ | ||
(goog.global['JSON']['stringify']) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['JSON'] is better written in dot notation.
['stringify'] is better written in dot notation.
* | ||
* @typedef {function(this:Object, string, *): *} | ||
*/ | ||
goog.json.Reviver; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
* | ||
* @typedef {function(this:Object, string, *): *} | ||
*/ | ||
goog.json.Replacer; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
/** @type {function(string):Object} */ (goog.global['JSON']['parse']) : | ||
function(s) { | ||
return /** @type {Object} */ ( | ||
eval('(' + s + ')')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eval can be harmful.
* @return {Object} The object generated from the JSON string. | ||
*/ | ||
goog.json.unsafeParse = goog.json.USE_NATIVE_JSON ? | ||
/** @type {function(string):Object} */ (goog.global['JSON']['parse']) : |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['JSON'] is better written in dot notation.
['parse'] is better written in dot notation.
* The current key visited during iteration. | ||
* @type {KEY} | ||
*/ | ||
this.currentKey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
* The target key for determining the start of a group. | ||
* @type {KEY} | ||
*/ | ||
this.targetKey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected an assignment or function call and instead saw an expression.
*/ | ||
goog.iter.dropWhile = function(iterable, f, opt_obj) { | ||
var iterator = goog.iter.toIterator(iterable); | ||
var newIter = new goog.iter.Iterator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing '()' invoking a constructor.
*/ | ||
goog.iter.map = function(iterable, f, opt_obj) { | ||
var iterator = goog.iter.toIterator(iterable); | ||
var newIter = new goog.iter.Iterator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing '()' invoking a constructor.
throw Error('Range step argument must not be zero'); | ||
} | ||
|
||
var newIter = new goog.iter.Iterator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing '()' invoking a constructor.
} | ||
|
||
// Send the message via the NIX wrapper object. | ||
this.nixChannel_['SendMessage'](service, payload); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['SendMessage'] is better written in dot notation.
this.nixChannel_ = channel; | ||
|
||
// Ensure that the NIX channel given to use is valid. | ||
var remoteAuthToken = this.nixChannel_['GetAuthToken'](); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['GetAuthToken'] is better written in dot notation.
// wrapper to the container via the channel they gave us. | ||
var theWindow = this.getWindow(); | ||
var getWrapper = theWindow[goog.net.xpc.NixTransport.NIX_GET_WRAPPER]; | ||
this.nixChannel_['CreateChannel'](getWrapper(this, this.authToken_)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['CreateChannel'] is better written in dot notation.
this.nixChannel_ = opener; | ||
|
||
// Ensure that the NIX channel given to use is valid. | ||
var remoteAuthToken = this.nixChannel_['GetAuthToken'](); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['GetAuthToken'] is better written in dot notation.
|
||
try { | ||
listenWindow.execScript(vbscript, 'vbscript'); | ||
listenWindow['nix_setup_complete'] = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['nix_setup_complete'] is better written in dot notation.
})); | ||
var ifr = div.childNodes[0]; | ||
div = null; | ||
ifr['xpcOnload'] = goog.net.xpc.IframeRelayTransport.iframeLoadHandler_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['xpcOnload'] is better written in dot notation.
} | ||
|
||
goog.net.xpc.channels[channelName].xpcDeliver( | ||
service, decodeURIComponent(payload)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'service' used out of scope.
} else { | ||
// There was a fragment id in the header, so this is a message | ||
// fragment, not a whole message. | ||
var service = header.substr(0, pos); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
'service' is already defined.
*/ | ||
goog.net.xpc.IframeRelayTransport.prototype.connect = function() { | ||
if (!this.getWindow()['xpcRelay']) { | ||
this.getWindow()['xpcRelay'] = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['xpcRelay'] is better written in dot notation.
* @override | ||
*/ | ||
goog.net.xpc.IframeRelayTransport.prototype.connect = function() { | ||
if (!this.getWindow()['xpcRelay']) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
['xpcRelay'] is better written in dot notation.
} | ||
} else { | ||
var p = cljs.core.first.call(null,s__19606__$2); | ||
return cljs.core.cons.call(null,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.param","span.param",-2079989519),new cljs.core.Keyword(null,"label","label",1718410804).cljs$core$IFn$_invoke$arity$1(p),(cljs.core.truth_(new cljs.core.Keyword(null,"example","example",-1755779144).cljs$core$IFn$_invoke$arity$1(p))?cljs.core._conj.call(null,(function (){var x__7627__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pre.example","pre.example",-1014445954),new cljs.core.Keyword(null,"example","example",-1755779144).cljs$core$IFn$_invoke$arity$1(p)], null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (cljs, p)
while(true){ | ||
if((i__19607 < size__7572__auto__)){ | ||
var p = cljs.core._nth.call(null,c__7571__auto__,i__19607); | ||
cljs.core.chunk_append.call(null,b__19608,new cljs.core.PersistentVector(null, 3, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"span.param","span.param",-2079989519),new cljs.core.Keyword(null,"label","label",1718410804).cljs$core$IFn$_invoke$arity$1(p),(cljs.core.truth_(new cljs.core.Keyword(null,"example","example",-1755779144).cljs$core$IFn$_invoke$arity$1(p))?cljs.core._conj.call(null,(function (){var x__7627__auto__ = new cljs.core.PersistentVector(null, 2, 5, cljs.core.PersistentVector.EMPTY_NODE, [new cljs.core.Keyword(null,"pre.example","pre.example",-1014445954),new cljs.core.Keyword(null,"example","example",-1755779144).cljs$core$IFn$_invoke$arity$1(p)], null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (cljs, p)
var c__7571__auto__ = cljs.core.chunk_first.call(null,s__19606__$2); | ||
var size__7572__auto__ = cljs.core.count.call(null,c__7571__auto__); | ||
var b__19608 = cljs.core.chunk_buffer.call(null,size__7572__auto__); | ||
if((function (){var i__19607 = (0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (size__7572__auto__, cljs, c__7571__auto__, b__19608)
* | ||
*/ | ||
lt.objs.langs.behaviors.__BEH__behavior_hint_pattern = (function lt$objs$langs$behaviors$__BEH__behavior_hint_pattern(this$){ | ||
return lt.object.merge_BANG_.call(null,this$,new cljs.core.PersistentArrayMap(null, 1, [new cljs.core.Keyword(null,"hint-pattern","hint-pattern",-1622710880),/[\w\-\>\:\*\$\?\<\!\+\.\"\\/]/], null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected escaped character '<' in regular expression.
lt.objs.langs.behaviors.__BEH__show_info_on_move = (function lt$objs$langs$behaviors$__BEH__show_info_on_move(this$){ | ||
var idx = lt.objs.langs.behaviors.__GT_index.call(null,this$); | ||
var map__19589 = lt.objs.langs.behaviors.idx__GT_entry_info.call(null,idx,new cljs.core.Keyword(null,"entries","entries",-86943161).cljs$core$IFn$_invoke$arity$1(cljs.core.deref.call(null,this$))); | ||
var map__19589__$1 = ((((!((map__19589 == null)))?((((map__19589.cljs$lang$protocol_mask$partition0$ & (64))) || (map__19589.cljs$core$ISeq$))?true:false):false))?cljs.core.apply.call(null,cljs.core.hash_map,map__19589):map__19589); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confusing use of '!'.
return (function (){ | ||
var me = this; | ||
return lt.object.raise.call(null,this$,new cljs.core.Keyword(null,"search!","search!",-612546952),lt.util.dom.val.call(null,me)); | ||
});})(e__7942__auto__)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before ','; readers may interpret this as an expression boundary.
return cljs.core.vec.call(null,cljs.core.map.call(null,((function (segs,segs__$1){ | ||
return (function (p1__13561_SHARP_){ | ||
return [cljs.core.str(p1__13561_SHARP_),cljs.core.str(lt.objs.files.separator)].join(''); | ||
});})(segs,segs__$1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Misleading line break before ','; readers may interpret this as an expression boundary.
var cur = start; | ||
var prev = ""; | ||
while(true){ | ||
if(cljs.core.truth_((function (){var or__6793__auto__ = cljs.core.empty_QMARK_.call(null,cur); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functions declared within loops referencing an outer scoped variable may lead to confusing semantics. (cljs, cur, roots, prev)
case 1: | ||
return lt.objs.files.lt_user_dir.cljs$core$IFn$_invoke$arity$1((arguments[(0)])); | ||
|
||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreachable 'break' after 'return'.
case 0: | ||
return lt.objs.files.lt_user_dir.cljs$core$IFn$_invoke$arity$0(); | ||
|
||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unreachable 'break' after 'return'.
This pull request introduces 1170 alerts when merging 17c9c5f into 3760844 - view on LGTM.com new alerts:
|
Experimental PR more commits to follow and changes to be dropped.