Skip to content

Commit 9ba2ab5

Browse files
committed
chore(build): add IE11 to CI
1 parent 1c9be9b commit 9ba2ab5

File tree

5 files changed

+90
-17
lines changed

5 files changed

+90
-17
lines changed

karma-js.conf.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ module.exports = function(config) {
2020
'node_modules/traceur/bin/traceur-runtime.js',
2121
'node_modules/es6-module-loader/dist/es6-module-loader-sans-promises.src.js',
2222
// Including systemjs because it defines `__eval`, which produces correct stack traces.
23+
'modules/angular2/src/test_lib/shims_for_IE.js',
2324
'node_modules/systemjs/dist/system.src.js',
2425
{pattern: 'node_modules/rx/dist/rx.js', included: false, watched: false, served: true},
2526
'node_modules/reflect-metadata/Reflect.js',
2627
'tools/build/file2modulename.js',
2728
'test-main.js',
28-
{pattern: 'modules/**/test/**/static_assets/**', included: false, watched: false},
29-
'modules/angular2/src/test_lib/shims_for_IE.ts'
29+
{pattern: 'modules/**/test/**/static_assets/**', included: false, watched: false}
3030
],
3131

3232
exclude: [

modules/angular2/src/test_lib/shims_for_IE.dart

Lines changed: 0 additions & 1 deletion
This file was deleted.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
// function.name (all IE)
2+
/*! @source http://stackoverflow.com/questions/6903762/function-name-not-supported-in-ie*/
3+
if (!Object.hasOwnProperty('name')) {
4+
Object.defineProperty(Function.prototype, 'name', {
5+
get: function() {
6+
var name = this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
7+
// For better performance only parse once, and then cache the
8+
// result through a new accessor for repeated access.
9+
Object.defineProperty(this, 'name', {value: name});
10+
return name;
11+
}
12+
});
13+
}
14+
15+
// URL polyfill for SystemJS (all IE)
16+
/*! @source https://github.com/ModuleLoader/es6-module-loader/blob/master/src/url-polyfill.js*/
17+
// from https://gist.github.com/Yaffle/1088850
18+
(function(global) {
19+
function URLPolyfill(url, baseURL) {
20+
if (typeof url != 'string') {
21+
throw new TypeError('URL must be a string');
22+
}
23+
var m = String(url).replace(/^\s+|\s+$/g, "").match(/^([^:\/?#]+:)?(?:\/\/(?:([^:@\/?#]*)(?::([^:@\/?#]*))?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);
24+
if (!m) {
25+
throw new RangeError();
26+
}
27+
var protocol = m[1] || "";
28+
var username = m[2] || "";
29+
var password = m[3] || "";
30+
var host = m[4] || "";
31+
var hostname = m[5] || "";
32+
var port = m[6] || "";
33+
var pathname = m[7] || "";
34+
var search = m[8] || "";
35+
var hash = m[9] || "";
36+
if (baseURL !== undefined) {
37+
var base = baseURL instanceof URLPolyfill ? baseURL : new URLPolyfill(baseURL);
38+
var flag = protocol === "" && host === "" && username === "";
39+
if (flag && pathname === "" && search === "") {
40+
search = base.search;
41+
}
42+
if (flag && pathname.charAt(0) !== "/") {
43+
pathname = (pathname !== "" ? (((base.host !== "" || base.username !== "") && base.pathname === "" ? "/" : "") + base.pathname.slice(0, base.pathname.lastIndexOf("/") + 1) + pathname) : base.pathname);
44+
}
45+
// dot segments removal
46+
var output = [];
47+
pathname.replace(/^(\.\.?(\/|$))+/, "")
48+
.replace(/\/(\.(\/|$))+/g, "/")
49+
.replace(/\/\.\.$/, "/../")
50+
.replace(/\/?[^\/]*/g, function (p) {
51+
if (p === "/..") {
52+
output.pop();
53+
} else {
54+
output.push(p);
55+
}
56+
});
57+
pathname = output.join("").replace(/^\//, pathname.charAt(0) === "/" ? "/" : "");
58+
if (flag) {
59+
port = base.port;
60+
hostname = base.hostname;
61+
host = base.host;
62+
password = base.password;
63+
username = base.username;
64+
}
65+
if (protocol === "") {
66+
protocol = base.protocol;
67+
}
68+
}
69+
70+
// convert windows file URLs to use /
71+
if (protocol == 'file:')
72+
pathname = pathname.replace(/\\/g, '/');
73+
74+
this.origin = protocol + (protocol !== "" || host !== "" ? "//" : "") + host;
75+
this.href = protocol + (protocol !== "" || host !== "" ? "//" : "") + (username !== "" ? username + (password !== "" ? ":" + password : "") + "@" : "") + host + pathname + search + hash;
76+
this.protocol = protocol;
77+
this.username = username;
78+
this.password = password;
79+
this.host = host;
80+
this.hostname = hostname;
81+
this.port = port;
82+
this.pathname = pathname;
83+
this.search = search;
84+
this.hash = hash;
85+
}
86+
global.URLPolyfill = URLPolyfill;
87+
})(typeof self != 'undefined' ? self : global);

modules/angular2/src/test_lib/shims_for_IE.ts

Lines changed: 0 additions & 13 deletions
This file was deleted.

sauce.conf.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ var aliases = {
125125
'SAFARI': ['SL_SAFARI7', 'SL_SAFARI8'],
126126
'BETA': ['SL_CHROMEBETA', 'SL_FIREFOXBETA'],
127127
'DEV': ['SL_CHROMEDEV', 'SL_FIREFOXDEV'],
128-
'CI': ['SL_CHROME', 'SL_ANDROID5.1', 'SL_SAFARI8', 'SL_IOS8', 'SL_FIREFOX']
128+
'CI': ['SL_CHROME', 'SL_ANDROID5.1', 'SL_SAFARI8', 'SL_IOS8', 'SL_FIREFOX', 'SL_IE11']
129129
};
130130

131131
module.exports = {

0 commit comments

Comments
 (0)