Optimized version of simple.js
authorRoberto Raggi <roberto.raggi@nokia.com>
Tue, 8 May 2012 12:29:01 +0000 (14:29 +0200)
committerRoberto Raggi <roberto.raggi@nokia.com>
Tue, 8 May 2012 12:29:01 +0000 (14:29 +0200)
tests/simple2.js [new file with mode: 0644]

diff --git a/tests/simple2.js b/tests/simple2.js
new file mode 100644 (file)
index 0000000..484d1fe
--- /dev/null
@@ -0,0 +1,19 @@
+
+function main()
+{
+    var a = 1
+    var b = 2
+    var c = 10
+    var d = 100
+
+    for (i = 0; i < 1000000; i = i + 1) {
+        if (a == 1)
+            d = d + a + b * c
+        else
+            d = 321
+    }
+
+    print("the result is", d)
+}
+
+main()