Class: Mustang::GlobalContext

Inherits:
Context show all
Defined in:
lib/mustang/context.rb

Overview

This kind of context is used by Mustang module.

Instance Attribute Summary

Attributes inherited from V8::Context

#error, #errors

Instance Method Summary collapse

Methods inherited from Context

#errors, #evaluate, #load

Methods inherited from V8::Context

#enter, #entered?, #eval, #evaluate, #get, #global, new, #prototype, #set

Constructor Details

#initializeGlobalContext

Returns a new instance of GlobalContext.



55
56
57
58
# File 'lib/mustang/context.rb', line 55

def initialize(*)
  super 
  enter
end

Instance Method Details

#exitObject



60
61
62
63
# File 'lib/mustang/context.rb', line 60

def exit
  # We have to disable exit, because global context is immortal. 
  raise ImmortalContextError, "Global context can't be exited"
end

#global?Boolean

Returns:

  • (Boolean)


65
66
67
# File 'lib/mustang/context.rb', line 65

def global?
  true
end