Permalink
Browse files

ensure that frame setting is updated when bytecode version is

  • Loading branch information...
1 parent 24e8363 commit 3ff2e52f87dec7e56a35cac9fd1e985b9849a260 @baroquebobcat baroquebobcat committed Feb 25, 2013
Showing with 11 additions and 8 deletions.
  1. +11 −8 lib/bitescript.rb
View
@@ -22,21 +22,24 @@ module BiteScript
JAVA1_8 = defined?(Opcodes::V1_8) ? Opcodes::V1_8 : Opcodes::V1_7
class << self
- attr_accessor :bytecode_version
+ attr_reader :bytecode_version
attr_accessor :compute_frames
attr_accessor :compute_maxs
+ def bytecode_version= version
+ case version
+ when JAVA1_4, JAVA1_5, JAVA1_6
+ BiteScript.compute_frames = false
+ else
+ BiteScript.compute_frames = true
+ end
+ @bytecode_version = version
+ end
+
# Default to JVM version we're running on
spec_version = ENV_JAVA['java.specification.version']
BiteScript.bytecode_version = BiteScript.const_get("JAVA#{spec_version.gsub('.', '_')}")
- case BiteScript.bytecode_version
- when JAVA1_4, JAVA1_5, JAVA1_6
- BiteScript.compute_frames = false
- else
- BiteScript.compute_frames = true
- end
-
BiteScript.compute_maxs = true
end
end

0 comments on commit 3ff2e52

Please sign in to comment.