Sha256: 2622815c435c63fb740804231a92a7cd83211516fa720c109c26e54a5e36e9e9

Contents?: true

Size: 774 Bytes

Versions: 37

Compression:

Stored size: 774 Bytes

Contents

class V8::Access
  module Indices

    def indices(obj)
      obj.respond_to?(:length) ? (0..obj.length).to_a : []
    end

    def iget(obj, index, &dontintercept)
      if obj.respond_to?(:[])
        obj.send(:[], index, &dontintercept)
      else
        yield
      end
    end

    def iset(obj, index, value, &dontintercept)
      if obj.respond_to?(:[]=)
        obj.send(:[]=, index, value, &dontintercept)
      else
        yield
      end
    end

    def iquery(obj, index, attributes, &dontintercept)
      if obj.respond_to?(:[])
        attributes.dont_delete
        unless obj.respond_to?(:[]=)
          attributes.read_only
        end
      else
        yield
      end
    end

    def idelete(obj, index, &dontintercept)
      yield
    end

  end
end

Version data entries

37 entries across 37 versions & 8 rubygems

Version Path
arcabouco-0.2.13 vendor/bundle/gems/therubyracer-0.12.2/lib/v8/access/indices.rb
therubyracer-0.12.3 lib/v8/access/indices.rb
ish_lib_manager-0.0.1 test/dummy/vendor/bundle/ruby/2.3.0/gems/therubyracer-0.11.4/lib/v8/access/indices.rb
therubyracer-xcode-0.12.3 lib/v8/access/indices.rb
therubyracer-xcode-0.12.2 lib/v8/access/indices.rb
therubyracer-tmpfork-0.12.2 lib/v8/access/indices.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/therubyracer-0.12.2/lib/v8/access/indices.rb
therubyracer-0.12.2 lib/v8/access/indices.rb
therubyracer-0.12.1 lib/v8/access/indices.rb
therubyracer-discourse-0.12.0 lib/v8/access/indices.rb
therubyracer-0.12.0 lib/v8/access/indices.rb
therubyracer-0.11.4 lib/v8/access/indices.rb
therubyracer-0.11.3 lib/v8/access/indices.rb
therubyracer-0.11.2 lib/v8/access/indices.rb
sunrise-cms-0.5.0.rc1 vendor/bundle/ruby/1.9.1/gems/therubyracer-0.11.0/lib/v8/access/indices.rb
therubyracer-0.11.1 lib/v8/access/indices.rb
therubyracer-0.11.1beta1 lib/v8/access/indices.rb
therubyracer-0.11.0 lib/v8/access/indices.rb
therubyracer-0.11.0beta8-x86-freebsd-9 lib/v8/access/indices.rb
therubyracer-0.11.0beta8-x86_64-linux lib/v8/access/indices.rb