Mercurial > pymonkey
comparison src/context.cpp @ 158:22d46b688ace
Resolved 2 TODOs.
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Sun, 30 Aug 2009 15:10:07 -0700 |
parents | a31ff2de6017 |
children | d1606a6cf1c0 |
comparison
equal
deleted
inserted
replaced
157:a31ff2de6017 | 158:22d46b688ace |
---|---|
158 lineno = JS_PCToLineNumber(self->cx, script, pcByte); | 158 lineno = JS_PCToLineNumber(self->cx, script, pcByte); |
159 | 159 |
160 if (JS_GetScriptObject(script)) { | 160 if (JS_GetScriptObject(script)) { |
161 pyScript = (PyObject *) PYM_newJSScript(self, script); | 161 pyScript = (PyObject *) PYM_newJSScript(self, script); |
162 if (pyScript == NULL) { | 162 if (pyScript == NULL) { |
163 // TODO: We should clean up here. | 163 Py_XDECREF(top); |
164 return NULL; | 164 return NULL; |
165 } | 165 } |
166 } | 166 } |
167 } | 167 } |
168 | 168 |
173 | 173 |
174 JSObject *funObj = JS_GetFrameFunctionObject(self->cx, frame); | 174 JSObject *funObj = JS_GetFrameFunctionObject(self->cx, frame); |
175 if (funObj) { | 175 if (funObj) { |
176 pyFunc = (PyObject *) PYM_newJSObject(self, funObj, NULL); | 176 pyFunc = (PyObject *) PYM_newJSObject(self, funObj, NULL); |
177 if (pyFunc == NULL) { | 177 if (pyFunc == NULL) { |
178 // TODO: We should clean up here. | 178 Py_XDECREF(top); |
179 Py_DECREF(pyScript); | |
179 return NULL; | 180 return NULL; |
180 } | 181 } |
181 } else { | 182 } else { |
182 pyFunc = Py_None; | 183 pyFunc = Py_None; |
183 Py_INCREF(pyFunc); | 184 Py_INCREF(pyFunc); |