# Path: bigrig/interpreter/objects/object.py
# class ObjectConstructor(FunctionInstance):
# class ObjectPrototype(ObjectInstance):
#     def __init__(self, interpreter):
#     def call(self, this, arguments):
#     def construct(self, arguments):
#     def get_arguments(self, arguments, count=1):
#     def get_prototype_of_method(self, this, arguments):
#     def get_own_property_descriptor_method(self, this, arguments):
#     def get_own_property_names_method(self, this, arguments):
#     def create_method_method(self, this, arguments):
#     def define_property_method(self, this, arguments):
#     def define_properties_method(self, this, arguments):
#     def seal_method(self, this, arguments):
#     def freeze_method(self, this, arguments):
#     def prevent_extensions_method(self, this, arguments):
#     def is_sealed_method(self, this, arguments):
#     def is_frozen_method(self, this, arguments):
#     def is_extensible_method(self, this, arguments):
#     def keys_method(self, this, arguments):
#     def __init__(self, interpreter):
#     def to_string_method(self, this, arguments):
#     def to_locale_string_method(self, this, arguments):
#     def value_of_method(self, this, arguments):
#     def has_own_property_method(self, this, arguments):
#     def is_prototype_of_method(self, this, arguments):
#     def property_is_enumerable_method(self, this, arguments):
# 
# Path: bigrig/interpreter/objects/function.py
# def define_native_method(obj, name, method, length=0,
#                          writable=True, enumerable=False, configurable=True):
#     """
#     Define a property for an instance method corresponding to a native implementation.
#     """
#     func = NativeFunctionInstance(obj.interpreter, method, length=length, name=name)
#     obj.set_property(
#         name, func, writable=writable, enumerable=enumerable, configurable=configurable
#     )
# 
# Path: bigrig/interpreter/types.py
# MASK16 = (2 ** 16) - 1
# MASK32 = (2 ** 32) - 1
# class Type(object):
# class PrimitiveType(Type):
# class UndefinedType(PrimitiveType):
# class NullType(PrimitiveType):
# class BooleanType(PrimitiveType):
# class NumberType(PrimitiveType):
# class StringType(PrimitiveType):
# class ObjectType(Type):
# class Conversions(object):
# def get_primitive_type(obj):
# def is_primitive(obj):
# def check_object_coercible(obj):
#     def to_primitive(self, value, preferred_type=None):
#     def to_boolean(self, value):
#     def to_number(self, value):
#     def to_integer(self, value):
#     def to_int32(self, value):
#     def to_uint32(self, value):
#     def to_uint16(self, value):
#     def to_string(self, value):
#     def to_object(self, value):
#     def same_value(self, x, y):
# def get_arguments(arguments, count=1):
# 
# Path: bigrig/interpreter/exceptions.py
# class ESTypeError(ESError):
#     """
#     Invalid type.
#     """
#     pass
# 
# class ESRangeError(ESError):
#     """
#     Invalid range.
#     """
#     pass


import math
import sys
from .object import ObjectInstance, FunctionInstance
from .function import define_native_method
from ..types import NumberType, Undefined, get_arguments, NaN, inf, get_primitive_type
from ..exceptions import ESTypeError, ESRangeError
        self.set_property('POSITIVE_INFINITY', inf)

    def call(self, this, arguments):
        """
        15.7.1.1
        """
        if arguments:
            return self.interpreter.to_number(arguments[0])
        return 0

    def construct(self, arguments):
        """
        15.7.2.1
        """
        value = self.call(None, arguments)
        obj = NumberInstance(self.interpreter, value)
        obj.prototype = self.interpreter.NumberPrototype
        obj.extensible = True
        return obj


class NumberPrototype(NumberInstance):
    """
    The prototype object assigned to ``Number`` instances.

    15.7.4
    """
    def __init__(self, interpreter):
        super(NumberPrototype, self).__init__(interpreter, 0)
        self.prototype = interpreter.ObjectPrototype

# Path: bigrig/interpreter/objects/object.py
# class ObjectConstructor(FunctionInstance):
# class ObjectPrototype(ObjectInstance):
#     def __init__(self, interpreter):
#     def call(self, this, arguments):
#     def construct(self, arguments):
#     def get_arguments(self, arguments, count=1):
#     def get_prototype_of_method(self, this, arguments):
#     def get_own_property_descriptor_method(self, this, arguments):
#     def get_own_property_names_method(self, this, arguments):
#     def create_method_method(self, this, arguments):
#     def define_property_method(self, this, arguments):
#     def define_properties_method(self, this, arguments):
#     def seal_method(self, this, arguments):
#     def freeze_method(self, this, arguments):
#     def prevent_extensions_method(self, this, arguments):
#     def is_sealed_method(self, this, arguments):
#     def is_frozen_method(self, this, arguments):
#     def is_extensible_method(self, this, arguments):
#     def keys_method(self, this, arguments):
#     def __init__(self, interpreter):
#     def to_string_method(self, this, arguments):
#     def to_locale_string_method(self, this, arguments):
#     def value_of_method(self, this, arguments):
#     def has_own_property_method(self, this, arguments):
#     def is_prototype_of_method(self, this, arguments):
#     def property_is_enumerable_method(self, this, arguments):
# 
# Path: bigrig/interpreter/objects/function.py
# def define_native_method(obj, name, method, length=0,
#                          writable=True, enumerable=False, configurable=True):
#     """
#     Define a property for an instance method corresponding to a native implementation.
#     """
#     func = NativeFunctionInstance(obj.interpreter, method, length=length, name=name)
#     obj.set_property(
#         name, func, writable=writable, enumerable=enumerable, configurable=configurable
#     )
# 
# Path: bigrig/interpreter/types.py
# MASK16 = (2 ** 16) - 1
# MASK32 = (2 ** 32) - 1
# class Type(object):
# class PrimitiveType(Type):
# class UndefinedType(PrimitiveType):
# class NullType(PrimitiveType):
# class BooleanType(PrimitiveType):
# class NumberType(PrimitiveType):
# class StringType(PrimitiveType):
# class ObjectType(Type):
# class Conversions(object):
# def get_primitive_type(obj):
# def is_primitive(obj):
# def check_object_coercible(obj):
#     def to_primitive(self, value, preferred_type=None):
#     def to_boolean(self, value):
#     def to_number(self, value):
#     def to_integer(self, value):
#     def to_int32(self, value):
#     def to_uint32(self, value):
#     def to_uint16(self, value):
#     def to_string(self, value):
#     def to_object(self, value):
#     def same_value(self, x, y):
# def get_arguments(arguments, count=1):
# 
# Path: bigrig/interpreter/exceptions.py
# class ESTypeError(ESError):
#     """
#     Invalid type.
#     """
#     pass
# 
# class ESRangeError(ESError):
#     """
#     Invalid range.
#     """
#     pass


# Path: bigrig/interpreter/objects/number.py
import math
import sys
from .object import ObjectInstance, FunctionInstance
from .function import define_native_method
from ..types import NumberType, Undefined, get_arguments, NaN, inf, get_primitive_type
from ..exceptions import ESTypeError, ESRangeError

        self.set_property('POSITIVE_INFINITY', inf)

    def call(self, this, arguments):
        """
        15.7.1.1
        """
        if arguments:
            return self.interpreter.to_number(arguments[0])
        return 0

    def construct(self, arguments):
        """
        15.7.2.1
        """
        value = self.call(None, arguments)
        obj = NumberInstance(self.interpreter, value)
        obj.prototype = self.interpreter.NumberPrototype
        obj.extensible = True
        return obj


class NumberPrototype(NumberInstance):
    """
    The prototype object assigned to ``Number`` instances.

    15.7.4
    """
    def __init__(self, interpreter):
        super(NumberPrototype, self).__init__(interpreter, 0)
        self.prototype = interpreter.ObjectPrototype

        define_native_method(self, 'toString', self.to_string_method)