Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
143 commits
Select commit Hold shift + click to select a range
e4f4d90
added globalThis tests
philippe-distributive Feb 1, 2024
a5b12a5
cleanup
philippe-distributive Feb 1, 2024
71269e7
value parameter to PyTypeFactory no longer needs to be allocated on t…
philippe-distributive Feb 1, 2024
cb3feef
cleanup
philippe-distributive Feb 1, 2024
13938db
should have been part of the previous commit
philippe-distributive Feb 1, 2024
c1fbc1f
pyTypeFactory use HandleValue instead of pointer
philippe-distributive Feb 2, 2024
636fcde
cleanup
philippe-distributive Feb 2, 2024
b5bd094
should have bee part of previous commit
philippe-distributive Feb 2, 2024
fade8f0
cleanup
philippe-distributive Feb 2, 2024
fee7bf3
typo fix
philippe-distributive Feb 2, 2024
695c71a
crash fix
philippe-distributive Feb 2, 2024
234da46
test for crash fix
philippe-distributive Feb 2, 2024
0998b84
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Feb 2, 2024
839d3e8
cleanup
philippe-distributive Feb 5, 2024
a7d7a1a
should have been part of the previous commit
philippe-distributive Feb 5, 2024
7b17b0f
added array test
philippe-distributive Feb 5, 2024
d0ed527
cleanup after test
philippe-distributive Feb 5, 2024
a7348de
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Feb 5, 2024
428005a
cleanup
philippe-distributive Feb 5, 2024
8e827f9
formatting
philippe-distributive Feb 5, 2024
15db758
added iterator test
philippe-distributive Feb 6, 2024
050096f
crash fix and its test
philippe-distributive Feb 6, 2024
20a8227
assign to list beyond current length js-style
philippe-distributive Feb 6, 2024
2d934fe
comment
philippe-distributive Feb 6, 2024
6395687
cleanup
philippe-distributive Feb 6, 2024
10c8c79
improved naming
philippe-distributive Feb 6, 2024
de32916
formatting
philippe-distributive Feb 6, 2024
c827e66
added missing pyExceptions
philippe-distributive Feb 6, 2024
8f2408f
no Py_SET_SIZE on python 3.8
philippe-distributive Feb 6, 2024
95a1b4d
removed incorrect comment
philippe-distributive Feb 6, 2024
1dc7dd1
missing file headers improved
philippe-distributive Feb 6, 2024
2d1462d
type improvement
philippe-distributive Feb 6, 2024
9ff38bc
improved comment
philippe-distributive Feb 6, 2024
18fde47
cleanup: no need for overriding methods that merely call super. prope…
philippe-distributive Feb 7, 2024
4d1d9c2
cleanup
philippe-distributive Feb 7, 2024
cc13130
further cleanup
philippe-distributive Feb 7, 2024
32d2d41
added missing file headers. cleanup
philippe-distributive Feb 7, 2024
7843271
further cleanup
philippe-distributive Feb 7, 2024
809b5fa
improved comment
philippe-distributive Feb 7, 2024
976327b
fixed copyright headers
philippe-distributive Feb 7, 2024
1884f79
uniform copyright headers
philippe-distributive Feb 7, 2024
bcf55ae
last missing copyrights. license statements fixes
philippe-distributive Feb 7, 2024
e2f446e
improved comment
philippe-distributive Feb 7, 2024
5153405
logic improvement
philippe-distributive Feb 8, 2024
454b943
improved naming
philippe-distributive Feb 8, 2024
a26680e
cleanup
philippe-distributive Feb 8, 2024
20013a4
project at advanced stage
philippe-distributive Feb 8, 2024
d946421
copyright headers missing and documentation cleanup
philippe-distributive Feb 8, 2024
1f42778
further cleanup and missing copyrights
philippe-distributive Feb 8, 2024
c484f7e
more missing copyrights
philippe-distributive Feb 8, 2024
b30b570
can now assign arguments directly from sys.arg
philippe-distributive Feb 9, 2024
a16436d
updates
philippe-distributive Feb 9, 2024
a93fcd2
English fix and improved organization
philippe-distributive Feb 9, 2024
ea2a2ec
no more leak with the second parameter of pyTypeFactory
philippe-distributive Feb 9, 2024
b9250f9
fixed english
philippe-distributive Feb 13, 2024
cb57161
more precise error reporting
philippe-distributive Feb 15, 2024
e28e160
simplification
philippe-distributive Feb 15, 2024
cdceef1
crash fix
philippe-distributive Feb 16, 2024
481f04b
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Feb 22, 2024
54cb096
cleanup
philippe-distributive Feb 22, 2024
7172cff
jsObject/jsArray should be persistentrooted
philippe-distributive Feb 23, 2024
28fd039
cleanup unused methods
philippe-distributive Feb 26, 2024
b0a8e0f
cleanup and minor improvements
philippe-distributive Feb 26, 2024
593da22
dict conversion no longer needed now that we have proxies
philippe-distributive Feb 26, 2024
6952028
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Feb 27, 2024
f787578
improved setdefault performance
philippe-distributive Feb 27, 2024
e248b44
decref the result of python calls. Rooted type simplifications
philippe-distributive Feb 27, 2024
943bb1d
fix file header attributions
philippe-distributive Feb 27, 2024
850508c
improved clear methods and related naming, variable folding
philippe-distributive Feb 27, 2024
763bd44
fix on clear method, incref in object.get
philippe-distributive Feb 27, 2024
ee5c738
heap-allocated root should be persistent
philippe-distributive Feb 28, 2024
1276a9a
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Feb 28, 2024
889c912
remove unused second parameter to pyTypeFactory
philippe-distributive Feb 28, 2024
4ba97f7
increment firefox version
philippe-distributive Feb 28, 2024
4df71ee
version update
philippe-distributive Feb 28, 2024
ba1afb8
use PersistentRooted pointer instead of inline in struct for Object a…
philippe-distributive Feb 29, 2024
30c120d
tp_name must be same as that of super type
philippe-distributive Feb 29, 2024
f8a1217
finished details of JSObjectProxy.repr: skip over the $super key to a…
philippe-distributive Feb 29, 2024
9733902
next version will be 0.4.0
philippe-distributive Feb 29, 2024
1849dbf
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Mar 1, 2024
ec03ef9
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Mar 1, 2024
c4dc2bd
hash not implemented entry not required
philippe-distributive Mar 1, 2024
40bdbb3
test fix
philippe-distributive Mar 1, 2024
0765086
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Mar 5, 2024
7e7ed33
improved reference management
philippe-distributive Mar 7, 2024
baab95f
dec ref needs to check for null
philippe-distributive Mar 7, 2024
cb92513
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Mar 11, 2024
9764d1f
post-merge patch-up
philippe-distributive Mar 11, 2024
dec4f72
Proxies now use parent type name for enhanced type compatibility
philippe-distributive Mar 11, 2024
a909fc7
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Mar 11, 2024
bfc7798
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Mar 13, 2024
c2d102d
cleanup and post-merge adjust
philippe-distributive Mar 13, 2024
5fa62df
post-merge fixup
philippe-distributive Mar 13, 2024
c645fca
include cleanup
philippe-distributive Mar 13, 2024
b986a4c
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Mar 13, 2024
9c0524f
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Mar 14, 2024
8622867
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Mar 14, 2024
bf16c39
enhanced python stack trace tests
philippe-distributive Mar 14, 2024
7abbd1b
Revert "enhanced python stack trace tests"
philippe-distributive Mar 14, 2024
f88cfd2
test fix
philippe-distributive Mar 14, 2024
25f6134
Full JS stacks provided in the context of a Python Exception while ca…
philippe-distributive Mar 14, 2024
7eaab5e
improved comment
philippe-distributive Mar 14, 2024
93fb621
one more comment
philippe-distributive Mar 14, 2024
015eb14
added test for array subclass
philippe-distributive Mar 14, 2024
73f068a
Merge branch 'philippe/pyTypeFactory-cleanup' into philippe/full-js-a…
philippedistributive Mar 14, 2024
b58b0ac
adjustment to __class__ implementation and added test
philippe-distributive Mar 15, 2024
453ded4
Update src/ExceptionType.cc
philippedistributive Mar 15, 2024
327ab26
proper exception stack type
philippe-distributive Mar 15, 2024
fbcb81c
Merge branch 'philippe/pyTypeFactory-cleanup' into philippe/full-js-a…
philippedistributive Mar 15, 2024
8dfaa43
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippedistributive Mar 15, 2024
993da0e
Merge branch 'philippe/pyTypeFactory-cleanup' into philippe/full-js-a…
philippedistributive Mar 15, 2024
b52383c
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippedistributive Mar 15, 2024
cee3fb0
Merge branch 'philippe/pyTypeFactory-cleanup' into philippe/full-js-a…
philippedistributive Mar 15, 2024
66dbb97
adjustment to __class__ for arrayproxy
philippe-distributive Mar 15, 2024
501f26d
Merge branch 'philippe/pyTypeFactory-cleanup' into philippe/full-js-a…
philippedistributive Mar 15, 2024
e08f74b
cleanup
philippe-distributive Mar 15, 2024
20a47d4
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippedistributive Mar 15, 2024
8c7bce7
Merge branch 'philippe/pyTypeFactory-cleanup' into philippe/full-js-a…
philippedistributive Mar 15, 2024
77f460b
Update src/jsTypeFactory.cc
philippedistributive Mar 15, 2024
c627e30
Revert "Update src/jsTypeFactory.cc"
philippe-distributive Mar 15, 2024
f9c29ad
remove commented-out code
philippe-distributive Mar 15, 2024
3cd6397
Merge branch 'philippe/pyTypeFactory-cleanup' into philippe/full-js-a…
philippedistributive Mar 15, 2024
e08a1e7
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippedistributive Mar 15, 2024
76aa711
Merge branch 'philippe/pyTypeFactory-cleanup' into philippe/full-js-a…
philippedistributive Mar 15, 2024
073972b
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippedistributive Mar 18, 2024
6d447c6
Merge branch 'philippe/pyTypeFactory-cleanup' into philippe/full-js-a…
philippedistributive Mar 18, 2024
e5a82e6
remove duplicate JS stack trace
philippe-distributive Mar 19, 2024
da5f621
logic improvement
philippe-distributive Mar 19, 2024
e8c439a
cleanup
philippe-distributive Mar 19, 2024
0dc70af
logic improvement
philippe-distributive Mar 19, 2024
9d737fd
newline not needed
philippe-distributive Mar 19, 2024
93888de
Merge pull request #296 from Distributive-Network/philippe/full-js-an…
philippedistributive Mar 20, 2024
dd5e156
entry newline needed
philippe-distributive Mar 20, 2024
1adaabb
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippedistributive Mar 20, 2024
27019d2
added get method test
philippe-distributive Mar 20, 2024
df32a3c
allow object key to shadow method
philippe-distributive Mar 20, 2024
1068741
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippedistributive Mar 20, 2024
78f9938
do distinguish between dict . and [] operators
philippe-distributive Mar 20, 2024
c0a1af8
Merge branch 'philippe/pyTypeFactory-cleanup' of github.com:Distribut…
philippe-distributive Mar 20, 2024
3cb7ebc
no need for cpython GC compatibility for these
philippe-distributive Mar 21, 2024
8aab622
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippe-distributive Mar 27, 2024
a2d818a
post-merge fixup
philippe-distributive Mar 27, 2024
e77be01
Merge branch 'caleb/fix/this' into philippe/pyTypeFactory-cleanup
philippedistributive Apr 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/test-and-publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
with:
path: |
./_spidermonkey_install/*
key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }}
key: spidermonkey115.8.0-${{ runner.os }}-${{ runner.arch }}
lookup-only: true # skip download
- name: Setup XCode
if: ${{ (matrix.os == 'macos-13' || matrix.os == 'macos-14') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
Expand All @@ -72,7 +72,7 @@ jobs:
with:
path: |
./_spidermonkey_install/*
key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }}
key: spidermonkey115.8.0-${{ runner.os }}-${{ runner.arch }}
lookup-only: true # skip download
- name: Install dependencies
if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
Expand Down Expand Up @@ -153,7 +153,7 @@ jobs:
with:
path: |
./_spidermonkey_install/*
key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }}
key: spidermonkey115.8.0-${{ runner.os }}-${{ runner.arch }}
fail-on-cache-miss: true # SpiderMonkey is expected to be cached in its dedicated job
- name: Build pminit
run: |
Expand Down
12 changes: 7 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ using the Python engine to provide the Javascript host environment.

We feature JavaScript Array and Object methods implemented on Python List and Dictionaries using the cPython C API, and the inverse using the Mozilla Firefox Spidermonkey JavaScript C++ API.

This product is in an intermediate stage, approximately 95% to MVP as of March 2024. It is under active development by [Distributive](https://distributive.network/).
This product is in an advanced stage, approximately 95% to MVP as of March 2024. It is under active development by [Distributive](https://distributive.network/).

External contributions and feedback are welcome and encouraged.

### tl;dr
Expand Down Expand Up @@ -250,6 +251,7 @@ generated by enumerating the global variable in the current SpiderMonkey context
## Built-In Functions

See definitions in [python/pythonmonkey/global.d.ts](https://github.com/Distributive-Network/PythonMonkey/blob/main/python/pythonmonkey/global.d.ts).
Including:

- `console`
- `atob`
Expand Down Expand Up @@ -386,10 +388,10 @@ in Python. Simply decorate a Dict named `exports` inside a file with a `.py` ext
loaded by `require()` -- in either JavaScript or Python.

### Program Module
The program module, or main module, is a special module in CommonJS. In a program module,
The program module, or main module, is a special module in CommonJS. In a program module:
- variables defined in the outermost scope are properties of `globalThis`
- returning from the outermost scope is a syntax error
- the `arguments` variable in an Array-like object which holds your program's argument vector
- the `arguments` variable in an Array which holds your program's argument vector
(command-line arguments)

```console
Expand All @@ -416,7 +418,7 @@ exports['today'] = date.today()
# Troubleshooting Tips

## CommonJS (require)
If you are having trouble with the CommonJS require function, set environment variable `DEBUG='ctx-module*'` and you can see the filenames it tries to laod.
If you are having trouble with the CommonJS require function, set environment variable `DEBUG='ctx-module*'` and you can see the filenames it tries to load.

## pmdb

Expand Down Expand Up @@ -453,7 +455,7 @@ List of commands:
```console
$ pmjs

Welcome to PythonMonkey v0.2.0.
Welcome to PythonMonkey v0.4.0.
Type ".help" for more information.
> .python import sys
> .python sys.path
Expand Down
2 changes: 2 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
# Main PythonMonkey build automation script. Run with `poetry build`.
# @author Hamada Gasmallah, hamada@distributive.network
# @date April 2023
# @copyright Copyright (c) 2023 Distributive Corp.
#

import subprocess
import os, sys
import platform
Expand Down
3 changes: 1 addition & 2 deletions include/BoolType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file BoolType.hh
* @author Caleb Aikens (caleb@distributive.network)
* @brief Struct for representing python bools
* @version 0.1
* @date 2022-12-02
*
* @copyright Copyright (c) 2022
* @copyright Copyright (c) 2022 Distributive Corp.
*
*/

Expand Down
1 change: 0 additions & 1 deletion include/BufferType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file BufferType.hh
* @author Tom Tang (xmader@distributive.network)
* @brief Struct for representing ArrayBuffers
* @version 0.1
* @date 2023-04-27
*
* @copyright Copyright (c) 2023 Distributive Corp.
Expand Down
3 changes: 1 addition & 2 deletions include/DateType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file DateType.hh
* @author Caleb Aikens (caleb@distributive.network)
* @brief Struct for representing python dates
* @version 0.1
* @date 2022-12-21
*
* @copyright Copyright (c) 2022
* @copyright Copyright (c) 2022 Distributive Corp.
*
*/

Expand Down
3 changes: 1 addition & 2 deletions include/DictType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file DictType.hh
* @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network)
* @brief Struct representing python dictionaries
* @version 0.1
* @date 2022-08-10
*
* @copyright Copyright (c) 2022
* @copyright Copyright (c) 2022 Distributive Corp.
*
*/

Expand Down
1 change: 0 additions & 1 deletion include/ExceptionType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* @file ExceptionType.hh
* @author Tom Tang (xmader@distributive.network) and Philippe Laporte (philippe@distributive.network)
* @brief Struct for representing Python Exception objects from a corresponding JS Error object
* @version 0.1
* @date 2023-04-11
*
* @copyright Copyright (c) 2023-2024 Distributive Corp.
Expand Down
3 changes: 1 addition & 2 deletions include/FloatType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file FloatType.hh
* @author Caleb Aikens (caleb@distributive.network)
* @brief Struct for representing python floats
* @version 0.1
* @date 2022-12-02
*
* @copyright Copyright (c) 2022
* @copyright Copyright (c) 2022 Distributive Corp.
*
*/

Expand Down
4 changes: 2 additions & 2 deletions include/FuncType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* @file FuncType.hh
* @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network)
* @brief Struct representing python functions
* @version 0.1
* @date 2022-08-08
*
* @copyright Copyright (c) 2022
* @copyright Copyright (c) 2022 Distributive Corp.
*
*/

#ifndef PythonMonkey_FuncType_
#define PythonMonkey_FuncType_

Expand Down
3 changes: 1 addition & 2 deletions include/IntType.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file IntType.hh
* @author Caleb Aikens (caleb@distributive.network) & Giovanni Tedesco (giovanni@distributive.network) & Tom Tang (xmader@distributive.network)
* @brief Struct for representing python ints
* @version 0.2
* @date 2023-03-16
*
* @copyright Copyright (c) 2023
* @copyright Copyright (c) 2023 Distributive Corp.
*
*/

Expand Down
2 changes: 1 addition & 1 deletion include/JSArrayIterProxy.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @version 0.1
* @date 2024-01-15
*
* Copyright (c) 2024 Distributive Corp.
* @copyright Copyright (c) 2024 Distributive Corp.
*
*/

Expand Down
60 changes: 11 additions & 49 deletions include/JSArrayProxy.hh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @version 0.1
* @date 2023-11-22
*
* Copyright (c) 2023 Distributive Corp.
* @copyright Copyright (c) 2023 Distributive Corp.
*
*/

Expand All @@ -24,7 +24,7 @@
*/
typedef struct {
PyListObject list;
JS::RootedObject jsArray;
JS::PersistentRootedObject *jsArray;
} JSArrayProxy;

/**
Expand All @@ -40,26 +40,6 @@ public:
*/
static void JSArrayProxy_dealloc(JSArrayProxy *self);

/**

@philippedistributive philippedistributive Feb 7, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these merely make a super call and so are redundant

* @brief New method (.tp_new), creates a new instance of the JSArrayProxy type, exposed as the __new()__ method in python
*
* @param type - The type of object to be created, will always be JSArrayProxyType or a derived type
* @param args - arguments to the __new()__ method, not used
* @param kwds - keyword arguments to the __new()__ method, not used
* @return PyObject* - A new instance of JSArrayProxy
*/
static PyObject *JSArrayProxy_new(PyTypeObject *type, PyObject *args, PyObject *kwds);

/**
* @brief Initialization method (.tp_init), initializes a newly created instance of JSArrayProxy. exposed as the __init()__ method in python
*
* @param self - The JSArrayProxy to be initialized
* @param args - arguments to the __init()__ method, expected to be a dict
* @param kwds - keyword arguments to the __init()__ method, not used
* @return int - -1 on exception, return any other value otherwise
*/
static int JSArrayProxy_init(JSArrayProxy *self, PyObject *args, PyObject *kwds);

/**
* @brief Length method (.mp_length and .sq_length), returns the number of keys in the JSObject, used by the python len() method
*
Expand All @@ -78,13 +58,13 @@ public:
static PyObject *JSArrayProxy_get(JSArrayProxy *self, PyObject *key);


/**
* @brief Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key which can be a slice, used by several built-in python methods as well as the [] and operator
*
* @param self - The JSArrayProxy
* @param key - The key for the value in the JSArrayProxy
* @return PyObject* NULL on exception, the corresponding value otherwise
*/
/**
* @brief Getter method (.mp_subscript), returns a value from the JSArrayProxy given a key which can be a slice, used by several built-in python methods as well as the [] and operator
*
* @param self - The JSArrayProxy
* @param key - The key for the value in the JSArrayProxy
* @return PyObject* NULL on exception, the corresponding value otherwise
*/
static PyObject *JSArrayProxy_get_subscript(JSArrayProxy *self, PyObject *key);

/**
Expand Down Expand Up @@ -182,25 +162,7 @@ public:
* @param self - The JSArrayProxy
* @return None
*/
static PyObject *JSArrayProxy_clear(JSArrayProxy *self);

/**
* @brief .tp_clear method
*
* @param self - The JSArrayProxy
* @return 0 on success
*/
static int JSArrayProxy_clear_slot(JSArrayProxy *self);

/**
* @brief .tp_traverse method
*
* @param self - The JSArrayProxy
* @param visitproc - The function to be applied on each element of the list
* @param arg - The argument to the visit function
* @return 0 on success
*/
static int JSArrayProxy_traverse(JSArrayProxy *self, visitproc visit, void *arg);
static PyObject *JSArrayProxy_clear_method(JSArrayProxy *self);

/**
* @brief copy method
Expand Down Expand Up @@ -413,7 +375,7 @@ PyDoc_STRVAR(list___reversed____doc__,
*/
static PyMethodDef JSArrayProxy_methods[] = {
{"__reversed__", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_iter_reverse, METH_NOARGS, list___reversed____doc__},
{"clear", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_clear, METH_NOARGS, py_list_clear__doc__},
{"clear", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_clear_method, METH_NOARGS, py_list_clear__doc__},
{"copy", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_copy, METH_NOARGS, list_copy__doc__},
{"append", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_append, METH_O, list_append__doc__},
{"insert", (PyCFunction)JSArrayProxyMethodDefinitions::JSArrayProxy_insert, METH_FASTCALL, list_insert__doc__},
Expand Down
3 changes: 1 addition & 2 deletions include/JSFunctionProxy.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file JSFunctionProxy.hh
* @author Caleb Aikens (caleb@distributive.network)
* @brief JSFunctionProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a function would.
* @version 0.1
* @date 2023-09-28
*
* Copyright (c) 2023 Distributive Corp.
* @copyright Copyright (c) 2023 Distributive Corp.
*
*/

Expand Down
3 changes: 1 addition & 2 deletions include/JSMethodProxy.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file JSMethodProxy.hh
* @author Caleb Aikens (caleb@distributive.network)
* @brief JSMethodProxy is a custom C-implemented python type. It acts as a proxy for JSFunctions from Spidermonkey, and behaves like a method would, treating `self` as `this`.
* @version 0.1
* @date 2023-11-14
*
* Copyright (c) 2023 Distributive Corp.
* @copyright Copyright (c) 2023 Distributive Corp.
*
*/

Expand Down
3 changes: 1 addition & 2 deletions include/JSObjectItemsProxy.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file JSObjectItemsProxy.hh
* @author Philippe Laporte (philippe@distributive.network)
* @brief JSObjectItemsProxy is a custom C-implemented python type that derives from dict items
* @version 0.1
* @date 2024-01-19
*
* Copyright (c) 2024 Distributive Corp.
* @copyright Copyright (c) 2024 Distributive Corp.
*
*/

Expand Down
5 changes: 2 additions & 3 deletions include/JSObjectIterProxy.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file JSObjectIterProxy.hh
* @author Philippe Laporte (philippe@distributive.network)
* @brief JSObjectIterProxy is a custom C-implemented python type that derives from PyDictIterKey
* @version 0.1
* @date 2024-01-17
*
* Copyright (c) 2024 Distributive Corp.
* @copyright Copyright (c) 2024 Distributive Corp.
*
*/

Expand All @@ -29,7 +28,7 @@

typedef struct {
PyObject_HEAD
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
JS::PersistentRootedIdVector *props;
int it_index;
bool reversed;
int kind;
Expand Down
3 changes: 1 addition & 2 deletions include/JSObjectKeysProxy.hh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@
* @file JSObjectKeysProxy.hh
* @author Philippe Laporte (philippe@distributive.network)
* @brief JSObjectKeysProxy is a custom C-implemented python type that derives from dict keys
* @version 0.1
* @date 2024-01-16
*
* Copyright (c) 2024 Distributive Corp.
* @copyright Copyright (c) 2024 Distributive Corp.
*
*/

Expand Down
Loading