# 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



#Object proto
fill_prototype(ObjectPrototype, jsobject.ObjectPrototype, default_attrs)
#Define __proto__ accessor (this cant be done by fill_prototype since)
@Js
def __proto__():
    return this.prototype if this.prototype is not None else null
getter = __proto__
@Js
def __proto__(val):
    if val.is_object():
        this.prototype = val
setter =  __proto__
ObjectPrototype.define_own_property('__proto__', {'set': setter,
                                                  'get': getter,
                                                  'enumerable': False,
                                                  'configurable':True})


#Function proto
fill_prototype(FunctionPrototype, jsfunction.FunctionPrototype, default_attrs)
#Number proto
fill_prototype(NumberPrototype, jsnumber.NumberPrototype, default_attrs)
#String proto
fill_prototype(StringPrototype, jsstring.StringPrototype, default_attrs)
#Boolean proto
fill_prototype(BooleanPrototype, jsboolean.BooleanPrototype, default_attrs)
#Array proto

# 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




#Object proto
fill_prototype(ObjectPrototype, jsobject.ObjectPrototype, default_attrs)
#Define __proto__ accessor (this cant be done by fill_prototype since)
@Js
def __proto__():
    return this.prototype if this.prototype is not None else null
getter = __proto__
@Js
def __proto__(val):
    if val.is_object():
        this.prototype = val
setter =  __proto__
ObjectPrototype.define_own_property('__proto__', {'set': setter,
                                                  'get': getter,
                                                  'enumerable': False,
                                                  'configurable':True})


#Function proto
fill_prototype(FunctionPrototype, jsfunction.FunctionPrototype, default_attrs)
#Number proto
fill_prototype(NumberPrototype, jsnumber.NumberPrototype, default_attrs)
#String proto
fill_prototype(StringPrototype, jsstring.StringPrototype, default_attrs)
#Boolean proto
fill_prototype(BooleanPrototype, jsboolean.BooleanPrototype, default_attrs)
#Array proto

fill_prototype(ArrayPrototype, jsarray.ArrayPrototype, default_attrs)