From 5122f98198e650f83e948a335e762aeeb306bbaa Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sat, 26 Dec 2020 16:24:24 +0100 Subject: [PATCH] Base+LibJS+LibWeb: Make prettier clean Also use "// prettier-ignore" comments where necessary rather than excluding whole files (via .prettierignore). --- .prettierignore | 3 - Base/res/html/misc/welcome.js | 2 +- Libraries/LibJS/Tests/arguments-object.js | 1 - .../LibJS/Tests/builtins/Array/Array.from.js | 3 +- Libraries/LibJS/Tests/builtins/Date/Date.js | 10 +-- .../Tests/builtins/Proxy/Proxy.handler-get.js | 13 ++-- .../Tests/builtins/Proxy/Proxy.handler-set.js | 2 +- .../builtins/RegExp/RegExp.prototype.flags.js | 1 + .../String/String.prototype.endsWith.js | 5 +- .../LibJS/Tests/classes/class-expressions.js | 15 ++-- .../Tests/functions/function-strict-mode.js | 11 +-- Libraries/LibJS/Tests/loops/break-basic.js | 3 +- Libraries/LibJS/Tests/new-expression.js | 5 +- Libraries/LibJS/Tests/parseInt.js | 70 +++++++++++-------- Libraries/LibJS/Tests/strict-mode-blocks.js | 3 + Libraries/LibJS/Tests/strict-mode-errors.js | 5 +- Libraries/LibJS/Tests/string-escapes.js | 2 + Libraries/LibJS/Tests/test-common.js | 2 +- Libraries/LibJS/Tests/use-strict-directive.js | 1 + Libraries/LibJS/Tests/with-basic.js | 2 +- Libraries/LibWeb/Tests/HTML/HTMLElement.js | 6 +- .../LibWeb/Tests/HTML/HTMLTemplateElement.js | 4 +- Libraries/LibWeb/Tests/HTML/document.body.js | 4 +- Libraries/LibWeb/Tests/test-common.js | 6 +- 24 files changed, 100 insertions(+), 79 deletions(-) delete mode 100644 .prettierignore diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index dca057cb36..0000000000 --- a/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -classes/class-expressions.js -functions/function-strict-mode.js -new-expression.js diff --git a/Base/res/html/misc/welcome.js b/Base/res/html/misc/welcome.js index 07497d0115..83dcbc8886 100644 --- a/Base/res/html/misc/welcome.js +++ b/Base/res/html/misc/welcome.js @@ -1,3 +1,3 @@ -document.addEventListener("DOMContentLoaded", function() { +document.addEventListener("DOMContentLoaded", function () { document.getElementById("ua").innerHTML = navigator.userAgent; }); diff --git a/Libraries/LibJS/Tests/arguments-object.js b/Libraries/LibJS/Tests/arguments-object.js index 4ea19669f8..17d9a141b8 100644 --- a/Libraries/LibJS/Tests/arguments-object.js +++ b/Libraries/LibJS/Tests/arguments-object.js @@ -13,4 +13,3 @@ test("basic arguments object", () => { expect(bar("hello", "friends", ":^)")).toBe("friends"); expect(bar("hello")).toBe(undefined); }); - diff --git a/Libraries/LibJS/Tests/builtins/Array/Array.from.js b/Libraries/LibJS/Tests/builtins/Array/Array.from.js index fe0cdefefc..0a015f8141 100644 --- a/Libraries/LibJS/Tests/builtins/Array/Array.from.js +++ b/Libraries/LibJS/Tests/builtins/Array/Array.from.js @@ -50,8 +50,9 @@ describe("normal behavior", () => { let value = begin - 1; return { next() { - if (value < end) + if (value < end) { value += 1; + } return { value: value, done: value >= end }; }, }; diff --git a/Libraries/LibJS/Tests/builtins/Date/Date.js b/Libraries/LibJS/Tests/builtins/Date/Date.js index e232b79137..cc76212e22 100644 --- a/Libraries/LibJS/Tests/builtins/Date/Date.js +++ b/Libraries/LibJS/Tests/builtins/Date/Date.js @@ -37,7 +37,7 @@ test("tuple constructor", () => { expect(new Date(2019, 11).getMilliseconds()).toBe(0); expect(new Date(2019, 11).getDay()).toBe(0); - let date = new Date(2019, 11, 15, 9, 16, 14, 123); // Note: Month is 0-based. + let date = new Date(2019, 11, 15, 9, 16, 14, 123); // Note: Month is 0-based. expect(date.getFullYear()).toBe(2019); expect(date.getMonth()).toBe(11); expect(date.getDate()).toBe(15); @@ -48,14 +48,14 @@ test("tuple constructor", () => { expect(date.getDay()).toBe(0); // getTime() returns a time stamp in UTC, but we can at least check it's in the right interval, which will be true independent of the local timezone if the range is big enough. - let timestamp_lower_bound = 1575072000000; // 2019-12-01T00:00:00Z - let timestamp_upper_bound = 1577750400000; // 2019-12-31T00:00:00Z + let timestamp_lower_bound = 1575072000000; // 2019-12-01T00:00:00Z + let timestamp_upper_bound = 1577750400000; // 2019-12-31T00:00:00Z expect(date.getTime()).toBeGreaterThan(timestamp_lower_bound); expect(date.getTime()).toBeLessThan(timestamp_upper_bound); }); test("tuple constructor overflow", () => { - let date = new Date(2019, 13, 33, 30, 70, 80, 2345); + let date = new Date(2019, 13, 33, 30, 70, 80, 2345); expect(date.getFullYear()).toBe(2020); expect(date.getMonth()).toBe(2); expect(date.getDate()).toBe(5); @@ -65,7 +65,7 @@ test("tuple constructor overflow", () => { expect(date.getMilliseconds()).toBe(345); expect(date.getDay()).toBe(4); - let date = new Date(2019, -13, -33, -30, -70, -80, -2345); + let date = new Date(2019, -13, -33, -30, -70, -80, -2345); expect(date.getFullYear()).toBe(2017); expect(date.getMonth()).toBe(9); expect(date.getDate()).toBe(26); diff --git a/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-get.js b/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-get.js index 9d9ab486c9..7919b196fe 100644 --- a/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-get.js +++ b/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-get.js @@ -42,11 +42,14 @@ describe("[[Get]] trap normal behavior", () => { }); test("custom receiver value", () => { - let p = new Proxy({}, { - get(target, property, receiver) { - return receiver; - }, - }); + let p = new Proxy( + {}, + { + get(target, property, receiver) { + return receiver; + }, + } + ); expect(Reflect.get(p, "foo", 42)).toBe(42); }); diff --git a/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-set.js b/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-set.js index ef1a75c48a..dd45c51b4b 100644 --- a/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-set.js +++ b/Libraries/LibJS/Tests/builtins/Proxy/Proxy.handler-set.js @@ -40,7 +40,7 @@ describe("[[Set]] trap normal behavior", () => { expect(p.foo).toBe(20); p.foo = 10; expect(p.foo).toBe(10); - p[Symbol.hasInstance] = "foo" + p[Symbol.hasInstance] = "foo"; expect(p[Symbol.hasInstance]).toBe("foo"); }); diff --git a/Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.flags.js b/Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.flags.js index b6445d0b22..9ccc0b614e 100644 --- a/Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.flags.js +++ b/Libraries/LibJS/Tests/builtins/RegExp/RegExp.prototype.flags.js @@ -6,5 +6,6 @@ test("basic functionality", () => { expect(/foo/s.flags).toBe("s"); expect(/foo/u.flags).toBe("u"); expect(/foo/y.flags).toBe("y"); + // prettier-ignore expect(/foo/sgimyu.flags).toBe("gimsuy"); }); diff --git a/Libraries/LibJS/Tests/builtins/String/String.prototype.endsWith.js b/Libraries/LibJS/Tests/builtins/String/String.prototype.endsWith.js index ef39541ce1..286cc6b1b2 100644 --- a/Libraries/LibJS/Tests/builtins/String/String.prototype.endsWith.js +++ b/Libraries/LibJS/Tests/builtins/String/String.prototype.endsWith.js @@ -34,6 +34,9 @@ test("basic functionality", () => { expect(s.endsWith("", -1)).toBeTrue(); expect(s.endsWith("", 42)).toBeTrue(); expect("12undefined".endsWith()).toBeTrue(); - expect(() => s.endsWith(/foobar/)).toThrowWithMessage(TypeError, "searchString is not a string, but a regular expression"); + expect(() => s.endsWith(/foobar/)).toThrowWithMessage( + TypeError, + "searchString is not a string, but a regular expression" + ); expect(s.endsWith("bar", undefined)).toBeTrue(); }); diff --git a/Libraries/LibJS/Tests/classes/class-expressions.js b/Libraries/LibJS/Tests/classes/class-expressions.js index d714b37f63..f67f54ff7f 100644 --- a/Libraries/LibJS/Tests/classes/class-expressions.js +++ b/Libraries/LibJS/Tests/classes/class-expressions.js @@ -1,14 +1,11 @@ -// This file must not be formatted by prettier. Make sure your IDE -// respects the .prettierignore file! - test("basic functionality", () => { const A = class { constructor(x) { - this.x = x; + this.x = x; } getX() { - return this.x * 2; + return this.x * 2; } }; @@ -16,6 +13,7 @@ test("basic functionality", () => { }); test("inline instantiation", () => { + // prettier-ignore const a = new class { constructor() { this.x = 10; @@ -30,6 +28,7 @@ test("inline instantiation", () => { }); test("inline instantiation with argument", () => { + // prettier-ignore const a = new class { constructor(x) { this.x = x; @@ -53,7 +52,7 @@ test("extending class expressions", () => { super(y); this.y = y * 2; } - }; + } const a = new A(10); expect(a.x).toBe(10); @@ -61,9 +60,9 @@ test("extending class expressions", () => { }); test("class expression name", () => { - let A = class {} + let A = class {}; expect(A.name).toBe("A"); - let B = class C {} + let B = class C {}; expect(B.name).toBe("C"); }); diff --git a/Libraries/LibJS/Tests/functions/function-strict-mode.js b/Libraries/LibJS/Tests/functions/function-strict-mode.js index 4c210d0f53..99ec10b9a7 100644 --- a/Libraries/LibJS/Tests/functions/function-strict-mode.js +++ b/Libraries/LibJS/Tests/functions/function-strict-mode.js @@ -1,6 +1,3 @@ -// This file must not be formatted by prettier. Make sure your IDE -// respects the .prettierignore file! - test("non strict-mode by default", () => { expect(isStrictMode()).toBeFalse(); }); @@ -10,21 +7,25 @@ test("use strict with double quotes", () => { expect(isStrictMode()).toBeTrue(); }); +// prettier-ignore test("use strict with single quotes", () => { 'use strict'; expect(isStrictMode()).toBeTrue(); }); +// prettier-ignore test("use strict with backticks does not yield strict mode", () => { `use strict`; expect(isStrictMode()).toBeFalse(); }); +// prettier-ignore test("use strict with single quotes after statement does not yield strict mode code", () => { ;'use strict'; expect(isStrictMode()).toBeFalse(); }); +// prettier-ignore test("use strict with double quotes after statement does not yield strict mode code", () => { ;"use strict"; expect(isStrictMode()).toBeFalse(); @@ -39,14 +40,14 @@ strict"; test("strict mode propagates down the scope chain", () => { "use strict"; expect(isStrictMode()).toBeTrue(); - (function() { + (function () { expect(isStrictMode()).toBeTrue(); })(); }); test("strict mode does not propagate up the scope chain", () => { expect(isStrictMode()).toBeFalse(); - (function() { + (function () { "use strict"; expect(isStrictMode()).toBeTrue(); })(); diff --git a/Libraries/LibJS/Tests/loops/break-basic.js b/Libraries/LibJS/Tests/loops/break-basic.js index 167ee3b9d7..1bb141c618 100644 --- a/Libraries/LibJS/Tests/loops/break-basic.js +++ b/Libraries/LibJS/Tests/loops/break-basic.js @@ -10,8 +10,9 @@ test("Toplevel break inside loop", () => { test("break inside sub-blocks", () => { var j = 0; for (var i = 0; i < 9; ++i) { - if (j == 4) + if (j == 4) { break; + } ++j; } expect(j).toBe(4); diff --git a/Libraries/LibJS/Tests/new-expression.js b/Libraries/LibJS/Tests/new-expression.js index 9c23ce336b..827b156910 100644 --- a/Libraries/LibJS/Tests/new-expression.js +++ b/Libraries/LibJS/Tests/new-expression.js @@ -1,6 +1,4 @@ -// This file must not be formatted by prettier. Make sure your IDE -// respects the .prettierignore file! - +// prettier-ignore test("new-expression parsing", () => { function Foo() { this.x = 1; @@ -21,6 +19,7 @@ test("new-expression parsing", () => { expect(foo).toBe("[object Object]2"); }); +// prettier-ignore test("new-expressions with object keys", () => { let a = { b: function () { diff --git a/Libraries/LibJS/Tests/parseInt.js b/Libraries/LibJS/Tests/parseInt.js index 95e897d7a7..e4115affd0 100644 --- a/Libraries/LibJS/Tests/parseInt.js +++ b/Libraries/LibJS/Tests/parseInt.js @@ -2,33 +2,33 @@ test("basic parseInt() functionality", () => { expect(parseInt("0")).toBe(0); expect(parseInt("100")).toBe(100); expect(parseInt("1000", 16)).toBe(4096); - expect(parseInt('0xF', 16)).toBe(15) - expect(parseInt('F', 16)).toBe(15) - expect(parseInt('17', 8)).toBe(15) - expect(parseInt(021, 8)).toBe(15) - expect(parseInt('015', 10)).toBe(15) - expect(parseInt(15.99, 10)).toBe(15) - expect(parseInt('15,123', 10)).toBe(15) - expect(parseInt('FXX123', 16)).toBe(15) - expect(parseInt('1111', 2)).toBe(15) - expect(parseInt('15 * 3', 10)).toBe(15) - expect(parseInt('15e2', 10)).toBe(15) - expect(parseInt('15px', 10)).toBe(15) - expect(parseInt('12', 13)).toBe(15) - expect(parseInt('Hello', 8)).toBeNaN(); - expect(parseInt('546', 2)).toBeNaN(); - expect(parseInt('-F', 16)).toBe(-15); - expect(parseInt('-0F', 16)).toBe(-15); - expect(parseInt('-0XF', 16)).toBe(-15); + expect(parseInt("0xF", 16)).toBe(15); + expect(parseInt("F", 16)).toBe(15); + expect(parseInt("17", 8)).toBe(15); + expect(parseInt(021, 8)).toBe(15); + expect(parseInt("015", 10)).toBe(15); + expect(parseInt(15.99, 10)).toBe(15); + expect(parseInt("15,123", 10)).toBe(15); + expect(parseInt("FXX123", 16)).toBe(15); + expect(parseInt("1111", 2)).toBe(15); + expect(parseInt("15 * 3", 10)).toBe(15); + expect(parseInt("15e2", 10)).toBe(15); + expect(parseInt("15px", 10)).toBe(15); + expect(parseInt("12", 13)).toBe(15); + expect(parseInt("Hello", 8)).toBeNaN(); + expect(parseInt("546", 2)).toBeNaN(); + expect(parseInt("-F", 16)).toBe(-15); + expect(parseInt("-0F", 16)).toBe(-15); + expect(parseInt("-0XF", 16)).toBe(-15); expect(parseInt(-15.1, 10)).toBe(-15); - expect(parseInt('-17', 8)).toBe(-15); - expect(parseInt('-15', 10)).toBe(-15); - expect(parseInt('-1111', 2)).toBe(-15); - expect(parseInt('-15e1', 10)).toBe(-15); - expect(parseInt('-12', 13)).toBe(-15); + expect(parseInt("-17", 8)).toBe(-15); + expect(parseInt("-15", 10)).toBe(-15); + expect(parseInt("-1111", 2)).toBe(-15); + expect(parseInt("-15e1", 10)).toBe(-15); + expect(parseInt("-12", 13)).toBe(-15); expect(parseInt(4.7, 10)).toBe(4); - expect(parseInt('0e0', 16)).toBe(224); - expect(parseInt('123_456')).toBe(123); + expect(parseInt("0e0", 16)).toBe(224); + expect(parseInt("123_456")).toBe(123); // FIXME: expect(parseInt(4.7 * 1e22, 10)).toBe(4); // FIXME: expect(parseInt(0.00000000000434, 10)).toBe(4); @@ -42,10 +42,18 @@ test("basic parseInt() functionality", () => { }); test("parseInt() radix is coerced to a number", () => { - const obj = { valueOf() { return 8; } }; - expect(parseInt('11', obj)).toBe(9); - obj.valueOf = function() { return 1; } - expect(parseInt('11', obj)).toBeNaN(); - obj.valueOf = function() { return Infinity; } - expect(parseInt('11', obj)).toBe(11); + const obj = { + valueOf() { + return 8; + }, + }; + expect(parseInt("11", obj)).toBe(9); + obj.valueOf = function () { + return 1; + }; + expect(parseInt("11", obj)).toBeNaN(); + obj.valueOf = function () { + return Infinity; + }; + expect(parseInt("11", obj)).toBe(11); }); diff --git a/Libraries/LibJS/Tests/strict-mode-blocks.js b/Libraries/LibJS/Tests/strict-mode-blocks.js index c1fe1a7d24..35d0264664 100644 --- a/Libraries/LibJS/Tests/strict-mode-blocks.js +++ b/Libraries/LibJS/Tests/strict-mode-blocks.js @@ -2,16 +2,19 @@ test("Issue #3641, strict mode should be function- or program-level, not block-l function func() { expect(isStrictMode()).toBeFalse(); + // prettier-ignore { "use strict"; expect(isStrictMode()).toBeFalse(); } + // prettier-ignore if (true) { "use strict"; expect(isStrictMode()).toBeFalse(); } + // prettier-ignore do { "use strict"; expect(isStrictMode()).toBeFalse(); diff --git a/Libraries/LibJS/Tests/strict-mode-errors.js b/Libraries/LibJS/Tests/strict-mode-errors.js index 2b640d1f3c..ada52e359f 100644 --- a/Libraries/LibJS/Tests/strict-mode-errors.js +++ b/Libraries/LibJS/Tests/strict-mode-errors.js @@ -7,6 +7,9 @@ test("basic functionality", () => { }).toThrowWithMessage(TypeError, "Cannot assign property foo to primitive value"); expect(() => { primitive[Symbol.hasInstance] = 123; - }).toThrowWithMessage(TypeError, "Cannot assign property Symbol(Symbol.hasInstance) to primitive value"); + }).toThrowWithMessage( + TypeError, + "Cannot assign property Symbol(Symbol.hasInstance) to primitive value" + ); }); }); diff --git a/Libraries/LibJS/Tests/string-escapes.js b/Libraries/LibJS/Tests/string-escapes.js index 6d3072effc..8a0920361e 100644 --- a/Libraries/LibJS/Tests/string-escapes.js +++ b/Libraries/LibJS/Tests/string-escapes.js @@ -40,7 +40,9 @@ describe("octal escapes", () => { expect("\5").toBe("\u0005"); expect("\6").toBe("\u0006"); expect("\7").toBe("\u0007"); + // prettier-ignore expect("\8").toBe("8"); + // prettier-ignore expect("\9").toBe("9"); expect("\128").toBe("\n8"); expect("\141bc").toBe("abc"); diff --git a/Libraries/LibJS/Tests/test-common.js b/Libraries/LibJS/Tests/test-common.js index 709d270867..4e6d0e62e0 100644 --- a/Libraries/LibJS/Tests/test-common.js +++ b/Libraries/LibJS/Tests/test-common.js @@ -302,7 +302,7 @@ class ExpectationError extends Error { // Test for syntax errors; target must be a string toEval() { this.__expect(typeof this.target === "string"); - const success = canParseSource(this.target) + const success = canParseSource(this.target); this.__expect(this.inverted ? !success : success); } diff --git a/Libraries/LibJS/Tests/use-strict-directive.js b/Libraries/LibJS/Tests/use-strict-directive.js index afd6f8fc75..c0bbd2ed9e 100644 --- a/Libraries/LibJS/Tests/use-strict-directive.js +++ b/Libraries/LibJS/Tests/use-strict-directive.js @@ -6,6 +6,7 @@ test("valid 'use strict; directive", () => { })() ).toBeTrue(); expect( + // prettier-ignore (() => { 'use strict'; return isStrictMode(); diff --git a/Libraries/LibJS/Tests/with-basic.js b/Libraries/LibJS/Tests/with-basic.js index a1029ef621..c2ef01698b 100644 --- a/Libraries/LibJS/Tests/with-basic.js +++ b/Libraries/LibJS/Tests/with-basic.js @@ -1,5 +1,5 @@ test("basic with statement functionality", () => { - var object = { "foo": 5, "bar": 6, "baz": 7 }; + var object = { foo: 5, bar: 6, baz: 7 }; var qux = 1; var bar = 99; diff --git a/Libraries/LibWeb/Tests/HTML/HTMLElement.js b/Libraries/LibWeb/Tests/HTML/HTMLElement.js index 8e113e4865..2950bb45c5 100644 --- a/Libraries/LibWeb/Tests/HTML/HTMLElement.js +++ b/Libraries/LibWeb/Tests/HTML/HTMLElement.js @@ -1,9 +1,9 @@ -loadPage("file:///res/html/misc/welcome.html") +loadPage("file:///res/html/misc/welcome.html"); afterInitialPageLoad(() => { - test("contentEditable attribute", () => { + test("contentEditable attribute", () => { expect(document.body.contentEditable).toBe("inherit"); expect(document.firstChild.nextSibling.nodeName).toBe("html"); expect(document.firstChild.nextSibling.contentEditable).toBe("true"); - }); + }); }); diff --git a/Libraries/LibWeb/Tests/HTML/HTMLTemplateElement.js b/Libraries/LibWeb/Tests/HTML/HTMLTemplateElement.js index 0b74b2196f..dd6c66e1f2 100644 --- a/Libraries/LibWeb/Tests/HTML/HTMLTemplateElement.js +++ b/Libraries/LibWeb/Tests/HTML/HTMLTemplateElement.js @@ -4,7 +4,7 @@ afterInitialPageLoad(() => { test("Basic functionality", () => { const template = document.getElementById("template"); expect(template).not.toBeNull(); - + // The contents of a template element are not children of the actual element. // The document fragment is not a child of the element either. expect(template.firstChild).toBeNull(); @@ -17,7 +17,7 @@ afterInitialPageLoad(() => { expect(templateDiv.nodeName).toBe("div"); expect(templateDiv.textContent).toBe("Hello template!"); }); - + test("Templates are inert (e.g. scripts won't run)", () => { // The page has a template element with a script element in it. // Templates are inert, for example, they won't run scripts. diff --git a/Libraries/LibWeb/Tests/HTML/document.body.js b/Libraries/LibWeb/Tests/HTML/document.body.js index d099b4e49c..9fc1907583 100644 --- a/Libraries/LibWeb/Tests/HTML/document.body.js +++ b/Libraries/LibWeb/Tests/HTML/document.body.js @@ -49,7 +49,7 @@ afterInitialPageLoad(() => { // FIXME: Add this in once removeChild is implemented. test.skip("Nullable", () => { - document.documentElement.removeChild(document.body); - expect(document.body).toBeNull(); + document.documentElement.removeChild(document.body); + expect(document.body).toBeNull(); }); }); diff --git a/Libraries/LibWeb/Tests/test-common.js b/Libraries/LibWeb/Tests/test-common.js index f0abf3f8c5..7fc4f914bf 100644 --- a/Libraries/LibWeb/Tests/test-common.js +++ b/Libraries/LibWeb/Tests/test-common.js @@ -25,7 +25,7 @@ let __AfterInitialPageLoad__ = () => {}; let afterInitialPageLoad; (() => { - loadPage = (page) => __PageToLoad__ = page; - beforeInitialPageLoad = (callback) => __BeforeInitialPageLoad__ = callback; - afterInitialPageLoad = (callback) => __AfterInitialPageLoad__ = callback; + loadPage = page => (__PageToLoad__ = page); + beforeInitialPageLoad = callback => (__BeforeInitialPageLoad__ = callback); + afterInitialPageLoad = callback => (__AfterInitialPageLoad__ = callback); })();