]> gitweb @ CieloNegro.org - youtube-dl.git/commitdiff
[swfinterp] Implement member assignment
authorPhilipp Hagemeister <phihag@phihag.de>
Mon, 17 Nov 2014 00:27:34 +0000 (01:27 +0100)
committerPhilipp Hagemeister <phihag@phihag.de>
Mon, 17 Nov 2014 00:27:34 +0000 (01:27 +0100)
test/swftests/MemberAssignment.as [new file with mode: 0644]

diff --git a/test/swftests/MemberAssignment.as b/test/swftests/MemberAssignment.as
new file mode 100644 (file)
index 0000000..dcba5e3
--- /dev/null
@@ -0,0 +1,22 @@
+// input: [1]
+// output: 2
+
+package {
+public class MemberAssignment {
+    public var v:int;
+
+    public function g():int {
+        return this.v;
+    }
+
+    public function f(a:int):int{
+        this.v = a;
+        return this.v + this.g();
+    }
+
+    public static function main(a:int): int {
+        var v:MemberAssignment = new MemberAssignment();
+        return v.f(a);
+    }
+}
+}