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, Set, 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



12
13
14
# File 'opal/opal/corelib/main.rb', line 12

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

.include(mod) ⇒ Object



8
9
10
# File 'opal/opal/corelib/main.rb', line 8

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

.private(*methods) ⇒ Object



115
116
117
# File 'opal/opal/corelib/unsupported.rb', line 115

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

.public(*methods) ⇒ Object



111
112
113
# File 'opal/opal/corelib/unsupported.rb', line 111

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

.to_sObject



4
5
6
# File 'opal/opal/corelib/main.rb', line 4

def to_s
  'main'
end

.using(mod) ⇒ Object

Compiler overrides this method



17
18
19
# File 'opal/opal/corelib/main.rb', line 17

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