lib/cldr-plurals/javascript_emitter.rb in cldr-plurals-1.1.1 vs lib/cldr-plurals/javascript_emitter.rb in cldr-plurals-1.2.0

- old
+ new

@@ -2,11 +2,11 @@ module CldrPlurals class JavascriptEmitter < Compiler::Emitter class << self - RUNTIME_VARS = %w(n i v w f t) + RUNTIME_VARS = %w(n i f t v w e) def emit_rules(rule_list) parts = rule_list.rules.map do |rule| "(#{emit_rule(rule)} ? '#{rule.name}' : " end + ["'other'"] @@ -18,10 +18,10 @@ def emit_rule(rule) emit(rule.root) end def emit_rule_standalone(rule) - "(function(n, i, f, t, v, w) { return #{emit_rule(rule)}; })" + "(function(#{RUNTIME_VARS.join(', ')}) { return #{emit_rule(rule)}; })" end protected def build_runtime_vars