Class: Sqreen::Js::ExecjsAdapter

Inherits:
JsServiceAdapter show all
Defined in:
lib/sqreen/js/execjs_adapter.rb

Instance Method Summary collapse

Instance Method Details

#preprocess(rule_name, code) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/sqreen/js/execjs_adapter.rb', line 18

def preprocess(rule_name, code)
  if thread_safe?
    ExecJsRunnable.new(ExecJS.compile(code))
  else
    ThreadLocalExecJsRunnable.new(code)
  end
end

#variant_nameObject



26
27
28
# File 'lib/sqreen/js/execjs_adapter.rb', line 26

def variant_name
  ExecJS.runtime.name + ' (ExecJS)'
end