Top Level Namespace

Defined Under Namespace

Modules: Comparable, Enumerable, Errno, JS, Kernel, Marshal, Math, ObjectSpace, Opal, PackUnpack, Process, __JS__ Classes: ArgumentError, Array, BasicObject, Binding, Boolean, Class, ClosedQueueError, CompatibilityError, Complex, Dir, EOFError, Encoding, EncodingError, Enumerator, Exception, FalseClass, FiberError, File, Float, FloatDomainError, FrozenError, GC, Hash, IO, IOError, IndexError, Integer, Interrupt, KeyError, LoadError, LocalJumpError, MatchData, Method, Module, NameError, NilClass, NoMatchingPatternError, NoMemoryError, NoMethodError, NotImplementedError, Number, Numeric, Object, PatternMatching, Proc, Random, Range, RangeError, Rational, Refinement, Regexp, RegexpError, RuntimeError, ScriptError, SecurityError, Signal, SignalException, StandardError, StopIteration, String, Struct, SyntaxError, SystemCallError, SystemExit, SystemStackError, ThreadError, Time, TracePoint, TrueClass, TypeError, UnboundMethod, UncaughtThrowError, ZeroDivisionError

Constant Summary collapse

Symbol =
String
TOPLEVEL_BINDING =
::Binding.new(
  %x{
    function(js) {
      return (new Function("self", "return " + js))(self);
    }
  },
  [], self, ['<main>', 0]
)

Class Method Summary collapse

Class Method Details

.autoload(*args) ⇒ Object



10
11
12
# File 'opal/opal/corelib/main.rb', line 10

def autoload(*args)
  `Opal.Object.$autoload.apply(Opal.Object, args)`
end

.include(mod) ⇒ Object



6
7
8
# File 'opal/opal/corelib/main.rb', line 6

def include(mod)
  ::Object.include mod
end

.private(*methods) ⇒ Object



113
114
115
# File 'opal/opal/corelib/unsupported.rb', line 113

def self.private(*methods)
  `return (methods.length === 1) ? methods[0] : methods`
end

.public(*methods) ⇒ Object



109
110
111
# File 'opal/opal/corelib/unsupported.rb', line 109

def self.public(*methods)
  `return (methods.length === 1) ? methods[0] : methods`
end

.to_sObject



2
3
4
# File 'opal/opal/corelib/main.rb', line 2

def to_s
  'main'
end

.using(mod) ⇒ Object

Compiler overrides this method



15
16
17
# File 'opal/opal/corelib/main.rb', line 15

def using(mod)
  ::Kernel.raise 'main.using is permitted only at toplevel'
end