diff src/function.cpp @ 160:56181fb5fc7e

Added a function.is_python property indicating whether the js function is implemented in python.
author Atul Varma <varmaa@toolness.com>
date Sun, 30 Aug 2009 15:47:23 -0700
parents 5ec81091cb89
children dd32a92f6b4f
line wrap: on
line diff
--- a/src/function.cpp	Sun Aug 30 15:23:26 2009 -0700
+++ b/src/function.cpp	Sun Aug 30 15:47:23 2009 -0700
@@ -144,6 +144,8 @@
    "Base line number of function's source code."},
   {"line_extent", T_UINT, offsetof(PYM_JSFunction, lineExtent), READONLY,
    "Line extent of function's source code."},
+  {"is_python", T_BYTE, offsetof(PYM_JSFunction, isPython), READONLY,
+   "Whether or not the function is implemented in Python."},
   {NULL, NULL, NULL, NULL, NULL}
 };
 
@@ -206,6 +208,7 @@
   jsFunction->filename = NULL;
   jsFunction->baseLineno = 0;
   jsFunction->lineExtent = 0;
+  jsFunction->isPython = 0;
 
   JSString *name = JS_GetFunctionId(jsFunction->fun);
   if (name != NULL) {
@@ -284,5 +287,7 @@
     return NULL;
   }
 
+  object->isPython = 1;
+
   return object;
 }