util: Remove execute_early.

This function was removed in favor of loading everything in
ui_init.js. The asynchronous nature of jQuery 3 document-ready
events may cause an undesirable order in which these are executed.
This commit is contained in:
Cory Lynch
2017-07-03 21:36:12 -04:00
committed by Tim Abbott
parent effd7ef41f
commit b13265d135
2 changed files with 0 additions and 28 deletions

View File

@@ -103,26 +103,6 @@ var _ = global._;
assert(!util.same_recipient(undefined, undefined));
}());
(function test_execute_early() {
var doc = $(document);
doc.one = function (event_name, f) {
assert.equal(event_name, 'phantom_page_loaded');
f();
};
var called = false;
var func = function () { called = true; };
global.page_params.test_suite = true;
util.execute_early(func);
assert(called);
called = false;
global.page_params.test_suite = false;
util.execute_early(func);
assert(called);
}());
(function test_robust_uri_decode() {
assert.equal(util.robust_uri_decode('xxx%3Ayyy'), 'xxx:yyy');
assert.equal(util.robust_uri_decode('xxx%3'), 'xxx');

View File

@@ -197,14 +197,6 @@ exports.CachedValue.prototype = {
},
};
exports.execute_early = function (func) {
if (page_params.test_suite) {
$(document).one('phantom_page_loaded', func);
} else {
$(func);
}
};
exports.is_all_or_everyone_mentioned = function (message_content) {
var all_everyone_re = /(^|\s)(@\*{2}(all|everyone)\*{2})|(@(all|everyone))($|\s)/;
return all_everyone_re.test(message_content);