Fix parse of simple for statement.

Related issue: #156

JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
This commit is contained in:
Ruben Ayrapetyan
2015-06-24 21:39:14 +03:00
parent 601f1eea58
commit f849cc6283
3 changed files with 240 additions and 109 deletions
+39 -1
View File
@@ -1,4 +1,5 @@
// Copyright 2014 Samsung Electronics Co., Ltd.
// Copyright 2014-2015 Samsung Electronics Co., Ltd.
// Copyright 2015 University of Szeged.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -12,15 +13,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// 1.
var i = 0;
for (; i < 100; i++) {
}
assert(i == 100);
// 2.
for (var j = 0; j < 100; j++) {
}
assert(j == 100);
// 3.
for (i = 0; ; ) {
if (i == 100) {
break;
@@ -30,6 +34,7 @@ for (i = 0; ; ) {
}
assert(i == 100);
// 4.
for (i = 0; i < 10; i++) {
for (j = 0; j < 10; j++) {
}
@@ -38,3 +43,36 @@ assert(i != 100);
assert(j != 100);
assert(i == 10);
assert(j == 10);
// 5.
s = '';
for (
var i = {x: 0};
i.x < 2
;
i.x++
)
{
s += i.x;
}
assert (s === '01');
// 6.
s = '';
for (
var i = {x: 0};
i.x < 2
;
i.x++
)
{
s += i.x;
}
assert (s === '01');