polydojo / jispy Goto Github PK
View Code? Open in Web Editor NEWA JavaScript interpreter in Python, built for embedding JavaScript.
License: Mozilla Public License 2.0
A JavaScript interpreter in Python, built for embedding JavaScript.
License: Mozilla Public License 2.0
I'm trying to run unicode JavaScript source and it fails :(
Would you please add the __init__.py
to use jispy as Python module?
Or even wrap it for pip install jispy
?
Looking to include this work into another project but you do not have any releases or tags. This would mean adding a commit into the requirements.txt
file which is not a big deal but is undesirable.
Is there any reason for not have a release? To be honest it is a negative of the project as it implies it is not ready for use.
This code shows the problem with the jispy interpreter:
var makeClosure = function (x) { var func = function (n) {return x+n;}; return func;},
myadderone = null,
myadderthousand = null;
myadderone = makeClosure(1);
myadderthousand = makeClosure(1000);
print(myadderone(0.5));
print(myadderthousand(1));
print(myadderthousand(2));
It evals to 1.5, 2 and 3, whereas it should be 1.5, 1001 and 1002.
The problem is that the inner function gets x=1 during the assignment
myadderone = makeClosure(1);,
which is a correct behavior, but then x=1 value remains when
myadderthousand = makeClosure(1000);
is executed, which is wrong.
Somehow crEnv in Function Object does not get created anew and that first environment with x=1 becomes forever attached to the inner function func.
Is it Safe to use this to run arbitrary code? I was thinking about using this in a filtering engine that users could right functions to filter objects. Is it safe?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.