Skip to content

Commit 3b24050

Browse files
further cleanup
1 parent ede4b1c commit 3b24050

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

include/JSObjectIterProxy.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
typedef struct {
3131
PyObject_HEAD
32-
JS::RootedIdVector *props;
32+
JS::RootedIdVector *props; // not conceptually the best use of the Rooted type but it works. There is no easy inter-operation with a JS::Heap type
3333
int it_index;
3434
bool reversed;
3535
int kind;

python/pythonmonkey/require.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# @file require.py
22
# Implementation of CommonJS "require" for PythonMonkey. This implementation uses the
33
# ctx-module npm package to do the heavy lifting. That package makes a complete module
4-
# system, obstensibly in a separate context, but our implementation here reuses the
4+
# system, ostensibly in a separate context, but our implementation here reuses the
55
# PythonMonkey global context for both.
66
#
77
# The context that ctx-module runs in needs a require function supporting
@@ -115,7 +115,7 @@
115115
116116
/**
117117
* The debug module has as its exports a function which may, depending on the DEBUG env var, emit
118-
* debugging statemnts to stdout. This is quick implementation of the node built-in.
118+
* debugging statements to stdout. This is quick implementation of the node built-in.
119119
*/
120120
bootstrap.modules.debug = function debug(selector)
121121
{

src/modules/pythonmonkey/pythonmonkey.cc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/**
22
* @file pythonmonkey.cc
3-
* @author Caleb Aikens ([email protected])
3+
* @author Caleb Aikens ([email protected]) and Philippe Laporte ([email protected])
44
* @brief This file defines the pythonmonkey module, along with its various functions.
5-
* @version 0.1
65
* @date 2023-03-29
76
*
8-
* @copyright Copyright (c) 2023 Distributive Corp.
7+
* @copyright Copyright (c) 2023-2024 Distributive Corp.
98
*
109
*/
1110

@@ -68,7 +67,7 @@ static PyTypeObject NullType = {
6867
static PyTypeObject BigIntType = {
6968
.tp_name = "pythonmonkey.bigint",
7069
.tp_flags = Py_TPFLAGS_DEFAULT
71-
| Py_TPFLAGS_LONG_SUBCLASS // https://docs.python.org/3/c-api/typeobj.html#Py_TPFLAGS_LONG_SUBCLASS
70+
| Py_TPFLAGS_LONG_SUBCLASS
7271
| Py_TPFLAGS_BASETYPE, // can be subclassed
7372
.tp_doc = PyDoc_STR("Javascript BigInt object"),
7473
.tp_base = &PyLong_Type, // extending the builtin int type
@@ -88,7 +87,7 @@ PyTypeObject JSObjectProxyType = {
8887
.tp_getattro = (getattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_get,
8988
.tp_setattro = (setattrofunc)JSObjectProxyMethodDefinitions::JSObjectProxy_assign,
9089
.tp_flags = Py_TPFLAGS_DEFAULT
91-
| Py_TPFLAGS_DICT_SUBCLASS, // https://docs.python.org/3/c-api/typeobj.html#Py_TPFLAGS_DICT_SUBCLASS
90+
| Py_TPFLAGS_DICT_SUBCLASS,
9291
.tp_doc = PyDoc_STR("Javascript Object proxy dict"),
9392
.tp_richcompare = (richcmpfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_richcompare,
9493
.tp_iter = (getiterfunc)JSObjectProxyMethodDefinitions::JSObjectProxy_iter,
@@ -108,7 +107,7 @@ PyTypeObject JSArrayProxyType = {
108107
.tp_as_sequence = &JSArrayProxy_sequence_methods,
109108
.tp_as_mapping = &JSArrayProxy_mapping_methods,
110109
.tp_getattro = (getattrofunc)JSArrayProxyMethodDefinitions::JSArrayProxy_get,
111-
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_DICT_SUBCLASS,
110+
.tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_LIST_SUBCLASS,
112111
.tp_doc = PyDoc_STR("Javascript Array proxy list"),
113112
.tp_traverse = (traverseproc)JSArrayProxyMethodDefinitions::JSArrayProxy_traverse,
114113
.tp_clear = (inquiry)JSArrayProxyMethodDefinitions::JSArrayProxy_clear_slot,

0 commit comments

Comments
 (0)