From 77a112cb88eceade0c52151f55ba8f03a720dc41 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Mon, 20 Jul 2015 19:36:59 -0400 Subject: [PATCH] Fixed JavaScript "no-eval" violation. --- .eslintrc | 2 +- django/contrib/gis/static/gis/js/OLMapWidget.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 37a5676ddb..ec705d2257 100644 --- a/.eslintrc +++ b/.eslintrc @@ -8,7 +8,7 @@ "key-spacing": [2, {"beforeColon": false, "afterColon": true}], "new-cap": [0, {"newIsCap": true, "capIsNew": true}], "no-alert": [0], - "no-eval": [1], + "no-eval": [2], "no-extend-native": [2, {"exceptions": ["Date", "String"]}], "no-multi-spaces": [2], "no-octal-escape": [2], diff --git a/django/contrib/gis/static/gis/js/OLMapWidget.js b/django/contrib/gis/static/gis/js/OLMapWidget.js index 40dd5890ce..0736779370 100644 --- a/django/contrib/gis/static/gis/js/OLMapWidget.js +++ b/django/contrib/gis/static/gis/js/OLMapWidget.js @@ -175,7 +175,7 @@ } else if (options.geom_name === 'GeometryCollection') { options.geom_type = OpenLayers.Geometry.Collection; } else { - options.geom_type = eval('OpenLayers.Geometry.' + options.geom_name); + options.geom_type = OpenLayers.Geometry[options.geom_name]; } // Default options