summaryrefslogtreecommitdiff
path: root/tests/webidl
diff options
context:
space:
mode:
authorOphir LOJKINE <pere.jobs@gmail.com>2014-05-19 23:21:21 +0200
committerOphir LOJKINE <pere.jobs@gmail.com>2014-05-19 23:21:21 +0200
commitea01df8b734fb59c8dd435b3c3a7c0aa77a9b08f (patch)
treebbb0594d17fa7e6d9fd435dff33608465164923d /tests/webidl
parentba00e71ac68819df214fdfc57dda71c5bb58e887 (diff)
parentf681994208ed73f7642e5658ba9482c1743f0f35 (diff)
Merge remote-tracking branch 'upstream/incoming' into fast-cwrap
Diffstat (limited to 'tests/webidl')
-rw-r--r--tests/webidl/output.txt2
-rw-r--r--tests/webidl/post.js3
-rw-r--r--tests/webidl/test.h3
-rw-r--r--tests/webidl/test.idl3
4 files changed, 11 insertions, 0 deletions
diff --git a/tests/webidl/output.txt b/tests/webidl/output.txt
index b874d928..c029935f 100644
--- a/tests/webidl/output.txt
+++ b/tests/webidl/output.txt
@@ -1,6 +1,7 @@
Parent:42
*
84
+object
c1
Parent:7
Child1:7
@@ -10,6 +11,7 @@ Child1:7
588
14
28
+Child1::parentFunc(90)
c1 v2
Parent:16
Child1:15
diff --git a/tests/webidl/post.js b/tests/webidl/post.js
index 444efcd1..5376f27b 100644
--- a/tests/webidl/post.js
+++ b/tests/webidl/post.js
@@ -5,6 +5,8 @@ var sme = new Module.Parent(42);
sme.mulVal(2);
Module.print('*')
Module.print(sme.getVal());
+sme.parentFunc(90);
+Module.print(typeof sme.getAsConst());
Module.print('c1');
@@ -16,6 +18,7 @@ Module.print(c1.getValSqr());
Module.print(c1.getValSqr(3));
Module.print(c1.getValTimes()); // default argument should be 1
Module.print(c1.getValTimes(2));
+c1.parentFunc(90);
Module.print('c1 v2');
diff --git a/tests/webidl/test.h b/tests/webidl/test.h
index 903f8f78..5d13846c 100644
--- a/tests/webidl/test.h
+++ b/tests/webidl/test.h
@@ -10,6 +10,8 @@ public:
Parent(Parent *p, Parent *q); // overload constructor
int getVal() { return value; }; // inline should work just fine here, unlike Way 1 before
void mulVal(int mul);
+ void parentFunc() {}
+ const Parent *getAsConst() { return NULL; }
};
class Child1 : public Parent {
@@ -19,6 +21,7 @@ public:
int getValSqr() { return value*value; }
int getValSqr(int more) { return value*value*more; }
int getValTimes(int times=1) { return value*times; }
+ void parentFunc(int x) { printf("Child1::parentFunc(%d)\n", x); }
};
// Child2 has vtable, parent does not. Checks we cast child->parent properly - (Parent*)child is not a no-op, must offset
diff --git a/tests/webidl/test.idl b/tests/webidl/test.idl
index 98ab5070..8ee82b76 100644
--- a/tests/webidl/test.idl
+++ b/tests/webidl/test.idl
@@ -5,12 +5,15 @@ interface Parent {
void Parent(long val);
long getVal();
void mulVal(long mul);
+ void parentFunc();
+ [Const] Parent getAsConst();
};
interface Child1 {
void Child1(optional long val);
long getValSqr(optional long more);
long getValTimes(optional long times=1);
+ void parentFunc(long x); // redefinition, name collides with parent
};
Child1 implements Parent;