fix(test): function.name is not available (IE11)
This commit is contained in:
parent
1f20ef9787
commit
5103f080e9
|
@ -24,7 +24,8 @@ module.exports = function(config) {
|
||||||
'node_modules/reflect-metadata/Reflect.js',
|
'node_modules/reflect-metadata/Reflect.js',
|
||||||
'tools/build/file2modulename.js',
|
'tools/build/file2modulename.js',
|
||||||
'test-main.js',
|
'test-main.js',
|
||||||
{pattern: 'modules/**/test/**/static_assets/**', included: false, watched: false}
|
{pattern: 'modules/**/test/**/static_assets/**', included: false, watched: false},
|
||||||
|
'modules/angular2/src/test_lib/shims_for_IE.es6'
|
||||||
],
|
],
|
||||||
|
|
||||||
exclude: [
|
exclude: [
|
||||||
|
|
|
@ -0,0 +1,13 @@
|
||||||
|
//function.name
|
||||||
|
/*! @source http://stackoverflow.com/questions/6903762/function-name-not-supported-in-ie*/
|
||||||
|
if (!(function f() {}).name) {
|
||||||
|
Object.defineProperty(Function.prototype, 'name', {
|
||||||
|
get: function() {
|
||||||
|
var name = this.toString().match(/^\s*function\s*(\S*)\s*\(/)[1];
|
||||||
|
// For better performance only parse once, and then cache the
|
||||||
|
// result through a new accessor for repeated access.
|
||||||
|
Object.defineProperty(this, 'name', { value: name });
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
Loading…
Reference in New Issue