# Path: scrapers/js2py/translators/friendly_nodes.py
# REGEXP_CONVERTER = PyJsParser()
# 
# Path: scrapers/js2py/prototypes/jsarray.py
# def to_arr(this):
#     def toString():
#             def func():
#     def toLocaleString():
#     def concat():
#     def join(separator):
#     def pop(): #todo check
#     def push(item): # todo check
#     def reverse():
#     def shift():  #todo check
#     def slice(start, end): # todo check
#     def sort(cmpfn):
#     def splice(start, deleteCount):
#     def unshift():
#     def indexOf(searchElement):
#     def lastIndexOf(searchElement):
#     def every(callbackfn):
#     def some(callbackfn):
#     def forEach(callbackfn):
#     def map(callbackfn):
#     def filter(callbackfn):
#     def reduce(callbackfn):
#     def reduceRight(callbackfn):
# def sort_compare(a, b, comp):
# ARR_STACK = set({})
#         A = this.Js([])
#         A = this.Js([])
#             E = items.pop(0)
#             E = items.pop(0)
#         T = arguments[1]
#         T = arguments[1]
#         T = arguments[1]
#         T = arguments[1]
#         A = this.Js([])
#         T = arguments[1]
# class ArrayPrototype:


from copy import copy
from .translators.friendly_nodes import REGEXP_CONVERTER
from .utils.injector import fix_js_args
from types import FunctionType, ModuleType, GeneratorType, BuiltinFunctionType, MethodType, BuiltinMethodType
from .prototypes import jsfunction, jsobject, jsnumber, jsstring, jsboolean, jsarray, jsregexp, jserror
import re
import traceback
import six
    import code
                current['value'] = undefined #undefined
                current['writable'] = False 
        elif is_data_descriptor(current) and is_data_descriptor(desc):
            if not configurable:
                if not current['writable'] and desc.get('writable'):
                    return False
            if not current['writable'] and 'value' in desc and current['value']!=desc['value']:
                return False
        elif is_accessor_descriptor(current) and is_accessor_descriptor(desc):
            if not configurable:
                if 'set' in desc and desc['set'] is not current['set']:
                    return False
                if 'get' in desc and desc['get'] is not current['get']:
                    return False
        current.update(desc)
        return True

    #these methods will work only for Number class
    def is_infinity(self):
        assert self.Class=='Number'
        return self.value==float('inf') or self.value==-float('inf')

    def is_nan(self):
        assert self.Class=='Number'
        return self.value!=self.value #nan!=nan evaluates to true

    def is_finite(self):
        return not (self.is_nan() or self.is_infinity())
    #Type Conversions. to_type. All must return pyjs subclass instance
    

# Path: scrapers/js2py/translators/friendly_nodes.py
# REGEXP_CONVERTER = PyJsParser()
# 
# Path: scrapers/js2py/prototypes/jsarray.py
# def to_arr(this):
#     def toString():
#             def func():
#     def toLocaleString():
#     def concat():
#     def join(separator):
#     def pop(): #todo check
#     def push(item): # todo check
#     def reverse():
#     def shift():  #todo check
#     def slice(start, end): # todo check
#     def sort(cmpfn):
#     def splice(start, deleteCount):
#     def unshift():
#     def indexOf(searchElement):
#     def lastIndexOf(searchElement):
#     def every(callbackfn):
#     def some(callbackfn):
#     def forEach(callbackfn):
#     def map(callbackfn):
#     def filter(callbackfn):
#     def reduce(callbackfn):
#     def reduceRight(callbackfn):
# def sort_compare(a, b, comp):
# ARR_STACK = set({})
#         A = this.Js([])
#         A = this.Js([])
#             E = items.pop(0)
#             E = items.pop(0)
#         T = arguments[1]
#         T = arguments[1]
#         T = arguments[1]
#         T = arguments[1]
#         A = this.Js([])
#         T = arguments[1]
# class ArrayPrototype:


# Path: scrapers/js2py/base.py
from copy import copy
from .translators.friendly_nodes import REGEXP_CONVERTER
from .utils.injector import fix_js_args
from types import FunctionType, ModuleType, GeneratorType, BuiltinFunctionType, MethodType, BuiltinMethodType
from .prototypes import jsfunction, jsobject, jsnumber, jsstring, jsboolean, jsarray, jsregexp, jserror
import re
import traceback
import six
    import code

                current['value'] = undefined #undefined
                current['writable'] = False 
        elif is_data_descriptor(current) and is_data_descriptor(desc):
            if not configurable:
                if not current['writable'] and desc.get('writable'):
                    return False
            if not current['writable'] and 'value' in desc and current['value']!=desc['value']:
                return False
        elif is_accessor_descriptor(current) and is_accessor_descriptor(desc):
            if not configurable:
                if 'set' in desc and desc['set'] is not current['set']:
                    return False
                if 'get' in desc and desc['get'] is not current['get']:
                    return False
        current.update(desc)
        return True

    #these methods will work only for Number class
    def is_infinity(self):
        assert self.Class=='Number'
        return self.value==float('inf') or self.value==-float('inf')

    def is_nan(self):
        assert self.Class=='Number'
        return self.value!=self.value #nan!=nan evaluates to true

    def is_finite(self):
        return not (self.is_nan() or self.is_infinity())
    #Type Conversions. to_type. All must return pyjs subclass instance
    

    def to_primitive(self, hint=None):