Comments (4)
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.
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.
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.
Thanks, I got it.
Original comment by [email protected]
on 6 Jan 2012 at 1:49
from tiny-js.
Related Issues (20)
- Null pointer dereference
- Null pointer dereference
- Null pointer dereference
- Null pointer dereference
- Null pointer dereference
- Null pointer dereference
- Null pointer dereference
- heap-use-after-free
- heap-use-after-free
- Null pointer dereference
- Null pointer dereference
- Division Exception
- Null pointer dereference
- Null pointer dereference
- Null pointer dereference
- Null pointer dereference
- heap-use-after-free
- heap-use-after-free HOT 5
- Null pointer dereference
- integer arithmetic HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tiny-js.