Class: Opal::Nodes::JsCallNode
- Defined in:
- opal/lib/opal/nodes/call_special.rb
Constant Summary
Constants inherited from CallNode
CallNode::OPERATORS, CallNode::SPECIALS
Instance Attribute Summary
Attributes inherited from CallNode
#arglist, #iter, #meth, #recvr
Attributes inherited from Base
Instance Method Summary collapse
- #compile ⇒ Object
- #compile_using_send ⇒ Object
-
#initialize ⇒ JsCallNode
constructor
A new instance of JsCallNode.
- #method_jsid ⇒ Object
Methods inherited from CallNode
Methods inherited from Base
#add_gvar, #add_ivar, #add_local, #add_temp, children, #children, #class_variable_owner, #class_variable_owner_nesting_level, #comments, #compile_to_fragments, #error, #expr, #expr?, #expr_or_nil, #fragment, handle, handlers, #has_rescue_else?, #helper, #in_ensure, #in_ensure?, #in_resbody, #in_resbody?, #in_rescue, #in_while?, #process, #push, #recv, #recv?, #s, #scope, #source_location, #stmt, #stmt?, #top_scope, truthy_optimize?, #unshift, #while_loop, #with_temp, #wrap
Methods included from Helpers
#conditional_send, #current_indent, #empty_line, #indent, #js_truthy, #js_truthy_optimize, #line, #mid_to_jsid, #property, #valid_name?
Constructor Details
#initialize ⇒ JsCallNode
Returns a new instance of JsCallNode.
34 35 36 37 38 39 40 41 42 43 |
# File 'opal/lib/opal/nodes/call_special.rb', line 34 def initialize(*) super # For .JS. call we pass a block # as a plain JS callback if @iter @arglist = @arglist << @iter end @iter = nil end |
Instance Method Details
#compile ⇒ Object
45 46 47 |
# File 'opal/lib/opal/nodes/call_special.rb', line 45 def compile default_compile end |
#compile_using_send ⇒ Object
53 54 55 56 57 58 59 60 |
# File 'opal/lib/opal/nodes/call_special.rb', line 53 def compile_using_send push recv(receiver_sexp), method_jsid, '.apply(null' compile_arguments if iter push '.concat(', expr(iter), ')' end push ')' end |
#method_jsid ⇒ Object
49 50 51 |
# File 'opal/lib/opal/nodes/call_special.rb', line 49 def method_jsid ".#{meth}" end |