Permalink
Browse files

Applying Marcin's patch (compat.patch) to lopex/compat.

git-svn-id: http://svn.codehaus.org/jruby/branches/lopex@4373 961051c9-f516-0410-bf72-c9f7e237a7b7
  • Loading branch information...
1 parent 68b9599 commit 5ace9c7d619ebd85ed96e23f8373d607cf506e64 @bdortch bdortch committed Sep 23, 2007
Showing with 12,948 additions and 12,581 deletions.
  1. +2 −3 compat/src/org/jruby/IncludedModuleWrapper.java
  2. +27 −20 compat/src/org/jruby/MetaClass.java
  3. +2,250 −1,897 compat/src/org/jruby/Ruby.java
  4. +2 −1 compat/src/org/jruby/RubyArray.java
  5. +769 −763 compat/src/org/jruby/RubyBigDecimal.java
  6. +3 −2 compat/src/org/jruby/RubyBignum.java
  7. +5 −4 compat/src/org/jruby/RubyBinding.java
  8. +8 −2 compat/src/org/jruby/RubyBoolean.java
  9. +239 −309 compat/src/org/jruby/RubyClass.java
  10. +98 −98 compat/src/org/jruby/RubyClassPathVariable.java
  11. +1 −0 compat/src/org/jruby/RubyComparable.java
  12. +4 −3 compat/src/org/jruby/RubyDir.java
  13. +556 −555 compat/src/org/jruby/RubyEnumerable.java
  14. +174 −174 compat/src/org/jruby/RubyEnumerator.java
  15. +2 −9 compat/src/org/jruby/RubyException.java
  16. +4 −5 compat/src/org/jruby/RubyFile.java
  17. +2 −1 compat/src/org/jruby/RubyFileStat.java
  18. +1 −0 compat/src/org/jruby/RubyFileTest.java
  19. +7 −2 compat/src/org/jruby/RubyFixnum.java
  20. +9 −5 compat/src/org/jruby/RubyFloat.java
  21. +1 −0 compat/src/org/jruby/RubyGC.java
  22. +2 −1 compat/src/org/jruby/RubyHash.java
  23. +7 −7 compat/src/org/jruby/RubyIO.java
  24. +3 −3 compat/src/org/jruby/RubyInteger.java
  25. +2 −2 compat/src/org/jruby/RubyJRuby.java
  26. +8 −7 compat/src/org/jruby/RubyKernel.java
  27. +1 −0 compat/src/org/jruby/RubyMarshal.java
  28. +2 −1 compat/src/org/jruby/RubyMatchData.java
  29. +1 −0 compat/src/org/jruby/RubyMath.java
  30. +2 −1 compat/src/org/jruby/RubyMethod.java
  31. +226 −239 compat/src/org/jruby/RubyModule.java
  32. +8 −3 compat/src/org/jruby/RubyNil.java
  33. +3 −2 compat/src/org/jruby/RubyNumeric.java
  34. +97 −115 compat/src/org/jruby/RubyObject.java
  35. +3 −2 compat/src/org/jruby/RubyObjectSpace.java
  36. +3 −2 compat/src/org/jruby/RubyPrecision.java
  37. +14 −6 compat/src/org/jruby/RubyProc.java
  38. +4 −2 compat/src/org/jruby/RubyProcess.java
  39. +29 −19 compat/src/org/jruby/RubyRange.java
  40. +4 −3 compat/src/org/jruby/RubyRegexp.java
  41. +3 −2 compat/src/org/jruby/RubyString.java
  42. +15 −16 compat/src/org/jruby/RubyStruct.java
  43. +7 −2 compat/src/org/jruby/RubySymbol.java
  44. +3 −2 compat/src/org/jruby/RubyThread.java
  45. +1 −0 compat/src/org/jruby/RubyThreadGroup.java
  46. +4 −3 compat/src/org/jruby/RubyTime.java
  47. +3 −2 compat/src/org/jruby/RubyUnboundMethod.java
  48. +305 −297 compat/src/org/jruby/RubyUndef.java
  49. +4 −4 compat/src/org/jruby/RubyZlib.java
  50. +342 −342 compat/src/org/jruby/ast/executable/RubiniusMachine.java
  51. +713 −713 compat/src/org/jruby/ast/executable/YARVMachine.java
  52. +495 −494 compat/src/org/jruby/compiler/MethodCompiler.java
  53. +2,923 −2,916 compat/src/org/jruby/compiler/NodeCompilerFactory.java
  54. +2,661 −2,657 compat/src/org/jruby/compiler/impl/StandardASMCompiler.java
  55. +61 −69 compat/src/org/jruby/evaluator/EvaluationState.java
  56. +15 −6 compat/src/org/jruby/javasupport/Java.java
  57. +4 −4 compat/src/org/jruby/javasupport/JavaArray.java
  58. +1 −1 compat/src/org/jruby/javasupport/JavaClass.java
  59. +549 −568 compat/src/org/jruby/javasupport/util/CompilerHelpers.java
  60. +143 −143 compat/src/org/jruby/libraries/FiberLibrary.java
  61. +28 −28 compat/src/org/jruby/runtime/ObjectAllocator.java
  62. +15 −5 compat/src/org/jruby/runtime/builtin/IRubyObject.java
  63. +23 −5 compat/src/org/jruby/runtime/marshal/MarshalStream.java
  64. +13 −1 compat/src/org/jruby/runtime/marshal/UnmarshalStream.java
  65. +1 −1 compat/test/org/jruby/test/MockRubyObject.java
  66. +1 −1 compat/test/org/jruby/test/TestRubyObject.java
  67. +32 −31 compat/test/test_autoload.rb
@@ -48,8 +48,7 @@
private RubyModule delegate;
public IncludedModuleWrapper(Ruby runtime, RubyClass superClass, RubyModule delegate) {
- super(runtime, superClass, null, false);
- // FIXME: The null makes me nervous, but it makes sense that an included wrapper would never have an allocator
+ super(runtime, superClass, false);
this.delegate = delegate;
this.metaClass = delegate.metaClass;
}
@@ -123,7 +122,7 @@ public RubyClass getRealClass() {
return getSuperClass().getRealClass();
}
- public boolean isSame(RubyModule module) {
+ protected boolean isSame(RubyModule module) {
return delegate.isSame(module);
}
@@ -29,46 +29,53 @@
***** END LICENSE BLOCK *****/
package org.jruby;
-import org.jruby.runtime.ClassIndex;
-import org.jruby.runtime.ObjectAllocator;
import org.jruby.runtime.builtin.IRubyObject;
-public class MetaClass extends RubyClass {
+public final class MetaClass extends RubyClass {
+
+ private IRubyObject attached;
- public MetaClass(Ruby runtime, RubyClass superClass, ObjectAllocator allocator,
- RubyModule parent) {
- super(runtime, runtime.getClass("Class"), superClass, allocator, parent, null, false);
-
- this.index = ClassIndex.CLASS;
+ /** NEWOBJ (in RubyObject#getSingletonClassClone())
+ *
+ */
+ public MetaClass(Ruby runtime) {
+ super(runtime, null, false);
+ }
+
+ /** rb_class_boot (for MetaClasses) (in makeMetaClass(RubyClass))
+ *
+ */
+ public MetaClass(Ruby runtime, RubyClass superClass) {
+ super(runtime, superClass, false);
+ index = superClass.index; // use same ClassIndex as metaclass, since we're technically still of that type
}
public boolean isSingleton() {
return true;
}
- protected RubyClass subclass() {
- throw getRuntime().newTypeError("can't make subclass of virtual class");
- }
-
/**
* If an object uses an anonymous class 'class << obj', then this grabs the original
* metaclass and not the one that get injected as a result of 'class << obj'.
*/
public RubyClass getRealClass() {
- return getSuperClass().getRealClass();
+ return superClass.getRealClass();
}
+ public final IRubyObject allocate(){
+ throw getRuntime().newTypeError("can't create instance of virtual class");
+ }
+
public void methodAdded(RubySymbol symbol) {
- getAttachedObject().callMethod(getRuntime().getCurrentContext(), "singleton_method_added", symbol);
+ attached.callMethod(getRuntime().getCurrentContext(), "singleton_method_added", symbol);
}
- public IRubyObject getAttachedObject() {
- // Though it may not be obvious, attachToObject is always called just after instance
- // creation. Kind of a brittle arrangement here...
- return getInstanceVariable("__attached__");
+ public IRubyObject getAttached() {
+ return attached;
}
- public IRubyObject allocateObject() {
- throw getRuntime().newTypeError("can't create instance of virtual class");
+ public void setAttached(IRubyObject attached) {
+ this.attached = attached;
}
+
}
Oops, something went wrong.

0 comments on commit 5ace9c7

Please sign in to comment.