Module: V8::Access::Invocation::Method

Includes:
Aritize
Defined in:
lib/v8/access/invocation.rb

Instance Method Summary collapse

Methods included from Aritize

#aritize

Instance Method Details

#methodcall(this, args) ⇒ Object


23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/v8/access/invocation.rb', line 23

def methodcall(this, args)
  context = V8::Context.current
  access = context.access
  if this.equal? self.receiver
    call *aritize(args)
  elsif this.class <= self.receiver.class
    access.methodcall(unbind, this, args)
  elsif this.equal? context.scope
    call *aritize(args)
  else
    fail TypeError, "cannot invoke #{self} on #{this}"
  end
end