Skip to content

Commit

Permalink
Fixed the destructor test.
Browse files Browse the repository at this point in the history
I hadn't made the js_ctor call account for the change to py2js_object changes
that were required to make the function tests work properly.
  • Loading branch information
Paul Davis committed Mar 25, 2009
1 parent 6410c4a commit 42a310b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 2 additions & 3 deletions spidermonkey/pyobject.c
Expand Up @@ -195,8 +195,7 @@ js_finalize(JSContext* jscx, JSObject* jsobj)
{
Context* pycx = (Context*) JS_GetContextPrivate(jscx);
PyObject* pyobj = NULL;



if(pycx == NULL)
{
// Not much else we can do but yell.
Expand Down Expand Up @@ -337,7 +336,6 @@ js_ctor(JSContext* jscx, JSObject* jsobj, uintN argc, jsval* argv, jsval* rval)
JS_ReportError(jscx, "Failed to construct object.");
goto error;
}
Py_INCREF(ret);

*rval = py2js(pycx, ret);
if(*rval == JSVAL_VOID)
Expand Down Expand Up @@ -470,6 +468,7 @@ py2js_object(Context* cx, PyObject* pyobj)
goto success;

error:
Py_XDECREF(attached);
success:
return ret;
}
Expand Down
4 changes: 4 additions & 0 deletions tests/test-utf16.py
Expand Up @@ -11,3 +11,7 @@ def test_empty_string_script(cx):
@t.cx()
def test_unicode_string(cx):
t.eq(cx.execute(u"5"), 5)

@t.cx()
def test_non_unicode_string(cx):
t.eq(cx.execute("5"), 5)

0 comments on commit 42a310b

Please sign in to comment.