lib/mustang/context.rb in mustang-0.1.1 vs lib/mustang/context.rb in mustang-0.2.0

- old
+ new

@@ -1,14 +1,10 @@ module Mustang # Raised when file specified to load doesn't exist. class ScriptNotFoundError < Errno::ENOENT end - # Raised when try to exit from global context. - class ImmortalContextError < RuntimeError - end - # Extended and more user-friendly version of <tt>Mustang::V8::Context</tt>. class Context < V8::Context # Evaluates given javascript source. Before evaluation it's able to # set given local variables within current context, eg: # @@ -41,29 +37,7 @@ # Returns list of errors encountered within this context. def errors @errors ||= [] end - - # Returns <tt>true</tt> when it is global (immortal) context. - def global? - false - end end # Context - - # This kind of context is used by <tt>Mustang</tt> module. - class GlobalContext < Context - def initialize(*) - super - enter - end - - def exit - # We have to disable exit, because global context is immortal. - raise ImmortalContextError, "Global context can't be exited" - end - - def global? - true - end - end # GlobalContext end # Mustang