You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing this code, the error is reported as follows:
Traceback (most recent call last):
File "D:\Test\example\test\demo.py", line 35, in
print(cryptojs['AES']['encrypt'](key, key, {
pythonmonkey.SpiderMonkeyError: Error in file evaluate, on line 209:
TypeError: properties.hasOwnProperty is not a function
Stack Trace:
mixIn@evaluate:209:37
extend@evaluate:143:30
encrypt@evaluate:681:29
encrypt@evaluate:201:59
This should be because its prototype object has the hasOwnProperty attribute
Thanks @Smawexi , On my machine I get a Segmentation Fault when exeucuting your code:
@philippedistributive , the code snippet mentioned in the comment by @Smawexi is formatted weirdly since GitHub's markdown renderer thinks the code is Markdown and not Python. As a result if you copy the example you'll get a syntax error, and if you fix the syntax error, you'll get the "Invalid Array Length" error. -- here is the intended source code sent in the above snippet (seen by pressing "edit" on the message):
and takes 1300ms seconds to run (on my machine)...
Running the same code using NodeJS (except replacing pm.require with require and replacing print with console.log) results in this output which takes 48ms on my box:
Activity
Smawexi commentedon Dec 9, 2023
When executing this code, the error is reported as follows:
Traceback (most recent call last):
File "D:\Test\example\test\demo.py", line 35, in
print(cryptojs['AES']['encrypt'](key, key, {
pythonmonkey.SpiderMonkeyError: Error in file evaluate, on line 209:
TypeError: properties.hasOwnProperty is not a function
Stack Trace:
mixIn@evaluate:209:37
extend@evaluate:143:30
encrypt@evaluate:681:29
encrypt@evaluate:201:59
This should be because its prototype object has the hasOwnProperty attribute
philippedistributive commentedon Feb 2, 2024
I get
wiwichips commentedon Feb 12, 2024
Thanks @Smawexi , On my machine I get a Segmentation Fault when exeucuting your code:
@philippedistributive , the code snippet mentioned in the comment by @Smawexi is formatted weirdly since GitHub's markdown renderer thinks the code is Markdown and not Python. As a result if you copy the example you'll get a syntax error, and if you fix the syntax error, you'll get the "Invalid Array Length" error. -- here is the intended source code sent in the above snippet (seen by pressing "edit" on the message):
repro.pyWhich results in
and takes 1300ms seconds to run (on my machine)...
Running the same code using NodeJS (except replacing
pm.requirewithrequireand replacingprintwithconsole.log) results in this output which takes 48ms on my box:Smawexi commentedon Feb 12, 2024
Now when I execute the following code, strange errors occur:
The output is:
0.3.0
Process finished with exit code -1073741795 (0xC000001D)
platform: windows10
python version: 3.9.13
pythonmonkey: 0.3.0
philippedistributive commentedon Feb 12, 2024
@Smawexi this latest error already has a fix pending release
philippedistributive commentedon Feb 12, 2024
And so does the initially reported one. Printing the crytop-js objects goes beyond our capabilities and we fail with:
RecursionError: maximum recursion depth exceeded while getting the repr of an object
Note that this is the python runtime behavior which of course is different from Node
Indeed the circularity comes out here:
'$super': [Circular *1]
philippedistributive commentedon Feb 12, 2024
When I try console.log I get:
[-]Some attributes of globalThis are missing[/-][+]troubles loading crypto-js[/+][-]troubles loading crypto-js[/-][+]Troubles loading crypto-js[/+]philippedistributive commentedon Mar 5, 2024
This is now fully fixed in coming release and will print the Crypto object properly