mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
fix clobber test in angular-bootstrap.js for FF
This commit is contained in:
parent
4a569560d8
commit
c8bb044be1
1 changed files with 7 additions and 3 deletions
10
src/angular-bootstrap.js
vendored
10
src/angular-bootstrap.js
vendored
|
|
@ -52,7 +52,9 @@
|
|||
}
|
||||
else if (!globalVars.hasOwnProperty(varKey)) {
|
||||
//console.log('new global variable found: ', prop);
|
||||
globalVars[varKey] = window[prop];
|
||||
try {
|
||||
globalVars[varKey] = window[prop];
|
||||
} catch(e) {} //ignore properties that throw exception when accessed (common in FF)
|
||||
} else if (globalVars[varKey] !== window[prop] && !isActuallyNaN(window[prop])) {
|
||||
clobbered.push(prop);
|
||||
console.error("Global variable clobbered by script " + file + "! Variable name: " + prop);
|
||||
|
|
@ -83,11 +85,13 @@
|
|||
|
||||
// initialize the window property cache
|
||||
for (prop in window) {
|
||||
globalVars[key(prop)] = window[prop];
|
||||
try {
|
||||
globalVars[key(prop)] = window[prop];
|
||||
} catch(e) {} //ignore properties that throw exception when accessed (common in FF)
|
||||
}
|
||||
|
||||
// load the js scripts
|
||||
for (i in arguments) {
|
||||
for (i in Array.prototype.slice.call(arguments, 0)) {
|
||||
file = arguments[i];
|
||||
document.write('<script type="text/javascript" src="' + serverPath + file + '" ' +
|
||||
'onload="angularClobberTest(\'' + file + '\')"></script>');
|
||||
|
|
|
|||
Loading…
Reference in a new issue