Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit 519d4d0

Browse files
committed
Work around [undefined].hasOwnProperty(0) === false in IE<=8
1 parent c5c0b96 commit 519d4d0

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

tests/build-pages.js

+4
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ function processTest(content) {
132132
// The test suite tries to parse an ISO 8601 date, which fails in <=IE8
133133
content = content.replace(/Date\.parse\("1989-11-09T17:57:00Z"\)/g, '$& || Date.parse("1989/11/09 17:57:00 UTC")');
134134

135+
// Another IE 8 issue: [undefined].hasOwnProperty(0) is false, so we need
136+
// to work around this in at least one test
137+
content = content.replace(/^(\s*)(var.*)\[value\](.*)$/m, '$1var arr = [];\n$1arr[0] = value;\n$1$2arr$3');
138+
135139
// Look for functions that might require shims in ES3 browsers
136140
var shimCode = [];
137141
for (var k in shims) {

tests/test262/pages/ch09/9.2/9.2.1_8_c_ii.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,9 @@
12371237
notStringOrObject.forEach(function (value) {
12381238
var error;
12391239
try {
1240-
var supported = Constructor.supportedLocalesOf([value]);
1240+
var arr = [];
1241+
arr[0] = value;
1242+
var supported = Constructor.supportedLocalesOf(arr);
12411243
} catch (e) {
12421244
error = e;
12431245
}

0 commit comments

Comments
 (0)