8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# File 'lib/ruby2js/filter/active_functions.rb', line 8
def on_send(node)
target, method, *args = node.children
return super unless args.empty?
if es2015 and method == :blank?
create_or_update_import("blank$")
process node.updated :send, [nil, "blank$", target]
elsif es2015 and method == :present?
create_or_update_import("present$")
process node.updated :send, [nil, "present$", target]
elsif es2015 and method == :presence
create_or_update_import("presence$")
process node.updated :send, [nil, "presence$", target]
else
super
end
end
|