Commits

Anonymous committed e1bde17

Initial Import

Comments (0)

Files changed (10)

+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+This isn't really in proper GNU ChangeLog format, it just happens to
+look that way.
+
+2008-06-10 Atul Varma <varmaa@gmail.com>
+	* Fixed the module to work with the latest SpiderMonkey (1.7)
+	  and Pyrex (0.9.8).
+	* Revamped the documentation, added doctests.
+	* Removed Pyrex as a build dependency.
+	* Made it easier to link to SpiderMonkey by using the
+	  pre-built XULRunner SDK.
+
+2003-10-05 John J Lee <jjl@pobox.com>
+	* Fixed segfault.
+	* Released 0.0.1a.
+
+2003-09-13 John J Lee <jjl@pobox.com>
+	* Functionality is there, but so is a nasty segfault. :-((
+include MANIFEST.in
+include COPYING
+include README
+include ChangeLog
+include *.pyx
+include setup.py
+include test.py
+include support.c
+include spidermonkey.c
+Metadata-Version: 1.0
+Name: spidermonkey
+Version: 0.0.1a
+Summary: JavaScript / Python bridge.
+Home-page: http://wwwsearch.sourceforge.net/spidermonkey/
+Author: John J. Lee
+Author-email: jjl@pobox.com
+License: GPL
+Description: Python/JavaScript bridge module, making use of Mozilla's spidermonkey
+        JavaScript implementation.  Allows implementation of JavaScript classes,
+        objects and functions in Python, and evaluation and calling of JavaScript
+        scripts and functions respectively.  Borrows heavily from Claes Jacobssen's
+        Javascript Perl module, in turn based on Mozilla's 'PerlConnect' Perl binding.
+        
+Platform: UNKNOWN
+===================
+Python-Spidermonkey
+===================
+
+This Python module allows for the implementation of Javascript?
+classes, objects and functions in Python, as well as the evaluation
+and calling of Javascript scripts and functions. It borrows heavily
+from Claes Jacobssen's ``Javascript`` Perl module, which in turn is
+based on Mozilla's ``PerlConnect`` Perl binding.
+
+This code was originally written by John J. Lee in 2003.  After being
+unmaintained for a number of years, it was subsequently picked up by
+Atul Varma in 2008.
+
+Tutorial
+========
+
+The first thing you'll want to do is create a ``Runtime`` instance,
+which encapsulates a ``JSRuntime`` object from Spidermonkey.  From the
+`JSAPI User Guide`_:
+
+  A ``JSRuntime``, or *runtime*, is the space in which the Javascript
+  variables, objects, scripts, and contexts used by your application
+  are allocated. Every ``JSContext`` and every object in an
+  application lives within a ``JSRuntime``. They cannot travel to
+  other runtimes or be shared across runtimes. Most applications only
+  need one runtime.
+
+Creating the ``Runtime`` instance is straightforward:
+
+  >>> from spidermonkey import Runtime
+  >>> rt = Runtime()
+
+You'll then want to use the ``Runtime`` to create a ``Context``
+instance, which encapsulates a ``JSContext`` object from Spidermonkey.
+From the JSAPI User Guide:
+
+  A ``JSContext``, or *context*, is like a little machine that can do
+  many things involving Javascript code and objects. It can compile
+  and execute scripts, get and set object properties, call Javascript
+  functions, convert Javascript data from one type to another, create
+  objects, and so on.
+
+In Firefox, for instance, a different context is used for each webpage
+you view.  A separate context is even created for each physical
+browser window, because much of Firefox's functionality is actually
+written in Javascript.  Contexts can have their own security
+policies associated with them, and objects can be shared between
+multiple contexts.
+
+Creating a context in Python-Spidermonkey is done like so:
+
+  >>> cx = rt.new_context()
+
+Now that you've got a context, you can do lots of things, like
+evaluating arbitrary Javascript expressions and using their results in
+Python code:
+
+  >>> cx.eval_script("1 + 2") + 3
+  6
+
+We can create classes in Python and access them in Javascript, too:
+
+  >>> class Foo:
+  ...   def hello(self):
+  ...     print "Hello, Javascript world!"
+  >>> cx.bind_class(Foo, bind_constructor=True)
+  >>> cx.eval_script("var f = new Foo(); f.hello();")
+  Hello, Javascript world!
+
+We can also get back objects from Javascript and use them:
+
+  >>> f = cx.eval_script("f;")
+  >>> f.hello()
+  Hello, Javascript world!
+
+.. _`JSAPI User Guide`: http://developer.mozilla.org/en/docs/JSAPI_User_Guide
+
+Limitations
+===========
+
+The module currently has a number of features that still need to be
+implemented.  For instance, it's not yet possible to call a function
+defined in Javascript:
+
+  >>> cx.eval_script("function foo(x) { return x + 1; }; foo;")
+  {'prototype': {}}
+
+Errors in Javascript code also don't produce particularly helpful
+tracebacks:
+
+  >>> cx.eval_script("3 + undefinedVariable")
+  Traceback (most recent call last):
+  ...
+  JSError: can't evaluate Javascript script
+
+Installation
+============
+
+Note that at present, installation has only been tested on OS X and
+64-bit Ubuntu Linux; support for Windows is forthcoming.
+
+At present, you'll need a C compiler on your system to install this
+extension, as well as the `Pyrex`_ package.
+
+* Check out the Python-Spidermonkey module from the `SVN repository`_.
+
+* From the root of your checkout, run::
+
+    python setup.py build
+
+  Don't worry about the compiler warnings.  Then, with appropriate
+  permissions, run::
+
+    python setup.py install
+
+.. _`Pyrex`: http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
+.. _`SVN repository`: http://code.google.com/p/python-spidermonkey/source/checkout
+
+Testing
+=======
+
+The module has a test suite.  Just run::
+
+  python test.py
+
+Note that one of the tests currently prints out a Javascript error
+message.  This isn't a test failure (though it is a `bug`_).
+
+.. _`bug`: http://code.google.com/p/python-spidermonkey/issues/detail?id=1
+
+Acknowledgements
+================
+
+Thanks to Brendan Eich for help with several Spidermonkey issues (and
+for all his Mozilla work), and to Erwin on the freenode ``#c`` IRC
+channel for gdb tips.
+import os
+import sys
+import glob
+from distutils.core import setup, Extension
+from distutils.command.clean import clean
+from distutils.command.install import install
+from distutils.file_util import copy_file
+
+try:
+    import Pyrex.Compiler.Main as Compiler
+    res = Compiler.compile(["spidermonkey.pyx"], timestamps=True)
+except ImportError:
+    if not os.path.exists("spidermonkey.c"):
+        sys.stderr.write("Pyrex is required for compiliation.")
+
+setup(name = "spidermonkey",
+    version = "0.0.1a",
+    license = "GPL",
+    author = "John J. Lee",
+    author_email = "jjl@pobox.com",
+    description = "JavaScript / Python bridge.",
+    url = "http://code.google.com/p/python-spidermonkey/",
+    long_description = """\
+Python/JavaScript bridge module, making use of Mozilla's spidermonkey
+JavaScript implementation.  Allows implementation of JavaScript classes,
+objects and functions in Python, and evaluation and calling of JavaScript
+scripts and functions respectively.  Borrows heavily from Claes Jacobssen's
+Javascript Perl module, in turn based on Mozilla's 'PerlConnect' Perl binding.
+""",
+    ext_modules =  [
+        Extension("spidermonkey",
+            sources=["spidermonkey.c"],
+            extra_compile_args=["-DXP_UNIX", "-DJS_THREADSAFE"],
+            include_dirs=["/usr/include/js", "/usr/local/include/js", "/opt/local/include/js"],
+            runtime_libraries=["/usr/lib", "/usr/local/lib", "/opt/local/lib"],
+            libraries=["js", "pthread"]
+        )
+    ]
+)
+/* Generated by Pyrex 0.9.8.5 on Thu Jan 22 22:14:29 2009 */
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#include "structmember.h"
+#ifndef PY_LONG_LONG
+  #define PY_LONG_LONG LONG_LONG
+#endif
+#if PY_VERSION_HEX < 0x02050000
+  typedef int Py_ssize_t;
+  #define PY_SSIZE_T_MAX INT_MAX
+  #define PY_SSIZE_T_MIN INT_MIN
+  #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
+  #define PyInt_AsSsize_t(o)	PyInt_AsLong(o)
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+  #ifndef __stdcall
+    #define __stdcall
+  #endif
+  #ifndef __cdecl
+    #define __cdecl
+  #endif
+#endif
+#ifdef __cplusplus
+#define __PYX_EXTERN_C extern "C"
+#else
+#define __PYX_EXTERN_C extern
+#endif
+#include <math.h>
+#include "string.h"
+#include "stdlib.h"
+#include "jsapi.h"
+#include "support.c"
+
+
+typedef struct {PyObject **p; int i; char *s; long n;} __Pyx_StringTabEntry; /*proto*/
+
+static PyObject *__pyx_m;
+static PyObject *__pyx_b;
+static int __pyx_lineno;
+static char *__pyx_filename;
+static char **__pyx_f;
+
+static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/
+
+static void __Pyx_WriteUnraisable(char *name); /*proto*/
+
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
+
+static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
+
+static int __Pyx_GetStarArgs(PyObject **args, PyObject **kwds, char *kwd_list[],     Py_ssize_t nargs, PyObject **args2, PyObject **kwds2, char rqd_kwds[]); /*proto*/
+
+static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, char *name); /*proto*/
+
+static PyObject *__Pyx_UnpackItem(PyObject *); /*proto*/
+static int __Pyx_EndUnpack(PyObject *); /*proto*/
+
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
+
+static PyObject *__Pyx_GetItemInt(PyObject *o, Py_ssize_t i); /*proto*/
+
+static int __Pyx_SetItemInt(PyObject *o, Py_ssize_t i, PyObject *v); /*proto*/
+
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
+
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/
+
+static PyObject *__Pyx_CreateClass(PyObject *bases, PyObject *dict, PyObject *name, char *modname); /*proto*/
+
+static void __Pyx_AddTraceback(char *funcname); /*proto*/
+
+/* Declarations from spidermonkey */
+
+
+/* Declarations from implementation of spidermonkey */
+
+typedef int __pyx_t_12spidermonkey_jsuint;
+
+typedef int __pyx_t_12spidermonkey_jsint;
+
+typedef int __pyx_t_12spidermonkey_uint8;
+
+typedef int __pyx_t_12spidermonkey_uint16;
+
+typedef int __pyx_t_12spidermonkey_uint32;
+
+typedef int __pyx_t_12spidermonkey_uintN;
+
+typedef int __pyx_t_12spidermonkey_size_t;
+
+typedef int __pyx_t_12spidermonkey_JSBool;
+
+typedef int __pyx_t_12spidermonkey_jsval;
+
+typedef int __pyx_t_12spidermonkey_jsid;
+
+typedef int __pyx_t_12spidermonkey_jsword;
+
+typedef char __pyx_t_12spidermonkey_jschar;
+
+typedef double __pyx_t_12spidermonkey_jsdouble;
+
+struct __pyx_obj_12spidermonkey_Runtime {
+  PyObject_HEAD
+  struct JSRuntime *rt;
+  PyObject *_cxs;
+};
+
+struct __pyx_obj_12spidermonkey_Context {
+  PyObject_HEAD
+  struct JSContext *cx;
+  struct JSObject *globj;
+  struct __pyx_obj_12spidermonkey_Runtime *rt;
+  PyObject *_funcs;
+  PyObject *_classes;
+  PyObject *_objs;
+  PyObject *_script;
+  PyObject *_evaled_script;
+  PyObject *_last_error;
+};
+
+struct __pyx_obj_12spidermonkey_ProxyClass {
+  PyObject_HEAD
+  struct JSClass *jsc;
+  PyObject *klass;
+};
+
+struct __pyx_obj_12spidermonkey_ProxyObject {
+  PyObject_HEAD
+  struct JSObject *jsobj;
+  PyObject *obj;
+};
+
+struct __pyx_obj_12spidermonkey_ProxyFunction {
+  PyObject_HEAD
+  struct __pyx_obj_12spidermonkey_Context *cx;
+  __pyx_t_12spidermonkey_jsval fun;
+};
+
+
+
+
+
+
+static PyTypeObject *__pyx_ptype_12spidermonkey_Runtime = 0;
+static PyTypeObject *__pyx_ptype_12spidermonkey_Context = 0;
+static PyTypeObject *__pyx_ptype_12spidermonkey_ProxyClass = 0;
+static PyTypeObject *__pyx_ptype_12spidermonkey_ProxyObject = 0;
+static PyTypeObject *__pyx_ptype_12spidermonkey_ProxyFunction = 0;
+static __pyx_t_12spidermonkey_JSBool __pyx_f_12spidermonkey_report(struct JSContext *); /*proto*/
+static void __pyx_f_12spidermonkey_report_error(struct JSContext *,char *,struct JSErrorReport *); /*proto*/
+static void *__pyx_f_12spidermonkey_xmalloc(__pyx_t_12spidermonkey_size_t); /*proto*/
+static struct __pyx_obj_12spidermonkey_Runtime *__pyx_f_12spidermonkey_get_runtime(struct JSRuntime *); /*proto*/
+static struct __pyx_obj_12spidermonkey_Context *__pyx_f_12spidermonkey_get_context(struct JSContext *); /*proto*/
+static struct __pyx_obj_12spidermonkey_Context *__pyx_f_12spidermonkey_runtime_get_context(struct __pyx_obj_12spidermonkey_Runtime *,struct JSContext *); /*proto*/
+static void __pyx_f_12spidermonkey_context_register_object(struct __pyx_obj_12spidermonkey_Context *,PyObject *,struct JSObject *); /*proto*/
+static void __pyx_f_12spidermonkey_context_add_object(struct __pyx_obj_12spidermonkey_Context *,struct __pyx_obj_12spidermonkey_ProxyObject *); /*proto*/
+static void __pyx_f_12spidermonkey_context_remove_object(struct __pyx_obj_12spidermonkey_Context *,struct __pyx_obj_12spidermonkey_ProxyObject *); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_context_get_object(struct __pyx_obj_12spidermonkey_Context *,struct JSObject *); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_context_get_object_from_obj(struct __pyx_obj_12spidermonkey_Context *,PyObject *); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_context_get_callback_fn(struct __pyx_obj_12spidermonkey_Context *,PyObject *); /*proto*/
+static struct __pyx_obj_12spidermonkey_ProxyClass *__pyx_f_12spidermonkey_context_get_class(struct __pyx_obj_12spidermonkey_Context *,PyObject *); /*proto*/
+static struct __pyx_obj_12spidermonkey_ProxyFunction *__pyx_f_12spidermonkey_create_proxy_function(struct __pyx_obj_12spidermonkey_Context *,__pyx_t_12spidermonkey_jsval); /*proto*/
+static __pyx_t_12spidermonkey_JSBool __pyx_f_12spidermonkey_constructor_cb(struct JSContext *,struct JSObject *,__pyx_t_12spidermonkey_uintN,__pyx_t_12spidermonkey_jsval *,__pyx_t_12spidermonkey_jsval *); /*proto*/
+static __pyx_t_12spidermonkey_JSBool __pyx_f_12spidermonkey_bound_method_cb(struct JSContext *,struct JSObject *,__pyx_t_12spidermonkey_uintN,__pyx_t_12spidermonkey_jsval *,__pyx_t_12spidermonkey_jsval *); /*proto*/
+static __pyx_t_12spidermonkey_jsval __pyx_f_12spidermonkey_new_method(struct JSContext *,PyObject *); /*proto*/
+static __pyx_t_12spidermonkey_JSBool __pyx_f_12spidermonkey_resolve_global(struct JSContext *,struct JSObject *,__pyx_t_12spidermonkey_jsval); /*proto*/
+static void __pyx_f_12spidermonkey_finalize(struct JSContext *,struct JSObject *); /*proto*/
+static __pyx_t_12spidermonkey_JSBool __pyx_f_12spidermonkey_get_property(struct JSContext *,struct JSObject *,__pyx_t_12spidermonkey_jsval,__pyx_t_12spidermonkey_jsval *); /*proto*/
+static __pyx_t_12spidermonkey_JSBool __pyx_f_12spidermonkey_set_property(struct JSContext *,struct JSObject *,__pyx_t_12spidermonkey_jsval,__pyx_t_12spidermonkey_jsval *); /*proto*/
+static __pyx_t_12spidermonkey_JSBool __pyx_f_12spidermonkey_function_cb(struct JSContext *,struct JSObject *,__pyx_t_12spidermonkey_uintN,__pyx_t_12spidermonkey_jsval *,__pyx_t_12spidermonkey_jsval *); /*proto*/
+static __pyx_t_12spidermonkey_jsval __pyx_f_12spidermonkey_JS_from_Py(struct JSContext *,struct JSObject *,PyObject *); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_dict_from_JShash(struct JSContext *,struct JSObject *); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_list_from_JSarray(struct JSContext *,struct JSObject *); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_Py_from_JSprimitive(__pyx_t_12spidermonkey_jsval); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_Py_from_JS(struct JSContext *,__pyx_t_12spidermonkey_jsval); /*proto*/
+
+static char __pyx_k1[] = "TupleType";
+static char __pyx_k2[] = "compat_isinstance";
+static char __pyx_k3[] = "IntType";
+static char __pyx_k4[] = "LongType";
+static char __pyx_k5[] = "FloatType";
+static char __pyx_k6[] = "StringTypes";
+static char __pyx_k7[] = "ListType";
+static char __pyx_k8[] = "DictType";
+static char __pyx_k9[] = "StringIO";
+static char __pyx_k10[] = "traceback";
+static char __pyx_k11[] = "print_exc";
+static char __pyx_k12[] = "getvalue";
+static char __pyx_k13[] = "sys";
+static char __pyx_k14[] = "stderr";
+static char __pyx_k15[] = "write";
+static char __pyx_k16[] = "%s:\n<no code>\n";
+static char __pyx_k17[] = "max";
+static char __pyx_k18[] = "min";
+static char __pyx_k19[] = " %s\n";
+static char __pyx_k20[] = "+%s\n";
+static char __pyx_k21[] = "\nJavaScript error at line %d: \"%s\":\n%s\n";
+static char __pyx_k22[] = "RUNTIMES";
+static char __pyx_k23[] = "Runtime not found";
+static char __pyx_k24[] = "can't create JavaScript runtime";
+static char __pyx_k25[] = "append";
+static char __pyx_k26[] = "finish_initialization";
+static char __pyx_k27[] = "JSContext not found in Runtime '%s'";
+static char __pyx_k28[] = "rt";
+static char __pyx_k29[] = "can't create JavaScript context";
+static char __pyx_k30[] = "bind_class";
+static char __pyx_k31[] = "__class__";
+static char __pyx_k32[] = "js_classname";
+static char __pyx_k33[] = "can't create JS global object";
+static char __pyx_k34[] = "can't initialise standard JS classes";
+static char __pyx_k35[] = "can't define JavaScript functions";
+static char __pyx_k36[] = "isstringlike";
+static char __pyx_k37[] = "name must be string-like";
+static char __pyx_k38[] = "can't get JavaScript property";
+static char __pyx_k39[] = "no global named '%s'";
+static char __pyx_k40[] = "callable";
+static char __pyx_k41[] = "not a callable object";
+static char __pyx_k42[] = "inspect";
+static char __pyx_k43[] = "isclass";
+static char __pyx_k44[] = "klass must be a class";
+static char __pyx_k45[] = "isinteger";
+static char __pyx_k46[] = "flags must be an integer";
+static char __pyx_k47[] = "failed to bind Python object %s";
+static char __pyx_k48[] = "no function named '%s'";
+static char __pyx_k49[] = "extend";
+static char __pyx_k50[] = "split";
+static char __pyx_k51[] = "\n";
+static char __pyx_k52[] = "Python";
+static char __pyx_k53[] = "JSError";
+static char __pyx_k54[] = "can't evaluate JavaScript script: %s";
+static char __pyx_k55[] = "remove";
+static char __pyx_k56[] = "object not found in context";
+static char __pyx_k57[] = "no callback function named '%s' is bound";
+static char __pyx_k58[] = "no class named '%s' is bound";
+static char __pyx_k59[] = "couldn't initialise JavaScript proxy class";
+static char __pyx_k60[] = "AttributeError";
+static char __pyx_k61[] = "%s has no detectable class.";
+static char __pyx_k62[] = "js_name";
+static char __pyx_k63[] = "__name__";
+static char __pyx_k64[] = "%s js_name attribute is not string-like";
+static char __pyx_k65[] = "ok";
+static char __pyx_k66[] = "Value is not a function: %s";
+static char __pyx_k67[] = "couldn't get JS constructor";
+static char __pyx_k68[] = "js_constructor";
+static char __pyx_k69[] = "func_name";
+static char __pyx_k70[] = "StringType";
+static char __pyx_k71[] = "MethodType";
+static char __pyx_k72[] = "bind_callable";
+static char __pyx_k73[] = "bind_attribute";
+static char __pyx_k74[] = "startswith";
+static char __pyx_k75[] = "_";
+static char __pyx_k76[] = "Illegal key: %s";
+static char __pyx_k77[] = "Didn't expect key: %s";
+static char __pyx_k78[] = "isfloat";
+static char __pyx_k79[] = "can't create new double";
+static char __pyx_k80[] = "can't create new string";
+static char __pyx_k81[] = "ismapping";
+static char __pyx_k82[] = "can't create new object";
+static char __pyx_k83[] = "iteritems";
+static char __pyx_k84[] = "can't define property";
+static char __pyx_k85[] = "issequence";
+static char __pyx_k86[] = "can't create new array object";
+static char __pyx_k87[] = "can't define element";
+static char __pyx_k88[] = "FunctionType";
+static char __pyx_k89[] = "LambdaType";
+static char __pyx_k90[] = "couldn't look up or create new object";
+static char __pyx_k91[] = "can't happen";
+static char __pyx_k92[] = "unknown primitive type";
+static char __pyx_k93[] = "cStringIO";
+static char __pyx_k94[] = "types";
+static char __pyx_k95[] = "InstanceType";
+
+static PyObject *__pyx_n_AttributeError;
+static PyObject *__pyx_n_DictType;
+static PyObject *__pyx_n_FloatType;
+static PyObject *__pyx_n_FunctionType;
+static PyObject *__pyx_n_InstanceType;
+static PyObject *__pyx_n_IntType;
+static PyObject *__pyx_n_JSError;
+static PyObject *__pyx_n_LambdaType;
+static PyObject *__pyx_n_ListType;
+static PyObject *__pyx_n_LongType;
+static PyObject *__pyx_n_MethodType;
+static PyObject *__pyx_n_RUNTIMES;
+static PyObject *__pyx_n_StringIO;
+static PyObject *__pyx_n_StringType;
+static PyObject *__pyx_n_StringTypes;
+static PyObject *__pyx_n_TupleType;
+static PyObject *__pyx_n__;
+static PyObject *__pyx_n___class__;
+static PyObject *__pyx_n___name__;
+static PyObject *__pyx_n_append;
+static PyObject *__pyx_n_bind_attribute;
+static PyObject *__pyx_n_bind_callable;
+static PyObject *__pyx_n_bind_class;
+static PyObject *__pyx_n_cStringIO;
+static PyObject *__pyx_n_callable;
+static PyObject *__pyx_n_compat_isinstance;
+static PyObject *__pyx_n_extend;
+static PyObject *__pyx_n_finish_initialization;
+static PyObject *__pyx_n_func_name;
+static PyObject *__pyx_n_getvalue;
+static PyObject *__pyx_n_inspect;
+static PyObject *__pyx_n_isclass;
+static PyObject *__pyx_n_isfloat;
+static PyObject *__pyx_n_isinteger;
+static PyObject *__pyx_n_ismapping;
+static PyObject *__pyx_n_issequence;
+static PyObject *__pyx_n_isstringlike;
+static PyObject *__pyx_n_iteritems;
+static PyObject *__pyx_n_js_classname;
+static PyObject *__pyx_n_js_constructor;
+static PyObject *__pyx_n_js_name;
+static PyObject *__pyx_n_max;
+static PyObject *__pyx_n_min;
+static PyObject *__pyx_n_ok;
+static PyObject *__pyx_n_print_exc;
+static PyObject *__pyx_n_remove;
+static PyObject *__pyx_n_rt;
+static PyObject *__pyx_n_split;
+static PyObject *__pyx_n_startswith;
+static PyObject *__pyx_n_stderr;
+static PyObject *__pyx_n_sys;
+static PyObject *__pyx_n_traceback;
+static PyObject *__pyx_n_types;
+static PyObject *__pyx_n_write;
+
+static PyObject *__pyx_k16p;
+static PyObject *__pyx_k19p;
+static PyObject *__pyx_k20p;
+static PyObject *__pyx_k21p;
+static PyObject *__pyx_k23p;
+static PyObject *__pyx_k24p;
+static PyObject *__pyx_k27p;
+static PyObject *__pyx_k29p;
+static PyObject *__pyx_k33p;
+static PyObject *__pyx_k34p;
+static PyObject *__pyx_k35p;
+static PyObject *__pyx_k37p;
+static PyObject *__pyx_k38p;
+static PyObject *__pyx_k39p;
+static PyObject *__pyx_k41p;
+static PyObject *__pyx_k44p;
+static PyObject *__pyx_k46p;
+static PyObject *__pyx_k47p;
+static PyObject *__pyx_k48p;
+static PyObject *__pyx_k51p;
+static PyObject *__pyx_k54p;
+static PyObject *__pyx_k56p;
+static PyObject *__pyx_k57p;
+static PyObject *__pyx_k58p;
+static PyObject *__pyx_k59p;
+static PyObject *__pyx_k61p;
+static PyObject *__pyx_k64p;
+static PyObject *__pyx_k66p;
+static PyObject *__pyx_k67p;
+static PyObject *__pyx_k76p;
+static PyObject *__pyx_k77p;
+static PyObject *__pyx_k79p;
+static PyObject *__pyx_k80p;
+static PyObject *__pyx_k82p;
+static PyObject *__pyx_k84p;
+static PyObject *__pyx_k86p;
+static PyObject *__pyx_k87p;
+static PyObject *__pyx_k90p;
+static PyObject *__pyx_k91p;
+static PyObject *__pyx_k92p;
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+  {&__pyx_n_AttributeError, 1, __pyx_k60, sizeof(__pyx_k60)},
+  {&__pyx_n_DictType, 1, __pyx_k8, sizeof(__pyx_k8)},
+  {&__pyx_n_FloatType, 1, __pyx_k5, sizeof(__pyx_k5)},
+  {&__pyx_n_FunctionType, 1, __pyx_k88, sizeof(__pyx_k88)},
+  {&__pyx_n_InstanceType, 1, __pyx_k95, sizeof(__pyx_k95)},
+  {&__pyx_n_IntType, 1, __pyx_k3, sizeof(__pyx_k3)},
+  {&__pyx_n_JSError, 1, __pyx_k53, sizeof(__pyx_k53)},
+  {&__pyx_n_LambdaType, 1, __pyx_k89, sizeof(__pyx_k89)},
+  {&__pyx_n_ListType, 1, __pyx_k7, sizeof(__pyx_k7)},
+  {&__pyx_n_LongType, 1, __pyx_k4, sizeof(__pyx_k4)},
+  {&__pyx_n_MethodType, 1, __pyx_k71, sizeof(__pyx_k71)},
+  {&__pyx_n_RUNTIMES, 1, __pyx_k22, sizeof(__pyx_k22)},
+  {&__pyx_n_StringIO, 1, __pyx_k9, sizeof(__pyx_k9)},
+  {&__pyx_n_StringType, 1, __pyx_k70, sizeof(__pyx_k70)},
+  {&__pyx_n_StringTypes, 1, __pyx_k6, sizeof(__pyx_k6)},
+  {&__pyx_n_TupleType, 1, __pyx_k1, sizeof(__pyx_k1)},
+  {&__pyx_n__, 1, __pyx_k75, sizeof(__pyx_k75)},
+  {&__pyx_n___class__, 1, __pyx_k31, sizeof(__pyx_k31)},
+  {&__pyx_n___name__, 1, __pyx_k63, sizeof(__pyx_k63)},
+  {&__pyx_n_append, 1, __pyx_k25, sizeof(__pyx_k25)},
+  {&__pyx_n_bind_attribute, 1, __pyx_k73, sizeof(__pyx_k73)},
+  {&__pyx_n_bind_callable, 1, __pyx_k72, sizeof(__pyx_k72)},
+  {&__pyx_n_bind_class, 1, __pyx_k30, sizeof(__pyx_k30)},
+  {&__pyx_n_cStringIO, 1, __pyx_k93, sizeof(__pyx_k93)},
+  {&__pyx_n_callable, 1, __pyx_k40, sizeof(__pyx_k40)},
+  {&__pyx_n_compat_isinstance, 1, __pyx_k2, sizeof(__pyx_k2)},
+  {&__pyx_n_extend, 1, __pyx_k49, sizeof(__pyx_k49)},
+  {&__pyx_n_finish_initialization, 1, __pyx_k26, sizeof(__pyx_k26)},
+  {&__pyx_n_func_name, 1, __pyx_k69, sizeof(__pyx_k69)},
+  {&__pyx_n_getvalue, 1, __pyx_k12, sizeof(__pyx_k12)},
+  {&__pyx_n_inspect, 1, __pyx_k42, sizeof(__pyx_k42)},
+  {&__pyx_n_isclass, 1, __pyx_k43, sizeof(__pyx_k43)},
+  {&__pyx_n_isfloat, 1, __pyx_k78, sizeof(__pyx_k78)},
+  {&__pyx_n_isinteger, 1, __pyx_k45, sizeof(__pyx_k45)},
+  {&__pyx_n_ismapping, 1, __pyx_k81, sizeof(__pyx_k81)},
+  {&__pyx_n_issequence, 1, __pyx_k85, sizeof(__pyx_k85)},
+  {&__pyx_n_isstringlike, 1, __pyx_k36, sizeof(__pyx_k36)},
+  {&__pyx_n_iteritems, 1, __pyx_k83, sizeof(__pyx_k83)},
+  {&__pyx_n_js_classname, 1, __pyx_k32, sizeof(__pyx_k32)},
+  {&__pyx_n_js_constructor, 1, __pyx_k68, sizeof(__pyx_k68)},
+  {&__pyx_n_js_name, 1, __pyx_k62, sizeof(__pyx_k62)},
+  {&__pyx_n_max, 1, __pyx_k17, sizeof(__pyx_k17)},
+  {&__pyx_n_min, 1, __pyx_k18, sizeof(__pyx_k18)},
+  {&__pyx_n_ok, 1, __pyx_k65, sizeof(__pyx_k65)},
+  {&__pyx_n_print_exc, 1, __pyx_k11, sizeof(__pyx_k11)},
+  {&__pyx_n_remove, 1, __pyx_k55, sizeof(__pyx_k55)},
+  {&__pyx_n_rt, 1, __pyx_k28, sizeof(__pyx_k28)},
+  {&__pyx_n_split, 1, __pyx_k50, sizeof(__pyx_k50)},
+  {&__pyx_n_startswith, 1, __pyx_k74, sizeof(__pyx_k74)},
+  {&__pyx_n_stderr, 1, __pyx_k14, sizeof(__pyx_k14)},
+  {&__pyx_n_sys, 1, __pyx_k13, sizeof(__pyx_k13)},
+  {&__pyx_n_traceback, 1, __pyx_k10, sizeof(__pyx_k10)},
+  {&__pyx_n_types, 1, __pyx_k94, sizeof(__pyx_k94)},
+  {&__pyx_n_write, 1, __pyx_k15, sizeof(__pyx_k15)},
+  {&__pyx_k16p, 0, __pyx_k16, sizeof(__pyx_k16)},
+  {&__pyx_k19p, 0, __pyx_k19, sizeof(__pyx_k19)},
+  {&__pyx_k20p, 0, __pyx_k20, sizeof(__pyx_k20)},
+  {&__pyx_k21p, 0, __pyx_k21, sizeof(__pyx_k21)},
+  {&__pyx_k23p, 0, __pyx_k23, sizeof(__pyx_k23)},
+  {&__pyx_k24p, 0, __pyx_k24, sizeof(__pyx_k24)},
+  {&__pyx_k27p, 0, __pyx_k27, sizeof(__pyx_k27)},
+  {&__pyx_k29p, 0, __pyx_k29, sizeof(__pyx_k29)},
+  {&__pyx_k33p, 0, __pyx_k33, sizeof(__pyx_k33)},
+  {&__pyx_k34p, 0, __pyx_k34, sizeof(__pyx_k34)},
+  {&__pyx_k35p, 0, __pyx_k35, sizeof(__pyx_k35)},
+  {&__pyx_k37p, 0, __pyx_k37, sizeof(__pyx_k37)},
+  {&__pyx_k38p, 0, __pyx_k38, sizeof(__pyx_k38)},
+  {&__pyx_k39p, 0, __pyx_k39, sizeof(__pyx_k39)},
+  {&__pyx_k41p, 0, __pyx_k41, sizeof(__pyx_k41)},
+  {&__pyx_k44p, 0, __pyx_k44, sizeof(__pyx_k44)},
+  {&__pyx_k46p, 0, __pyx_k46, sizeof(__pyx_k46)},
+  {&__pyx_k47p, 0, __pyx_k47, sizeof(__pyx_k47)},
+  {&__pyx_k48p, 0, __pyx_k48, sizeof(__pyx_k48)},
+  {&__pyx_k51p, 0, __pyx_k51, sizeof(__pyx_k51)},
+  {&__pyx_k54p, 0, __pyx_k54, sizeof(__pyx_k54)},
+  {&__pyx_k56p, 0, __pyx_k56, sizeof(__pyx_k56)},
+  {&__pyx_k57p, 0, __pyx_k57, sizeof(__pyx_k57)},
+  {&__pyx_k58p, 0, __pyx_k58, sizeof(__pyx_k58)},
+  {&__pyx_k59p, 0, __pyx_k59, sizeof(__pyx_k59)},
+  {&__pyx_k61p, 0, __pyx_k61, sizeof(__pyx_k61)},
+  {&__pyx_k64p, 0, __pyx_k64, sizeof(__pyx_k64)},
+  {&__pyx_k66p, 0, __pyx_k66, sizeof(__pyx_k66)},
+  {&__pyx_k67p, 0, __pyx_k67, sizeof(__pyx_k67)},
+  {&__pyx_k76p, 0, __pyx_k76, sizeof(__pyx_k76)},
+  {&__pyx_k77p, 0, __pyx_k77, sizeof(__pyx_k77)},
+  {&__pyx_k79p, 0, __pyx_k79, sizeof(__pyx_k79)},
+  {&__pyx_k80p, 0, __pyx_k80, sizeof(__pyx_k80)},
+  {&__pyx_k82p, 0, __pyx_k82, sizeof(__pyx_k82)},
+  {&__pyx_k84p, 0, __pyx_k84, sizeof(__pyx_k84)},
+  {&__pyx_k86p, 0, __pyx_k86, sizeof(__pyx_k86)},
+  {&__pyx_k87p, 0, __pyx_k87, sizeof(__pyx_k87)},
+  {&__pyx_k90p, 0, __pyx_k90, sizeof(__pyx_k90)},
+  {&__pyx_k91p, 0, __pyx_k91, sizeof(__pyx_k91)},
+  {&__pyx_k92p, 0, __pyx_k92, sizeof(__pyx_k92)},
+  {0, 0, 0, 0}
+};
+
+static PyObject *__pyx_d1;
+static PyObject *__pyx_d2;
+static PyObject *__pyx_d3;
+static PyObject *__pyx_d4;
+
+
+/* Implementation of spidermonkey */
+
+static PyObject *__pyx_f_12spidermonkey_compat_isinstance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_compat_isinstance(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_obj = 0;
+  PyObject *__pyx_v_tuple_or_obj = 0;
+  PyObject *__pyx_v_otherobj;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  int __pyx_3;
+  static char *__pyx_argnames[] = {"obj","tuple_or_obj",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_obj, &__pyx_v_tuple_or_obj)) return 0;
+  Py_INCREF(__pyx_v_obj);
+  Py_INCREF(__pyx_v_tuple_or_obj);
+  __pyx_v_otherobj = Py_None; Py_INCREF(Py_None);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":371 */
+  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_tuple_or_obj);
+  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_tuple_or_obj);
+  __pyx_2 = PyObject_CallObject(((PyObject *)(&PyType_Type)), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_TupleType); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;}
+  if (PyObject_Cmp(__pyx_2, __pyx_1, &__pyx_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; goto __pyx_L1;}
+  __pyx_3 = __pyx_3 == 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  if (__pyx_3) {
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":372 */
+    __pyx_2 = PyObject_GetIter(__pyx_v_tuple_or_obj); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; goto __pyx_L1;}
+    for (;;) {
+      __pyx_1 = PyIter_Next(__pyx_2);
+      if (!__pyx_1) {
+        if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; goto __pyx_L1;}
+        break;
+      }
+      Py_DECREF(__pyx_v_otherobj);
+      __pyx_v_otherobj = __pyx_1;
+      __pyx_1 = 0;
+      __pyx_3 = PyObject_IsInstance(__pyx_v_obj,__pyx_v_otherobj); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 373; goto __pyx_L1;}
+      if (__pyx_3) {
+        Py_INCREF(Py_True);
+        __pyx_r = Py_True;
+        Py_DECREF(__pyx_2); __pyx_2 = 0;
+        goto __pyx_L0;
+        goto __pyx_L5;
+      }
+      __pyx_L5:;
+    }
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":375 */
+    Py_INCREF(Py_False);
+    __pyx_r = Py_False;
+    goto __pyx_L0;
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":376 */
+  __pyx_3 = PyObject_IsInstance(__pyx_v_obj,__pyx_v_tuple_or_obj); if (__pyx_3 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; goto __pyx_L1;}
+  __pyx_1 = PyInt_FromLong(__pyx_3); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; goto __pyx_L1;}
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  __Pyx_AddTraceback("spidermonkey.compat_isinstance");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_otherobj);
+  Py_DECREF(__pyx_v_obj);
+  Py_DECREF(__pyx_v_tuple_or_obj);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_12spidermonkey_isinteger(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_isinteger(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_x = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  int __pyx_5;
+  static char *__pyx_argnames[] = {"x",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0;
+  Py_INCREF(__pyx_v_x);
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_compat_isinstance); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
+  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_IntType); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
+  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_LongType); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
+  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
+  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
+  __pyx_2 = 0;
+  __pyx_3 = 0;
+  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_x);
+  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);
+  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
+  __pyx_4 = 0;
+  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_5 = PyObject_IsTrue(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  __pyx_4 = PyInt_FromLong(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; goto __pyx_L1;}
+  __pyx_r = __pyx_4;
+  __pyx_4 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("spidermonkey.isinteger");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_x);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_12spidermonkey_isfloat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_isfloat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_x = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  int __pyx_4;
+  static char *__pyx_argnames[] = {"x",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0;
+  Py_INCREF(__pyx_v_x);
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_compat_isinstance); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
+  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_FloatType); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_x);
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_x);
+  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_1 = PyInt_FromLong(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; goto __pyx_L1;}
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("spidermonkey.isfloat");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_x);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_12spidermonkey_isstringlike(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_isstringlike(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_x = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  int __pyx_4;
+  static char *__pyx_argnames[] = {"x",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0;
+  Py_INCREF(__pyx_v_x);
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_compat_isinstance); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}
+  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_StringTypes); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_x);
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_x);
+  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_1 = PyInt_FromLong(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; goto __pyx_L1;}
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("spidermonkey.isstringlike");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_x);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_12spidermonkey_issequence(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_issequence(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_x = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  int __pyx_5;
+  static char *__pyx_argnames[] = {"x",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0;
+  Py_INCREF(__pyx_v_x);
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_compat_isinstance); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
+  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_ListType); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
+  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_TupleType); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
+  __pyx_4 = PyTuple_New(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_4, 0, __pyx_2);
+  PyTuple_SET_ITEM(__pyx_4, 1, __pyx_3);
+  __pyx_2 = 0;
+  __pyx_3 = 0;
+  __pyx_2 = PyTuple_New(2); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_x);
+  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_x);
+  PyTuple_SET_ITEM(__pyx_2, 1, __pyx_4);
+  __pyx_4 = 0;
+  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_5 = PyObject_IsTrue(__pyx_3); if (__pyx_5 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  __pyx_4 = PyInt_FromLong(__pyx_5); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 388; goto __pyx_L1;}
+  __pyx_r = __pyx_4;
+  __pyx_4 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("spidermonkey.issequence");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_x);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_12spidermonkey_ismapping(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_ismapping(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_x = 0;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  int __pyx_4;
+  static char *__pyx_argnames[] = {"x",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "O", __pyx_argnames, &__pyx_v_x)) return 0;
+  Py_INCREF(__pyx_v_x);
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_compat_isinstance); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
+  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_n_DictType); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
+  __pyx_3 = PyTuple_New(2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_x);
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_x);
+  PyTuple_SET_ITEM(__pyx_3, 1, __pyx_2);
+  __pyx_2 = 0;
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  __pyx_4 = PyObject_IsTrue(__pyx_2); if (__pyx_4 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_1 = PyInt_FromLong(__pyx_4); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 391; goto __pyx_L1;}
+  __pyx_r = __pyx_1;
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("spidermonkey.ismapping");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_x);
+  return __pyx_r;
+}
+
+static __pyx_t_12spidermonkey_JSBool __pyx_f_12spidermonkey_report(struct JSContext *__pyx_v_cx) {
+  PyObject *__pyx_v_f;
+  PyObject *__pyx_v_msg;
+  __pyx_t_12spidermonkey_JSBool __pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  __pyx_v_f = Py_None; Py_INCREF(Py_None);
+  __pyx_v_msg = Py_None; Py_INCREF(Py_None);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":395 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_StringIO); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;}
+  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 395; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_v_f);
+  __pyx_v_f = __pyx_2;
+  __pyx_2 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":396 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_traceback); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;}
+  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_print_exc); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;}
+  Py_INCREF(Py_None);
+  PyTuple_SET_ITEM(__pyx_1, 0, Py_None);
+  Py_INCREF(__pyx_v_f);
+  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_f);
+  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 396; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":397 */
+  __pyx_2 = PyObject_GetAttr(__pyx_v_f, __pyx_n_getvalue); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
+  __pyx_1 = PyObject_CallObject(__pyx_2, 0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 397; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(__pyx_v_msg);
+  __pyx_v_msg = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":400 */
+  __pyx_3 = __Pyx_GetName(__pyx_m, __pyx_n_sys); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; goto __pyx_L1;}
+  __pyx_2 = PyObject_GetAttr(__pyx_3, __pyx_n_stderr); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; goto __pyx_L1;}
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  __pyx_1 = PyObject_GetAttr(__pyx_2, __pyx_n_write); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_3 = PyTuple_New(1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_msg);
+  PyTuple_SET_ITEM(__pyx_3, 0, __pyx_v_msg);
+  __pyx_2 = PyObject_CallObject(__pyx_1, __pyx_3); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":401 */
+  __pyx_r = JS_FALSE;
+  goto __pyx_L0;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_WriteUnraisable("spidermonkey.report");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_f);
+  Py_DECREF(__pyx_v_msg);
+  return __pyx_r;
+}
+
+static void __pyx_f_12spidermonkey_report_error(struct JSContext *__pyx_v_cx,char *__pyx_v_message,struct JSErrorReport *__pyx_v_report) {
+  struct __pyx_obj_12spidermonkey_Context *__pyx_v_context;
+  PyObject *__pyx_v_lines;
+  PyObject *__pyx_v_msg;
+  PyObject *__pyx_v_i;
+  PyObject *__pyx_v_n;
+  PyObject *__pyx_v_start;
+  PyObject *__pyx_v_end;
+  PyObject *__pyx_v_nr_pre;
+  PyObject *__pyx_v_nr_post;
+  PyObject *__pyx_v_data;
+  PyObject *__pyx_v_outer_fmt;
+  PyObject *__pyx_v_inner_fmt;
+  PyObject *__pyx_v_fmt;
+  PyObject *__pyx_v_line;
+  PyObject *__pyx_1 = 0;
+  Py_ssize_t __pyx_2;
+  int __pyx_3;
+  PyObject *__pyx_4 = 0;
+  PyObject *__pyx_5 = 0;
+  PyObject *__pyx_6 = 0;
+  Py_ssize_t __pyx_7;
+  __pyx_v_context = ((struct __pyx_obj_12spidermonkey_Context *)Py_None); Py_INCREF(Py_None);
+  __pyx_v_lines = Py_None; Py_INCREF(Py_None);
+  __pyx_v_msg = Py_None; Py_INCREF(Py_None);
+  __pyx_v_i = Py_None; Py_INCREF(Py_None);
+  __pyx_v_n = Py_None; Py_INCREF(Py_None);
+  __pyx_v_start = Py_None; Py_INCREF(Py_None);
+  __pyx_v_end = Py_None; Py_INCREF(Py_None);
+  __pyx_v_nr_pre = Py_None; Py_INCREF(Py_None);
+  __pyx_v_nr_post = Py_None; Py_INCREF(Py_None);
+  __pyx_v_data = Py_None; Py_INCREF(Py_None);
+  __pyx_v_outer_fmt = Py_None; Py_INCREF(Py_None);
+  __pyx_v_inner_fmt = Py_None; Py_INCREF(Py_None);
+  __pyx_v_fmt = Py_None; Py_INCREF(Py_None);
+  __pyx_v_line = Py_None; Py_INCREF(Py_None);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":407 */
+  __pyx_1 = ((PyObject *)__pyx_f_12spidermonkey_get_context(__pyx_v_cx)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 407; goto __pyx_L1;}
+  Py_DECREF(((PyObject *)__pyx_v_context));
+  __pyx_v_context = ((struct __pyx_obj_12spidermonkey_Context *)__pyx_1);
+  __pyx_1 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":409 */
+  Py_INCREF(__pyx_v_context->_evaled_script);
+  Py_DECREF(__pyx_v_lines);
+  __pyx_v_lines = __pyx_v_context->_evaled_script;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":411 */
+  __pyx_2 = PyObject_Length(__pyx_v_lines); if (__pyx_2 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 411; goto __pyx_L1;}
+  __pyx_3 = (__pyx_2 == 0);
+  if (__pyx_3) {
+    __pyx_1 = PyString_FromString(__pyx_v_message); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}
+    __pyx_4 = PyNumber_Remainder(__pyx_k16p, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 412; goto __pyx_L1;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    Py_DECREF(__pyx_v_msg);
+    __pyx_v_msg = __pyx_4;
+    __pyx_4 = 0;
+    goto __pyx_L2;
+  }
+  /*else*/ {
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":414 */
+    __pyx_1 = PyInt_FromLong(__pyx_v_report->lineno); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 414; goto __pyx_L1;}
+    Py_DECREF(__pyx_v_i);
+    __pyx_v_i = __pyx_1;
+    __pyx_1 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":415 */
+    __pyx_4 = PyInt_FromLong(2); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; goto __pyx_L1;}
+    Py_DECREF(__pyx_v_n);
+    __pyx_v_n = __pyx_4;
+    __pyx_4 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":417 */
+    __pyx_1 = __Pyx_GetName(__pyx_b, __pyx_n_max); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;}
+    __pyx_4 = PyNumber_Subtract(__pyx_v_i, __pyx_v_n); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;}
+    __pyx_5 = PyInt_FromLong(0); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;}
+    __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_4);
+    PyTuple_SET_ITEM(__pyx_6, 1, __pyx_5);
+    __pyx_4 = 0;
+    __pyx_5 = 0;
+    __pyx_4 = PyObject_CallObject(__pyx_1, __pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 417; goto __pyx_L1;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    Py_DECREF(__pyx_6); __pyx_6 = 0;
+    Py_DECREF(__pyx_v_start);
+    __pyx_v_start = __pyx_4;
+    __pyx_4 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":418 */
+    __pyx_5 = __Pyx_GetName(__pyx_b, __pyx_n_min); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+    __pyx_1 = PyNumber_Add(__pyx_v_i, __pyx_v_n); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+    __pyx_6 = PyInt_FromLong(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+    __pyx_4 = PyNumber_Add(__pyx_1, __pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    Py_DECREF(__pyx_6); __pyx_6 = 0;
+    __pyx_2 = PyObject_Length(__pyx_v_lines); if (__pyx_2 == -1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+    __pyx_1 = PyInt_FromSsize_t(__pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+    __pyx_6 = PyTuple_New(2); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_4);
+    PyTuple_SET_ITEM(__pyx_6, 1, __pyx_1);
+    __pyx_4 = 0;
+    __pyx_1 = 0;
+    __pyx_4 = PyObject_CallObject(__pyx_5, __pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 418; goto __pyx_L1;}
+    Py_DECREF(__pyx_5); __pyx_5 = 0;
+    Py_DECREF(__pyx_6); __pyx_6 = 0;
+    Py_DECREF(__pyx_v_end);
+    __pyx_v_end = __pyx_4;
+    __pyx_4 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":419 */
+    __pyx_1 = PyNumber_Subtract(__pyx_v_i, __pyx_v_start); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 419; goto __pyx_L1;}
+    Py_DECREF(__pyx_v_nr_pre);
+    __pyx_v_nr_pre = __pyx_1;
+    __pyx_1 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":420 */
+    __pyx_5 = PyNumber_Subtract(__pyx_v_end, __pyx_v_i); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;}
+    __pyx_6 = PyInt_FromLong(1); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;}
+    __pyx_4 = PyNumber_Subtract(__pyx_5, __pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; goto __pyx_L1;}
+    Py_DECREF(__pyx_5); __pyx_5 = 0;
+    Py_DECREF(__pyx_6); __pyx_6 = 0;
+    Py_DECREF(__pyx_v_nr_post);
+    __pyx_v_nr_post = __pyx_4;
+    __pyx_4 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":422 */
+    __pyx_2 = PyInt_AsSsize_t(__pyx_v_start); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;}
+    __pyx_7 = PyInt_AsSsize_t(__pyx_v_end); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;}
+    __pyx_1 = PySequence_GetSlice(__pyx_v_lines, __pyx_2, __pyx_7); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;}
+    __pyx_5 = PyTuple_New(1); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_5, 0, __pyx_1);
+    __pyx_1 = 0;
+    __pyx_6 = PyObject_CallObject(((PyObject *)(&PyTuple_Type)), __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 422; goto __pyx_L1;}
+    Py_DECREF(__pyx_5); __pyx_5 = 0;
+    Py_DECREF(__pyx_v_data);
+    __pyx_v_data = __pyx_6;
+    __pyx_6 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":424 */
+    Py_INCREF(__pyx_k19p);
+    Py_DECREF(__pyx_v_outer_fmt);
+    __pyx_v_outer_fmt = __pyx_k19p;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":425 */
+    Py_INCREF(__pyx_k20p);
+    Py_DECREF(__pyx_v_inner_fmt);
+    __pyx_v_inner_fmt = __pyx_k20p;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":426 */
+    __pyx_4 = PyNumber_Multiply(__pyx_v_outer_fmt, __pyx_v_nr_pre); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}
+    __pyx_1 = PyNumber_Add(__pyx_4, __pyx_v_inner_fmt); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    __pyx_5 = PyNumber_Multiply(__pyx_v_outer_fmt, __pyx_v_nr_post); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}
+    __pyx_6 = PyNumber_Add(__pyx_1, __pyx_5); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 426; goto __pyx_L1;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    Py_DECREF(__pyx_5); __pyx_5 = 0;
+    Py_DECREF(__pyx_v_fmt);
+    __pyx_v_fmt = __pyx_6;
+    __pyx_6 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":427 */
+    __pyx_4 = PyNumber_Remainder(__pyx_v_fmt, __pyx_v_data); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; goto __pyx_L1;}
+    Py_DECREF(__pyx_v_line);
+    __pyx_v_line = __pyx_4;
+    __pyx_4 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":428 */
+    __pyx_1 = PyInt_FromLong(__pyx_v_report->lineno); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; goto __pyx_L1;}
+    __pyx_5 = PyString_FromString(__pyx_v_message); if (!__pyx_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; goto __pyx_L1;}
+    __pyx_6 = PyTuple_New(3); if (!__pyx_6) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_6, 0, __pyx_1);
+    PyTuple_SET_ITEM(__pyx_6, 1, __pyx_5);
+    Py_INCREF(__pyx_v_line);
+    PyTuple_SET_ITEM(__pyx_6, 2, __pyx_v_line);
+    __pyx_1 = 0;
+    __pyx_5 = 0;
+    __pyx_4 = PyNumber_Remainder(__pyx_k21p, __pyx_6); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; goto __pyx_L1;}
+    Py_DECREF(__pyx_6); __pyx_6 = 0;
+    Py_DECREF(__pyx_v_msg);
+    __pyx_v_msg = __pyx_4;
+    __pyx_4 = 0;
+  }
+  __pyx_L2:;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":429 */
+  Py_INCREF(__pyx_v_msg);
+  Py_DECREF(__pyx_v_context->_last_error);
+  __pyx_v_context->_last_error = __pyx_v_msg;
+
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_4);
+  Py_XDECREF(__pyx_5);
+  Py_XDECREF(__pyx_6);
+  __Pyx_WriteUnraisable("spidermonkey.report_error");
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_context);
+  Py_DECREF(__pyx_v_lines);
+  Py_DECREF(__pyx_v_msg);
+  Py_DECREF(__pyx_v_i);
+  Py_DECREF(__pyx_v_n);
+  Py_DECREF(__pyx_v_start);
+  Py_DECREF(__pyx_v_end);
+  Py_DECREF(__pyx_v_nr_pre);
+  Py_DECREF(__pyx_v_nr_post);
+  Py_DECREF(__pyx_v_data);
+  Py_DECREF(__pyx_v_outer_fmt);
+  Py_DECREF(__pyx_v_inner_fmt);
+  Py_DECREF(__pyx_v_fmt);
+  Py_DECREF(__pyx_v_line);
+}
+
+static void *__pyx_f_12spidermonkey_xmalloc(__pyx_t_12spidermonkey_size_t __pyx_v_size) {
+  void *__pyx_v_mem;
+  void *__pyx_r;
+  int __pyx_1;
+  PyObject *__pyx_2 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":433 */
+  __pyx_v_mem = malloc(__pyx_v_size);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":434 */
+  __pyx_1 = (((int)__pyx_v_mem) == 0);
+  if (__pyx_1) {
+    __pyx_2 = PyObject_CallObject(PyExc_MemoryError, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; goto __pyx_L1;}
+    __Pyx_Raise(__pyx_2, 0, 0);
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; goto __pyx_L1;}
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":436 */
+  __pyx_r = __pyx_v_mem;
+  goto __pyx_L0;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_2);
+  __Pyx_AddTraceback("spidermonkey.xmalloc");
+  __pyx_r = NULL;
+  __pyx_L0:;
+  return __pyx_r;
+}
+
+static struct __pyx_obj_12spidermonkey_Runtime *__pyx_f_12spidermonkey_get_runtime(struct JSRuntime *__pyx_v_crt) {
+  struct __pyx_obj_12spidermonkey_Runtime *__pyx_v_rt;
+  struct __pyx_obj_12spidermonkey_Runtime *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  int __pyx_3;
+  __pyx_v_rt = ((struct __pyx_obj_12spidermonkey_Runtime *)Py_None); Py_INCREF(Py_None);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":442 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_RUNTIMES); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
+  __pyx_2 = PyObject_GetIter(__pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  for (;;) {
+    __pyx_1 = PyIter_Next(__pyx_2);
+    if (!__pyx_1) {
+      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
+      break;
+    }
+    if (!__Pyx_TypeTest(__pyx_1, __pyx_ptype_12spidermonkey_Runtime)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_v_rt));
+    __pyx_v_rt = ((struct __pyx_obj_12spidermonkey_Runtime *)__pyx_1);
+    __pyx_1 = 0;
+    __pyx_3 = (__pyx_v_rt->rt == __pyx_v_crt);
+    if (__pyx_3) {
+      Py_INCREF(((PyObject *)__pyx_v_rt));
+      __pyx_r = __pyx_v_rt;
+      Py_DECREF(__pyx_2); __pyx_2 = 0;
+      goto __pyx_L0;
+      goto __pyx_L4;
+    }
+    __pyx_L4:;
+  }
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":445 */
+  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
+  Py_INCREF(__pyx_k23p);
+  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k23p);
+  __pyx_2 = PyObject_CallObject(PyExc_ValueError, __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __Pyx_Raise(__pyx_2, 0, 0);
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 445; goto __pyx_L1;}
+
+  __pyx_r = ((struct __pyx_obj_12spidermonkey_Runtime *)Py_None); Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  __Pyx_AddTraceback("spidermonkey.get_runtime");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_rt);
+  return __pyx_r;
+}
+
+static struct __pyx_obj_12spidermonkey_Context *__pyx_f_12spidermonkey_get_context(struct JSContext *__pyx_v_ccx) {
+  struct JSRuntime *__pyx_v_crt;
+  PyObject *__pyx_v_rt;
+  struct __pyx_obj_12spidermonkey_Context *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  __pyx_v_rt = Py_None; Py_INCREF(Py_None);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":450 */
+  __pyx_v_crt = JS_GetRuntime(__pyx_v_ccx);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":451 */
+  __pyx_1 = ((PyObject *)__pyx_f_12spidermonkey_get_runtime(__pyx_v_crt)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; goto __pyx_L1;}
+  Py_DECREF(__pyx_v_rt);
+  __pyx_v_rt = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":452 */
+  if (!__Pyx_TypeTest(__pyx_v_rt, __pyx_ptype_12spidermonkey_Runtime)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}
+  __pyx_1 = ((PyObject *)__pyx_f_12spidermonkey_runtime_get_context(((struct __pyx_obj_12spidermonkey_Runtime *)__pyx_v_rt),__pyx_v_ccx)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; goto __pyx_L1;}
+  __pyx_r = ((struct __pyx_obj_12spidermonkey_Context *)__pyx_1);
+  __pyx_1 = 0;
+  goto __pyx_L0;
+
+  __pyx_r = ((struct __pyx_obj_12spidermonkey_Context *)Py_None); Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  __Pyx_AddTraceback("spidermonkey.get_context");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_rt);
+  return __pyx_r;
+}
+
+static int __pyx_f_12spidermonkey_7Runtime___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_12spidermonkey_7Runtime___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_args = 0;
+  PyObject *__pyx_v_kwargs = 0;
+  int __pyx_r;
+  int __pyx_1;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  static char *__pyx_argnames[] = {0};
+  if (__Pyx_GetStarArgs(&__pyx_args, &__pyx_kwds, __pyx_argnames, 0, &__pyx_v_args, &__pyx_v_kwargs, 0) < 0) return -1;
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) {
+    Py_XDECREF(__pyx_args);
+    Py_XDECREF(__pyx_kwds);
+    Py_XDECREF(__pyx_v_args);
+    Py_XDECREF(__pyx_v_kwargs);
+    return -1;
+  }
+  Py_INCREF(__pyx_v_self);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":462 */
+  ((struct __pyx_obj_12spidermonkey_Runtime *)__pyx_v_self)->rt = JS_NewRuntime(1000000);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":463 */
+  __pyx_1 = (((struct __pyx_obj_12spidermonkey_Runtime *)__pyx_v_self)->rt == NULL);
+  if (__pyx_1) {
+    __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
+    Py_INCREF(__pyx_k24p);
+    PyTuple_SET_ITEM(__pyx_2, 0, __pyx_k24p);
+    __pyx_3 = PyObject_CallObject(PyExc_SystemError, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
+    Py_DECREF(__pyx_2); __pyx_2 = 0;
+    __Pyx_Raise(__pyx_3, 0, 0);
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 464; goto __pyx_L1;}
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("spidermonkey.Runtime.__cinit__");
+  __pyx_r = -1;
+  __pyx_L0:;
+  Py_XDECREF(__pyx_v_args);
+  Py_XDECREF(__pyx_v_kwargs);
+  Py_DECREF(__pyx_v_self);
+  Py_XDECREF(__pyx_args);
+  Py_XDECREF(__pyx_kwds);
+  return __pyx_r;
+}
+
+static int __pyx_f_12spidermonkey_7Runtime___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_12spidermonkey_7Runtime___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  int __pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  static char *__pyx_argnames[] = {0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return -1;
+  Py_INCREF(__pyx_v_self);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":467 */
+  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 467; goto __pyx_L1;}
+  Py_DECREF(((struct __pyx_obj_12spidermonkey_Runtime *)__pyx_v_self)->_cxs);
+  ((struct __pyx_obj_12spidermonkey_Runtime *)__pyx_v_self)->_cxs = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":468 */
+  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_RUNTIMES); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}
+  __pyx_2 = PyObject_GetAttr(__pyx_1, __pyx_n_append); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_self);
+  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
+  __pyx_3 = PyObject_CallObject(__pyx_2, __pyx_1); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 468; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("spidermonkey.Runtime.__init__");
+  __pyx_r = -1;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_12spidermonkey_7Runtime_new_context(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_7Runtime_new_context(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_v_globj = 0;
+  PyObject *__pyx_v_cx;
+  PyObject *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  PyObject *__pyx_3 = 0;
+  static char *__pyx_argnames[] = {"globj",0};
+  __pyx_v_globj = __pyx_d1;
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "|O", __pyx_argnames, &__pyx_v_globj)) return 0;
+  Py_INCREF(__pyx_v_self);
+  Py_INCREF(__pyx_v_globj);
+  __pyx_v_cx = Py_None; Py_INCREF(Py_None);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":471 */
+  __pyx_1 = PyTuple_New(2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_self);
+  PyTuple_SET_ITEM(__pyx_1, 0, __pyx_v_self);
+  Py_INCREF(__pyx_v_globj);
+  PyTuple_SET_ITEM(__pyx_1, 1, __pyx_v_globj);
+  __pyx_2 = PyObject_CallObject(((PyObject *)__pyx_ptype_12spidermonkey_Context), __pyx_1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_v_cx);
+  __pyx_v_cx = __pyx_2;
+  __pyx_2 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":472 */
+  __pyx_1 = PyObject_GetAttr(((struct __pyx_obj_12spidermonkey_Runtime *)__pyx_v_self)->_cxs, __pyx_n_append); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}
+  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}
+  Py_INCREF(__pyx_v_cx);
+  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_v_cx);
+  __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_2); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":473 */
+  __pyx_1 = PyObject_GetAttr(__pyx_v_cx, __pyx_n_finish_initialization); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}
+  __pyx_2 = PyObject_CallObject(__pyx_1, 0); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 473; goto __pyx_L1;}
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":474 */
+  Py_INCREF(__pyx_v_cx);
+  __pyx_r = __pyx_v_cx;
+  goto __pyx_L0;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  Py_XDECREF(__pyx_3);
+  __Pyx_AddTraceback("spidermonkey.Runtime.new_context");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_cx);
+  Py_DECREF(__pyx_v_self);
+  Py_DECREF(__pyx_v_globj);
+  return __pyx_r;
+}
+
+static PyObject *__pyx_f_12spidermonkey_7Runtime___del__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyObject *__pyx_f_12spidermonkey_7Runtime___del__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  PyObject *__pyx_r;
+  static char *__pyx_argnames[] = {0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "", __pyx_argnames)) return 0;
+  Py_INCREF(__pyx_v_self);
+  Py_INCREF(Py_None);
+  Py_DECREF(((struct __pyx_obj_12spidermonkey_Runtime *)__pyx_v_self)->_cxs);
+  ((struct __pyx_obj_12spidermonkey_Runtime *)__pyx_v_self)->_cxs = Py_None;
+
+  __pyx_r = Py_None; Py_INCREF(Py_None);
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static void __pyx_f_12spidermonkey_7Runtime___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_f_12spidermonkey_7Runtime___dealloc__(PyObject *__pyx_v_self) {
+  Py_INCREF(__pyx_v_self);
+  JS_DestroyRuntime(((struct __pyx_obj_12spidermonkey_Runtime *)__pyx_v_self)->rt);
+
+  Py_DECREF(__pyx_v_self);
+}
+
+static struct __pyx_obj_12spidermonkey_Context *__pyx_f_12spidermonkey_runtime_get_context(struct __pyx_obj_12spidermonkey_Runtime *__pyx_v_self,struct JSContext *__pyx_v_ccx) {
+  struct __pyx_obj_12spidermonkey_Context *__pyx_v_cx;
+  struct __pyx_obj_12spidermonkey_Context *__pyx_r;
+  PyObject *__pyx_1 = 0;
+  PyObject *__pyx_2 = 0;
+  int __pyx_3;
+  Py_INCREF(__pyx_v_self);
+  __pyx_v_cx = ((struct __pyx_obj_12spidermonkey_Context *)Py_None); Py_INCREF(Py_None);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":486 */
+  __pyx_1 = PyObject_GetIter(__pyx_v_self->_cxs); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; goto __pyx_L1;}
+  for (;;) {
+    __pyx_2 = PyIter_Next(__pyx_1);
+    if (!__pyx_2) {
+      if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; goto __pyx_L1;}
+      break;
+    }
+    if (!__Pyx_TypeTest(__pyx_2, __pyx_ptype_12spidermonkey_Context)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; goto __pyx_L1;}
+    Py_DECREF(((PyObject *)__pyx_v_cx));
+    __pyx_v_cx = ((struct __pyx_obj_12spidermonkey_Context *)__pyx_2);
+    __pyx_2 = 0;
+    __pyx_3 = (__pyx_v_ccx == __pyx_v_cx->cx);
+    if (__pyx_3) {
+      Py_INCREF(((PyObject *)__pyx_v_cx));
+      __pyx_r = __pyx_v_cx;
+      Py_DECREF(__pyx_1); __pyx_1 = 0;
+      goto __pyx_L0;
+      goto __pyx_L4;
+    }
+    __pyx_L4:;
+  }
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":489 */
+  __pyx_2 = __Pyx_GetName(__pyx_b, __pyx_n_rt); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;}
+  __pyx_1 = PyNumber_Remainder(__pyx_k27p, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __pyx_2 = PyTuple_New(1); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;}
+  PyTuple_SET_ITEM(__pyx_2, 0, __pyx_1);
+  __pyx_1 = 0;
+  __pyx_1 = PyObject_CallObject(PyExc_ValueError, __pyx_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;}
+  Py_DECREF(__pyx_2); __pyx_2 = 0;
+  __Pyx_Raise(__pyx_1, 0, 0);
+  Py_DECREF(__pyx_1); __pyx_1 = 0;
+  {__pyx_filename = __pyx_f[0]; __pyx_lineno = 489; goto __pyx_L1;}
+
+  __pyx_r = ((struct __pyx_obj_12spidermonkey_Context *)Py_None); Py_INCREF(Py_None);
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_2);
+  __Pyx_AddTraceback("spidermonkey.runtime_get_context");
+  __pyx_r = 0;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_cx);
+  Py_DECREF(__pyx_v_self);
+  return __pyx_r;
+}
+
+static int __pyx_f_12spidermonkey_7Context___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_12spidermonkey_7Context___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct __pyx_obj_12spidermonkey_Runtime *__pyx_v_rt = 0;
+  PyObject *__pyx_v_globj = 0;
+  PyObject *__pyx_v_STACK_CHUNK_SIZE;
+  int __pyx_r;
+  PyObject *__pyx_1 = 0;
+  __pyx_t_12spidermonkey_size_t __pyx_2;
+  int __pyx_3;
+  PyObject *__pyx_4 = 0;
+  static char *__pyx_argnames[] = {"rt","globj",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_rt, &__pyx_v_globj)) return -1;
+  Py_INCREF(__pyx_v_self);
+  Py_INCREF(__pyx_v_rt);
+  Py_INCREF(__pyx_v_globj);
+  __pyx_v_STACK_CHUNK_SIZE = Py_None; Py_INCREF(Py_None);
+  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rt), __pyx_ptype_12spidermonkey_Runtime, 1, "rt")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; goto __pyx_L1;}
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":505 */
+  Py_INCREF(((PyObject *)__pyx_v_rt));
+  Py_DECREF(((PyObject *)((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->rt));
+  ((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->rt = __pyx_v_rt;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":509 */
+  __pyx_1 = PyInt_FromLong(8192); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; goto __pyx_L1;}
+  Py_DECREF(__pyx_v_STACK_CHUNK_SIZE);
+  __pyx_v_STACK_CHUNK_SIZE = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":511 */
+  __pyx_2 = PyInt_AsLong(__pyx_v_STACK_CHUNK_SIZE); if (PyErr_Occurred()) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 511; goto __pyx_L1;}
+  ((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->cx = JS_NewContext(__pyx_v_rt->rt,__pyx_2);
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":512 */
+  __pyx_3 = (((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->cx == NULL);
+  if (__pyx_3) {
+    __pyx_1 = PyTuple_New(1); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}
+    Py_INCREF(__pyx_k29p);
+    PyTuple_SET_ITEM(__pyx_1, 0, __pyx_k29p);
+    __pyx_4 = PyObject_CallObject(PyExc_SystemError, __pyx_1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    __Pyx_Raise(__pyx_4, 0, 0);
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 513; goto __pyx_L1;}
+    goto __pyx_L2;
+  }
+  __pyx_L2:;
+
+  __pyx_r = 0;
+  goto __pyx_L0;
+  __pyx_L1:;
+  Py_XDECREF(__pyx_1);
+  Py_XDECREF(__pyx_4);
+  __Pyx_AddTraceback("spidermonkey.Context.__cinit__");
+  __pyx_r = -1;
+  __pyx_L0:;
+  Py_DECREF(__pyx_v_STACK_CHUNK_SIZE);
+  Py_DECREF(__pyx_v_self);
+  Py_DECREF(__pyx_v_rt);
+  Py_DECREF(__pyx_v_globj);
+  return __pyx_r;
+}
+
+static int __pyx_f_12spidermonkey_7Context___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_f_12spidermonkey_7Context___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+  struct __pyx_obj_12spidermonkey_Runtime *__pyx_v_rt = 0;
+  PyObject *__pyx_v_globj = 0;
+  struct __pyx_obj_12spidermonkey_ProxyClass *__pyx_v_proxy_class;
+  int __pyx_r;
+  PyObject *__pyx_1 = 0;
+  int __pyx_2;
+  PyObject *__pyx_3 = 0;
+  PyObject *__pyx_4 = 0;
+  static char *__pyx_argnames[] = {"rt","globj",0};
+  if (!PyArg_ParseTupleAndKeywords(__pyx_args, __pyx_kwds, "OO", __pyx_argnames, &__pyx_v_rt, &__pyx_v_globj)) return -1;
+  Py_INCREF(__pyx_v_self);
+  Py_INCREF(__pyx_v_rt);
+  Py_INCREF(__pyx_v_globj);
+  __pyx_v_proxy_class = ((struct __pyx_obj_12spidermonkey_ProxyClass *)Py_None); Py_INCREF(Py_None);
+  if (!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rt), __pyx_ptype_12spidermonkey_Runtime, 1, "rt")) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 515; goto __pyx_L1;}
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":518 */
+  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 518; goto __pyx_L1;}
+  Py_DECREF(((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->_funcs);
+  ((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->_funcs = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":519 */
+  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 519; goto __pyx_L1;}
+  Py_DECREF(((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->_classes);
+  ((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->_classes = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":520 */
+  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 520; goto __pyx_L1;}
+  Py_DECREF(((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->_objs);
+  ((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->_objs = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":521 */
+  __pyx_1 = PyList_New(0); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 521; goto __pyx_L1;}
+  Py_DECREF(((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->_evaled_script);
+  ((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->_evaled_script = __pyx_1;
+  __pyx_1 = 0;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":522 */
+  Py_INCREF(Py_None);
+  Py_DECREF(((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->_last_error);
+  ((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->_last_error = Py_None;
+
+  /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":524 */
+  __pyx_2 = PyObject_IsTrue(__pyx_v_globj); if (__pyx_2 < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 524; goto __pyx_L1;}
+  if (__pyx_2) {
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":525 */
+    __pyx_1 = PyObject_GetAttr(__pyx_v_self, __pyx_n_bind_class); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;}
+    __pyx_3 = PyObject_GetAttr(__pyx_v_globj, __pyx_n___class__); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;}
+    __pyx_4 = PyTuple_New(3); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;}
+    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_3);
+    Py_INCREF(Py_False);
+    PyTuple_SET_ITEM(__pyx_4, 1, Py_False);
+    Py_INCREF(Py_True);
+    PyTuple_SET_ITEM(__pyx_4, 2, Py_True);
+    __pyx_3 = 0;
+    __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; goto __pyx_L1;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":526 */
+    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_n_js_classname); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}
+    __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}
+    Py_INCREF(__pyx_v_globj);
+    PyTuple_SET_ITEM(__pyx_4, 0, __pyx_v_globj);
+    __pyx_3 = PyObject_CallObject(__pyx_1, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}
+    Py_DECREF(__pyx_1); __pyx_1 = 0;
+    Py_DECREF(__pyx_4); __pyx_4 = 0;
+    __pyx_1 = ((PyObject *)__pyx_f_12spidermonkey_context_get_class(((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self),__pyx_3)); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 526; goto __pyx_L1;}
+    Py_DECREF(__pyx_3); __pyx_3 = 0;
+    Py_DECREF(((PyObject *)__pyx_v_proxy_class));
+    __pyx_v_proxy_class = ((struct __pyx_obj_12spidermonkey_ProxyClass *)__pyx_1);
+    __pyx_1 = 0;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":527 */
+    ((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->globj = JS_NewObject(((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->cx,__pyx_v_proxy_class->jsc,NULL,NULL);
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":528 */
+    __pyx_2 = (((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->globj == NULL);
+    if (__pyx_2) {
+      __pyx_4 = PyTuple_New(1); if (!__pyx_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
+      Py_INCREF(__pyx_k33p);
+      PyTuple_SET_ITEM(__pyx_4, 0, __pyx_k33p);
+      __pyx_3 = PyObject_CallObject(PyExc_SystemError, __pyx_4); if (!__pyx_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
+      Py_DECREF(__pyx_4); __pyx_4 = 0;
+      __Pyx_Raise(__pyx_3, 0, 0);
+      Py_DECREF(__pyx_3); __pyx_3 = 0;
+      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; goto __pyx_L1;}
+      goto __pyx_L3;
+    }
+    __pyx_L3:;
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":530 */
+    __pyx_f_12spidermonkey_context_register_object(((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self),__pyx_v_globj,((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->globj);
+    goto __pyx_L2;
+  }
+  /*else*/ {
+
+    /* "/usr/local/src/python-spidermonkey/spidermonkey.pyx":532 */
+    ((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->globj = make_global_object(((struct __pyx_obj_12spidermonkey_Context *)__pyx_v_self)->cx);
+