Skip to content

Commit 0541825

Browse files
committedNov 9, 2013
Implement BasicObject#__id__
1 parent 1da9826 commit 0541825

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed
 

‎opal/core/basic_object.rb

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ def ==(other)
66
`self === other`
77
end
88

9+
def __id__
10+
`self._id || (self._id = Opal.uid())`
11+
end
12+
913
def __send__(symbol, *args, &block)
1014
%x{
1115
var func = self['$' + symbol]

‎opal/core/kernel.rb

+1-3
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,7 @@ def nil?
384384
false
385385
end
386386

387-
def object_id
388-
`self._id || (self._id = Opal.uid())`
389-
end
387+
alias object_id __id__
390388

391389
def printf(*args)
392390
if args.length > 0

0 commit comments

Comments
 (0)
Please sign in to comment.