aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/v4/fun.2.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/v4/fun.2.js')
-rw-r--r--tests/manual/v4/fun.2.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/manual/v4/fun.2.js b/tests/manual/v4/fun.2.js
new file mode 100644
index 0000000000..c3fb613ac6
--- /dev/null
+++ b/tests/manual/v4/fun.2.js
@@ -0,0 +1,14 @@
+
+function Point(x,y) {
+ this.x = 10
+ this.y = 20
+}
+
+Point.prototype = {
+ print: function() { print(this.x, this.y) }
+}
+
+var pt = new Point(10, 20)
+print(pt.x, pt.y)
+pt.print()
+