Coder Social home page Coder Social logo

polydojo / jispy Goto Github PK

View Code? Open in Web Editor NEW
56.0 56.0 17.0 97 KB

A JavaScript interpreter in Python, built for embedding JavaScript.

License: Mozilla Public License 2.0

Python 88.75% JavaScript 11.25%
interpreter javascript javascript-interpreter python

jispy's People

Contributors

sumukhbarve avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jispy's Issues

Add __init__.py

Would you please add the __init__.py to use jispy as Python module?
Or even wrap it for pip install jispy?

No releases

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.

Problem with double use of closure

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 run arbitrary code?

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.