Skip to content

Commit

Permalink
Removing eval usage in goog.graphics.VmlGraphics to workaround an IE<…
Browse files Browse the repository at this point in the history
…8 bug.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=104092021
  • Loading branch information
koto authored and shicks committed Sep 29, 2015
1 parent 8a31aff commit f5111dd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion closure/goog/deps.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 10 additions & 5 deletions closure/goog/graphics/vmlgraphics.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ goog.require('goog.graphics.VmlTextElement');
goog.require('goog.html.uncheckedconversions');
goog.require('goog.math');
goog.require('goog.math.Size');
goog.require('goog.reflect');
goog.require('goog.string');
goog.require('goog.string.Const');
goog.require('goog.style');
goog.require('goog.userAgent');



Expand Down Expand Up @@ -497,17 +499,20 @@ goog.graphics.VmlGraphics.prototype.createFullSizeElement_ = function(type) {


/**
* IE magic - if this "no-op" line is not here, the if statement below will
* fail intermittently. The eval is used to prevent the JsCompiler from
* IE magic - if this "no-op" logic is not here, the 'if' statement in createDom
* will fail intermittently. The logic is used to prevent the JsCompiler from
* stripping this piece of code, which it quite reasonably thinks is doing
* nothing. Put it in try-catch block to prevent "Unspecified Error" when
* this statement is executed in a defer JS in IE.
* More info here:
* http://www.mail-archive.com/users@openlayers.org/msg01838.html
*/
try {
eval('document.namespaces');
} catch (ex) {}
if (goog.userAgent.IE) {
try {
goog.reflect.sinkValue(document.namespaces);
} catch (e) {
}
}


/**
Expand Down

0 comments on commit f5111dd

Please sign in to comment.