aboutsummaryrefslogtreecommitdiff
path: root/tests/webidl
diff options
context:
space:
mode:
Diffstat (limited to 'tests/webidl')
-rw-r--r--tests/webidl/output.txt1
-rw-r--r--tests/webidl/post.js2
-rw-r--r--tests/webidl/test.h2
-rw-r--r--tests/webidl/test.idl2
4 files changed, 7 insertions, 0 deletions
diff --git a/tests/webidl/output.txt b/tests/webidl/output.txt
index b874d928..af3b0087 100644
--- a/tests/webidl/output.txt
+++ b/tests/webidl/output.txt
@@ -10,6 +10,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..8056a5ff 100644
--- a/tests/webidl/post.js
+++ b/tests/webidl/post.js
@@ -5,6 +5,7 @@ var sme = new Module.Parent(42);
sme.mulVal(2);
Module.print('*')
Module.print(sme.getVal());
+sme.parentFunc(90);
Module.print('c1');
@@ -16,6 +17,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..d8eb0fbc 100644
--- a/tests/webidl/test.h
+++ b/tests/webidl/test.h
@@ -10,6 +10,7 @@ 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() {}
};
class Child1 : public Parent {
@@ -19,6 +20,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..6d87d5e3 100644
--- a/tests/webidl/test.idl
+++ b/tests/webidl/test.idl
@@ -5,12 +5,14 @@ interface Parent {
void Parent(long val);
long getVal();
void mulVal(long mul);
+ void parentFunc();
};
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;