Skip to content
This repository was archived by the owner on Aug 1, 2024. It is now read-only.

Commit b15ae93

Browse files
concavelenzcopybara-github
authored andcommitted
Remove obvious special cases for IE10 and below.
RELNOTES: Drop support for IE10 PiperOrigin-RevId: 484648225 Change-Id: Ia035e0be683b0c2e4028c46d821826c720e80dfa
1 parent 9979d6c commit b15ae93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+407
-1149
lines changed

closure/goog/crypt/base64.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,9 +421,6 @@ goog.crypt.base64.decodeStringToByteArray = function(input, opt_ignored) {
421421
*/
422422
goog.crypt.base64.decodeStringToUint8Array = function(input) {
423423
'use strict';
424-
goog.asserts.assert(
425-
!goog.userAgent.IE || goog.userAgent.isVersionOrHigher('10'),
426-
'Browser does not support typed arrays');
427424
var len = input.length;
428425
// Approximate the length of the array needed for output.
429426
// Our method varies according to the format of the input, which we can

closure/goog/crypt/sha2_64bit_test.js

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ const Sha512_256 = goog.require('goog.crypt.Sha512_256');
1313
const crypt = goog.require('goog.crypt');
1414
const hashTester = goog.require('goog.crypt.hashTester');
1515
const testSuite = goog.require('goog.testing.testSuite');
16-
const userAgent = goog.require('goog.userAgent');
1716

1817
/**
1918
* Each object in the test vector array is a source text and one or more
@@ -163,16 +162,13 @@ testSuite({
163162

164163
/** Test one really large string using SHA512 */
165164
testHashing512Large() {
166-
// This test tends to time out on IE7 and IE8. See b/22873770.
167-
if (!userAgent.IE || userAgent.isVersionOrHigher('9')) {
168-
const hasher = new Sha512();
169-
hasher.update((new Array(1000000)).fill(0));
170-
const digest = hasher.digest();
171-
const expected = crypt.hexToByteArray(
172-
'ce044bc9fd43269d5bbc946cbebc3bb711341115cc4abdf2edbc3ff2c57ad4b1' +
173-
'5deb699bda257fea5aef9c6e55fcf4cf9dc25a8c3ce25f2efe90908379bff7ed');
174-
assertElementsEquals(expected, digest);
175-
}
165+
const hasher = new Sha512();
166+
hasher.update((new Array(1000000)).fill(0));
167+
const digest = hasher.digest();
168+
const expected = crypt.hexToByteArray(
169+
'ce044bc9fd43269d5bbc946cbebc3bb711341115cc4abdf2edbc3ff2c57ad4b1' +
170+
'5deb699bda257fea5aef9c6e55fcf4cf9dc25a8c3ce25f2efe90908379bff7ed');
171+
assertElementsEquals(expected, digest);
176172
},
177173

178174
/** Check that the code throws an error for bad input */

closure/goog/debug/BUILD

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,10 @@ closure_js_library(
110110
"//closure/goog/disposable",
111111
"//closure/goog/events",
112112
"//closure/goog/events:event",
113-
"//closure/goog/events:eventtarget",
114113
"//closure/goog/log",
115114
"//closure/goog/net:xhrio",
116115
"//closure/goog/object",
117116
"//closure/goog/uri:utils",
118-
"//closure/goog/useragent",
119117
],
120118
)
121119

closure/goog/debug/error_test.js

Lines changed: 17 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -49,40 +49,26 @@ testSuite({
4949

5050
assertEquals('Message property should be set', 'testing', message);
5151

52-
expectedFailures.expectFailureFor(
53-
(userAgent.IE && !userAgent.isVersionOrHigher('10')) ||
54-
product.SAFARI ||
55-
(product.CHROME && !userAgent.isVersionOrHigher(532)),
56-
'error.stack is not widely supported');
52+
assertNotNull(stack);
5753

58-
try {
59-
assertNotNull(stack);
60-
61-
if (product.FIREFOX) {
62-
// Firefox 4 and greater does not have the first line that says
63-
// 'Error'. So we insert a dummy line to simplify the test.
64-
stack.splice(0, 0, 'Error');
65-
}
66-
67-
// If the stack trace came from a synthetic Error object created
68-
// inside the goog.debug.Error constructor, it will have an extra frame
69-
// at stack[1]. If it came from captureStackTrace or was attached
70-
// by IE when the error was caught, it will not.
71-
if (!Error.captureStackTrace && !userAgent.IE) {
72-
stack.splice(1, 1); // Remove stack[1].
73-
}
54+
if (product.FIREFOX) {
55+
// Firefox 4 and greater does not have the first line that says
56+
// 'Error'. So we insert a dummy line to simplify the test.
57+
stack.splice(0, 0, 'Error');
58+
}
7459

75-
assertContains(
76-
'1st line of stack should have "Error"', 'Error', stack[0]);
77-
assertContains(
78-
'2nd line of stack should have "zzzzz"', 'zzzzz', stack[1]);
79-
assertContains(
80-
'3rd line of stack should have "yyyyy"', 'yyyyy', stack[2]);
81-
assertContains(
82-
'4th line of stack should have "xxxxx"', 'xxxxx', stack[3]);
83-
} catch (e) {
84-
expectedFailures.handleException(e);
60+
// If the stack trace came from a synthetic Error object created
61+
// inside the goog.debug.Error constructor, it will have an extra frame
62+
// at stack[1]. If it came from captureStackTrace or was attached
63+
// by IE when the error was caught, it will not.
64+
if (!Error.captureStackTrace && !userAgent.IE) {
65+
stack.splice(1, 1); // Remove stack[1].
8566
}
67+
68+
assertContains('1st line of stack should have "Error"', 'Error', stack[0]);
69+
assertContains('2nd line of stack should have "zzzzz"', 'zzzzz', stack[1]);
70+
assertContains('3rd line of stack should have "yyyyy"', 'yyyyy', stack[2]);
71+
assertContains('4th line of stack should have "xxxxx"', 'xxxxx', stack[3]);
8672
},
8773

8874
/** @suppress {checkTypes} suppression added to enable type checking */

closure/goog/debug/errorreporter.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ goog.require('goog.log');
2626
goog.require('goog.net.XhrIo');
2727
goog.require('goog.object');
2828
goog.require('goog.uri.utils');
29-
goog.require('goog.userAgent');
3029

3130

3231

@@ -264,21 +263,14 @@ if (goog.debug.ErrorReporter.ALLOW_AUTO_PROTECT) {
264263
*/
265264
goog.debug.ErrorReporter.prototype.setup_ = function() {
266265
'use strict';
267-
if (goog.userAgent.IE && !goog.userAgent.isVersionOrHigher('10')) {
268-
// Use "onerror" because caught exceptions in IE don't provide line
269-
// number.
270-
goog.debug.catchErrors(
271-
goog.bind(this.handleException, this), false, null);
272-
} else {
273-
// "onerror" doesn't work with FF2 or Chrome
274-
this.errorHandler_ =
275-
new goog.debug.ErrorHandler(goog.bind(this.handleException, this));
276-
277-
this.errorHandler_.protectWindowSetTimeout();
278-
this.errorHandler_.protectWindowSetInterval();
279-
this.errorHandler_.protectWindowRequestAnimationFrame();
280-
goog.debug.entryPointRegistry.monitorAll(this.errorHandler_);
281-
}
266+
// "onerror" doesn't work with FF2 or Chrome
267+
this.errorHandler_ =
268+
new goog.debug.ErrorHandler(goog.bind(this.handleException, this));
269+
270+
this.errorHandler_.protectWindowSetTimeout();
271+
this.errorHandler_.protectWindowSetInterval();
272+
this.errorHandler_.protectWindowRequestAnimationFrame();
273+
goog.debug.entryPointRegistry.monitorAll(this.errorHandler_);
282274
};
283275
}
284276

closure/goog/debug/errorreporter_test.js

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -162,35 +162,7 @@ testSuite({
162162
assertEquals('trace=Not%20available', MockXhrIo.lastContent);
163163
},
164164

165-
/** @suppress {checkTypes} suppression added to enable type checking */
166-
test_internetExplorerSendErrorReport() {
167-
stubs.set(userAgent, 'IE', true);
168-
stubs.set(userAgent, 'isVersionOrHigher', functions.FALSE);
169-
170-
// Remove test runner's onerror handler so the test doesn't fail.
171-
stubs.set(globalThis, 'onerror', null);
172-
173-
errorReporter = ErrorReporter.install('/errorreporter');
174-
globalThis.onerror('Goodbye :(', url, 22);
175-
assertEquals(
176-
`/errorreporter?script=${encodedUrl}` +
177-
'&error=Goodbye%20%3A(&line=22',
178-
MockXhrIo.lastUrl);
179-
assertEquals('trace=Not%20available', MockXhrIo.lastContent);
180-
},
181-
182-
/** @suppress {checkTypes} suppression added to enable type checking */
183-
test_setLoggingHeaders() {
184-
stubs.set(userAgent, 'IE', true);
185-
stubs.set(userAgent, 'isVersionOrHigher', functions.FALSE);
186-
// Remove test runner's onerror handler so the test doesn't fail.
187-
stubs.set(globalThis, 'onerror', null);
188165

189-
errorReporter = ErrorReporter.install('/errorreporter');
190-
errorReporter.setLoggingHeaders('header!');
191-
globalThis.onerror('Goodbye :(', 'http://www.your.tst/more/bogus.js', 22);
192-
assertEquals('header!', MockXhrIo.lastHeaders);
193-
},
194166

195167
test_nonInternetExplorerSendErrorReportWithTrace() {
196168
stubs.set(userAgent, 'IE', false);
@@ -341,12 +313,12 @@ testSuite({
341313

342314
testProtectAdditionalEntryPoint_IE() {
343315
stubs.set(userAgent, 'IE', true);
344-
stubs.set(userAgent, 'isVersionOrHigher', functions.FALSE);
345316

346317
errorReporter = ErrorReporter.install('/errorreporter');
347318
const fn = () => {};
348319
const protectedFn = errorReporter.protectAdditionalEntryPoint(fn);
349-
assertNull(protectedFn);
320+
assertNotNull(protectedFn);
321+
assertNotEquals(fn, protectedFn);
350322
},
351323

352324
testHandleException_dispatchesEvent() {

0 commit comments

Comments
 (0)