annotate object.c @ 23:951ad1b15587

The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
author Atul Varma <varmaa@toolness.com>
date Sun, 28 Jun 2009 22:58:04 -0700
parents 988a8998c75f
children d4efcbb06964
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
1 #include "object.h"
21
fc04e5f1c675 Changed object constructor to take a context instead of a runtime.
Atul Varma <varmaa@toolness.com>
parents: 18
diff changeset
2 #include "runtime.h"
22
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
3 #include "utils.h"
13
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
4
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
5 JSClass PYM_JS_ObjectClass = {
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
6 "PymonkeyObject", JSCLASS_GLOBAL_FLAGS,
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
7 JS_PropertyStub, JS_PropertyStub, JS_PropertyStub, JS_PropertyStub,
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
8 JS_EnumerateStub, JS_ResolveStub, JS_ConvertStub, JS_FinalizeStub,
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
9 JSCLASS_NO_OPTIONAL_MEMBERS
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
10 };
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
11
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
12 static void
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
13 PYM_JSObjectDealloc(PYM_JSObject *self)
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
14 {
15
baa4cb961330 JS objects in python-land are now rooted while in python-land so that they're not gc'd while in python-land.
Atul Varma <varmaa@toolness.com>
parents: 13
diff changeset
15 if (self->obj) {
23
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
16 JS_DHashTableOperate(&self->runtime->objects,
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
17 (void *) self->uniqueId,
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
18 JS_DHASH_REMOVE);
22
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
19
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
20 // JS_RemoveRoot() always returns JS_TRUE, so don't
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
21 // bother checking its return value.
15
baa4cb961330 JS objects in python-land are now rooted while in python-land so that they're not gc'd while in python-land.
Atul Varma <varmaa@toolness.com>
parents: 13
diff changeset
22 JS_RemoveRootRT(self->runtime->rt, &self->obj);
baa4cb961330 JS objects in python-land are now rooted while in python-land so that they're not gc'd while in python-land.
Atul Varma <varmaa@toolness.com>
parents: 13
diff changeset
23 self->obj = NULL;
baa4cb961330 JS objects in python-land are now rooted while in python-land so that they're not gc'd while in python-land.
Atul Varma <varmaa@toolness.com>
parents: 13
diff changeset
24 }
baa4cb961330 JS objects in python-land are now rooted while in python-land so that they're not gc'd while in python-land.
Atul Varma <varmaa@toolness.com>
parents: 13
diff changeset
25
22
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
26 if (self->runtime) {
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
27 Py_DECREF(self->runtime);
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
28 self->runtime = NULL;
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
29 }
13
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
30 }
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
31
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
32 PyTypeObject PYM_JSObjectType = {
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
33 PyObject_HEAD_INIT(NULL)
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
34 0, /*ob_size*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
35 "pymonkey.Object", /*tp_name*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
36 sizeof(PYM_JSObject), /*tp_basicsize*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
37 0, /*tp_itemsize*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
38 /*tp_dealloc*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
39 (destructor) PYM_JSObjectDealloc,
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
40 0, /*tp_print*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
41 0, /*tp_getattr*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
42 0, /*tp_setattr*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
43 0, /*tp_compare*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
44 0, /*tp_repr*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
45 0, /*tp_as_number*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
46 0, /*tp_as_sequence*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
47 0, /*tp_as_mapping*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
48 0, /*tp_hash */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
49 0, /*tp_call*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
50 0, /*tp_str*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
51 0, /*tp_getattro*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
52 0, /*tp_setattro*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
53 0, /*tp_as_buffer*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
54 Py_TPFLAGS_DEFAULT, /*tp_flags*/
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
55 /* tp_doc */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
56 "JavaScript Object.",
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
57 0, /* tp_traverse */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
58 0, /* tp_clear */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
59 0, /* tp_richcompare */
23
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
60 0, /* tp_weaklistoffset */
13
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
61 0, /* tp_iter */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
62 0, /* tp_iternext */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
63 0, /* tp_methods */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
64 0, /* tp_members */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
65 0, /* tp_getset */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
66 0, /* tp_base */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
67 0, /* tp_dict */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
68 0, /* tp_descr_get */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
69 0, /* tp_descr_set */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
70 0, /* tp_dictoffset */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
71 0, /* tp_init */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
72 0, /* tp_alloc */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
73 0, /* tp_new */
ca17531e8c81 Added an object class.
Atul Varma <varmaa@toolness.com>
parents:
diff changeset
74 };
18
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
75
21
fc04e5f1c675 Changed object constructor to take a context instead of a runtime.
Atul Varma <varmaa@toolness.com>
parents: 18
diff changeset
76 PYM_JSObject *PYM_newJSObject(PYM_JSContextObject *context,
18
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
77 JSObject *obj) {
22
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
78 jsid uniqueId;
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
79 if (!JS_GetObjectId(context->cx, obj, &uniqueId)) {
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
80 PyErr_SetString(PYM_error, "JS_GetObjectId() failed");
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
81 return NULL;
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
82 }
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
83
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
84 PYM_JSRuntimeObject *runtime = context->runtime;
23
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
85 PYM_HashEntry *cached = (PYM_HashEntry *) JS_DHashTableOperate(
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
86 &runtime->objects,
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
87 (void *) uniqueId,
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
88 JS_DHASH_LOOKUP
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
89 );
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
90
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
91 if (JS_DHASH_ENTRY_IS_BUSY((JSDHashEntryHdr *) cached)) {
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
92 Py_INCREF((PyObject *) cached->value);
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
93 return (PYM_JSObject *) cached->value;
22
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
94 }
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
95
18
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
96 PYM_JSObject *object = PyObject_New(PYM_JSObject,
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
97 &PYM_JSObjectType);
23
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
98 if (object == NULL)
18
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
99 return NULL;
22
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
100
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
101 object->runtime = NULL;
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
102 object->obj = NULL;
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
103 object->uniqueId = NULL;
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
104
23
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
105 cached = (PYM_HashEntry *) JS_DHashTableOperate(&runtime->objects,
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
106 (void *) uniqueId,
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
107 JS_DHASH_ADD);
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
108 if (cached == NULL) {
22
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
109 Py_DECREF(object);
23
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
110 PyErr_SetString(PYM_error, "JS_DHashTableOperate() failed");
22
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
111 return NULL;
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
112 }
988a8998c75f JS objects reflected into Python are now identity-preserving, though the implementation for this is pretty bad right now.
Atul Varma <varmaa@toolness.com>
parents: 21
diff changeset
113
23
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
114 cached->base.key = (void *) uniqueId;
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
115 cached->value = object;
18
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
116
21
fc04e5f1c675 Changed object constructor to take a context instead of a runtime.
Atul Varma <varmaa@toolness.com>
parents: 18
diff changeset
117 object->runtime = context->runtime;
18
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
118 Py_INCREF(object->runtime);
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
119
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
120 object->obj = obj;
23
951ad1b15587 The hashtable of reflected JS objects now uses a JS_DHashTable instead of a PyDict. Also removed weakref-ability of the JSObject class since it didn't make any sense to use Python's weakref support for JSObjects.
Atul Varma <varmaa@toolness.com>
parents: 22
diff changeset
121 object->uniqueId = uniqueId;
18
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
122
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
123 JS_AddNamedRootRT(object->runtime->rt, &object->obj,
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
124 "Pymonkey-Generated Object");
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
125
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
126 return object;
f3223debd70b Refactoring; moved PYM_JSObject creation code into a new public function in object.c.
Atul Varma <varmaa@toolness.com>
parents: 15
diff changeset
127 }