From 30a1fd1462c9b23c457e0a561795a014e2bb1a3f Mon Sep 17 00:00:00 2001 From: Takaaki Kinoshita Date: Thu, 7 Jul 2016 11:47:33 +0900 Subject: [PATCH] Support complex context by using eval --- lib/execjs/duktape_runtime.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/execjs/duktape_runtime.rb b/lib/execjs/duktape_runtime.rb index 8ae42a5..b6573d2 100644 --- a/lib/execjs/duktape_runtime.rb +++ b/lib/execjs/duktape_runtime.rb @@ -26,9 +26,7 @@ def eval(source, options = {}) end def call(identifier, *args) - @ctx.call_prop(identifier.split("."), *args) - rescue Exception => e - raise wrap_error(e) + eval "#{identifier}.apply(this, #{::JSON.generate(args)})" end private