Permalink
Browse files

Use new Binding#constant_scope (was renamed from static_scope a while…

… ago in Rubinius).
  • Loading branch information...
1 parent bbe2f8e commit 79300a5678f51a61ef5a241a2d2dd62078510ab1 @bakkdoor committed Jun 30, 2012
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/eval.fy
View
9 lib/eval.fy
@@ -16,7 +16,14 @@ def Fancy eval: code binding: binding (nil) file: file ("(fancy-eval)") line: li
# The compiled method
cm = Fancy Compiler compile_code: code vars: (binding variables()) file: file line: line
- cm scope=(binding static_scope() dup())
+
+ # Binding#static_scope was renamed to Binding#constant_scope a while ago.
+ # if the new version fails, retry with the old name for backwards compatibility (for now).
+ try {
+ cm scope=(binding constant_scope() dup())
+ } catch NoMethodError => e {
+ cm scope=(binding static_scope() dup())
+ }
cm name=('__fancy_eval__)
script = Rubinius CompiledMethod Script new(cm, file, true)

0 comments on commit 79300a5

Please sign in to comment.