From 0312a6da73d06c4fc80a80db21d63c1999682724 Mon Sep 17 00:00:00 2001 From: Dmitri Date: Mon, 17 Apr 2017 13:43:07 +0700 Subject: [PATCH] replaced eval() with window[] --- component/Bubbles.js | 2 +- component/start-here/hello.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/component/Bubbles.js b/component/Bubbles.js index 11936cc..be231e7 100644 --- a/component/Bubbles.js +++ b/component/Bubbles.js @@ -51,7 +51,7 @@ function Bubbles(container, self, options) { // navigate "answers" this.answer = function(key){ - var func = function(key){ typeof window[key] === "function" ? eval(key)() : false; } + var func = function(key){ typeof window[key] === "function" ? window[key]() : false; } this.convo[key] !== undefined ? this.reply(this.convo[key]) : func(key); }; diff --git a/component/start-here/hello.html b/component/start-here/hello.html index 55865c2..a7cc93e 100644 --- a/component/start-here/hello.html +++ b/component/start-here/hello.html @@ -41,7 +41,7 @@ "reply": [ { "question": "👍", - "answer" : "start" + "answer" : "functionTwo" }, { "question": "What for? 🤔",