openlayers/openlayers — pull request #1005 by tschaub (2013-06-14 22:48:41+00:00)
Title: Better chance of running with Content Security Policy rules

OpenLayers cannot run in environments where [CSP](http://en.wikipedia.org/wiki/Content_Security_Policy) is enforced - for example a Firefox extension that doesn't allow dynamic code evaluation (with `eval`). We still conditionally use eval in the JSON parser, but this can be avoided by developers using native `JSON.parse` before calling our GeoJSON parser, for example.

This change allows OpenLayers to run in more restricted environments.

A potential negative side-effect of this change is that anybody extending `OpenLayers.Symbolizer` or `OpenLayers.Geometry.Collection` who uses their own `CLASS_NAME` *and* loads their application in a closure where their namespace is not added to `window` will no longer be able to call `clone`. In these cases, `eval` worked and there is not a good alternative to resolving a constructor from a class name string. I think the chances that people are relying on this are slim. If they need different behavior, the `getConstructor` function can be overridden.