Methods

Less::CallJS

Utility for calling into the JavaScript runtime.

Public Instance Methods

calljs() click to toggle source

@private Wrap JavaScript invocations with uniform error handling

@yield code to wrap

# File lib/less/parser.rb, line 11
def calljs
  lock do
    yield
  end
rescue V8::JSError => e
  raise ParseError.new(e)
end
lock() click to toggle source

@private Ensure proper locking before entering the V8 API

@yield code to wrap in lock

# File lib/less/parser.rb, line 23
def lock
  result, exception = nil, nil
  V8::C::Locker() do
    begin
      result = yield
    rescue Exception => e
      exception = e
    end
  end
  if exception
    raise exception
  else
    result
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.