Add failing input for string iteration

This commit is contained in:
Andrew Morris
2023-03-13 13:44:34 +11:00
parent fe730a613a
commit fad421d693
2 changed files with 17 additions and 1 deletions

View File

@@ -407,12 +407,13 @@ ValueScript is in early development. There may be some descriptions of
ValueScript elsewhere here that represent how ValueScript is intended to work,
not the subset of ValueScript that has actually been implemented.
A lot of the essential language features are implemented, including:
Lots of things are implemented though, including:
- Classes
- Closures
- Loops
- Recursion
- Destructuring
- Local imports¹
- Tree shaking¹

View File

@@ -0,0 +1,15 @@
// test_output! ["🚀","","","","🍹","","","","a","b","c","£","","한","","","🎨","","",""]
// This is wrong. It should be: ["🚀","🍹","a","b","c","£","한","🎨"].
// The reason is that for-of is currently approximated using indexing from 0 to .length. This is
// expected to be fixed when iterators are added to the language.
export default function () {
const str = "🚀🍹abc£한🎨";
let outputs = [];
for (const c of str) {
outputs.push(c);
}
return outputs;
}