1- // PythonScript Runtime - regenerated on: Fri Nov 22 01:47:08 2013
1+ // PythonScript Runtime - regenerated on: Fri Nov 22 16:33:44 2013
22__NULL_OBJECT__ = Object . create ( null ) ;
33if ( "window" in this && "document" in this ) {
44 __NODEJS__ = false ;
@@ -47,25 +47,20 @@ adapt_arguments = function(handler) {
4747__get__ = function ( object , attribute ) {
4848 "Retrieve an attribute, method, property, or wrapper function.\n\n method are actually functions which are converted to methods by\n prepending their arguments with the current object. Properties are\n not functions!\n\n DOM support:\n http://stackoverflow.com/questions/14202699/document-createelement-not-working\n https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof\n\n Direct JavaScript Calls:\n if an external javascript function is found, and it was not a wrapper that was generated here,\n check the function for a 'cached_wrapper' attribute, if none is found then generate a new\n wrapper, cache it on the function, and return the wrapper.\n " ;
4949 if ( attribute == "__call__" ) {
50- if ( { } . toString . call ( object ) === '[object Function]' ) {
51- if ( object . pythonscript_function === true ) {
52- return object ;
50+ if ( object . pythonscript_function || object . is_wrapper ) {
51+ return object ;
52+ } else {
53+ if ( object . cached_wrapper ) {
54+ return object . cached_wrapper ;
5355 } else {
54- if ( object . is_wrapper !== undefined ) {
55- return object ;
56- } else {
57- var cached = object . cached_wrapper ;
58- if ( cached ) {
59- return cached ;
60- } else {
61- var wrapper = function ( args , kwargs ) {
62- return object . apply ( undefined , args ) ;
63- }
64-
65- wrapper . is_wrapper = true ;
66- object . cached_wrapper = wrapper ;
67- return wrapper ;
56+ if ( { } . toString . call ( object ) === '[object Function]' ) {
57+ var wrapper = function ( args , kwargs ) {
58+ return object . apply ( undefined , args ) ;
6859 }
60+
61+ wrapper . is_wrapper = true ;
62+ object . cached_wrapper = wrapper ;
63+ return wrapper ;
6964 }
7065 }
7166 }
@@ -126,25 +121,17 @@ __get__ = function(object, attribute) {
126121 }
127122 if ( attribute in __class__ . __unbound_methods__ ) {
128123 attr = __class__ . __unbound_methods__ [ attribute ] ;
129- var method = function ( ) {
130- var args ;
131- args = Array . prototype . slice . call ( arguments ) ;
132- if ( args [ 0 ] instanceof Array && { } . toString . call ( args [ 1 ] ) === '[object Object]' && args . length == 2 ) {
133- /*pass*/
134- } else {
135- args = [ args , Object ( ) ] ;
124+ if ( attr . fastdef ) {
125+ var method = function ( args , kwargs ) {
126+ if ( arguments && arguments [ 0 ] ) {
127+ arguments [ 0 ] . splice ( 0 , 0 , object ) ;
128+ return attr . apply ( this , arguments ) ;
129+ } else {
130+ return attr ( [ object ] , { } ) ;
131+ }
136132 }
137- args [ 0 ] . splice ( 0 , 0 , object ) ;
138- return attr . apply ( this , args ) ;
139- }
140133
141- method . is_wrapper = true ;
142- object [ attribute ] = method ;
143- return method ;
144- }
145- attr = __class__ [ attribute ] ;
146- if ( attribute in __class__ ) {
147- if ( { } . toString . call ( attr ) === '[object Function]' ) {
134+ } else {
148135 var method = function ( ) {
149136 var args ;
150137 args = Array . prototype . slice . call ( arguments ) ;
@@ -157,6 +144,38 @@ __get__ = function(object, attribute) {
157144 return attr . apply ( this , args ) ;
158145 }
159146
147+ }
148+ method . is_wrapper = true ;
149+ object [ attribute ] = method ;
150+ return method ;
151+ }
152+ attr = __class__ [ attribute ] ;
153+ if ( attribute in __class__ ) {
154+ if ( { } . toString . call ( attr ) === '[object Function]' ) {
155+ if ( attr . fastdef ) {
156+ var method = function ( args , kwargs ) {
157+ if ( arguments && arguments [ 0 ] ) {
158+ arguments [ 0 ] . splice ( 0 , 0 , object ) ;
159+ return attr . apply ( this , arguments ) ;
160+ } else {
161+ return attr ( [ object ] , { } ) ;
162+ }
163+ }
164+
165+ } else {
166+ var method = function ( ) {
167+ var args ;
168+ args = Array . prototype . slice . call ( arguments ) ;
169+ if ( args [ 0 ] instanceof Array && { } . toString . call ( args [ 1 ] ) === '[object Object]' && args . length == 2 ) {
170+ /*pass*/
171+ } else {
172+ args = [ args , Object ( ) ] ;
173+ }
174+ args [ 0 ] . splice ( 0 , 0 , object ) ;
175+ return attr . apply ( this , args ) ;
176+ }
177+
178+ }
160179 method . is_wrapper = true ;
161180 object [ attribute ] = method ;
162181 return method ;
@@ -173,18 +192,30 @@ __get__ = function(object, attribute) {
173192 attr = _get_upstream_attribute ( base , attribute ) ;
174193 if ( attr ) {
175194 if ( { } . toString . call ( attr ) === '[object Function]' ) {
176- var method = function ( ) {
177- var args ;
178- args = Array . prototype . slice . call ( arguments ) ;
179- if ( args [ 0 ] instanceof Array && { } . toString . call ( args [ 1 ] ) === '[object Object]' && args . length == 2 ) {
180- /*pass*/
181- } else {
182- args = [ args , Object ( ) ] ;
195+ if ( attr . fastdef ) {
196+ var method = function ( args , kwargs ) {
197+ if ( arguments && arguments [ 0 ] ) {
198+ arguments [ 0 ] . splice ( 0 , 0 , object ) ;
199+ return attr . apply ( this , arguments ) ;
200+ } else {
201+ return attr ( [ object ] , { } ) ;
202+ }
183203 }
184- args [ 0 ] . splice ( 0 , 0 , object ) ;
185- return attr . apply ( this , args ) ;
186- }
187204
205+ } else {
206+ var method = function ( ) {
207+ var args ;
208+ args = Array . prototype . slice . call ( arguments ) ;
209+ if ( args [ 0 ] instanceof Array && { } . toString . call ( args [ 1 ] ) === '[object Object]' && args . length == 2 ) {
210+ /*pass*/
211+ } else {
212+ args = [ args , Object ( ) ] ;
213+ }
214+ args [ 0 ] . splice ( 0 , 0 , object ) ;
215+ return attr . apply ( this , args ) ;
216+ }
217+
218+ }
188219 method . is_wrapper = true ;
189220 object [ attribute ] = method ;
190221 return method ;
@@ -1283,6 +1314,7 @@ ord = function(args, kwargs) {
12831314ord . NAME = "ord" ;
12841315ord . args_signature = [ "char" ] ;
12851316ord . kwargs_signature = { } ;
1317+ ord . fastdef = true ;
12861318ord . types_signature = { } ;
12871319ord . pythonscript_function = true ;
12881320chr = function ( args , kwargs ) {
@@ -1293,6 +1325,7 @@ chr = function(args, kwargs) {
12931325chr . NAME = "chr" ;
12941326chr . args_signature = [ "num" ] ;
12951327chr . kwargs_signature = { } ;
1328+ chr . fastdef = true ;
12961329chr . types_signature = { } ;
12971330chr . pythonscript_function = true ;
12981331var Iterator , __Iterator_attrs , __Iterator_parents ;
@@ -1677,6 +1710,7 @@ __list___getitem__ = function(args, kwargs) {
16771710__list___getitem__ . NAME = "__list___getitem__" ;
16781711__list___getitem__ . args_signature = [ "self" , "index" ] ;
16791712__list___getitem__ . kwargs_signature = { } ;
1713+ __list___getitem__ . fastdef = true ;
16801714__list___getitem__ . types_signature = { } ;
16811715__list___getitem__ . pythonscript_function = true ;
16821716__list_attrs [ "__getitem__" ] = __list___getitem__ ;
@@ -1690,6 +1724,7 @@ __list___setitem__ = function(args, kwargs) {
16901724__list___setitem__ . NAME = "__list___setitem__" ;
16911725__list___setitem__ . args_signature = [ "self" , "index" , "value" ] ;
16921726__list___setitem__ . kwargs_signature = { } ;
1727+ __list___setitem__ . fastdef = true ;
16931728__list___setitem__ . types_signature = { } ;
16941729__list___setitem__ . pythonscript_function = true ;
16951730__list_attrs [ "__setitem__" ] = __list___setitem__ ;
0 commit comments