Code Monkey home page Code Monkey logo

Comments (4)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
Hi, 

Do you have any example code?

I'm not sure we support break in while loops (maybe on Armin's branch) so while 
(true) will always just be an infinite loop...

Original comment by [email protected] on 29 Dec 2011 at 3:40

from tiny-js.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
Hi, 
Please see the statement: "int loopCount = TINYJS_LOOP_MAX_ITERATIONS;"
{
    var i = 0;
    while (true)i++;
}
After run the above statements, TinyJS will throw an exception 
"CScriptException("LOOP_ERROR")".
[WHILE Loop exceeded 8912 iterations]
I don't know what's the reason of limiting LOOP COUNT, and can you tell me?

The break in while loops is supported on Armin's branch, but not on the trunck.
The prefix opertation "++" and "--" is not supported too.

I tried to use code on Armin's branch, but it don't support some important key 
words too. Such as "var sObject = new Object();".

I hope you can support the break operation.
Waiting for you, thank you!

Original comment by [email protected] on 29 Dec 2011 at 4:40

from tiny-js.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
The reasoning is that TinyJS is designed for scripting applications - as such 
it's generally used for very small loops. If you have lots of loop iterations 
we assume it's generally a bug in the script - and not getting stuck in an 
infinite (or huge) loop is a useful feature that has come in handy for me.

If you want more leeway, just set TINYJS_LOOP_MAX_ITERATIONS to something big. 
TinyJS isn't that fast, so setting it to 2 billion is effectively infinite.

As for the lack of Prefix, this is documented at the top of TinyJS.cpp, along 
with some other things that aren't implemented/don't work.

Break/continue may be implemented at some point, but not soon, and probably not 
by me. I use TinyJS for scripting in my applications, and for that, the current 
subset of Javascript is more than sufficient.

Armin's branch *does* support 'new' though, so maybe the only problem you have 
is with the use of 'Object'?

I'm afraid that if you're after a fully-featured JavaScript interpreter, you're 
probably better off going elsewhere. TinyJS is designed to be simple, and as 
such supporting the whole of the ECMAScript standard really isn't what it's 
about.

Original comment by [email protected] on 5 Jan 2012 at 5:31

from tiny-js.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 16, 2024
Thanks, I got it.

Original comment by [email protected] on 6 Jan 2012 at 1:49

from tiny-js.

Related Issues (20)

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.