Comments (2)
Confirmed. Looks like a problem in "for" construct.
var a = 0, b = [], x = function() {
if (a < 10) return ++a;
return undefined;
}
for (var i; (i = x());) b.push(i);
console.log(b);
Should print [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
but does [2, 4, 6, 8, 10]
in Otto.
from otto.
Investigated a little bit and I think I have a fix. Namely, removing this block: https://github.com/robertkrimen/otto/blob/master/evaluate_statement.go#L193-198
from otto.
Related Issues (20)
- parser.ParseFile difference between []byte and file HOT 2
- Compile throws error HOT 3
- JS VM crashing go HOT 2
- Errors caused by different go versions HOT 3
- TestBinaryShiftOperation test fails HOT 31
- Parser don't allow leading 0 HOT 8
- `panic: strconv.ParseInt: parsing "toJSON": invalid syntax` on `ToValue` a `map` HOT 3
- new Date can't not parse datetime string HOT 2
- Memory is slowly increasing until OOM HOT 4
- "use strict" is not in effect HOT 7
- Overview of extending thrid party packages
- Implementation of the export and import keywords to support, amongst others, unit tests. HOT 3
- dates and timezone HOT 1
- How do I call a function that I extract from other javascript code
- Doe this framework support wsam? HOT 1
- fatal error: concurrent map write HOT 5
- How to obtain the values of jump related variables such as window.location.href?
- 多线程的时候会报错 HOT 2
- Code generator: AST ⇒ javascript code HOT 3
- Value of json expression is `undefined` HOT 1
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 otto.