Mercurial > pymonkey
comparison pymonkey.c @ 5:aae78eac86d6
Added support for booleans.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 28 Jun 2009 12:47:30 -0700 |
parents | 2711b636f8e6 |
children | 42f57789f84f |
comparison
equal
deleted
inserted
replaced
4:2711b636f8e6 | 5:aae78eac86d6 |
---|---|
17 | 17 |
18 if (JSVAL_IS_DOUBLE(value)) { | 18 if (JSVAL_IS_DOUBLE(value)) { |
19 jsdouble *doubleRef = JSVAL_TO_DOUBLE(value); | 19 jsdouble *doubleRef = JSVAL_TO_DOUBLE(value); |
20 return PyFloat_FromDouble(*doubleRef); | 20 return PyFloat_FromDouble(*doubleRef); |
21 } | 21 } |
22 | |
23 if (value == JSVAL_FALSE) | |
24 Py_RETURN_FALSE; | |
25 | |
26 if (value == JSVAL_TRUE) | |
27 Py_RETURN_TRUE; | |
22 | 28 |
23 if (JSVAL_IS_NULL(value)) { | 29 if (JSVAL_IS_NULL(value)) { |
24 Py_INCREF(Py_None); | 30 Py_INCREF(Py_None); |
25 return Py_None; | 31 return Py_None; |
26 } | 32 } |