1+ from __future__ import unicode_literals
2+
13from base import Scope
24from func_utils import *
35from conversions import *
1315import prototypes .jsjson as jsjson
1416import prototypes .jsutils as jsutils
1517
16-
1718from constructors import jsnumber
1819from constructors import jsstring
1920from constructors import jsarray
2223from constructors import jsmath
2324from constructors import jsobject
2425from constructors import jsfunction
26+ from constructors import jsconsole
27+
2528
2629def fill_proto (proto , proto_class , space ):
2730 for i in dir (proto_class ):
@@ -244,6 +247,8 @@ def new_create(args, space):
244247 for k ,v in jsmath .CONSTANTS .items ():
245248 set_protected (math , k , v )
246249
250+ console = space .NewObject ()
251+ fill_proto (console , jsconsole .ConsoleMethods , space )
247252
248253
249254 # set global object
@@ -264,7 +269,8 @@ def new_create(args, space):
264269 'isFinite' : isFinite ,
265270 'isNaN' : isNaN ,
266271 'eval' : easy_func (jsfunction ._eval , space ),
267- 'log' : easy_func (jsfunction .log , space ),
272+ 'console' : console ,
273+ 'log' : console .get (u'log' ),
268274 }
269275
270276 builtins .update (error_constructors )
0 commit comments