Skip to content
This repository
Browse code

Merge pull request #22 from apiaryio/unicode

Don't use eval for dictionary access.
  • Loading branch information...
commit 41cd25e5073a8964cbc784a7edab92fb4524b464 2 parents 46e8d49 + c5c73cc
Vadim Baryshev authored March 04, 2013

Showing 1 changed file with 1 addition and 1 deletion. Show diff stats Hide diff stats

  1. 2  lib/ect.js
2  lib/ect.js
@@ -54,7 +54,7 @@
54 54
 
55 55
 			read = function (file) {
56 56
 				if (Object.prototype.toString.call(ect.options.root) === '[object Object]') {
57  
-					var data = eval('(ect.options.root.' + file + ')');
  57
+					var data = file.split('.').reduce(function (currentContext, key) { return currentContext[key]; }, ect.options.root);
58 58
 					if (Object.prototype.toString.call(data) === '[object String]') {
59 59
 						return data;
60 60
 					} else {

0 notes on commit 41cd25e

Please sign in to comment.
Something went wrong with that request. Please try again.