Created
September 27, 2011 02:20
-
-
Save baroquebobcat/1244151 to your computer and use it in GitHub Desktop.
blog post notes
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$JRubyMethod["name" => ["[]", "get"], "required" => 1] | |
def get(context:ThreadContext , arg:IRubyObject):IRubyObject | |
getRuntime.newFixnum @buffer.get(int(longValueFromObject(arg))) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Foo | |
def bar | |
"bar" | |
end | |
def baz | |
{"quux" => bar} | |
end | |
end | |
Foo.new.baz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
]$ mirah hash.mirah | |
NativeMethodAccessorImpl.java:-2:in `invoke0': java.lang.reflect.InvocationTargetException | |
from NativeMethodAccessorImpl.java:39:in `invoke' | |
from DelegatingMethodAccessorImpl.java:25:in `invoke' | |
from Method.java:597:in `invoke' | |
from NativeMethodAccessorImpl.java:-2:in `invoke0' | |
from NativeMethodAccessorImpl.java:39:in `invoke' | |
from DelegatingMethodAccessorImpl.java:25:in `invoke' | |
from Method.java:597:in `invoke' | |
Caused by: | |
hash.mirah:1:in `main': java.lang.VerifyError: (class: Foo, method: baz signature: ()Ljava/util/HashMap;) Accessing value from uninitialized register 2 | |
from NativeMethodAccessorImpl.java:-2:in `invoke0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# with a string | |
java.lang.String.java_class.java_method 'endsWith', 'java.lang.String' | |
# with a java proxy object | |
java.lang.String.java_class.java_method 'endsWith', java.lang.String | |
# with a symbol | |
java.lang.String.java_class.java_method 'charAt', :int |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rake test:jvm TEST=test/jvm/test_annotations.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment