diff --git a/lib/coffee_script/nodes.rb b/lib/coffee_script/nodes.rb index 525e1af6..84726d74 100644 --- a/lib/coffee_script/nodes.rb +++ b/lib/coffee_script/nodes.rb @@ -595,7 +595,7 @@ module CoffeeScript first, second = @first.compile(o), @second.compile(o) o[:scope].find(first) if @first.unwrap.is_a?(Value) sym = @operator[0..1] - return "#{first} = (typeof #{first} !== \"undefined\" && #{first} !== null) ? #{first} : #{second}" if @operator == '?=' + return "#{first} = (#{first} !== undefined && #{first} !== null) ? #{first} : #{second}" if @operator == '?=' "#{first} = #{first} #{sym} #{second}" end