summaryrefslogtreecommitdiff
path: root/tests/embind/embind_test.cpp
diff options
context:
space:
mode:
authorChad Austin <chad@imvu.com>2014-05-16 23:34:47 -0700
committerChad Austin <chad@chadaustin.me>2014-05-16 23:41:36 -0700
commitb41adadcf60a25c14f4b139d0ee664521f76a620 (patch)
treebfa375fa57f071b4eb0aeb49d1630fa41171b80e /tests/embind/embind_test.cpp
parent398cded47b7e08fbb753fb7b4788da29a22195bb (diff)
expose typeof via emscripten::val
Diffstat (limited to 'tests/embind/embind_test.cpp')
-rw-r--r--tests/embind/embind_test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/embind/embind_test.cpp b/tests/embind/embind_test.cpp
index 5a83903a..52103bbb 100644
--- a/tests/embind/embind_test.cpp
+++ b/tests/embind/embind_test.cpp
@@ -2368,3 +2368,11 @@ EMSCRIPTEN_BINDINGS(val_new_) {
function("construct_with_memory_view", &construct_with_memory_view);
function("construct_with_ints_and_float", &construct_with_ints_and_float);
}
+
+std::string getTypeOfVal(const val& v) {
+ return v.typeof().as<std::string>();
+}
+
+EMSCRIPTEN_BINDINGS(typeof) {
+ function("getTypeOfVal", &getTypeOfVal);
+}