aboutsummaryrefslogtreecommitdiff
path: root/Examples/test-suite/javascript/smart_pointer_simple_runme.js
diff options
context:
space:
mode:
Diffstat (limited to 'Examples/test-suite/javascript/smart_pointer_simple_runme.js')
-rw-r--r--Examples/test-suite/javascript/smart_pointer_simple_runme.js15
1 files changed, 15 insertions, 0 deletions
diff --git a/Examples/test-suite/javascript/smart_pointer_simple_runme.js b/Examples/test-suite/javascript/smart_pointer_simple_runme.js
new file mode 100644
index 000000000..e00dcefb7
--- /dev/null
+++ b/Examples/test-suite/javascript/smart_pointer_simple_runme.js
@@ -0,0 +1,15 @@
+var smart_pointer_simple = require("smart_pointer_simple");
+
+f = new smart_pointer_simple.Foo();
+b = new smart_pointer_simple.Bar(f);
+
+b.x = 3;
+if (b.getx() != 3) {
+ throw new Error;
+}
+
+fp = b.__deref__();
+fp.x = 4;
+if (fp.getx() != 4) {
+ throw new Error;
+}