From b2bb1cbfaa4c202f377b331996870ae23c2e3fd1 Mon Sep 17 00:00:00 2001 From: Nick Clifford Date: Thu, 16 Feb 2017 14:44:43 -0600 Subject: [PATCH] Fix unlabeled ExecJS runtime error Without this fix, calling `Babel::Transpiler.transform` with **any** input will raise `ExecJS::RuntimeError` with no message. --- lib/babel/transpiler.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/babel/transpiler.rb b/lib/babel/transpiler.rb index 71728be..2b14a20 100644 --- a/lib/babel/transpiler.rb +++ b/lib/babel/transpiler.rb @@ -21,7 +21,7 @@ def self.script_path end def self.context - @context ||= ExecJS.compile("var self = this; " + File.read(script_path)) + @context ||= ExecJS.compile("var self = this; " + File.read(script_path, encoding: 'utf-8')) end def self.transform(code, options = {})