<commit_before>gem 'therubyracer', '>=0.7.0'
require 'v8'

require 'cucumber/js_support/js_snippets'

module Cucumber
  module JsSupport

    def self.argument_safe_string(string)
      arg_string = string.to_s.gsub(/[']/, '\\\\\'')
      arg_string.gsub("\n", '\n')
    end

    class JsWorld
      def initialize
        @world = V8::Context.new
      end

      def execute(js_function, args=[])
        js_function.call(@world.scope, *args)
      end

      def method_missing(method_name, *args)
        @world.send(method_name, *args)
      end
    end
<commit_msg>use new function calling conventions which are part of 0.7.1<commit_after>gem 'therubyracer', '>=0.7.0'
require 'v8'

require 'cucumber/js_support/js_snippets'

module Cucumber
  module JsSupport

    def self.argument_safe_string(string)
      arg_string = string.to_s.gsub(/[']/, '\\\\\'')
      arg_string.gsub("\n", '\n')
    end

    class JsWorld
      def initialize
        @world = V8::Context.new
      end

      def execute(js_function, args=[])
        js_function.call(*args)
      end

      def method_missing(method_name, *args)
        @world.send(method_name, *args)
      end
    end

{'fraction_non_alphanumeric': 0.13191489361702127, 'fraction_numerical': 0.011063829787234043, 'mean_word_length': 2.607361963190184, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3816925', 'n_tokens_mistral': 421, 'n_tokens_neox': 406, 'n_words': 84}