Skip to content

Commit

Permalink
Add Native#has_key? and its aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
meh committed Sep 3, 2013
1 parent e555c67 commit 837d344
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions corelib/native.rb
Expand Up @@ -92,6 +92,14 @@ def self.call(obj, key, *args, &block)

include Base

def has_key?(name)
`#@native.hasOwnProperty(#{name})`
end

alias key? has_key?
alias include? has_key?
alias member? has_key?

def each(*args)
if block_given?
%x{
Expand Down

0 comments on commit 837d344

Please sign in to comment.