Skip to content

Commit bdf6e4a

Browse files
Merge pull request #1539 from glimmerjs/drop-ie11-code
Drop ie11 code
2 parents 6c6c7f0 + 8ed044e commit bdf6e4a

File tree

9 files changed

+32
-500
lines changed

9 files changed

+32
-500
lines changed

packages/@glimmer-workspace/integration-tests/lib/suites/initial-render.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1060,12 +1060,12 @@ export class InitialRenderSuite extends RenderTest {
10601060
@test
10611061
'Integer powers of 2'() {
10621062
const ints = [];
1063-
let i = 9007199254740991; // Number.MAX_SAFE_INTEGER isn't available on IE11
1063+
let i = Number.MAX_SAFE_INTEGER;
10641064
while (i > 1) {
10651065
ints.push(i);
10661066
i = Math.round(i / 2);
10671067
}
1068-
i = -9007199254740991; // Number.MIN_SAFE_INTEGER isn't available on IE11
1068+
i = Number.MIN_SAFE_INTEGER;
10691069
while (i < -1) {
10701070
ints.push(i);
10711071
i = Math.round(i / 2);

packages/@glimmer-workspace/integration-tests/test/chaos-rehydration-test.ts

+1-12
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ import {
2626
test,
2727
} from '..';
2828

29-
// `window.ActiveXObject` is "falsey" in IE11 (but not `undefined` or `false`)
30-
// `"ActiveXObject" in window` returns `true` in all IE versions
31-
// only IE11 will pass _both_ of these conditions
32-
const isIE11 = !(window as any).ActiveXObject && 'ActiveXObject' in window;
33-
3429
abstract class AbstractChaosMonkeyTest extends RenderTest {
3530
abstract renderClientSide(template: string | ComponentBlueprint, context: Dict<unknown>): void;
3631

@@ -247,13 +242,7 @@ class ChaosMonkeyRehydration extends AbstractChaosMonkeyTest {
247242
const b = blockStack();
248243

249244
// assert that we are in a "browser corrected" state (note the `</p>` before the `<div>world!</div>`)
250-
if (isIE11) {
251-
// IE11 doesn't behave the same as modern browsers
252-
this.assertServerOutput(`<p>hello ${b(1)}<div>world!</div>${b(1)}<p></p>`);
253-
} else {
254-
this.assertServerOutput(`<p>hello ${b(1)}</p><div>world!</div>${b(1)}<p></p>`);
255-
}
256-
245+
this.assertServerOutput(`<p>hello ${b(1)}</p><div>world!</div>${b(1)}<p></p>`);
257246
this.runIterations(template, context, '<p>hello <div>world!</div></p>', 100);
258247
}
259248
}

packages/@glimmer-workspace/integration-tests/test/initial-render-test.ts

+1-12
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ import {
2929
toTextContent,
3030
} from '..';
3131

32-
// `window.ActiveXObject` is "falsey" in IE11 (but not `undefined` or `false`)
33-
// `"ActiveXObject" in window` returns `true` in all IE versions
34-
// only IE11 will pass _both_ of these conditions
35-
const isIE11 = !(window as any).ActiveXObject && 'ActiveXObject' in window;
36-
3732
class RenderTests extends InitialRenderSuite {
3833
static override suiteName = 'initial render (client)';
3934
override name = 'client';
@@ -1062,13 +1057,7 @@ class RehydratingComponents extends AbstractRehydrationTests {
10621057

10631058
let id = this.testType === 'Dynamic' ? 3 : 2;
10641059

1065-
// assert that we are in a "browser corrected" state (note the `</p>` before the `<div>world!</div>`)
1066-
if (isIE11) {
1067-
// IE11 doesn't behave the same as modern browsers
1068-
this.assertServerComponent(`<p>hello ${b(id)}<div>world!</div>${b(id)}<p></p>`);
1069-
} else {
1070-
this.assertServerComponent(`<p>hello ${b(id)}</p><div>world!</div>${b(id)}<p></p>`);
1071-
}
1060+
this.assertServerComponent(`<p>hello ${b(id)}</p><div>world!</div>${b(id)}<p></p>`);
10721061

10731062
this.renderClientSide(componentToRender, { show: true });
10741063
this.assertComponent('<p>hello <div>world!</div></p>');

packages/@glimmer-workspace/integration-tests/test/modifiers/on-test.ts

+2-13
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ const isChrome = hasDom
3131
? typeof global.chrome === 'object' && !(typeof global.opera === 'object')
3232
: false;
3333
const isFirefox = hasDom ? /Firefox|FxiOS/u.test(navigator.userAgent) : false;
34-
const isIE11 = !global.ActiveXObject && 'ActiveXObject' in window;
3534

3635
interface Counters {
3736
adds: number;
@@ -82,8 +81,6 @@ if (hasDom) {
8281

8382
if (isChrome || isFirefox) {
8483
assert.strictEqual(SUPPORTS_EVENT_OPTIONS, true, 'is true in chrome and firefox');
85-
} else if (isIE11) {
86-
assert.strictEqual(SUPPORTS_EVENT_OPTIONS, false, 'is false in IE11');
8784
}
8885
}
8986

@@ -189,11 +186,7 @@ if (hasDom) {
189186

190187
assert.strictEqual(count, 1, 'has been called 1 times');
191188

192-
if (isIE11) {
193-
this.assertCounts({ adds: 1, removes: 1 });
194-
} else {
195-
this.assertCounts({ adds: 1, removes: 0 });
196-
}
189+
this.assertCounts({ adds: 1, removes: 0 });
197190
}
198191

199192
@test
@@ -226,11 +219,7 @@ if (hasDom) {
226219
button.click();
227220
assert.strictEqual(count, 3, 'is not called again');
228221

229-
if (isIE11) {
230-
this.assertCounts({ adds: 2, removes: 2 });
231-
} else {
232-
this.assertCounts({ adds: 2, removes: 1 });
233-
}
222+
this.assertCounts({ adds: 2, removes: 1 });
234223
}
235224

236225
@test

packages/@glimmer/debug/lib/metadata.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export function strip(strings: TemplateStringsArray, ...args: unknown[]) {
197197
// eslint-disable-next-line regexp/no-super-linear-backtracking
198198
out = /^\s*?\n?([\s\S]*?)\s*$/u.exec(out)![1] as string;
199199

200-
let min = 9007199254740991; // Number.MAX_SAFE_INTEGER isn't available on IE11
200+
let min = Number.MAX_SAFE_INTEGER;
201201

202202
for (let line of out.split('\n')) {
203203
let leading = /^\s*/u.exec(line)![0].length;

packages/@glimmer/runtime/lib/dom/sanitized-values.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,7 @@ function findProtocolForURL() {
7878
}
7979
};
8080
} else {
81-
// fallback for IE11 support
82-
let parsingNode = document.createElement('a');
83-
return (url: string) => {
84-
parsingNode.href = url;
85-
return parsingNode.protocol;
86-
};
81+
throw new Error(`@glimmer/runtime needs a valid "globalThis.URL"`);
8782
}
8883
}
8984

packages/@glimmer/util/test/debug-to-string-test.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
11
import { debugToString as maybeDebugToString } from '@glimmer/util';
2-
// `window.ActiveXObject` is "falsey" in IE11 (but not `undefined` or `false`)
3-
// `"ActiveXObject" in window` returns `true` in all IE versions
4-
// only IE11 will pass _both_ of these conditions
5-
const isIE11 = !(window as any).ActiveXObject && 'ActiveXObject' in window;
62

73
QUnit.module('debug-to-string tests');
84

@@ -37,11 +33,9 @@ if (import.meta.env.DEV) {
3733
QUnit.test('should return debug name for primitive [Infinity]', (assert) => {
3834
assert.deepEqual(debugToString(Infinity), 'Infinity');
3935
});
40-
if (!isIE11) {
41-
QUnit.test('should return debug name for primitive [Symbol]', (assert) => {
42-
assert.deepEqual(debugToString(Symbol('Foo')), 'Symbol(Foo)');
43-
});
44-
}
36+
QUnit.test('should return debug name for primitive [Symbol]', (assert) => {
37+
assert.deepEqual(debugToString(Symbol('Foo')), 'Symbol(Foo)');
38+
});
4539
QUnit.test('should return debug name for object', (assert) => {
4640
assert.deepEqual(debugToString({}), 'Object');
4741
});

packages/@glimmer/validator/lib/debug.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,7 @@ if (import.meta.env.DEV) {
171171
current = current.parent;
172172
}
173173

174-
// TODO: Use String.prototype.repeat here once we can drop support for IE11
175-
return trackingStack.map((label, index) => Array(2 * index + 1).join(' ') + label).join('\n');
174+
return trackingStack.map((label, index) => ' '.repeat(2 * index) + label).join('\n');
176175
};
177176

178177
debug.markTagAsConsumed = (_tag: Tag) => {

0 commit comments

Comments
 (0)