aboutsummaryrefslogtreecommitdiff
path: root/tests/embind/embind_test.cpp
diff options
context:
space:
mode:
authorChad Austin <caustin@gmail.com>2014-03-22 23:52:57 -0700
committerChad Austin <chad@chadaustin.me>2014-03-28 23:56:40 -0700
commit6291f97039f94eb2eaeae7535a7dbe9c6ff8bbe5 (patch)
tree2c6eb2deb474a78bff5410953e19eb96d07f141e /tests/embind/embind_test.cpp
parent464f4a3cace3eba27c145d347d031930b9630a51 (diff)
make val::new_ compatible with asm.js
Diffstat (limited to 'tests/embind/embind_test.cpp')
-rw-r--r--tests/embind/embind_test.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp
index 2f78fa2f..8dab6ec7 100644
--- a/tests/embind/embind_test.cpp
+++ b/tests/embind/embind_test.cpp
@@ -842,7 +842,7 @@ Enum emval_test_take_and_return_Enum(Enum e) {
return e;
}
-enum class EnumClass { ONE, TWO };
+enum class EnumClass : char { ONE, TWO };
EnumClass emval_test_take_and_return_EnumClass(EnumClass e) {
return e;
@@ -2332,3 +2332,17 @@ EMSCRIPTEN_BINDINGS(val_as) {
// memory_view is always JS -> C++
//function("val_as_memory_view", &val_as<memory_view>);
}
+
+val construct_with_6(val factory) {
+ unsigned char a1 = 6;
+ double a2 = -12.5;
+ std::string a3("a3");
+ StructVector a4(1, 2, 3, 4);
+ EnumClass a5 = EnumClass::TWO;
+ TupleVector a6(-1, -2, -3, -4);
+ return factory.new_(a1, a2, a3, a4, a5, a6);
+}
+
+EMSCRIPTEN_BINDINGS(val_new_) {
+ function("construct_with_6_arguments", &construct_with_6);
+}