summaryrefslogtreecommitdiffstats
path: root/examples/script/qsdbg/example.js
diff options
context:
space:
mode:
authorKent Hansen <kent.hansen@nokia.com>2009-11-26 10:34:44 (GMT)
committerKent Hansen <kent.hansen@nokia.com>2009-11-26 10:34:44 (GMT)
commit1d55c88b66013f86be9c7ef069f0f8cdb598d1e2 (patch)
tree11e0f61253828ac98d066ecf0c11674e02cfe99f /examples/script/qsdbg/example.js
parent8ed2b99ab836f6adaf64f4ee76205cdde7c0508a (diff)
downloadQt-1d55c88b66013f86be9c7ef069f0f8cdb598d1e2.zip
Qt-1d55c88b66013f86be9c7ef069f0f8cdb598d1e2.tar.gz
Qt-1d55c88b66013f86be9c7ef069f0f8cdb598d1e2.tar.bz2
rename .qs files to .js
QtScript _is_ JavaScript, there's no need to use a custom extension. Most of the other examples were already using .js, but there were two files that still had the .qs extension. Agreed with Simon. Reviewed-by: TrustMe
Diffstat (limited to 'examples/script/qsdbg/example.js')
-rw-r--r--examples/script/qsdbg/example.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/examples/script/qsdbg/example.js b/examples/script/qsdbg/example.js
new file mode 100644
index 0000000..47c1363
--- /dev/null
+++ b/examples/script/qsdbg/example.js
@@ -0,0 +1,17 @@
+function bar() {
+ var x = 1;
+ var y = 2;
+ return x + y;
+}
+
+function foo(a, b, c) {
+ var i = a + bar();
+ var j = b - bar();
+ var k = c * bar();
+ return Math.cos(i) + Math.sin(j) - Math.atan(k);
+}
+
+var first = foo(1, 2, 3);
+var second = foo(4, 5, 6);
+print("first was:", first, ", and second was:", second);
+