Skip to content

Commit 00dfec4

Browse files
Merge pull request #234 from Distributive-Network/philippe/pyTypeFactory-cleanup
Several fixes including: allocate RootedValue for pyTypeFactory call on the stack instead of the heap
2 parents 74ceb71 + e77be01 commit 00dfec4

File tree

105 files changed

+918
-873
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+918
-873
lines changed

.github/workflows/test-and-publish.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ jobs:
5252
with:
5353
path: |
5454
./_spidermonkey_install/*
55-
key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }}
55+
key: spidermonkey115.8.0-${{ runner.os }}-${{ runner.arch }}
5656
lookup-only: true # skip download
5757
- name: Setup XCode
5858
if: ${{ (matrix.os == 'macos-13' || matrix.os == 'macos-14') && steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
@@ -72,7 +72,7 @@ jobs:
7272
with:
7373
path: |
7474
./_spidermonkey_install/*
75-
key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }}
75+
key: spidermonkey115.8.0-${{ runner.os }}-${{ runner.arch }}
7676
lookup-only: true # skip download
7777
- name: Install dependencies
7878
if: ${{ steps.cache-spidermonkey.outputs.cache-hit != 'true' }}
@@ -153,7 +153,7 @@ jobs:
153153
with:
154154
path: |
155155
./_spidermonkey_install/*
156-
key: spidermonkey115.7.0-${{ runner.os }}-${{ runner.arch }}
156+
key: spidermonkey115.8.0-${{ runner.os }}-${{ runner.arch }}
157157
fail-on-cache-miss: true # SpiderMonkey is expected to be cached in its dedicated job
158158
- name: Build pminit
159159
run: |

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ using the Python engine to provide the Javascript host environment.
88

99
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.
1010

11-
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/).
11+
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/).
12+
1213
External contributions and feedback are welcome and encouraged.
1314

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

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

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

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

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

418420
## CommonJS (require)
419-
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.
421+
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.
420422

421423
## pmdb
422424

@@ -453,7 +455,7 @@ List of commands:
453455
```console
454456
$ pmjs
455457

456-
Welcome to PythonMonkey v0.2.0.
458+
Welcome to PythonMonkey v0.4.0.
457459
Type ".help" for more information.
458460
> .python import sys
459461
> .python sys.path

build.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
# Main PythonMonkey build automation script. Run with `poetry build`.
33
# @author Hamada Gasmallah, [email protected]
44
# @date April 2023
5+
# @copyright Copyright (c) 2023 Distributive Corp.
56
#
7+
68
import subprocess
79
import os, sys
810
import platform

include/BoolType.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
* @file BoolType.hh
33
* @author Caleb Aikens ([email protected])
44
* @brief Struct for representing python bools
5-
* @version 0.1
65
* @date 2022-12-02
76
*
8-
* @copyright Copyright (c) 2022
7+
* @copyright Copyright (c) 2022 Distributive Corp.
98
*
109
*/
1110

include/BufferType.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* @file BufferType.hh
33
* @author Tom Tang ([email protected])
44
* @brief Struct for representing ArrayBuffers
5-
* @version 0.1
65
* @date 2023-04-27
76
*
87
* @copyright Copyright (c) 2023 Distributive Corp.

include/DateType.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
* @file DateType.hh
33
* @author Caleb Aikens ([email protected])
44
* @brief Struct for representing python dates
5-
* @version 0.1
65
* @date 2022-12-21
76
*
8-
* @copyright Copyright (c) 2022
7+
* @copyright Copyright (c) 2022 Distributive Corp.
98
*
109
*/
1110

include/DictType.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
* @file DictType.hh
33
* @author Caleb Aikens ([email protected]) & Giovanni Tedesco ([email protected])
44
* @brief Struct representing python dictionaries
5-
* @version 0.1
65
* @date 2022-08-10
76
*
8-
* @copyright Copyright (c) 2022
7+
* @copyright Copyright (c) 2022 Distributive Corp.
98
*
109
*/
1110

include/ExceptionType.hh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* @file ExceptionType.hh
33
* @author Tom Tang ([email protected]) and Philippe Laporte ([email protected])
44
* @brief Struct for representing Python Exception objects from a corresponding JS Error object
5-
* @version 0.1
65
* @date 2023-04-11
76
*
87
* @copyright Copyright (c) 2023-2024 Distributive Corp.

include/FloatType.hh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22
* @file FloatType.hh
33
* @author Caleb Aikens ([email protected])
44
* @brief Struct for representing python floats
5-
* @version 0.1
65
* @date 2022-12-02
76
*
8-
* @copyright Copyright (c) 2022
7+
* @copyright Copyright (c) 2022 Distributive Corp.
98
*
109
*/
1110

include/FuncType.hh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
* @file FuncType.hh
33
* @author Caleb Aikens ([email protected]) & Giovanni Tedesco ([email protected])
44
* @brief Struct representing python functions
5-
* @version 0.1
65
* @date 2022-08-08
76
*
8-
* @copyright Copyright (c) 2022
7+
* @copyright Copyright (c) 2022 Distributive Corp.
98
*
109
*/
10+
1111
#ifndef PythonMonkey_FuncType_
1212
#define PythonMonkey_FuncType_
1313

0 commit comments

Comments
 (0)