Mercurial > pymonkey
comparison src/context.cpp @ 140:ce8099238c01
As per a discussion with jorendorff, it looks like we can pass NULL to compile_script(), since we're not using object principals (and instead just using an object capability model for now).
author | Atul Varma <varmaa@toolness.com> |
---|---|
date | Mon, 24 Aug 2009 21:53:39 -0700 |
parents | b4e216d06e83 |
children | 5d53f6293a81 |
comparison
equal
deleted
inserted
replaced
139:d08cb5a06c66 | 140:ce8099238c01 |
---|---|
313 | 313 |
314 static PyObject * | 314 static PyObject * |
315 PYM_compileScript(PYM_JSContextObject *self, PyObject *args) | 315 PYM_compileScript(PYM_JSContextObject *self, PyObject *args) |
316 { | 316 { |
317 PYM_SANITY_CHECK(self->runtime); | 317 PYM_SANITY_CHECK(self->runtime); |
318 PYM_JSObject *object; | |
319 char *source = NULL; | 318 char *source = NULL; |
320 int sourceLen; | 319 int sourceLen; |
321 const char *filename; | 320 const char *filename; |
322 int lineNo; | 321 int lineNo; |
323 | 322 |
324 if (!PyArg_ParseTuple(args, "O!es#si", &PYM_JSObjectType, &object, | 323 if (!PyArg_ParseTuple(args, "es#si", "utf-16", &source, &sourceLen, |
325 "utf-16", &source, &sourceLen, &filename, &lineNo)) | 324 &filename, &lineNo)) |
326 return NULL; | 325 return NULL; |
327 | 326 |
328 PYM_UTF16String str(source, sourceLen); | 327 PYM_UTF16String str(source, sourceLen); |
329 | 328 |
330 PYM_ENSURE_RUNTIME_MATCH(self->runtime, object->runtime); | |
331 | |
332 JSScript *script; | 329 JSScript *script; |
333 script = JS_CompileUCScript(self->cx, object->obj, str.jsbuffer, | 330 script = JS_CompileUCScript(self->cx, NULL, str.jsbuffer, |
334 str.jslen, filename, lineNo); | 331 str.jslen, filename, lineNo); |
335 | 332 |
336 if (script == NULL) { | 333 if (script == NULL) { |
337 PYM_jsExceptionToPython(self); | 334 PYM_jsExceptionToPython(self); |
338 return NULL; | 335 return NULL; |