diff options
| author | Igor Minar | 2011-01-20 14:45:53 -0800 | 
|---|---|---|
| committer | Igor Minar | 2011-01-24 14:03:17 -0800 | 
| commit | c8bb044be13f33ef4c661ac9dbf7033b50a45d03 (patch) | |
| tree | 617d4c9babc40984c774882a5e47167d215b886f /src/angular-bootstrap.js | |
| parent | 4a569560d8b667e625f8d9c9aea2e02945af058c (diff) | |
| download | angular.js-c8bb044be13f33ef4c661ac9dbf7033b50a45d03.tar.bz2 | |
fix clobber test in angular-bootstrap.js for FF
Diffstat (limited to 'src/angular-bootstrap.js')
| -rw-r--r-- | src/angular-bootstrap.js | 10 | 
1 files changed, 7 insertions, 3 deletions
| diff --git a/src/angular-bootstrap.js b/src/angular-bootstrap.js index 4d5c2749..427c93c8 100644 --- a/src/angular-bootstrap.js +++ b/src/angular-bootstrap.js @@ -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>'); | 
