Permalink
Browse files

Merge pull request #22 from apiaryio/unicode

Don't use eval for dictionary access.
  • Loading branch information...
baryshev committed Mar 4, 2013
2 parents 46e8d49 + c5c73cc commit 41cd25e5073a8964cbc784a7edab92fb4524b464
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/ect.js
View
@@ -54,7 +54,7 @@
read = function (file) {
if (Object.prototype.toString.call(ect.options.root) === '[object Object]') {
- var data = eval('(ect.options.root.' + file + ')');
+ var data = file.split('.').reduce(function (currentContext, key) { return currentContext[key]; }, ect.options.root);
if (Object.prototype.toString.call(data) === '[object String]') {
return data;
} else {

0 comments on commit 41cd25e

Please sign in to comment.