summaryrefslogtreecommitdiff
path: root/Examples/test-suite/javascript/disown_runme.js
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/javascript/disown_runme.js')
-rw-r--r--Examples/test-suite/javascript/disown_runme.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/Examples/test-suite/javascript/disown_runme.js b/Examples/test-suite/javascript/disown_runme.js
new file mode 100644
index 000000000..a4a6fd880
--- /dev/null
+++ b/Examples/test-suite/javascript/disown_runme.js
@@ -0,0 +1,22 @@
+var disown = require("./disown");
+
+var a = new disown.A();
+var tmp = a.thisown;
+a.thisown = 0
+if (a.thisown) {
+ throw new Error("Failed.");
+}
+a.thisown = 1
+if (!a.thisown) {
+ throw new Error("Failed.");
+}
+a.thisown = tmp
+if (a.thisown != tmp) {
+ throw new Error("Failed.");
+}
+
+var b = new disown.B();
+b.acquire(a);
+if (a.thisown) {
+ throw new Error("Failed.");
+}