From 8647b54a61028bac1c852f1e43187658698e57af Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Sun, 17 Jan 2010 14:26:00 -0500 Subject: [PATCH] rename compile_double_reference to compile_reference --- lib/coffee_script/nodes.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/coffee_script/nodes.rb b/lib/coffee_script/nodes.rb index 836fb8ee..4c297dbe 100644 --- a/lib/coffee_script/nodes.rb +++ b/lib/coffee_script/nodes.rb @@ -309,7 +309,7 @@ module CoffeeScript # If the code generation wished to use the result of a function call # in multiple places, ensure that the function is only ever called once. - def compile_double_reference(o) + def compile_reference(o) reference = o[:scope].free_variable call = ParentheticalNode.new(AssignNode.new(reference, self)) return call, reference @@ -602,7 +602,7 @@ module CoffeeScript # http://docs.python.org/reference/expressions.html#notin def compile_chain(o) shared = @first.unwrap.second - @first.second, shared = *shared.compile_double_reference(o) if shared.is_a?(CallNode) + @first.second, shared = *shared.compile_reference(o) if shared.is_a?(CallNode) "(#{@first.compile(o)}) && (#{shared.compile(o)} #{@operator} #{@second.compile(o)})" end @@ -903,7 +903,7 @@ module CoffeeScript def self.compile_test(o, variable) first, second = variable, variable - first, second = *variable.compile_double_reference(o) if variable.is_a?(CallNode) + first, second = *variable.compile_reference(o) if variable.is_a?(CallNode) "(typeof #{first.compile(o)} !== \"undefined\" && #{second.compile(o)} !== null)" end